Skip to content

fix(projection): recover Codex rows parked by obsolete path collisions - #4356

Merged
ScriptedAlchemy merged 23 commits into
masterfrom
copilot/fix-parked-terminal-rows
Oct 22, 2026
Merged

ScriptedAlchemy merged 23 commits into
masterfrom
copilot/fix-parked-terminal-rows

Conversation

Copilot AI commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex observations parked by the obsolete project_path collision are recovered once per store. Recovery walks bounded rowid windows and records completion only after the final committed window. Previously completed historical skips repair their derived projection state and request the existing temporal rebuild in the same guarded transaction. Suspended rebuilds receive the repaired staged effect, so resuming them preserves recovered messages. Original observations and sanitization receipts remain immutable; genuine collisions stay parked.

The predecessor behavior shipped in master history (950bf21f85). Recovery uses existing background schema convergence and does not block daemon admission.

The graph-off overflow regression holds background admission while restoring the canonical retained text owner and committing one bounded page. It retains exact owner/generation identity, committed progress, queryability, and zero full-decode assertions. The handoff fixture settles initial graph admission, then holds the scheduler across save admission and snapshots its exact generation under that hold. After releasing the scheduler, it still proves broker debt prevents currency without relying on an unknown verification state.

Includes master through 3fa43f6cba, including the discovery-clock fixture control and warming-route publication join. The handoff merge resolution preserves both master's readiness settlement and the branch's scheduler barrier.

Validation:

  • On 954841daa2760d2c8280746bb1b18beff32db79c, the reported detached warm-up regression and the merged committed-save handoff regression both passed: 2 passed, zero failed or ignored, 937 filtered, 14.41 seconds. Bazel invocation d69c0045-2265-4bd7-9dd2-09a35c4f32b8 forced Rustc and TestRunner remote, disabled local fallback, and disabled test-result caching.
  • On the previous 6a9b98f head, the Linux fleet passed 168 of 169 targets. All 461 global-database unit tests passed; code-index tests passed 649 with one pre-existing ignored test. The sole failing target was the detached warm-up assertion now covered by the passing focused run.
  • Pinned formatting and merge whitespace checks passed.

Full current-head hosted CI, including the Linux fleet, Clippy, shipped CLI, and aggregate result, must pass before merge.

Fixes #4327

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 954841d

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
Copilot AI and others added 4 commits October 20, 2026 15:41
…ost:26831/ScriptedAlchemy/tracedecay into copilot/fix-parked-terminal-rows

Co-authored-by: ScriptedAlchemy <25274700+ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: ScriptedAlchemy <25274700+ScriptedAlchemy@users.noreply.github.com>
@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

@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) October 22, 2026 00:33
@ScriptedAlchemy ScriptedAlchemy changed the title fix(projection): re-arm Codex queue rows parked on obsolete project_path collision fix(projection): recover Codex rows parked by obsolete path collisions Oct 22, 2026
@ScriptedAlchemy
ScriptedAlchemy merged commit 2d8a442 into master Oct 22, 2026
29 of 30 checks passed
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