You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow guarded Codex-only AGENTS/.gitignore commits on protected branches (#38)
Guardrail maintenance on protected branches needs a narrow exception so Codex can land managed AGENTS.md and .gitignore updates while still blocking other protected-branch commits. Setup/doctor also self-repair critical guardrail files from templates.
Constraint: Protected branches must continue blocking general Codex commits outside agent/* branches
Rejected: Disable protected-branch Codex guard entirely | weakens branch safety policy
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep template and live pre-commit hook logic in lockstep
Tested: node --check bin/multiagent-safety.js
Not-tested: fully passing suite in this environment
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -289,6 +289,7 @@ and asks `[y/N]` whether to update immediately (default is `N`).
289
289
- Non-interactive setup: skips global installs by default; use `--yes-global-install` to force.
290
290
- In already-initialized repos, `setup` / `install` / `fix` block writes on protected `main` by default; start an agent branch first. Use `--allow-protected-base-write` only for emergency in-place maintenance.
291
291
-`gx doctor` on protected `main` auto-starts an isolated `agent/gx/...-gx-doctor` worktree branch and applies repairs there.
292
+
-`gx setup` and `gx doctor` always refresh `.githooks/pre-commit` from templates, so Codex sub-branch enforcement stays repaired.
292
293
-`scripts/codex-agent.sh` now auto-runs finish automation after a Codex session when `origin` exists:
293
294
auto-commit changed files, run PR/merge cleanup, and prune merged worktrees.
294
295
If conflicts remain, it keeps the sandbox and prompts for a conflict-resolution review pass.
@@ -368,7 +369,7 @@ multiagent.protectedBranches
368
369
## What is protected
369
370
370
371
- direct commits to protected branches (defaults: `dev`, `main`, `master`; configurable via `gx protect ...`)
371
-
- protected-branch commits are blocked regardless of commit client (including VS Code Source Control)
372
+
- protected-branch commits are blocked by default for all clients; Codex sessions only may commit protected branches when staged files are strictly `AGENTS.md` and/or `.gitignore`
372
373
- Codex-session commits on non-`agent/*` branches are blocked by default (`multiagent.codexRequireAgentBranch=true`)
373
374
- Codex commits attempted on protected branches trigger `guardex-preedit-guard` and require starting work via `scripts/codex-agent.sh`
0 commit comments