Files
agent/docs/image-to-video-cat-recovery.md

42 lines
4.2 KiB
Markdown

# Cat upload recovery — 2026-09-16
## Scope and evidence
- Original task: `i2v_6d07ef38-e230-4da3-b337-435c65cb912d`, title `test`, exact duration 3 seconds.
- Frozen reference SHA-256: `5a4220f1fc37a110f3801bbc35119921ec7871b4c94d2233078af20951f4c880`.
- Original initialization failed with upstream HTTP 500 at 2026-09-15T09:23:36.444Z. No upload ticket, asset or generation job was stored locally. The historical server-side root cause remains unconfirmed.
- On 2026-09-16 immediately before recovery, a READ ONLY query of `direct_upload_tickets`, scoped to this exact content hash and original tenant, returned zero matching rows. This is current reconciliation, not proof that no historical ticket ever existed.
- The original record (revision 2), original error receipt, owner, frozen prompt, duration and reference bytes were preserved. An exclusive one-shot recovery marker and backup were written privately. No token or signed storage URL is recorded in this document.
## Executed recovery
`scripts/recover-confirmed-cat-upload.mjs` performed one user-authorized upload attempt with the local server stopped, using the production image-video service and adapter. It fails closed on changed task/revision/hash/identity, stale reconciliation, an existing recovery marker, or an online local server. Its remote wrapper prohibits generation submission.
- Initialize: success, 2026-09-16T04:11:36.699Z.
- Image PUT: completed; finalization receipt returned `finalizing` at 2026-09-16T04:11:37.317Z.
- Normal server read/refresh: `awaiting_submission` at 2026-09-16T04:12:41.023Z.
- Browser: existing page reconnected and Skills panel showed the cat task as `参考图已入库 · 待生成审批`, with original title, prompt and 3-second target.
- H3 submission: **not performed**. No generated cat video is claimed.
- Focused regression run: 3 files / 29 tests passed (`image-video.test.ts`, `image-video-mcp.test.ts`, `image-video-duration.test.ts`).
## Continuation repair — completed 2026-09-16
Session registry and browser chat are in-memory. After restart the task remains visible, but its original session no longer exists. The new explicit continuation flow preserves the existing tool owner checks; it does not silently reassign tasks or restore old chat history.
After user design approval, implemented `继续此任务` for local drafts and references awaiting generation. Clicking it shows an unchecked local-session continuation confirmation. The strict JSON, local-origin route validates the live idle target, original owner inactivity, frozen revision, state and reference hash. Ownership history is saved privately and all original image/request/upload/asset bindings remain intact. Unknown results and already-submitted jobs cannot be reset through continuation. The model has no continuation tool.
After confirmation, the UI fills (but does not send) the original task's chat request. An already-imported reference requests only status verification followed by separate H3 generation approval, not another upload. Late responses are discarded on session changes; the target is revalidated within the task lock. If the original session is still active, return to its existing page instead of transferring it.
Live browser verification on the user's cat task:
- Confirmation button initially disabled until the checkbox was checked.
- Local continuation succeeded, revision 9 → 10, one ownership-history entry.
- State remained `awaiting_submission`, no generation job appeared.
- Upload ID, asset ID, reference hash and request hash were unchanged.
- Remote receipt count remained 3; no additional upload/finalize/submit.
- Browser returned to Chat with exact original 3-second request filled in and Send enabled; no message was automatically sent.
- Regression verification: 236 tests passed (13 shared, 152 harness, 46 web, 25 server); typecheck, lint and build passed. Existing web chunk-size warning remains.
- Bounded independent review found two session-lifecycle races; both received failing regression tests and fixes, and follow-up review reported no blockers.
This verifies continuation, not unattended image-to-video acceptance or a proven root-cause fix for the historical upstream 500. Cat video generation still requires the user's separate approval.