Repository navigation
Avoid reloading analysis inputs after inference and measure storage waits - #216
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Verdict: changes needed for 88c36c2. P2 — Regenerate the published OpenAPI schema for the new diagnostic stage. Verification:
The new analysis availability checks correctly reject deletion during loading/inference, including same-version restoration, and avoid the second payload read. No additional regression found in the storage timing or error paths. Separate existing limitation: a deterministic runtime probe reproduced a same-version delete/restore race during the asynchronous packet hash after the final tool check, on both this head and its base (agent-runtime-do.ts:855-857). This is not introduced here and is not counted as this PR's regression, but the tool-level fence does not establish an atomic guarantee through persistence. Limits: no production latency measurement or live provider calls; shared-catalog/object removal during inference remains outside the documented session-only check. No implementation changes, push, merge or deployment performed. |
|
Verdict: approve 0b13463. The previous P2 is resolved. This commit changes only docs/api-reference/openapi.json, adding catalog_write_wait at all four generated enum occurrences. It now matches the runtime schema; no source, test or dependency changes were introduced after the previous review. Fresh verification at this head:
The 45 session-evidence Workers integration tests and six additional deletion/cancellation probes passed during the prior review of unchanged runtime code; those were not rerun for this documentation-only delta. No new blocking findings. The separately documented preexisting delete/restore race after the final tool check remains unchanged, as do the session-only availability boundary and lack of production latency measurements. This approval covers the PR changes, not a claim that those existing limitations are fixed. No merge or deployment performed. |
Problem / Motivation
Frame, storyboard and transcript analysis reload their complete saved inputs after inference just to check for deletion. Users wait for another catalog lookup and R2 download, including potentially several megabytes of transcript text.
What changed
Analysis now loads each input once and captures the session's SQLite deletion generation before that read. After inference, it checks the generation and selected asset rows synchronously. Deletion followed by retrieval of the same version still rejects the old analysis. Any session generation change, including an unrelated deletion, rejects the in-flight result.
%%{init: {'themeVariables': {'actorBkg': '#e2e8f0', 'actorTextColor': '#0f172a', 'signalColor': '#64748b', 'signalTextColor': '#64748b', 'sequenceNumberColor': '#ffffff', 'noteBkgColor': '#f1f5f9', 'noteTextColor': '#0f172a'}}}%% sequenceDiagram autonumber participant App as Analysis tool participant Store as D1 and R2 participant Model as Analyst participant Session as Session SQLite App->>Store: Load saved inputs (retained) App->>Model: Analyze inputs (retained) Model-->>App: Findings alt Before App->>Store: Reload full inputs (removed) else After App->>Session: Check generation and asset rows (added) endThe initial verified read remains; the final payload reload is replaced with a local availability check.
The published OpenAPI schema includes the new diagnostic stage. Correlated logs time analysis input reads. Frame diagnostics distinguish the overall catalog write window from the publication wait remaining after extraction. Overlapping durations must not be added.
The final check covers session deletion, not shared catalog or object removal during inference. Shared sources currently have no deletion policy. The run-scoped cache remains a separate PR. Retrieval still waits for persistence.
Tests
Coverage includes cancellation, deletion during loading and inference, session clearing, same-version restoration, and deterministic write-overlap timing. Production latency measurement remains outstanding. No migration is required.