feat: make bump shortcut + main-checkout-read-only doctrine#928
Conversation
Two related fixes for an invariant that's been silently broken: the
main `~/Code/lobu` checkout was supposed to stay on `main` so other
agents could `git worktree add` cleanly, but agents (and humans
running ad-hoc commands) were doing 1-line submodule pointer bumps
directly in it. That left the main checkout on `chore/some-fix`
branches, breaking parallel `make task-setup` runs.
1. AGENTS.md: new "Scope discipline" rule — `~/Code/lobu` is
read-only for agents. All writes, even trivial bumps, go through
a worktree. The rule was implicit in the existing "Subagent
isolation" line but only mentioned in the context of subagents,
not the dispatcher's own direct edits.
2. `make bump SUBMODULE=<path> [TARGET=<ref>] [NAME=<slug>]`: the
missing lightweight alternative to `make task-setup` for the
"advance a submodule pointer" case. Skips bun install, .env copy,
port allocation — none of which are needed for a one-line commit.
Resolves TARGET inside the submodule, no-ops cleanly if already
at target, otherwise commits + pushes + opens an auto-merge PR.
Smoke tested with NAME=smoke-noop targeting the current pin:
creates worktree, initializes submodule, detects no-op, cleans up
worktree + branch ref. No orphan branches left behind.
Why this matters: lobu/owletto pointer bumps happen multiple times
per day. Without this shortcut the temptation to skip `task-setup`
("it's just one line") is overwhelming, and that's exactly how the
main checkout ends up on a `chore/*` branch.
📝 WalkthroughWalkthroughThis PR introduces ChangesSubmodule bump command
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Line 20: Update the Makefile help string for the bump target to document the
optional NAME parameter: modify the help echo that currently shows "make bump
SUBMODULE=<path> [TARGET=<ref>]" so it includes "[NAME=<slug>]" (e.g. "make bump
SUBMODULE=<path> [TARGET=<ref>] [NAME=<slug>]") to match how the bump target
uses NAME to customize the branch slug; ensure the updated help text appears in
the same echo statement that prints the bump usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 04561d94-8684-44b2-9657-5dc62d3b2b62
📒 Files selected for processing (3)
AGENTS.mdMakefilescripts/bump-submodule.sh
| @echo " make task-setup NAME=<name> - Create a paired worktree at .claude/worktrees/<name> (lobu + submodule on real branch, .env copied, ports auto-assigned, Lobu context registered)" | ||
| @echo " make task-clean NAME=<name> [FORCE=1] - Remove the worktree, both branches, and the Lobu context (refuses if there's uncommitted/unpushed work unless FORCE=1)" | ||
| @echo " make task-use NAME=<name|main> - Point Chrome ext / Mac app symlinks at this worktree (or 'main' for the canonical checkout)" | ||
| @echo " make bump SUBMODULE=<path> [TARGET=<ref>] - Lightweight worktree + commit + PR for a trivial submodule pointer bump (skips bun install, .env, ports)" |
There was a problem hiding this comment.
Document the optional NAME parameter.
The help text omits [NAME=<slug>], but line 94 shows the target accepts it and the script uses it to customize the branch slug. Users reading make help won't discover this option.
📝 Proposed fix
- `@echo` " make bump SUBMODULE=<path> [TARGET=<ref>] - Lightweight worktree + commit + PR for a trivial submodule pointer bump (skips bun install, .env, ports)"
+ `@echo` " make bump SUBMODULE=<path> [TARGET=<ref>] [NAME=<slug>] - Lightweight worktree + commit + PR for a trivial submodule pointer bump (skips bun install, .env, ports)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @echo " make bump SUBMODULE=<path> [TARGET=<ref>] - Lightweight worktree + commit + PR for a trivial submodule pointer bump (skips bun install, .env, ports)" | |
| `@echo` " make bump SUBMODULE=<path> [TARGET=<ref>] [NAME=<slug>] - Lightweight worktree + commit + PR for a trivial submodule pointer bump (skips bun install, .env, ports)" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Makefile` at line 20, Update the Makefile help string for the bump target to
document the optional NAME parameter: modify the help echo that currently shows
"make bump SUBMODULE=<path> [TARGET=<ref>]" so it includes "[NAME=<slug>]" (e.g.
"make bump SUBMODULE=<path> [TARGET=<ref>] [NAME=<slug>]") to match how the bump
target uses NAME to customize the branch slug; ensure the updated help text
appears in the same echo statement that prints the bump usage.
Summary
Two related fixes for an invariant the codebase relies on but doesn't enforce.
The problem.
~/Code/lobu(the main checkout) is supposed to stay onmain— that's what lets parallel agentsgit worktree add ...cleanly. But submodule pointer bumps and "tiny build fixes" kept landing as direct commits in the main checkout, leaving it onchore/some-fixbranches. Reflog evidence from a single afternoon:```
17:11:51 checkout: moving from main to chore/bump-owletto-guardrails
17:54:59 checkout: moving from main to chore/bump-owletto-loading-skeletons
18:39:24 checkout: moving from main to chore/unblock-image-builds
```
Each of these silently broke any parallel
make task-setupthat ran while the main checkout was on a non-main branch.The fix.
AGENTS.md doctrine line — new `Scope discipline` rule: `~/Code/lobu` is read-only for agents. Every write — commit, branch, submodule bump, one-line fix — goes through a worktree. Was implicit in the "subagent isolation" line; now explicit for direct edits too.
`make bump SUBMODULE= [TARGET=] [NAME=]` — the missing lightweight alternative to `make task-setup` for the trivial "advance a submodule pointer" case. Skips bun install, .env copy, port allocation — none needed for a one-line commit. Resolves TARGET inside the submodule, no-ops cleanly if already at target, otherwise commits + pushes + opens an auto-merge PR.
The temptation to skip `task-setup` for "it's just one line" disappears when there's a one-command shortcut that already uses a worktree.
Smoke test
Usage
```
make bump SUBMODULE=packages/owletto # bump to origin/main
make bump SUBMODULE=packages/owletto TARGET=abc123def # bump to specific SHA
make bump SUBMODULE=packages/owletto NAME=cancel-button # custom slug
```
Summary by CodeRabbit
New Features
make bumpcommand for submodule pointer updates with optional automatic pull request creation support.Documentation