Doctor mutation-scope repair - #283
Open
davidabram wants to merge 16 commits into
Open
davidabram wants to merge 16 commits into
davidabram wants to merge 16 commits into
Conversation
davidabram
added this pull request to stack #240
September 20, 2026 19:27
Define the staged implementation plan for safely repairing blocked mutation-scope states through adapter-owned recovery protocols and positive owner evidence. The plan sequences formalization, shared process-owner extraction, adapter repairs, doctor orchestration, rendering, and cross-adapter validation while preserving fail-closed behavior. Plan: doctor-mutation-scope-fix Tasks: T01-T07 Co-authored-by: SCE <sce@crocoder.dev>
Move the large inline hook and setup test suites into focused sibling modules so production modules remain easier to navigate. Split Pi mutation-scope coverage by lifecycle, guard reconciliation, and runtime seams while preserving the existing behavioral coverage. Co-authored-by: SCE <sce@crocoder.dev>
Split installation and prompting implementations from the setup module into dedicated files, keeping the orchestration module focused on shared setup state and APIs. Preserve existing setup behavior while making the service easier to navigate and maintain.
Split the monolithic hooks implementation into dedicated modules for runtime helpers, commit hooks, conversation traces, diff traces, and Claude transforms. Keep the public hook dispatch surface stable while isolating related helpers and tests. Co-authored-by: SCE <sce@crocoder.dev>
Separate event parsing, lifecycle orchestration, and payload rendering for the Claude, Codex, and Pi adapters. This keeps adapter entry points small while preserving their existing behavior and makes each concern easier to test and evolve. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
2 times, most recently
from
September 21, 2026 00:00
d3b66ef to
4f7c0a3
Compare
Prevent concurrent tool failures and cleanup errors from misattributing mutations by separating hook parsing, lifecycle dispatch, payload construction, and coverage. Track per-call cleanup state, consume ambiguous intervals with recovery barriers, preserve sibling scopes, and fail closed until recovery succeeds. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
3 times, most recently
from
September 21, 2026 10:34
ce2e9c0 to
e604ff4
Compare
Formalize the safe doctor-repair lifecycle and its safety invariants so concurrent hook activity, owner evidence, and interrupted recovery are checkable before implementation. Add executable Quint scenarios covering ordinary abandonment, dead-owner repair, stale diagnoses, retries, and non-resurrection. Implements T01 of `doctor-mutation-scope-fix`. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
from
September 21, 2026 11:33
e604ff4 to
17ba350
Compare
Move ProcessOwner and conservative liveness checks into an adapter-neutral hooks module so other hook adapters can reuse positive process-death evidence. Repoint Pi mutation-scope imports and update the affected context and plan records while preserving behavior and persisted owner data. Plan: doctor-mutation-scope-fix (T02) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
from
September 21, 2026 12:28
dae85a0 to
9098de2
Compare
Prevent orphaned OpenCode mutation-scope attempts from remaining permanently blocked without positive owner-death evidence. Persist backward-compatible owner metadata, re-prove dead owners under the adapter locks, and reuse the existing recovery sequence while refusing live-owner and concurrent-race repairs. Leave doctor wiring for T05. Plan: doctor-mutation-scope-fix.md (T03) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
3 times, most recently
from
September 21, 2026 13:50
d0192d5 to
46012d3
Compare
Persist PendingAbandon before Claude cleanup seam calls so interrupted cleanup can be safely retried without confusing live attempts with established abandon intent. Add batch marking, lock-protected re-proofing, repair behavior, regression coverage, and the corresponding context updates. Plan: doctor-mutation-scope-fix.md (T04) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
from
September 21, 2026 15:15
46012d3 to
a0276bf
Compare
Resolve the containing worktree before locating Git metadata so snapshots created from nested directories apply repository-level gitignore rules correctly. Add regression coverage to ensure ignored files under a nested directory stay out of captured trees. Co-authored-by: SCE <sce@crocoder.dev>
Enable `sce doctor --fix` to repair blocked Claude and OpenCode Agent-tracing state only when adapter-owned repairability checks prove it safe. Dispatch repairs through the production mutation-scope seam and record success only after fresh health confirms healthy or recovering, while leaving manual-only states untouched. Plan: doctor-mutation-scope-fix.md (T05) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
from
September 21, 2026 16:52
8633dec to
df003b0
Compare
Blocked mutation-scope health was reported as manual-only even when the owning adapter proved automatic recovery safe, and manual remediation was not rendered consistently across doctor surfaces. Use adapter-owned repairability to select fixability, next action, and remediation; thread that text through human rows and fix results while preserving the existing JSON health-array schema. Add regressions for auto-fixable and manual-only states, including real state paths and no-delete guidance. Plan: doctor-mutation-scope-fix.md (T06) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
from
September 21, 2026 17:44
84246f2 to
75c4065
Compare
Ensure attempted mutation-scope targets have exactly one fix result, even when a repair ends in a manually recoverable Blocked or Invalid state. Link mutation-scope problems to their targets and exclude attempted targets from the generic manual-result path while preserving never-attempted and unrelated manual diagnostics. Add aggregation regressions covering healthy, recovering, blocked, invalid, and never-attempted outcomes. Record the ownership correction in the doctor mutation-scope plan. Plan: doctor-mutation-scope-fix (T06) Co-authored-by: SCE <sce@crocoder.dev>
Exercise the full doctor diagnosis and fix pipeline with Claude and OpenCode states together, proving that an auto-fixable target is repaired while a manual-only target remains safely blocked. Document the corresponding Quint safety invariants and map them to the adapter regression tests. Plan: doctor-mutation-scope-fix (T07) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
doctor-mutation-scope-fix
branch
from
September 21, 2026 21:33
390413f to
888f067
Compare
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.