Skip to content

fix(projection): re-arm Codex queue rows parked on obsolete project_path collision - #4356

Open
ScriptedAlchemy with Copilot wants to merge 14 commits into
masterfrom
copilot/fix-parked-terminal-rows
Open

ScriptedAlchemy with Copilot wants to merge 14 commits into
masterfrom
copilot/fix-parked-terminal-rows

Conversation

Copilot AI commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4327

Codex observations parked by the obsolete project_path collision can remain invisible after an upgrade. The old projector also wrote an OutputCollision disposition, advanced its checkpoint, and recorded an empty temporal effect. Clearing the retry deadline alone leaves that historical skip looking like an exact duplicate.

This change recovers those observations once per store. It walks the queue in bounded rowid windows, retains the exact Codex project_path predicate, and records completion only after the final committed window. For previously completed skips, the same guarded writer transaction repairs the derived projection state and requests the existing session temporal rebuild. A suspended projection rebuild receives the repaired staged effect so resuming it cannot erase the recovered message. Observations and sanitization receipts remain immutable; genuine collisions remain parked.

Coverage includes bounded-window interruption/restart, the one-time convergence marker, genuine collision preservation, registered upgrade with recovered message text, suspended rebuild resume, and transactional rollback. The registered upgrade journeys are registered_upgrade_recovers_parked_codex_messages_once and registered_upgrade_keeps_recovered_codex_messages_after_rebuild_resume in tracedecay-global-db.

On the current head, the repository gates, scope gate, dashboard checks, and benchmark harness checks pass. Native Clippy, shipped build, feature gates, and Linux fleet validation are still queued or running. The existing native regression targets must finish before merge.

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a8392fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI linked an issue Oct 19, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix parked terminal rows to re-arm on project path upgrade fix(projection): re-arm Codex queue rows parked on obsolete project_path collision Oct 19, 2026
Copilot AI requested a review from ScriptedAlchemy October 19, 2026 04:05
@ScriptedAlchemy
ScriptedAlchemy force-pushed the copilot/fix-parked-terminal-rows branch from 815a89c to 45d7c23 Compare October 20, 2026 22:42
@ScriptedAlchemy
ScriptedAlchemy force-pushed the copilot/fix-parked-terminal-rows branch from 03cfac0 to eabbde4 Compare October 20, 2026 23:04

@ScriptedAlchemy ScriptedAlchemy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-referenced #4327 and the current session reconciliation. The obsolete collision is selected narrowly and the one-time marker is atomic. Before treating #4327 as complete, add the issue's missing production-path upgrade regression: seed a real parked Codex observation, run registered schema convergence and a projection pass, assert its message text becomes readable, and show genuine transcript/lineage/project-key collisions remain parked on a second upgrade. The current test only fabricates last_error strings and inspects retry deadlines. Also keep the repair bounded per writer transaction (inline finding).

Rechecked the newer eabbde4 head: moving the LIKE predicate into the SQL literal leaves both points unchanged. This is source review; no native latency measurement or passing upgrade test is claimed.

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review October 21, 2026 00:49

@ScriptedAlchemy ScriptedAlchemy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed 67314e5 to complete the bounded recovery fix. Inspection of shipped beta.88 code showed that terminal parking also saved an OutputCollision disposition and an empty canonical temporal effect and advanced the checkpoint. Clearing only the retry deadline would acknowledge the old skip as ExactDuplicate, leaving the message missing.

The repair now walks committed windows of at most 128 queue rows, matches only the obsolete Codex project_path collision, verifies the saved zero-output effect, and replays through the existing collision-guarded writer without rewinding the checkpoint. Trigger removal/recreation, derived-effect replacement, retry changes, and completion marking stay inside the same write transaction. Genuine conflicts remain parked. It also requests the existing temporal reset and repairs a matching staged skip in a suspended rebuild so later activation cannot discard the recovered message.

Added registered upgrade/restart and suspended-rebuild journeys, public message-read assertions, preserved unrelated collision/checkpoint assertions, and an injected write failure that verifies complete rollback and restored immutability guards. Pinned CI rustfmt and git diff --check pass; two static passes found no remaining concrete issue. Native tests have not run locally; CI must execute //crates/tracedecay-global-db:unit_test. Marked ready to enable that lane.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-arm projection rows parked as terminal Codex collisions

2 participants