fffiloni commited on
Commit
4260e58
·
verified ·
1 Parent(s): b06ddb7

Upload 4 files

Browse files
Files changed (2) hide show
  1. README.md +8 -8
  2. app.py +25 -0
README.md CHANGED
@@ -133,17 +133,17 @@ See `CHANGELOG_V194.md` for the Model Pre-scan Decision Card UI pass.
133
  See `CHANGELOG_V195.md` for the Runtime CSS Cleanup with Legacy Safety Net pass.
134
 
135
 
136
- Current release: Agentic Space Factory v198.26.32.
137
 
138
- ## v198.26.32Recipe-Aware Repair Loop
139
 
140
- - Adds `repair/RECIPE_AWARE_REPAIR_PACKET.json`, built from `MODEL_RECIPE.json` and `APP_RUNTIME_CONTRACT.json`, so Pi repairs with the same model-family authority used at generation time.
141
- - Extends repair task packets with model family, artifact role, loader strategy, expected output type, known failure match, and family-specific directives.
142
- - Adds known repair signatures for duplicate Diffusers token injection, non-writable HF cache paths, missing ZeroGPU `@spaces.GPU`, schema/dropdown mismatch, SDXL-LoRA text-encoder mismatch, FLUX template syntax failures, and model-not-loaded-after-boot failures.
143
- - Makes failed Pi patch attempts terminal and honest: no publishable patch becomes `no_patch_produced_by_pi` / related guard statuses instead of ending as `post_repair_validation=not_started`.
144
- - Allows a more direct recipe-aware relaunch when Pi produced no useful patch and repair budget remains; otherwise the run ends with explicit `repair_exhausted` metadata.
145
 
146
- See `CHANGELOG_V198_26_31.md`.
147
 
148
  ## v198.26.27 — Pi Repair Execution Guarantee & Model-Family Runtime Recipes
149
 
 
133
  See `CHANGELOG_V195.md` for the Runtime CSS Cleanup with Legacy Safety Net pass.
134
 
135
 
136
+ Current release: Agentic Space Factory v198.26.33.
137
 
138
+ ## v198.26.33Model Card Instruction Authority & Terminal Repair Reconciliation
139
 
140
+ - Adds `MODEL_CARD_INSTRUCTIONS.json`, extracted from the README/model card, so explicit install commands, loader symbols, runtime notes and model-card deviations become first-class worker context.
141
+ - Promotes explicit model-card requirements into `MODEL_RECIPE.json`, Pi generation prompts, repair task packets and recipe-aware repair packets.
142
+ - Adds model-card alignment and local-requirement sanity guards so generated Spaces cannot silently replace official model-card install commands with missing or non-publishable local artifacts such as invented `.whl` files.
143
+ - Propagates structured `/health` failure classes into recipe-aware repair matching, including SDXL-LoRA `CLIPTextModel.text_model` failures.
144
+ - Strengthens terminal repair reconciliation so `repair_outcome.json` terminal failures cannot leave Active Run or Runs Explorer stuck on `running`.
145
 
146
+ See `CHANGELOG_V198_26_33.md`.
147
 
148
  ## v198.26.27 — Pi Repair Execution Guarantee & Model-Family Runtime Recipes
149
 
app.py CHANGED
@@ -517,6 +517,31 @@ def _build_live_run_snapshot(
517
  **summary,
518
  **({"status": summary_status, "validation_status": summary_status, "result_status": summary_status, "terminal": True, "can_resume": False} if validation_terminal_locked else {}),
519
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  view_bundle = {**bundle, "events": events, "state": effective_state, "summary": effective_summary}
521
 
522
  # v198.26.1: build/read snapshots must be read-only. Loading a run used to
 
517
  **summary,
518
  **({"status": summary_status, "validation_status": summary_status, "result_status": summary_status, "terminal": True, "can_resume": False} if validation_terminal_locked else {}),
519
  }
520
+
521
+ # v198.26.33: repair_outcome.json is a terminal evidence source. A run can
522
+ # be left with stale summary/state="running" if the repair path writes the
523
+ # outcome after the last lightweight state flush. Active Run polling should
524
+ # derive the product verdict from this artifact instead of showing endless
525
+ # running. Protected partial summaries remain partial; otherwise terminal
526
+ # repair failure becomes failed.
527
+ repair_outcome = bundle.get("repair_outcome") or {}
528
+ if isinstance(repair_outcome, dict) and repair_outcome:
529
+ repair_status = str(repair_outcome.get("post_repair_validation") or repair_outcome.get("failure_type") or repair_outcome.get("status") or "").strip().lower()
530
+ terminal_repair_failures = {"failed", "repair_validation_failed", "upload_failed", "smoke_still_failed", "repair_failed_same_error", "repair_exhausted", "no_patch_produced_by_pi", "no_relevant_patch_produced_by_pi", "pi_patch_rejected_by_guard"}
531
+ if repair_status in terminal_repair_failures and str(effective_summary.get("status") or "").lower() in {"", "running", "queued", "pending", "started", "scheduled"}:
532
+ effective_summary["status"] = "failed"
533
+ effective_summary["display_status"] = "failed"
534
+ effective_summary["effective_status"] = "failed"
535
+ effective_summary["repair_outcome_status"] = repair_outcome.get("post_repair_validation") or ""
536
+ effective_summary["failure_type"] = repair_outcome.get("failure_type") or "repair_validation_failed"
537
+ effective_summary["terminal_evidence"] = "repair_outcome.json"
538
+ effective_summary["message"] = repair_outcome.get("final_user_message") or effective_summary.get("message") or "Repair failed terminally."
539
+ effective_state["status"] = "failed"
540
+ effective_state["repair_outcome"] = repair_outcome
541
+ effective_state["terminal_evidence"] = "repair_outcome.json"
542
+ else:
543
+ effective_state.setdefault("repair_outcome", repair_outcome)
544
+
545
  view_bundle = {**bundle, "events": events, "state": effective_state, "summary": effective_summary}
546
 
547
  # v198.26.1: build/read snapshots must be read-only. Loading a run used to