Guard in-place starts behind explicit allow flag#8
Closed
Conversation
added 3 commits
April 10, 2026 13:45
The branch start helper now requires explicit --allow-in-place alongside --in-place, keeping the default path isolated in agent worktrees.\n\nAlso added regression tests for default worktree behavior and the in-place guard/override flow, and documented the explicit override in README. Constraint: Preserve existing default branch/worktree flow for current users Rejected: Remove --in-place entirely | some advanced local workflows still need an explicit escape hatch Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep main/dev workflows worktree-first; do not relax in-place guard without adding equivalent safety Tested: npm test; node --check bin/multiagent-safety.js; npm pack --dry-run Not-tested: End-to-end GitHub Actions run for this commit
Pre-commit now blocks Codex/OMX session commits on non-agent branches by default, while allowing human branch workflows to continue.\n\nSetup and doctor now auto-refresh managed safety files ( and ) when templates drift, so rerunning musafety applies the latest branch-safety logic without requiring manual force flags. Added regression coverage for the Codex guard plus auto-refresh behavior. Constraint: Keep existing human VS Code commits on non-protected feature branches working Rejected: Block all non-agent branch commits for everyone | would break normal human trunk/feature workflows Confidence: high Scope-risk: moderate Reversibility: clean Directive: Treat Codex branch guard and template auto-refresh as safety-critical defaults; do not weaken without replacement controls Tested: npm test; node --check bin/multiagent-safety.js; npm pack --dry-run Not-tested: GitHub Actions run for this new commit
This update tightens branch lifecycle guardrails around in-place work while keeping the finish flow ergonomic. It adds managed hook/script updates and test coverage so setup/doctor can auto-heal drift and the finish lifecycle remains deterministic across local/remote cleanup. Constraint: Must preserve existing agent-branch UX while adding safety rails Rejected: Force all flows through extra interactive prompts | would slow scripted and CI usage Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep hook templates and lifecycle tests in sync when changing branch-finish semantics Tested: npm test (55/55 pass) Not-tested: Manual VS Code Source Control merge path after install
Collaborator
Author
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.
Summary\n- block \ by default\n- require explicit \ override\n- keep default flow worktree-first and parse options reliably even after positional args\n- add regression tests for default worktree behavior + in-place guard/override\n- document the in-place guard in README\n\n## Verification\n- npm test\n- node --check bin/multiagent-safety.js\n- npm pack --dry-run