Skip to content

Commit d520975

Browse files
chore(mainline): configure pre-integration checks and rewrite agent docs
Add full QA suite as PreIntegrate checks in mainline.toml so mq run-once validates the same gates as pre-push hooks. Rewrite AGENTS.md mainline section with failure handling, daemon usage, and audit trail commands. Co-authored-by: Andrew <andrewxhill@gmail.com>
1 parent 2e4f519 commit d520975

2 files changed

Lines changed: 46 additions & 22 deletions

File tree

AGENTS.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,63 @@
44

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

89
### Rules
910

10-
- **Never commit, merge, rebase, or push directly on `main`.** The main
11+
- **Never commit, merge, rebase, push, or reset on `main`.** The main
1112
worktree is read-only for development purposes.
12-
- Create feature worktrees with `wtnew <branch>` or under
13-
`~/Projects/_wt/recallnet/codecontext/`.
14-
- Do all work (commits, tests, iteration) in the feature worktree.
15-
- `mq` auto-discovers the repo from your cwd — no `--repo` flag needed.
16-
- When ready to land, submit from the feature worktree: `mq submit`
17-
- Integrate and publish from the main worktree: `mq run-once` then
18-
`mq publish`
19-
- Clean up after landing: `wtdrop <path>` or
20-
`git worktree remove <worktree-path>`
13+
- Create feature worktrees with `wtnew <branch>`. Do all work there.
14+
- Run `pnpm install` once in a new worktree (they don't share
15+
`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>`
2122

2223
### Quick reference
2324

2425
```
25-
# Create worktree
26+
# Create worktree and work in it
2627
wtnew my-feature
28+
pnpm install
29+
# ... edit, test, commit ...
2730
28-
# Work in it (cd into the worktree)
29-
pnpm install # worktrees don't share node_modules
30-
# ... make changes, commit ...
31-
32-
# Land through mainline (from the feature worktree)
31+
# Submit from the feature worktree
3332
mq submit
3433
35-
# Integrate and publish (cd to the main worktree first)
34+
# Integrate and publish from the main worktree
3635
mq run-once
3736
mq publish
3837
3938
# Clean up
4039
wtdrop <worktree-path>
4140
```
4241

42+
### Handling failures
43+
44+
- If `mq run-once` fails (conflict, test failure), the protected branch
45+
is untouched. Fix the issue in the feature worktree, commit, then
46+
`mq retry --submission <id>`.
47+
- To abandon: `mq cancel --submission <id>`
48+
- Check what went wrong: `mq logs --follow`
49+
4350
### Monitoring
4451

4552
- `mq status` — current queue state
46-
- `mq doctor` — health check (branch state, locks, queue)
47-
- `mq repo show`repo config and worktree info
53+
- `mq doctor` — health check (branch, locks, queue)
54+
- `mq repo show` — config and worktree info
4855
- `mq logs --follow` — integration history
49-
- `mq watch` — live queue monitoring
56+
- `mq watch` — live queue updates
57+
- `mq events --follow` — raw audit trail
58+
59+
### Daemon (optional)
60+
61+
For unattended integration, run the daemon:
62+
`mainlined --interval 5s`
63+
It watches the queue, integrates, and publishes automatically.
5064

5165
## Commit Flow
5266

mainline.toml

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

1514
[publish]
1615
Mode = 'manual'
1716
Coalesced = true
1817
InterruptInflight = false
1918

2019
[checks]
21-
PreIntegrate = []
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+
]
2232
PrePublish = []
2333
CommandTimeout = '5m'

0 commit comments

Comments
 (0)