fffiloni commited on
Commit
de5fc64
·
verified ·
1 Parent(s): b4332ab

Upload 4 files

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +5 -4
README.md CHANGED
@@ -133,4 +133,4 @@ 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.8.
 
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.9.
app.py CHANGED
@@ -266,7 +266,7 @@ def _resolve_target_space_identity(run_id: str | None, bundle: dict[str, Any], *
266
  upload_event_ok = bool(any(str((e or {}).get("step") or "") in {"upload_files", "runtime_upload_epoch"} and str((e or {}).get("status") or "").lower() == "success" for e in events if isinstance(e, dict)))
267
  runtime_uploaded = bool(runtime_upload_epoch.get("last_upload_completed_at") or runtime_upload_epoch.get("upload_sequence") or runtime_history or upload_event_ok)
268
  space_runtime_known = bool(isinstance(space_runtime, dict) and (space_runtime.get("stage") or space_runtime.get("status") or space_runtime.get("runtime_status") or space_runtime.get("updated_at") or space_runtime.get("url")))
269
- # v198.26.8: Space links are durable run facts, not a projection of the
270
  # latest 100 events. A runtime upload epoch or a persisted runtime probe
271
  # proves that the Space existed even if the final outcome later failed.
272
  space_created = bool(target and (create_event_ok or runtime_uploaded or space_runtime_known))
@@ -283,7 +283,7 @@ def _resolve_target_space_identity(run_id: str | None, bundle: dict[str, Any], *
283
  sources.append("explicit_target_space_url")
284
  links_ready = bool(target_space_url and (space_created or runtime_uploaded or space_runtime_known))
285
  return {
286
- "schema_version": "space_identity.v198_26_8",
287
  "target_space": target,
288
  "target_space_id": target,
289
  "target_space_known": bool(target),
@@ -1002,7 +1002,7 @@ def register_custom_routes(fastapi_app: FastAPI) -> None:
1002
  run_id = validate_run_id(run_id)
1003
  bucket_source = user_bucket_source(username=ctx["username"], bucket_name=bucket_name)
1004
  snapshot = _build_live_run_snapshot(run_id, bucket_source=bucket_source, token=ctx["token"], include_heavy=False)
1005
- return JSONResponse({**snapshot["view"], "summary": snapshot["summary"], "state": snapshot["state"], "events": snapshot["events"], "events_recent": snapshot["events"][-100:], "events_count": len(snapshot["events"]), "eval_publish": snapshot["eval_publish"], "final_status_reconciliation": snapshot["bundle"].get("final_status_reconciliation") or {}, "eval_record": snapshot["bundle"].get("eval_record") or {}, "space_link_state": snapshot["view"].get("space_link_state") or {}, "space_identity": snapshot["bundle"].get("space_identity") or {}, "links": snapshot["view"].get("links") or {}})
1006
 
1007
  @fastapi_app.post("/api/runs/{run_id}/cancel")
1008
  async def api_cancel_run(request: Request, run_id: str, bucket_name: str = settings.bucket_name): # type: ignore[no-untyped-def]
@@ -1225,7 +1225,8 @@ def register_custom_routes(fastapi_app: FastAPI) -> None:
1225
  "technical_blockers": bundle.get("technical_blockers") or {},
1226
  "repair_decision": bundle.get("repair_decision") or {},
1227
  "blockage": bundle.get("blockage") or {},
1228
- "run_documents": bundle.get("run_documents") or [],
 
1229
  "events": events[-100:],
1230
  "events_recent": events[-100:],
1231
  "events_count": len(events),
 
266
  upload_event_ok = bool(any(str((e or {}).get("step") or "") in {"upload_files", "runtime_upload_epoch"} and str((e or {}).get("status") or "").lower() == "success" for e in events if isinstance(e, dict)))
267
  runtime_uploaded = bool(runtime_upload_epoch.get("last_upload_completed_at") or runtime_upload_epoch.get("upload_sequence") or runtime_history or upload_event_ok)
268
  space_runtime_known = bool(isinstance(space_runtime, dict) and (space_runtime.get("stage") or space_runtime.get("status") or space_runtime.get("runtime_status") or space_runtime.get("updated_at") or space_runtime.get("url")))
269
+ # v198.26.9: Space links are durable run facts, not a projection of the
270
  # latest 100 events. A runtime upload epoch or a persisted runtime probe
271
  # proves that the Space existed even if the final outcome later failed.
272
  space_created = bool(target and (create_event_ok or runtime_uploaded or space_runtime_known))
 
283
  sources.append("explicit_target_space_url")
284
  links_ready = bool(target_space_url and (space_created or runtime_uploaded or space_runtime_known))
285
  return {
286
+ "schema_version": "space_identity.v198_26_9",
287
  "target_space": target,
288
  "target_space_id": target,
289
  "target_space_known": bool(target),
 
1002
  run_id = validate_run_id(run_id)
1003
  bucket_source = user_bucket_source(username=ctx["username"], bucket_name=bucket_name)
1004
  snapshot = _build_live_run_snapshot(run_id, bucket_source=bucket_source, token=ctx["token"], include_heavy=False)
1005
+ return JSONResponse({**snapshot["view"], "summary": snapshot["summary"], "state": snapshot["state"], "events": snapshot["events"], "events_recent": snapshot["events"][-100:], "events_count": len(snapshot["events"]), "eval_publish": snapshot["eval_publish"], "final_status_reconciliation": snapshot["bundle"].get("final_status_reconciliation") or {}, "eval_record": snapshot["bundle"].get("eval_record") or {}, "validation_metrics": snapshot["view"].get("validation_metrics") or {}, "run_documents": snapshot["view"].get("run_documents") or snapshot["bundle"].get("run_documents") or [], "space_link_state": snapshot["view"].get("space_link_state") or {}, "space_identity": snapshot["bundle"].get("space_identity") or {}, "links": snapshot["view"].get("links") or {}})
1006
 
1007
  @fastapi_app.post("/api/runs/{run_id}/cancel")
1008
  async def api_cancel_run(request: Request, run_id: str, bucket_name: str = settings.bucket_name): # type: ignore[no-untyped-def]
 
1225
  "technical_blockers": bundle.get("technical_blockers") or {},
1226
  "repair_decision": bundle.get("repair_decision") or {},
1227
  "blockage": bundle.get("blockage") or {},
1228
+ "run_documents": view.get("run_documents") or bundle.get("run_documents") or [],
1229
+ "validation_metrics": view.get("validation_metrics") or {},
1230
  "events": events[-100:],
1231
  "events_recent": events[-100:],
1232
  "events_count": len(events),