Commit 4fca9c5
When passed AND the agent lane has `.gitmodules`, the finish flow runs
`submoduleModule.advance({ commit: true })` on the lane before spawning
agent-branch-finish.sh. Pointer bumps land as a commit on the agent
branch, so the resulting PR contains the user's code edits + the
submodule pointer bumps as one atomic unit.
Closes the manual ritual for monorepo shops: instead of running
`gx submodule advance --push` in a separate lane after merge, users
can include `--advance-submodules` in the finish command and get one
combined PR.
Safety:
- Opt-in flag — default off, no behavior change for non-users.
- Reuses Phase B plumbing (PR #558): refuses to commit if any
submodule is dirty or if the lane's working tree has unrelated
changes.
- Dry-run path shows the would-advance preview without mutating.
- If lane has no `.gitmodules`, flag is logged as ignored and the
rest of finish proceeds normally.
Verified end-to-end against gitguardex's own .gitmodules:
- `node bin/multiagent-safety.js finish --dry-run --advance-submodules`
correctly reports `would-init` for each uninitialized submodule
then continues with the normal finish dry-run output.
Files:
- src/cli/args.js — add --advance-submodules/--no-advance-submodules
- src/finish/index.js — import submoduleModule, call advance() in
the finish loop between auto-commit and runPackageAsset('branchFinish')
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
1 parent f6e3742 commit 4fca9c5
6 files changed
Lines changed: 98 additions & 0 deletions
File tree
- openspec/changes/agent-claude-branch-finish-advance-submodules-flag-2026-05-11-13-50
- specs/branch-finish-advance-submodules-flag
- src
- cli
- finish
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1002 | 1002 | | |
1003 | 1003 | | |
1004 | 1004 | | |
| 1005 | + | |
1005 | 1006 | | |
1006 | 1007 | | |
1007 | 1008 | | |
| |||
1109 | 1110 | | |
1110 | 1111 | | |
1111 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
1112 | 1121 | | |
1113 | 1122 | | |
1114 | 1123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
308 | 335 | | |
309 | 336 | | |
310 | 337 | | |
| |||
0 commit comments