Skip to content

Make the remaining CLI extractions reviewable without changing Guardex behavior#323

Merged
NagyVikt merged 2 commits intomainfrom
agent/codex/extract-doctor-sandbox-module-2026-04-22-15-38
Apr 22, 2026
Merged

Make the remaining CLI extractions reviewable without changing Guardex behavior#323
NagyVikt merged 2 commits intomainfrom
agent/codex/extract-doctor-sandbox-module-2026-04-22-15-38

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

NagyVikt 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
@NagyVikt NagyVikt merged commit e3e44ab into main Apr 22, 2026
@NagyVikt NagyVikt deleted the agent/codex/extract-doctor-sandbox-module-2026-04-22-15-38 branch April 22, 2026 14:32
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