Repository navigation
fix(queue): keep legacy lifecycle projections replay-safe - #1376
vincentkoc wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 3, 2026, 10:01 AM ET / 14:01 UTC. ClawSweeper reviewWhat this changesThe PR accepts string and null-kind terminal-operation ledger entries when loading lifecycle projections, normalizes them to a null kind, and adds focused storage tests. Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: the unchanged prior P1 finding still applies. Its new wildcard treatment of an unknown terminal kind silently accepts a same-ID replay with a different disposition where current main returns HTTP 409; no durable-row provenance establishes that this semantic downgrade is required. Priority: P2 Review scores
Verification
How this fits togetherThe dashboard Worker records exact-review lifecycle state in a SQLite Durable Object. Terminal operation identities make replayed requests idempotent while rejecting a reused identity whose terminal outcome conflicts, before queue cleanup and Bay projection updates occur. flowchart LR
A[Signed terminal request] --> B[Dashboard Worker]
B --> C[Lifecycle projection store]
C --> D[Terminal operation ledger]
D --> E{Duplicate or conflict check}
E -->|new operation| F[Lifecycle and queue state]
E -->|duplicate| G[Idempotent response]
F --> H[Bay projection and scheduling]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve strict conflicting-kind rejection and keep the existing missing-ledger compatibility path; add a legacy bridge only after deployed-row provenance establishes how an unknown historical operation kind can be validated safely. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible at this PR head: the focused test injects each legacy representation and then reuses its operation ID with a different requeue kind, which the introduced duplicate branch accepts rather than conflicts. Is this the best way to solve the issue? No: permissively treating an unknown historical kind as every possible terminal kind weakens the established replay invariant. Restoring strict validation is the narrowest safe repair unless durable provenance proves a different contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 69ec53b00f11. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Closing unmerged after deployment/source provenance resolved the premise. Pre- Therefore no deployed row needs this decoder, while accepting null-kind IDs would weaken concrete-kind conflict detection. Hosted |
Related: #1375
What Problem This Solves
Fixes an upgrade issue where a lifecycle projection written before #1375 could be rejected when its terminal-operation ledger still used a string operation ID or a null-kind operation entry.
Why This Change Was Made
Read-time normalization converts legacy string IDs to
{ operationId, kind: null }. A legacy null-kind ID remains an idempotent duplicate for any replayed terminal kind, matching the earlier deployed behavior; concrete different-kind reuse still returns 409. New writes continue to store concrete kinds, the ledger remains unbounded for the projection lifetime, and malformed or duplicate IDs remain invalid.This is the narrow compatibility follow-up required because #1375 merged before its replacing exact-head ClawSweeper review tuple completed. It does not revert #1375 and does not change queue, workflow, schema, configuration, capacity, cadence, or live operations.
User Impact
Maintainers can upgrade without legacy terminal-operation rows becoming unreadable or replaying a previously applied terminal mutation. Current-format rows retain strict conflicting-kind protection.
OpenClaw Bay Impact
Bay lifecycle behavior is unchanged. A real local Wrangler Worker with its SQLite Durable Object accepted the existing router and terminal flows: delayed router replay preserved
requeue, duplicate replay left the durable timestamp unchanged, and concrete conflicting-kind reuse returned 409.Documentation Impact
No documentation change. This restores read compatibility for deployed durable rows without changing the documented queue or lifecycle contract.
Evidence
98a2e67789544319e149db762d16cb6eb0ed2f14+23/-14(net+9)+35/-6(net+29)node --test test/dashboard-worker-publication-lifecycle.test.ts: 81 passedtsconfig.json,tsconfig.repair.json, andtsconfig.dashboard.jsonpassedoxfmt --check,oxlint, andgit diff --checkpassedThe repository's broad Bay proof started the real Wrangler runtime but its public-visibility fixture returned
503 target_visibility_unverified; that fixture failure is unrelated to this read-compatibility change and is not counted as passing proof.Real Behavior Proof
4.107.0, loopback mock GitHub API, disposable local persistence, no production credentials or endpoints.updated_atunchanged; terminal replay leftupdated_atunchanged; conflicting concrete kind returned HTTP 409.{"ok":true,"transport":"HTTP loopback","runtime":"Wrangler Worker with SQLite Durable Object","router":{"delayed_receipt_preserved_requeue":true,"duplicate_left_updated_at_unchanged":true},"terminal":{"duplicate_left_updated_at_unchanged":true,"conflicting_kind_status":409}}