Skip to content

Commit 2916585

Browse files
chore(mainline): clean reinit with current mq CLI
Remove stale setup and reinitialize from scratch using the current mq CLI surface. AGENTS.md now documents the turbo path (mq land), submit --check-only, mq doctor --fix, events --lifecycle, and repo audit. Co-authored-by: Andrew <andrewxhill@gmail.com>
1 parent 908ca39 commit 2916585

2 files changed

Lines changed: 39 additions & 58 deletions

File tree

AGENTS.md

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,70 @@
33
## Branch Workflow (mainline)
44

55
This repo uses `mainline` (`mq`) to coordinate the protected `main` branch.
6+
`mq` is installed globally and auto-discovers the repo from cwd.
7+
68
All code changes happen in feature worktrees, never directly on `main`.
7-
`mq` is installed globally — auto-discovers the repo from cwd.
89

910
### Rules
1011

1112
- **Never commit, merge, rebase, push, or reset on `main`.** The main
12-
worktree is read-only for development purposes.
13+
worktree is read-only for development.
14+
- Allowed on `main`: `git status`, `git diff`, `git log`, `git show`,
15+
`git fetch`, `git worktree add`.
1316
- Create feature worktrees with `wtnew <branch>`. Do all work there.
1417
- Run `pnpm install` once in a new worktree (they don't share
1518
`node_modules`).
16-
- When ready to land: `mq submit` (from the feature worktree).
17-
- To integrate: `mq run-once` (from the main worktree). This rebases the
18-
topic onto `main`, runs the full QA suite (see `PreIntegrate` in
19-
`mainline.toml`), then fast-forwards `main`.
20-
- To push to remote: `mq publish` (from the main worktree).
21-
- Clean up after landing: `wtdrop <worktree-path>`
19+
- Land through `mq`, never through manual merge or push.
20+
21+
### Agent turbo path
2222

23-
### Quick reference
23+
From a feature worktree, the fastest end-to-end path is:
2424

2525
```
26-
# Create worktree and work in it
27-
wtnew my-feature
28-
pnpm install
29-
# ... edit, test, commit ...
26+
mq submit --check-only --json # dry-run: verify branch is submittable
27+
mq land --json --timeout 30m # submit + integrate + publish, wait for completion
28+
```
3029

31-
# Validate before submitting (dry run)
32-
mq submit --check-only
30+
`mq land` is the all-in-one command: it submits, waits for serialized
31+
integration (rebase-then-ff onto `main`), then publishes to remote.
3332

34-
# Submit and wait for integration to complete
35-
mq submit --wait --timeout 15m
33+
If you only need integration without publish:
3634

37-
# Or submit and integrate/publish manually from the main worktree
38-
mq submit
39-
mq run-once
40-
mq publish
41-
42-
# Clean up
43-
wtdrop <worktree-path>
35+
```
36+
mq submit --wait --timeout 15m --json
4437
```
4538

46-
### Submit options
39+
### Manual path
4740

48-
- `mq submit` — queue the branch for integration
49-
- `mq submit --check-only` — dry-run validation (no side effects)
50-
- `mq submit --wait` — submit and block until integration finishes
51-
- `mq submit --wait --timeout 15m` — with timeout
52-
- `mq submit --allow-newer-head` — allow if branch advanced since last
53-
submit
54-
- Add `--json` to any command for machine-readable output
41+
When the daemon is not running or you need step-by-step control:
42+
43+
```
44+
# From the feature worktree
45+
mq submit
46+
47+
# From the main worktree
48+
mq run-once # integrate one queued submission
49+
mq publish # push protected tip to remote
50+
```
5551

5652
### Handling failures
5753

58-
- If `mq run-once` fails (conflict, test failure), the protected branch
59-
is untouched. Fix the issue in the feature worktree, commit, then
60-
`mq retry --submission <id>`.
54+
- If integration fails (conflict, check failure), `main` is untouched.
55+
Fix the issue in the feature worktree, commit, then:
56+
`mq retry --submission <id>`
6157
- To abandon: `mq cancel --submission <id>`
6258
- Check what went wrong: `mq logs --follow`
59+
- Auto-repair stuck states: `mq doctor --fix`
6360

6461
### Monitoring
6562

66-
- `mq status`current queue state
63+
- `mq status --json` — queue state, workers, submissions
6764
- `mq doctor` — health check (branch, locks, queue)
68-
- `mq repo show` — config and worktree info
69-
- `mq repo root`canonical root trust status
65+
- `mq repo show --json` — config, worktrees, upstream status
66+
- `mq repo audit`local branches not yet merged into `main`
7067
- `mq logs --follow` — integration history
71-
- `mq watch` — live queue updates
72-
- `mq events --follow` — raw audit trail
73-
74-
### Daemon (optional)
75-
76-
For unattended integration, run the daemon:
77-
`mainlined --interval 5s`
78-
It watches the queue, integrates, and publishes automatically.
68+
- `mq watch` — live status refresh
69+
- `mq events --follow --json --lifecycle` — branch lifecycle stream
7970

8071
## Commit Flow
8172

mainline.toml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,14 @@ HookPolicy = 'inherit'
1010
Strategy = 'rebase-then-ff'
1111
SyncPolicy = 'sync-before-integrate'
1212
DirtyWorktreePolicy = 'reject'
13+
MaxQueueDepth = 0
1314

1415
[publish]
1516
Mode = 'manual'
1617
Coalesced = true
1718
InterruptInflight = false
1819

1920
[checks]
20-
PreIntegrate = [
21-
'pnpm install --frozen-lockfile --ignore-scripts',
22-
'npx turbo build',
23-
'pnpm lint',
24-
'npx turbo typecheck',
25-
'npx turbo test',
26-
'pnpm go:qa',
27-
'pnpm python:qa',
28-
'pnpm ruby:qa',
29-
'pnpm docs:lint',
30-
'pnpm skills:lint',
31-
]
21+
PreIntegrate = []
3222
PrePublish = []
3323
CommandTimeout = '5m'

0 commit comments

Comments
 (0)