feat(provenance): trace Studio generations from Wizard to asset - #95
Conversation
PR Review — Loreframe StudioRisk: low Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
dad5ea6 to
1310026
Compare
|
cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Queued jobs can lack task IDs
- _new_generation_job now assigns the deterministic task-generation-{job_id} identity before Activity publish, so /api/v1/generate still returns a task_id if publication fails and the Wizard will not retry a second job.
Or push these changes by commenting:
@cursor push 03c31efe38
Preview (03c31efe38)
diff --git a/app/_launch_runtime.py b/app/_launch_runtime.py
--- a/app/_launch_runtime.py
+++ b/app/_launch_runtime.py
@@ -632,6 +632,8 @@
"provenance": copy.deepcopy(provenance or {}),
"recovered": recovered,
}
+ job.setdefault("task_id", f"task-generation-{job['id']}")
+ job.setdefault("root_task_id", job["task_id"])
# Reserve FIFO order synchronously. Starting one thread per request is
# still useful for cancellation/recovery, but thread scheduling no longer
# decides which submitted generation reaches the GPU first.
@@ -642,8 +644,10 @@
try:
task = publisher(job)
if isinstance(task, dict):
- job["task_id"] = task.get("id")
- job["root_task_id"] = task.get("root_id")
+ job["task_id"] = task.get("id") or job["task_id"]
+ job["root_task_id"] = (
+ task.get("root_id") or task.get("id") or job["root_task_id"]
+ )
except Exception as exc:
print(f"[Task registry] Could not publish generation {job['id']}: {exc}")
return jobYou can send follow-ups to the cloud agent here.
Extract Music, Trailer, Productions and Compact workspace into composable panels so the files that CI treated as new 100-complexity hotspots are no longer single functions. Refresh the code-health baseline after that split. CI now prints a GitHub table in the job summary and upserts the same table as a PR comment. Markdown, JSON catalogs and tests stay out of the product complexity scan. The token heuristic no longer matches `task-generation-...` ids (false positive on #95).
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8eff12a. Configure here.

Summary
Verification
Identity contract
The backend job ID remains the polling/cancellation handle.
task_idis the canonical Activity identity and is now required before the Wizard reports a generation as queued. A physical output folder is never invented as a logicalworkspace_id.Note
Medium Risk
Touches core generation enqueue, persistence, and public metadata APIs; provenance is attribution-only but incorrect wiring could break clients or mis-attribute outputs.
Overview
Adds an end-to-end generation provenance path so Wizard commands and manual Studio submits can be correlated with Activity tasks and output asset manifests.
Backend: Clients may send optional
provenanceon/api/v1/generateand/api/v1/model3d/generate; it is normalized vianormalize_submission_provenance(actor/capability/command correlation only—no spoofed job/task IDs or output folders). Unknownworkspace_idcollection IDs are rejected. Jobs store provenance, persist it through queue recovery, and assign canonicaltask_id/root_task_idat creation (still used if Activity publication fails). Activity task metadata and asset sidecars now carry actor, tool, capability, and command IDs; Studio and 3D outputs publish through shared helpers usingpublish_generation_sidecar_best_effortso manifest failures cannot break completed generations. Manifest timing includesqueued_at.Frontend:
GenerationSubmissionContextflows from the Generate button (user) and Wizard capabilities (wizard+commandId) into generation requests; jobs tracktaskId/rootTaskIdseparately from the pollingjob_id, and Wizard queuing reports the canonical task id (including Hunyuan3D).Tests and live E2E assert command → task → output metadata alignment.
Reviewed by Cursor Bugbot for commit 8eff12a. Configure here.