Skip to content

Make protected-main doctor flow readable without changing behavior#279

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/refactor-cli-doctor-foundations-2026-04-22-10-50
Apr 22, 2026
Merged

Make protected-main doctor flow readable without changing behavior#279
NagyVikt merged 1 commit intomainfrom
agent/codex/refactor-cli-doctor-foundations-2026-04-22-10-50

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

The protected-main doctor path was carrying sandbox bootstrap, nested execution, auto-commit, finish, merge-back, lock sync, scaffold sync, JSON emission, and console reporting inside one long routine. This refactor adds JSDoc contracts for the summary/result payloads and splits the lifecycle into named helpers so the flow is easier to reason about and safer to change.

Constraint: Must preserve gx doctor protected-main behavior and output wording
Rejected: Replace the parser or migrate shell helpers in the same PR | scope too broad for one reversible cleanup pass
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep future parser and shell-runtime migrations separate until the protected-main doctor lifecycle remains green under install.test.js
Tested: node --check bin/multiagent-safety.js; node --test --test-name-pattern="doctor on protected main|doctor forwards --no-wait-for-merge|doctor compacts auto-finish failures" test/install.test.js; node --test test/install.test.js; openspec validate agent-codex-refactor-cli-doctor-foundations-2026-04-22-10-50 --type change --strict; openspec validate --specs
Not-tested: node --test test/metadata.test.js remains red because scripts/agent-branch-start.sh already diverges from templates/scripts/agent-branch-start.sh outside this diff
@NagyVikt NagyVikt merged commit faf3301 into main Apr 22, 2026
@NagyVikt NagyVikt deleted the agent/codex/refactor-cli-doctor-foundations-2026-04-22-10-50 branch April 22, 2026 09:03
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.

1 participant