Repository navigation
mutation-cursor reconciliation wiring - #305
Merged
Merged
Conversation
davidabram
added this pull request to stack #302
October 8, 2026 21:58
davidabram
force-pushed
the
ref-recon
branch
9 times, most recently
from
October 9, 2026 07:31
5f99e67 to
de6a1b7
Compare
davidabram
removed this pull request from stack #302
October 10, 2026 08:24
davidabram
added this pull request to stack #312
October 10, 2026 08:24
Document how to make the existing mutation-cursor ref reconciler operational through shared mutation-scope maintenance and `sce doctor --fix`, including automatic throttling, safety constraints, tests, and context synchronization. Plan: mutation-cursor-ref-reconciliation-wiring (T01-T06) Co-authored-by: SCE <sce@crocoder.dev>
Document the verified lock ownership, production call graph, advisory-only hook design, durable maintenance-state rules, and database-opening constraints needed to implement mutation-cursor ref reconciliation safely. Cite the completed audit and its findings so the follow-up implementation tasks have explicit scope and evidence. Plan: mutation-cursor-ref-reconciliation-wiring, T01 Co-authored-by: SCE <sce@crocoder.dev>
Add explicit reconciliation and hook advisory entrypoints that share one held worktree lock, persist bounded maintenance state, and record successful and failed passes. Add verified-existing agent-trace DB opening so maintenance does not create or migrate databases, while preserving the existing deletion path. Plan: `mutation-cursor-ref-reconciliation-wiring.md` (T02) Co-authored-by: SCE <sce@crocoder.dev>
Ensure explicit reconciliation uses the production-resolved, verified read-only database and reports state-persistence diagnostics without losing reconciliation errors. Distinguish pre-rename failures from post-rename durability uncertainty, require confirmed writes for advisory results, and add deterministic coverage for open races, WAL coexistence, lock ownership, and persistence failures. Plan: mutation-cursor-ref-reconciliation-wiring (T02) Co-authored-by: SCE <sce@crocoder.dev>
…scopes Completed mutation-scope boundaries now run the advisory-only ref reconciliation check after coordination returns, while preserving hook results and avoiding reconciliation, Git, or database work on the hook path. The injected report is mapped to stable debug or warning logs, including durability and state failures, and is limited to Close and Flush boundaries. Ref: context/plans/mutation-cursor-ref-reconciliation-wiring.md (T03) Co-authored-by: SCE <sce@crocoder.dev>
Expose actionable reconciliation advisory outcomes through an injected diagnostic writer while retaining structured logging. Add outcome-specific diagnostics for durability and state-write failures, keep advisory delivery independent of mutation results, and cover the seven outcome shapes with focused tests. Ref: context/plans/mutation-cursor-ref-reconciliation-wiring.md (T03) Co-authored-by: SCE <sce@crocoder.dev>
Make `sce doctor --fix` execute one explicit snapshot-ref reconciliation pass and report typed outcomes, while plain `sce doctor` remains read-only and reports when maintenance is recommended. Add a runtime facade and injected seams to preserve doctor testability and expose counts, failure kinds, warnings, and busy results. Update the `mutation-cursor-ref-reconciliation-wiring` plan and related context for T04. Co-authored-by: SCE <sce@crocoder.dev>
Cover retention of durable roots across worktrees, fail-closed handling of malformed namespace refs, and advisory busy behavior while an explicit pass holds the lock. Parameterize the durable-root fixture so the production-path tests exercise foreign worktree roots without repairing missing pins. Plan: mutation-cursor-ref-reconciliation-wiring (T05) Co-authored-by: SCE <sce@crocoder.dev>
Add CLI, linked-worktree, cross-process, lock-contention, state-recovery, and cancellation tests for the ref reconciliation path, using narrow coordinator and snapshot seams to exercise real behavior without changing production semantics. Cover database verification and fail-closed behavior, durable state normalization and uncertain persistence, hook/advisory ordering, and doctor outcomes. Plan: mutation-cursor-ref-reconciliation-wiring.md (T05) T05 remains in progress for the explicitly recorded S9, S14, and S26 production-path gaps and guard-removal checks. Co-authored-by: SCE <sce@crocoder.dev>
Remove obsolete dead-code allowances now that snapshot-ref reconciliation runs through `sce doctor --fix`, keep only justified single-event loader exceptions, and make unreachable checkout-identity outcomes and test-only wrappers explicit. Synchronize the reconciliation, doctor, storage, and overview context with the single-lock maintenance entrypoint, verified-existing DB contract, advisory boundary, typed outcomes, and deferred cleanup limitations. Plan: `context/plans/mutation-cursor-ref-reconciliation-wiring.md` — T06 Co-authored-by: SCE <sce@crocoder.dev>
Expand doctor CLI coverage to assert successful exit status for reported reconciliation outcomes and to exercise recovery from failed, stale, invalid, corrupt, oversized, and unreadable maintenance state. Record the remediation evidence and completed coverage status for the reconciliation wiring plan. Plan: mutation-cursor-ref-reconciliation-wiring (T05) Co-authored-by: SCE <sce@crocoder.dev>
Preserve the persistence failure phase when advisory anchor or normalization writes complete replacement but cannot confirm directory durability. Render a durability-specific diagnostic for those outcomes, while retaining the existing write-failed wording for pre-rename failures and adding regression coverage for visible post-rename state. Update the reconciliation plan's T05 durability semantics and scenario coverage to match the outcome mapping. Plan: mutation-cursor-ref-reconciliation-wiring (T05) Co-authored-by: SCE <sce@crocoder.dev>
Add regression coverage proving that maintenance opening of a missing Agent Trace database returns the typed missing-database error without creating state-root entries. Mark the mutation-cursor reconciliation plan's acceptance criteria complete and record validation evidence for the completed implementation. Plan: mutation-cursor-ref-reconciliation-wiring Tasks: T05, T06 Co-authored-by: SCE <sce@crocoder.dev>
The doctor reconciliation CLI test sandbox assumed a `state` directory under the temporary home, but on macOS the CLI resolves its state root to `Library/Application Support`. Resolve the sandbox state root per platform so the tests locate the same Agent Trace database and maintenance state as the CLI under test. Co-authored-by: SCE <sce@crocoder.dev>
Consolidate redundant reconciliation, advisory, doctor, and maintenance-state tests into table-driven cases while strengthening assertions for exit statuses, ref inventories, pin preservation, typed failures, and read-only database behavior. Remove obsolete test-only lock-acquisition wrappers and align the CLI/context coverage documentation with the retained scenarios. Plan: mutation-cursor-ref-reconciliation-wiring Tasks: T05 Co-authored-by: SCE <sce@crocoder.dev>
Allow a retry when its backoff can finish before the contention deadline without requiring the busy timeout to fit in the remaining budget. Add boundary tests covering sleep and immediate retry eligibility. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
removed this pull request from stack #312
October 10, 2026 22:50
davidabram
added this pull request to stack #320
October 10, 2026 22:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.