Conversation
added 2 commits
April 22, 2026 16:32
The protected-main doctor path was still living inline inside src/cli/main.js, which kept sandbox lifecycle, merge-back, and output rendering coupled to the top-level command dispatcher. This commit moves that lifecycle into src/doctor/index.js, moves the remaining shared branch/config helpers into src/git/index.js, and keeps the doctor CLI behavior covered by focused regression tests. Constraint: gx doctor protected-branch behavior and output had to stay stable during the extraction Rejected: Fold the overlapping scaffold/DI extraction into this commit | unrelated branch drift was already present in the worktree Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Do not move the protected-main doctor lifecycle or shared branch/config helpers back into src/cli/main.js; reconcile the overlapping scaffold/DI branch drift separately before finish Tested: node --check src/cli/main.js src/doctor/index.js src/git/index.js; node --test test/cli-args-dispatch.test.js; node --test test/doctor.test.js; openspec validate agent-codex-extract-doctor-sandbox-module-2026-04-22-15-38 --type change --strict; openspec validate --specs Not-tested: gx branch finish --branch agent/codex/extract-doctor-sandbox-module-2026-04-22-15-38 --base main --via-pr --wait-for-merge --cleanup; npm test
…x behavior Move the last git/worktree, scaffold/template, and protected-main doctor seams out of src/cli/main.js so the sensitive paths live in owned modules. This also removes the cached factory wrappers for sandbox, toolchain, and finish wiring while keeping command behavior and release metadata expectations stable. Constraint: Must preserve protected-main doctor and finish behavior while shrinking src/cli/main.js Rejected: Keep the service-locator wrappers in main.js | leaves the most sensitive flows in the least reviewable file Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep future CLI extractions behavior-preserving and extend focused regression coverage before moving protected-branch flows again Tested: node --check src/cli/main.js src/git/index.js src/scaffold/index.js src/doctor/index.js src/sandbox/index.js src/finish/index.js src/toolchain/index.js; node --test test/cli-args-dispatch.test.js test/doctor.test.js test/install.test.js test/metadata.test.js test/finish.test.js test/setup.test.js; npm test; openspec validate agent-codex-extract-git-scaffold-doctor-di-2026-04-22-15-38 --type change --strict; openspec validate --specs Not-tested: Live gh-authenticated release publishing against GitHub
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.
Automated by gx branch finish (PR flow).