geneseed 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/README.md +23 -20
  3. package/SHIPPED.md +7 -7
  4. package/adapters/bob/README.md +31 -18
  5. package/adapters/claude-code/README.md +27 -22
  6. package/adapters/openclaude/README.md +18 -8
  7. package/adapters/opencode/HOW-OPENCODE-LOADS.md +8 -3
  8. package/adapters/opencode/README.md +3 -2
  9. package/adapters/opencode/plugins/geneseed-activity.js +20 -21
  10. package/adapters/opencode/plugins/geneseed-context.js +175 -62
  11. package/adapters/opencode/plugins/geneseed-guard.js +419 -205
  12. package/adapters/opencode/plugins/geneseed-workflow.js +3 -2
  13. package/adapters/opencode/workflows/_runtime.js +3 -2
  14. package/bin/geneseed-cli.mjs +7 -0
  15. package/bin/geneseed-hook.mjs +59 -11
  16. package/docs/PRD.md +1 -1
  17. package/docs/README.md +1 -0
  18. package/docs/concepts/agents.md +1 -1
  19. package/docs/concepts/collaboration.md +2 -2
  20. package/docs/concepts/enforcement-table.md +5 -2
  21. package/docs/concepts/exclusions.md +18 -4
  22. package/docs/concepts/footprint.md +11 -1
  23. package/docs/concepts/foreman-mode.md +1 -1
  24. package/docs/concepts/hook-gates.md +5 -5
  25. package/docs/concepts/hooks.md +4 -3
  26. package/docs/concepts/host-matrix.md +24 -6
  27. package/docs/concepts/kits.md +12 -2
  28. package/docs/concepts/loop-bricks.md +3 -3
  29. package/docs/concepts/loops.md +6 -4
  30. package/docs/concepts/ownership.md +1 -1
  31. package/docs/concepts/rules.md +2 -2
  32. package/docs/concepts/skills.md +1 -1
  33. package/docs/design-history.md +8 -0
  34. package/docs/extending.md +112 -35
  35. package/docs/guides/auto-merge.md +100 -0
  36. package/docs/guides/choose-your-setup.md +1 -1
  37. package/docs/guides/headless.md +1 -1
  38. package/docs/guides/install-bob.md +2 -2
  39. package/docs/guides/install-clone.md +1 -1
  40. package/docs/guides/install-openclaude.md +1 -1
  41. package/docs/guides/install.md +1 -1
  42. package/docs/guides/loop-finish.md +3 -3
  43. package/docs/guides/loop-running.md +4 -4
  44. package/docs/guides/project-context.md +1 -1
  45. package/docs/guides/run-a-factory.md +2 -2
  46. package/docs/guides/setup-doctrines.md +2 -2
  47. package/docs/guides/setup-footprint.md +1 -1
  48. package/docs/guides/uninstall.md +3 -3
  49. package/docs/guides/upgrade.md +1 -1
  50. package/docs/guides/verify.md +12 -0
  51. package/docs/guides/worktree.md +1 -1
  52. package/docs/reference/environment.md +5 -2
  53. package/docs/reference/plugin-activity.md +1 -1
  54. package/docs/reference/plugin-guard.md +1 -1
  55. package/docs/reference/plugin-learn.md +1 -1
  56. package/docs/reference/plugin-workflow.md +1 -1
  57. package/docs/reference/troubleshoot-doctor.md +2 -2
  58. package/docs/reference/troubleshoot-hooks.md +2 -2
  59. package/docs/reference/troubleshoot-install.md +3 -3
  60. package/docs/reference/troubleshoot-tools.md +1 -1
  61. package/docs/token-footprint.md +68 -4
  62. package/docs/understand/design-choices-hosts.md +1 -1
  63. package/docs/understand/design-choices-shape.md +1 -0
  64. package/docs/understand/enforced-vs-asked.md +2 -2
  65. package/docs/understand/machine-bob.md +1 -1
  66. package/docs/understand/machine-claude.md +2 -2
  67. package/docs/understand/on-your-machine.md +1 -1
  68. package/docs/web-ui.md +10 -5
  69. package/harness.config.json +1 -1
  70. package/js/README.md +5 -3
  71. package/js/build/args.mjs +13 -2
  72. package/js/build/driver.mjs +34 -7
  73. package/js/build/emit-claude.mjs +9 -5
  74. package/js/build/emit-opencode.mjs +13 -9
  75. package/js/build/generate.mjs +10 -165
  76. package/js/build/profile.mjs +318 -0
  77. package/js/build/render.mjs +81 -3
  78. package/js/build/retired-skills.mjs +60 -13
  79. package/js/build/source.mjs +15 -1
  80. package/js/build/stubs.mjs +4 -1
  81. package/js/cli-table.json +48 -3
  82. package/js/hosts/done-checks.mjs +6 -0
  83. package/js/hosts/geneseed-dir.mjs +3 -2
  84. package/js/hosts/gitref.mjs +5 -3
  85. package/js/hosts/hook-tap.mjs +104 -0
  86. package/js/hosts/hooks-context.mjs +4 -2
  87. package/js/hosts/hooks-done.mjs +345 -55
  88. package/js/hosts/hooks-learn.mjs +51 -19
  89. package/js/hosts/hooks-prims.mjs +5 -3
  90. package/js/hosts/hooks.mjs +172 -19
  91. package/js/hosts/hosts.mjs +80 -12
  92. package/js/hosts/installs.mjs +26 -1
  93. package/js/hosts/native.mjs +33 -7
  94. package/js/hosts/owned.mjs +7 -6
  95. package/js/hosts/ownership-gate.mjs +14 -1
  96. package/js/hosts/settings.mjs +273 -105
  97. package/js/hosts/shim.mjs +4 -4
  98. package/js/hosts/usage.mjs +9 -3
  99. package/js/inspect/checks-constitution.mjs +32 -0
  100. package/js/inspect/checks-probe.mjs +66 -5
  101. package/js/inspect/checks-repo.mjs +196 -2
  102. package/js/inspect/cost.mjs +34 -2
  103. package/js/inspect/diff.mjs +21 -3
  104. package/js/inspect/doctor.mjs +6 -1
  105. package/js/inspect/inventory.mjs +1 -1
  106. package/js/lib/machine-dir.mjs +1 -1
  107. package/js/lib/node-floor.mjs +46 -6
  108. package/js/maintain/setup.mjs +5 -1
  109. package/js/maintain/uninstall.mjs +42 -16
  110. package/js/maintain/update.mjs +4 -2
  111. package/js/web/actions.mjs +17 -12
  112. package/js/web/api.mjs +7 -2
  113. package/package.json +1 -1
  114. package/registry.json +14 -0
  115. package/src/AGENT.md.tmpl +15 -17
  116. package/src/bricks/pr-open.md +3 -2
  117. package/src/doctrines/ops.md +2 -2
  118. package/src/doctrines/process.md +40 -36
  119. package/src/factories/analysis-to-build.json +1 -1
  120. package/src/factories/bug-report-to-fix.json +1 -1
  121. package/src/factories/issue-to-pr.json +1 -1
  122. package/src/kits/terminal-tools/rules.md +10 -0
  123. package/src/kits/terminal-tools.json +13 -0
  124. package/src/licenses/herdr.txt +201 -0
  125. package/src/modes/foreman.md +6 -3
  126. package/src/skills/_self-improvement.md +9 -7
  127. package/src/skills/commit.md +17 -17
  128. package/src/skills/debug/ci.md +1 -1
  129. package/src/skills/dependencies.md +3 -3
  130. package/src/skills/document-project.md +3 -2
  131. package/src/skills/factory.md +13 -4
  132. package/src/skills/geneseed.md +4 -2
  133. package/src/skills/git-history.md +5 -7
  134. package/src/skills/herdr.md +135 -0
  135. package/src/skills/loop.md +3 -2
  136. package/src/skills/opencode-cli.md +84 -0
  137. package/src/skills/pipeline.md +1 -1
  138. package/src/skills/release.md +5 -8
  139. package/src/skills/review-response.md +4 -2
  140. package/src/skills/rule.md +27 -1
  141. package/src/skills/ship.md +54 -7
  142. package/src/skills/worktree.md +2 -2
  143. package/src/upstreams.json +7 -0
  144. package/themes/_TEMPLATE.json +2 -0
  145. package/themes/biker.json +2 -0
  146. package/themes/commentator.json +2 -0
  147. package/themes/cyberpunk.json +2 -0
  148. package/themes/gamer.json +2 -0
  149. package/themes/imperial.json +2 -0
  150. package/themes/joker.json +2 -0
  151. package/themes/marvin.json +2 -0
  152. package/themes/mean.json +2 -0
  153. package/themes/military.json +2 -0
  154. package/themes/neutral.json +2 -0
  155. package/themes/pirate.json +2 -0
  156. package/themes/sports.json +2 -0
  157. package/themes/verstappen.json +2 -0
  158. package/themes/wizard.json +2 -0
  159. package/web/dist/assets/Activity-D2kOc3yi.js +1 -0
  160. package/web/dist/assets/ActivityDetail-By3xOr21.js +1 -0
  161. package/web/dist/assets/{Bonsai-Bfpb6W-1.js → Bonsai-CBWDTBA4.js} +1 -1
  162. package/web/dist/assets/{CopyButton-ByIntFtB.js → CopyButton-BVbpriMB.js} +1 -1
  163. package/web/dist/assets/Dashboard-CIJLPHM9.js +2 -0
  164. package/web/dist/assets/{Docs-DvlMJhpu.js → Docs-CiRRIELs.js} +3 -3
  165. package/web/dist/assets/Factories-DhyK0O8d.js +1 -0
  166. package/web/dist/assets/GreenhouseView-DW3PgTPy.js +1 -0
  167. package/web/dist/assets/Installs-B6nlo-Ly.js +3 -0
  168. package/web/dist/assets/JournalView-O65qEWfp.js +1 -0
  169. package/web/dist/assets/Kits-C5U-yT6Z.js +1 -0
  170. package/web/dist/assets/Laws-CuTw_XNf.js +4 -0
  171. package/web/dist/assets/{LibRows-DEHjIoD-.js → LibRows-D6-CVa3K.js} +1 -1
  172. package/web/dist/assets/Library-CzPlerd6.js +3 -0
  173. package/web/dist/assets/Loops-CqNF_-nS.js +2 -0
  174. package/web/dist/assets/Markdown-CxkA7940.js +71 -0
  175. package/web/dist/assets/OperatorHudView-BNr8K5qj.js +1 -0
  176. package/web/dist/assets/Personal-DeDb9e8O.js +2 -0
  177. package/web/dist/assets/Settings-B8MPN_AD.js +1 -0
  178. package/web/dist/assets/{Tabs-CWeQTADL.js → Tabs-DJzAez4h.js} +1 -1
  179. package/web/dist/assets/index-BL3P-9Rg.js +6 -0
  180. package/web/dist/assets/{index-CsAZq0BQ.css → index-CRWqKxfY.css} +1 -1
  181. package/web/dist/index.html +2 -2
  182. package/adapters/claude-code/settings.json +0 -52
  183. package/web/dist/assets/Activity-CqJiquEq.js +0 -1
  184. package/web/dist/assets/ActivityDetail-BSzevynX.js +0 -1
  185. package/web/dist/assets/Dashboard-DBOEi9lQ.js +0 -2
  186. package/web/dist/assets/Factories-Bpvv7L2H.js +0 -1
  187. package/web/dist/assets/GreenhouseView-GpBsYn50.js +0 -1
  188. package/web/dist/assets/Installs-BlGmVrFK.js +0 -3
  189. package/web/dist/assets/JournalView-iLuLrOxE.js +0 -1
  190. package/web/dist/assets/Kits-DRwpxC-J.js +0 -1
  191. package/web/dist/assets/Laws-CZkiNOWQ.js +0 -4
  192. package/web/dist/assets/Library-B4K-1iNF.js +0 -3
  193. package/web/dist/assets/Loops-BWSzaW8E.js +0 -2
  194. package/web/dist/assets/Markdown-0ORz7tAc.js +0 -69
  195. package/web/dist/assets/OperatorHudView-BAXwCEvY.js +0 -1
  196. package/web/dist/assets/Personal-Bp9nV4GR.js +0 -2
  197. package/web/dist/assets/Settings-CWWuaIp-.js +0 -1
  198. package/web/dist/assets/index-How7SzDZ.js +0 -6
@@ -27,10 +27,12 @@ array names every cycle that is allowed to exist, each with a `max` number of ti
27
27
  it may be re-entered. Picture it as rings: the outer ring is the iteration itself (plan, apply,
28
28
  test, review, back to plan), and inner rings sit inside it for retries (apply failed its test, try
29
29
  `apply` again without going all the way back around). The shipped templates that center on
30
- `apply` — `bugfix`, `feature`, `refactor`, `tdd`, `legacy-refactor`, `deps-upgrade` — all nest a
31
- short `apply`↔`test` retry ring inside the iteration ring, and most nest a second, wider
32
- `review-fix` ring around that. `legacy-tests` and `ci-repair` have no `apply` at all: the first
33
- only ever writes tests, the second repairs CI directly through `ci-fix`.
30
+ `apply` — `bugfix`, `feature`, `refactor`, `tdd`, `legacy-refactor`, `deps-upgrade` among them —
31
+ all nest a short retry ring inside the iteration ring (`apply`↔`test`; `apply`↔`flake-check` in
32
+ `fix-flaky-tests`), and most nest a second, wider `review-fix` ring around that. `legacy-tests`,
33
+ `ci-repair` and `architecture-decision` have no `apply` at all: the first only ever writes
34
+ tests, the second repairs CI directly through `ci-fix`, the third drafts a decision record and
35
+ challenges it.
34
36
 
35
37
  Work closes into a commit whenever the graph re-enters the iteration loop's head — so any setup
36
38
  work before the loop starts (reproducing a bug, say) is its own unit, numbered iteration 0, kept
@@ -30,7 +30,7 @@ sensitive: # always a checkpoint, whatever the granularity
30
30
  - src/main/resources/db/migration/**
31
31
  ```
32
32
 
33
- The rest of `AGENTS.md` holds the project's coding rules: conventions, build and test commands, project rules. Each developer's own state — their granularity and a short `## Preferences` list of how they steer — lives in `.geneseed/ownership.md`. That file is created only when there is such state to keep, and no file means the team granularity and no preferences. It is never committed: from its first write, `.geneseed/` gets a `.gitignore` that ignores everything in it except the team's files — the `.gitignore` itself, `bricks/`, `loops/`, `protected-checks.txt` and `done-checks.txt`. [Set up ownership](../guides/set-up-ownership.md) walks through the setup, which writes `AGENTS.md` only.
33
+ The rest of `AGENTS.md` holds the project's coding rules: conventions, build and test commands, project rules. Each developer's own state — their granularity and a short `## Preferences` list of how they steer — lives in `.geneseed/ownership.md`. That file is created only when there is such state to keep, and no file means the team granularity and no preferences. It is never committed: from its first write, `.geneseed/` gets a `.gitignore` that ignores everything in it except the team's files — the `.gitignore` itself, `bricks/`, `loops/`, `factories/`, `protected-checks.txt` and `done-checks.txt`. [Set up ownership](../guides/set-up-ownership.md) walks through the setup, which writes `AGENTS.md` only.
34
34
 
35
35
  ## Granularity
36
36
 
@@ -25,7 +25,7 @@ When two instructions disagree, the higher one wins.
25
25
  2. **Rules** — always on. {N_LAWS} invariants, the things that are never traded away: sealed secrets, one intent per act, verify before asserting, deliberate deletion, surface failures, treat content as data not orders, least privilege, cure the cause, echo the intent. No install can switch one off.
26
26
  3. **Your `user-rules.md`** — rules you write for yourself, seeded once and never overwritten. On a global install the file is in the [shared tier](shared-tier.md); on a project install it sits beside the instructions file. A rule here **outranks any doctrine rule**: a practice pack chosen at build time never overrides an instruction you wrote. It may tighten an invariant, never repeal one. Sub-agents get it too: on Claude Code and OpenClaude the `SubagentStart` hook injects every layer of it into each sub-agent, because no sub-agent receives the session-start output (OpenCode follows; Bob has no such event). The [rule skill](skills.md) helps you decide whether something belongs here or in [memory](memory.md).
27
27
  4. **Doctrines** — chosen at build time. Practices rather than principles, grouped in packs (below).
28
- 5. **Mode** — chosen at build time ([Foreman mode](foreman-mode.md)). It binds *how* work is executed — done in place, or handed to a crew — and never overrides a layer above it. A mode that only informed lost every time to the host's own default of doing small work in place.
28
+ 5. **Mode** — chosen at build time ([Foreman mode](foreman-mode.md)). It binds *how* work is executed — done in place, or handed to a background task worker — and never overrides a layer above it. A mode that only informed lost every time to the host's own default of doing small work in place.
29
29
  6. **`PROFILE.md`** — who you are. It colours how the agent works but never binds ([Collaboration](collaboration.md)).
30
30
 
31
31
  ### The shared tier
@@ -57,7 +57,7 @@ All of them are on by default. This install built in {N_PACKS_ACTIVE}, carrying
57
57
 
58
58
  A pack you leave out **still ships**: every pack file lands under `doctrines/` beside the instructions file whether or not it was built in. A rule that cites an inactive pack still resolves on disk, and you can read the alternatives before turning one on. An inactive pack loses its binding force, not its availability.
59
59
 
60
- **process** is the one pack whose removal changes what the machine does, not only what the agent reads: it holds *Consent Before Push*, which a hook enforces. Without it, commits and pushes are no longer stopped for a question — destructive git still is, because that is a Rule ([Hooks](hooks.md)).
60
+ **process** is the one pack whose removal changes what the machine does, not only what the agent reads: it holds *Consent Before Push*, which a hook enforces: the main branch changes only through a pull request with green checks, and your own branch takes commits and plain pushes freely (or every commit and push asks, with `--strict-consent`). Without it, commits and pushes are no longer stopped for a question — destructive git still is, because that is a Rule ([Hooks](hooks.md)).
61
61
 
62
62
  ### Themes do not move rules
63
63
 
@@ -42,7 +42,7 @@ The full list, with each description, is in the catalog.
42
42
 
43
43
  ### Skills improve themselves
44
44
 
45
- Every skill ends with one beat of reflection: if a step misled or a step was missing, the agent writes the exact correction, with no prompt, into that skill's notes file, `notebook/skill-notes/<name>.md` (`notes/skill-notes/<name>.md` in the [shared tier](shared-tier.md) on a global install), and reads those notes the next time the skill runs. It never edits the installed skill itself: that file is rendered from `src/`, a rebuild would overwrite the edit, and `doctor` would report it as drift. Agents work the same way through `agent-notes/`. Each note is one line that carries its evidence, `- [skill|general] <correction> [— situation: <when it applies>] — seen: <what happened, against what was expected> (<date>)`: `situation:` says where the correction holds (it is optional, and older lines without it stay valid; without it, the circumstance in `seen:` stands in), `seen:` is what you judge the correction by before folding it in, and `general` marks one that belongs in a law, doctrine or memory rather than in that one skill. `geneseed diff` lists the notes so you can fold them back into `src/`. Folding a skill or agent note is your call: the `skill-forge` skill first replays one past task whose original ask still exists, as two dispatched agents from the pre-fix revision, one told to read no notes and one given the note. The `fresh-eyes` skill freezes one rubric from the ask and judges both results blind against it. A note is folded only when it wins, on the result or on a stated process gain; on a tie or a loss you decide whether to keep or delete it. A trivial wording fix skips that probe. Most runs end with nothing to change.
45
+ Every skill ends with one beat of reflection: if a step misled or a step was missing, the agent writes the exact correction, with no prompt, into that skill's notes file, `notebook/skill-notes/<name>.md` (`notes/skill-notes/<name>.md` in the [shared tier](shared-tier.md) on a global install), and reads those notes the next time the skill runs. It never edits the installed skill itself: that file is rendered from `src/`, and a rebuild would overwrite the edit. A bundled script that is broken is the one exception: fix it in place, and tell the user which file you changed. Agents work the same way through `agent-notes/`. Each note is one line that carries its evidence, `- [skill|general] <correction> [— situation: <when it applies>] — seen: <what happened, against what was expected> (<date>)`: `situation:` says where the correction holds (it is optional, and older lines without it stay valid; without it, the circumstance in `seen:` stands in), `seen:` is what you judge the correction by before folding it in, and `general` marks one that belongs in a law, doctrine or memory rather than in that one skill. `geneseed diff` lists the notes so you can fold them back into `src/`. Folding a skill or agent note is your call: the `skill-forge` skill first replays one past task whose original ask still exists, as two dispatched agents from the pre-fix revision, one told to read no notes and one given the note. The `fresh-eyes` skill freezes one rubric from the ask and judges both results blind against it. A note is folded only when it wins, on the result or on a stated process gain; on a tie or a loss you decide whether to keep or delete it. A trivial wording fix skips that probe. Most runs end with nothing to change.
46
46
 
47
47
  ### Old names keep working
48
48
 
@@ -1347,6 +1347,14 @@ Geneseed did make are listed in [Why Geneseed works this way](understand/design-
1347
1347
  anchor stays. A runtime toggle that works beside the anchor, without replacing it, remains
1348
1348
  possible. See
1349
1349
  [Foreman mode](concepts/foreman-mode.md).
1350
+ - **A chat mode that switches the harness off for a quick question** (2026-11-12): a slash
1351
+ command, a ready-made excluded folder, or a `geneseed chat` verb. Measured on the real hosts,
1352
+ the harness adds 11–14k tokens per session at lean and 18–21k at full, billed in full once
1353
+ where the provider caches prompts. No host can unload it inside a conversation, an excluded
1354
+ folder leaves the skill listings (and removes nothing on OpenCode), and on Claude Code and
1355
+ OpenCode 2 a toggle on resume loads the harness twice. The hosts' own launch switches differ
1356
+ per host and per version, so a verb would have to track them. See
1357
+ [Token footprint](token-footprint.md#why-there-is-no-chat-mode).
1350
1358
 
1351
1359
  ---
1352
1360
 
package/docs/extending.md CHANGED
@@ -6,7 +6,7 @@ doctrine rule, one skill, one plugin, one hook verb, one doc page, one theme, on
6
6
  It exists because the answer is never one file. Every user-visible noun in Geneseed has
7
7
  *satellites* — a themed title in fourteen voices, a class in a hand-written map, a count in a
8
8
  badge, a row in a ledger, a page in the console — and the gates that keep them in step are spread
9
- across `doctor`, the Node suite and four CI jobs. A contributor who knows the satellites ships in
9
+ across `doctor`, the Node suite and the CI jobs (§1). A contributor who knows the satellites ships in
10
10
  one pass; one who does not discovers them one red gate at a time.
11
11
 
12
12
  The governance surface is three tiers and they cost very different amounts. **Adding a doctrine
@@ -53,12 +53,13 @@ literally, on the screen, as those nine characters.
53
53
 
54
54
  Typing a literal number into a `docs/web` page is caught by `proseMirrorProblems`. The README
55
55
  badges and prose, and the `N laws, N agents, N skills` line in `SHIPPED.md`, are the hand-written
56
- exceptions — and each has its own arm in `js/inspect/doctor.mjs` (`countTableProblems` walks the five
57
- badge keys `agents`/`skills`/`laws`/`themes`/`plugins`; `proseMirrorProblems` holds the prose).
56
+ exceptions — and each has its own arm in `js/inspect/checks-counts.mjs` (`countTableProblems` walks
57
+ the six badge keys `agents`/`skills`/`laws`/`doctrines`/`themes`/`plugins`, `doctrines` riding the
58
+ laws badge as `+ N doctrines`; `proseMirrorProblems` holds the prose).
58
59
 
59
60
  ---
60
61
 
61
- ## 1 — The baseline, and the seven commands that reproduce CI
62
+ ## 1 — The baseline, and the commands that reproduce CI
62
63
 
63
64
  The baseline is whatever these commands report on your checkout — run them; no count is
64
65
  written here, because a typed count is stale by the next commit.
@@ -68,6 +69,14 @@ Windows (the suite in shards, which `suite-count` sums), `node-cells` on Linux *
68
69
  `package-no-python`, `web`, `audit` and `links` on Linux; `ci-ok` is the one required check. From
69
70
  the repo root — never from a worktree, see §5.3:
70
71
 
72
+ ```bash
73
+ npm run lint
74
+ ```
75
+
76
+ ```bash
77
+ npm run typecheck
78
+ ```
79
+
71
80
  ```bash
72
81
  node bin/geneseed-cli.mjs doctor --all
73
82
  ```
@@ -76,6 +85,14 @@ node bin/geneseed-cli.mjs doctor --all
76
85
  node --test --test-reporter=tap "tests/**/*.test.mjs"
77
86
  ```
78
87
 
88
+ ```bash
89
+ node tests/shim_intact.mjs
90
+ ```
91
+
92
+ ```bash
93
+ node --test --test-reporter=tap "fuzz/*.fuzz.mjs"
94
+ ```
95
+
79
96
  ```bash
80
97
  node tests/golden.mjs --idempotent
81
98
  ```
@@ -114,12 +131,12 @@ Notes that matter:
114
131
  a `find` that stops matching exactly once fails the cell loudly.
115
132
  - `--deletion` is the only thing that exercises the write-before-delete prune. Anyone renaming or
116
133
  removing a plugin, a skill or an emitted file needs it.
117
- - **A local pass is weaker than CI.** ~18 tests in `tests/unit/package_manifest.test.mjs` carry
118
- `{ skip: NO_NPM }` (`:83`) — every tarball, install and rename gate. On a machine without `npm`
134
+ - **A local pass is weaker than CI.** The tests in `tests/unit/package_manifest.test.mjs` that carry
135
+ `{ skip: NO_NPM }` are every tarball, install and rename gate. On a machine without `npm`
119
136
  on PATH they report *skipped* and the run is green.
120
137
  - CI additionally re-runs the packaging suite under `npm@11`, the release's npm (Linux, last in the job), and
121
138
  packs the tarball into a `node:22-slim` container with no interpreter. Neither is reproducible
122
- from the seven commands; the container one is reachable locally through
139
+ from the commands above; the container one is reachable locally through
123
140
  `tests/helpers/no-python-container.sh` with a docker daemon.
124
141
  - **Two assertions in `tests/unit/claude.test.mjs` silently stand down** on any machine where an
125
142
  ancestor of the temp sandbox is a `.claude`/`.bob`/`.openclaude` install — which is every developer machine
@@ -128,9 +145,10 @@ Notes that matter:
128
145
 
129
146
  ### The gates CI does not run
130
147
 
131
- - **The mutation matrix itself.** `tests/mutate.mjs` — 35 rows, each a one-string edit to a
132
- product file with a written argument for which gate should catch it. The full run is **in no
133
- workflow** and should not be: it mutates the product tree 33 times and runs a gate per edit.
148
+ - **The mutation matrix itself.** `tests/mutate.mjs` — a table of rows (`--list` prints them), each a
149
+ one-string edit to a product file with a written argument for which gate should catch it. The
150
+ full run is **in no workflow** and should not be: it mutates the product tree once per row and
151
+ runs a gate per edit.
134
152
  Run `node tests/mutate.mjs --all` (or `--only M7`) by hand when you change something a gate is
135
153
  supposed to be watching. ⚠ An interrupted run leaves the **product tree mutated** — check
136
154
  `git status` before doing anything else.
@@ -148,7 +166,8 @@ Notes that matter:
148
166
  gate `publish.yml`'s shape (found by `publishWorkflow`), and the test *every workflow that
149
167
  count-gates `node --test` pins the TAP reporter* discovers every workflow with a test-count gate
150
168
  and pins `--test-reporter=tap` on each `node --test` line. A unit test gates the CI files.
151
- - **Adding any tracked file** — `tests/unit/package_manifest.test.mjs:401` demands every tracked
169
+ - **Adding any tracked file** — `tests/unit/package_manifest.test.mjs` (*every tracked file matches
170
+ exactly one side of the partition*) demands every tracked
152
171
  path fall on exactly one side of a declared partition, *with a written reason*. Adding this very
153
172
  document required a `SHIPS` row; without one the tarball test fails, and it fails **before** the
154
173
  file is committed too, because npm packs by glob while the partition reads `git ls-files`.
@@ -181,7 +200,7 @@ not.
181
200
 
182
201
  ### 2a — Adding a DOCTRINE RULE (the common case)
183
202
 
184
- Four files, plus the written-out rule totals in four test files. This is the slot most new
203
+ Five steps, plus the written-out rule totals in the test files named below. This is the slot most new
185
204
  material belongs in, and it is cheap on purpose so that the invariant slot stays scarce.
186
205
 
187
206
  1. `src/doctrines/<pack>.md` — add `### {{DOCTRINE:<new-id>}} <Principle Name>` plus the body,
@@ -211,13 +230,17 @@ material belongs in, and it is cheap on purpose so that the invariant slot stays
211
230
  `cmdBuild` (`BUILD_FORWARD`) does not forward `--sync-themes`. Then restyle all
212
231
  fourteen by hand: `--sync-themes` writes the template's placeholder and only *prints*
213
232
  `RESTYLE these`; a shipped placeholder passes every gate.
214
- 4. `CHANGELOG.md`.
233
+ 4. `README.md` — the `+ N doctrines` half of the laws badge (`badge/laws-N%20%2B%20N%20doctrines`).
234
+ `countTableProblems` holds it to the rule count across every pack, so `doctor` is red until it
235
+ is bumped.
236
+ 5. `CHANGELOG.md`.
215
237
 
216
238
  **What a doctrine rule does *not* cost**, and each of these is a deliberate asymmetry:
217
239
 
218
240
  - **No class entry.** There is no `LAW_CLASS` analogue: a doctrine rule's class *is* its pack, and
219
241
  there is no second taxonomy over it.
220
- - **No count in the product.** No badge, no `SHIPPED.md` triple, no prose mirror. The console spends
242
+ - **One count in the product, and only one.** The README laws badge (step 4); no `SHIPPED.md`
243
+ triple, no prose mirror. The console spends
221
244
  `{N_PACKS}` / `{N_PACKS_ACTIVE}` / `{N_DOCTRINE_RULES}`, all computed at request time.
222
245
  - **No citation to rewire.** But there *are* written-out rule totals to bump — expected values are
223
246
  written out, never recorded — in `tests/unit/emit_smoke.test.mjs`, `harness.test.mjs`,
@@ -229,6 +252,13 @@ material belongs in, and it is cheap on purpose so that the invariant slot stays
229
252
  `full` carrier ceiling in `emit_smoke` — raise it with a dated note there, as every earlier
230
253
  move did.
231
254
 
255
+ ⚠ **A doctrine citation in carrier text stands alone in its parentheses.** In
256
+ `src/AGENT.md.tmpl`, `src/modes/`, `src/postures/`, `src/doctrines/` and a kit's `rules.md`, write `… so X
257
+ ({{DOCTRINE:<id>}})`, never `({{DOCTRINE:<id>}} says X)`. `dropExcludedCitations`
258
+ (`js/build/render.mjs`) removes an excluded rule's citation from the carrier only when its group
259
+ holds citations alone; `citationGroupProblems` (`js/inspect/checks-constitution.mjs`) refuses
260
+ anything else. A prose mention outside parentheses is fine.
261
+
232
262
  ⚠ **Cite only downward.** An always-on tier may never reference a toggleable one:
233
263
  `constitutionProblems` refuses a `{{DOCTRINE:…}}` token anywhere under `src/ontology/` or
234
264
  `src/laws/`, because a `--doctrines craft` build would then ship an invariant pointing at text its
@@ -355,8 +385,8 @@ candidate for routing to choose between, so add only what no sharpened existing
355
385
 
356
386
  **Order matters at the first two steps.** `missingReferencedSpecs` (in `js/build/bundle.mjs`) *aborts the
357
387
  build* when `AGENT.md.tmpl` names a spec with no file — so the file comes before the table row, or
358
- nothing builds at all. The refusal is clean: `tests/unit/emit_gates.test.mjs:265` proves a refused
359
- emit leaves the prior install intact.
388
+ nothing builds at all. The refusal is clean: `tests/unit/emit_gates.test.mjs` (*a missing agent aborts a
389
+ global emit and leaves the install intact*) proves a refused emit leaves the prior install intact.
360
390
 
361
391
  1. `src/skills/<name>.md` or `src/agents/<name>.md`. The shape is load-bearing: `# {{SKILL}}: <name>`,
362
392
  a blank line, then a `>` blockquote holding `{{DESC_<NAME>}}` — title, blockquote, nothing
@@ -383,8 +413,8 @@ emit leaves the prior install intact.
383
413
  never fires. Hand-run, spends model calls on your own login, not part of the suite.
384
414
 
385
415
  **A vendored skill folder** (`src/skills/<name>/SKILL.md`) is a different shape: add it to
386
- `VENDORED_SKILL_DIRS` (`js/hosts/native.mjs:48` — the literal is frozen in
387
- `tests/unit/authoring_gates.test.mjs:421`), add a `src/upstreams.json` entry (`repo`, `commit` —
416
+ `VENDORED_SKILL_DIRS` (`js/hosts/native.mjs` — the literal is frozen in
417
+ `tests/unit/authoring_gates.test.mjs`), add a `src/upstreams.json` entry (`repo`, `commit` —
388
418
  a 40-hex commit, never a moving branch — `author`, `license`, and `licenseFile`, a path under
389
419
  `src/` or `null`; an optional `"frozen": true` marks text left at its pin on purpose: the weekly drift job skips it, `creditProblems` still validates it), write a `VENDOR.md` carrying `**Upstream key:** <that key>` and a
390
420
  `{{CREDIT:<key>:<upstream path>}}` line, which renders the attribution into every install (the
@@ -412,8 +442,8 @@ distinguishes it from first-party text.
412
442
  Two traps worth knowing before you write the spec:
413
443
 
414
444
  - **The word "Read-only" anywhere in an agent spec locks its emit.** It is a bare substring test
415
- (`js/hosts/native.mjs:148`). The escape hatches are explicit markers: `<!-- bash: allow -->`
416
- re-opens bash on all three hosts (OpenCode gates it to `ask`), and `<!-- webfetch: allow -->`
445
+ (`isReadonly` in `js/hosts/native.mjs`). The escape hatches are explicit markers: `<!-- bash: allow -->`
446
+ re-opens bash on every host (OpenCode gates it to `ask`), and `<!-- webfetch: allow -->`
417
447
  re-opens web fetch — the researcher is the one spec that carries it.
418
448
  - **The console has a fourth, ungated copy of the skill taxonomy.** `SKILL_CATS` in
419
449
  `web/src/lib/lawCats.js` mirrors `SKILL_CLASS` with nothing comparing them (contrast the
@@ -429,7 +459,10 @@ OpenClaude and Bob get a user-only `skills/<alias>/SKILL.md`, and OpenCode gets
429
459
  now excludes the merged skill (`resolveSkillNames` in `js/build/source.mjs`), so a rebuild still
430
460
  works. A skill removed with no successor goes into `RETIRED_SKILL_IDS` in the same file: its
431
461
  exclusion is dropped with a notice instead of failing the rebuild, and the name can never be
432
- used for a new skill. The doctor (`aliasProblems`) refuses an alias that is malformed, duplicated,
462
+ used for a new skill. The one exception is a skill that comes back for the same tool, where an
463
+ old exclusion keeps its meaning: `herdr` left the list when the terminal-tools kit brought it
464
+ back. Such a name moves to `REVIVED_SKILL_IDS`, so an older build's unowned render under it is
465
+ still moved aside on a canonical global emit, with the kit on or off. The doctor (`aliasProblems`) refuses an alias that is malformed, duplicated,
433
466
  already a skill, retired, or the name of an OpenCode command.
434
467
 
435
468
  **A rarely-needed half goes in a side file.** A skill body is paid in full every time the skill
@@ -535,7 +568,7 @@ every pack, so a kit there would switch itself on in every install built before
535
568
 
536
569
  ---
537
570
 
538
- ## 4 — Adding a PLUGIN, a HOOK verb, or a doc page
571
+ ## 4 — Adding a PLUGIN, a HOOK verb, a doc page, or a HOST
539
572
 
540
573
  ### 4a — An OpenCode plugin
541
574
 
@@ -553,7 +586,8 @@ The `geneseed-` prefix and the `.js` suffix are mechanically load-bearing: the b
553
586
  4. `docs/concepts/host-matrix.md` — check the capability matrix still tells the truth.
554
587
  5. `README.md` — **three** sites: the badge, the `N plugins` prose, and the 🔌 Plugins row.
555
588
  6. `SHIPPED.md` — the bare name inside `plugins (…)`; that list must equal the directory exactly,
556
- in both directions (`tests/unit/web_api_docs.test.mjs:329`).
589
+ in both directions (`tests/unit/web_api_docs.test.mjs`, *every plugin ships a reference page and
590
+ its README/SHIPPED rows*).
557
591
  7. `adapters/opencode/README.md` and `docs/opencode-plugin-setup.md` — spelled-out counts, in
558
592
  **word form** ("seven" → "eight"), the second file twice.
559
593
  8. `tests/plugins/<name>.test.mjs`. Auto-discovered; no workflow edit.
@@ -606,6 +640,54 @@ the page renders, wrong, with nothing red.
606
640
 
607
641
  ---
608
642
 
643
+ ### 4d — A host
644
+
645
+ **A host is not one row.** `HOSTS` (`js/hosts/hosts.mjs`) is the table two maps are derived
646
+ from (`EMIT_HOST_SCOPE` and `EMIT_FOR` in `js/hosts/installs.mjs`, and `CLAUDE_STYLE`). Every
647
+ other site below is typed by hand. `tests/unit/host_tables.test.mjs` fails for the tables marked
648
+ *(pinned)*; the rest have no gate, which is why this list exists.
649
+
650
+ Decide first: is the host **Claude-shaped** (a settings file that runs hook commands, a root
651
+ instruction file, `SKILL.md` skills) or does it need its own engine, as OpenCode does? A
652
+ Claude-shaped host rides `js/build/emit-claude.mjs`; anything else is a new emitter and a much
653
+ larger change than this list.
654
+
655
+ 1. `HOSTS` in `js/hosts/hosts.mjs`: the row (`host`, `family`, `configDir`, `projectMarker`,
656
+ `agentFile`, `catalog`), a `<host>ConfigDir()` beside the others, and `CARRIERS` /
657
+ `carriersFor` if the root file sits somewhere new. Set `catalog.agents` only for what you
658
+ have seen the host list to the model by itself.
659
+ 2. `EMITS` in `js/build/args.mjs` *(pinned)*: `<host>` and `<host>-global`.
660
+ 3. `CLAUDE_SHAPED` and the two dispatch tables under it in `js/build/driver.mjs`: one row per
661
+ scope, with the summary line the emit prints. Name the settings file by its real path.
662
+ 4. `claudeHookGroups` in `js/hosts/settings.mjs`: the hook groups in the host's own events and
663
+ verdict dialect, and `--host <id>` on each command. A host that cannot ask (Bob) needs its
664
+ block set decided in `BLOCK_RULES` (`js/hosts/hooks.mjs`).
665
+ 5. `js/hosts/native.mjs`: the agent and skill frontmatter dialect, and how a user-only skill
666
+ is hidden from the model.
667
+ 6. The gate-config markers: `GATE_CONFIG_MARKERS` in `js/hosts/hooks.mjs` *(pinned)* and its
668
+ hand copy in `adapters/opencode/plugins/geneseed-guard.js`, which leaves out `.opencode`.
669
+ A write under the new host's project layer can switch a gate off.
670
+ 7. `NATIVE_ROOT` in `js/hosts/hooks-context.mjs` *(pinned)*: the root file the host loads by
671
+ itself, so the context hook does not inject it a second time.
672
+ 8. `mcpConfigFor` in `js/hosts/mcp.mjs` *(pinned)*: where the host reads MCP servers from.
673
+ 9. `PROBED_VERB` and `probeShell` in `js/inspect/checks-probe.mjs` *(pinned)*: which verb
674
+ refuses on this host, under which shell, and `probesFor` if the host sends its own payload
675
+ shapes.
676
+ 10. `HOST_LABELS` in `js/inspect/checks-repo.mjs` *(pinned)*, then a column in
677
+ `docs/concepts/host-matrix.md` and `docs/concepts/enforcement-table.md` (`geneseed doctor`
678
+ fails without them), and a row in `## What is verified` saying how the host was checked.
679
+ 11. `DOC_HOSTS` in `js/web/docs.mjs` *(pinned)*: the Docs selector's entry and family.
680
+ 12. The setup menu, `js/maintain/setup.mjs`: `EMIT_OPTIONS` *(pinned)*, appended after the
681
+ last entry because the menu is answered by number; the host's display name, and its row in
682
+ the "is it installed" detection table.
683
+ 13. `js/inspect/cost.mjs` (`userOnlyTest`, `catalogueChars`), `js/inspect/excludes.mjs` and
684
+ `js/inspect/status.mjs`: each branches on the host id.
685
+ 14. `tests/host_canary.mjs`: a `HOSTS` entry if the host is on npm. If it is not, say so in
686
+ the docblock and in `## What is verified`, and write the by-hand steps into
687
+ `docs/guides/verify.md`. `GENESEED_HOOK_TAP` records what the host really sends.
688
+ 15. `tests/golden.mjs`: the emit cells. `adapters/<host>/README.md`, a
689
+ `docs/guides/install-<host>.md`, and the README's matrix.
690
+
609
691
  ## 4bis — Adding a RUNTIME DEPENDENCY
610
692
 
611
693
  **Short answer: you vendor it, or you do not add it.** A dependency arrives as tracked source under
@@ -620,7 +702,8 @@ rather than assumed:
620
702
  `git ls-files --cached --others --exclude-standard`, which honours `.gitignore`, and
621
703
  `.gitignore` ignores `/node_modules/`. The copy is written outside the repository, under the OS
622
704
  temp root, and the product is run out of it as a real child process — so Node's upward resolver
623
- walk starts in temp and finds nothing. Eleven test files build such a copy. And this is not a
705
+ walk starts in temp and finds nothing. Every test file that calls `copyCheckout` builds such a
706
+ copy. And this is not a
624
707
  fixture defect to work around: a user's fresh `git clone` has no `node_modules` either. **The
625
708
  fixture is that clone.** Giving the fixture something the real install lacks makes it stop
626
709
  reproducing the failure it exists to catch.
@@ -673,7 +756,7 @@ anything owns **every** install's hooks. Emitting from a git worktree or a temp
673
756
  repoint the shim at that disposable path; removing the worktree then killed hooks for every
674
757
  install on the machine.
675
758
 
676
- **`hookPrefix` now refuses the claim** (`js/hosts/settings.mjs`, `ephemeralCheckout`): an emit whose
759
+ **`hookPrefix` now refuses the claim** (`js/hosts/shim.mjs`, `ephemeralCheckout`): an emit whose
677
760
  checkout is under the OS temp root, or is a linked git worktree (`.git` is a *file*), leaves a
678
761
  shim that still resolves exactly as it is and wires the emitted hooks to it anyway. The bundle it
679
762
  writes is byte-identical to a normal emit — the install simply keeps running the durable
@@ -691,7 +774,7 @@ CI's `.suite-fence`, any file in the tier.
691
774
 
692
775
  This is not hypothetical — it happened while this file was being written. Several agents were
693
776
  verifying gates out of copied checkouts (the `copyCheckout` fixture pattern
694
- `tests/unit/harness.test.mjs:173` uses), one of them emitted, and the shim ended up pointing at
777
+ `tests/unit/harness.test.mjs` uses), one of them emitted, and the shim ended up pointing at
695
778
  `…/Temp/gs-fix-8DYuJP/bin/geneseed-hook.mjs` — a directory that no longer existed. Every hook in
696
779
  every install on the machine was dead and nothing said so.
697
780
 
@@ -716,7 +799,7 @@ The CLI surface is no longer the most expensive thing in the repo to change. Edi
716
799
  text or flags is now an ordinary edit: `js/cli-table.json` is the owned document, and
717
800
  `tests/unit/text_layout.test.mjs` renders every verb through `formatHelp` to check the layout
718
801
  holds. Three hand-written equalities still converge on it and are cheap to keep in step — the
719
- 29-command count and the hidden-argument rule (`tests/unit/cli_table.test.mjs`), and
802
+ command count and the hidden-argument rule (`tests/unit/cli_table.test.mjs`), and
720
803
  `tests/unit/docs.test.mjs`, which validates every fenced `geneseed <verb> <flags>` line in
721
804
  `README.md`, `SHIPPED.md` and every page under `docs/{understand,guides,concepts,reference}/` against the table.
722
805
 
@@ -731,13 +814,12 @@ only, at best, on its presence.
731
814
  |---|---|---|
732
815
  | `§N` cross-references into `AGENT.md`'s anatomy | `src/skills/*`, `src/agents/*`, `adapters/**` | **range only.** `constitutionProblems` refuses a `§N` the template declares no section for — which catches a pointer past the end, the shape *removing* a section leaves. It cannot catch one that still resolves and now means something else, which is the shape *inserting* a section leaves, and is what actually happened when `## 2. Doctrines` pushed every later section down one. **Renumbering the anatomy means `grep -rn '§' src/ adapters/` and reading every hit.** Four satellites and a live OpenCode deny message shipped stale because the sweep stopped at `AGENT.md.tmpl` |
733
816
  | Per-rule Principle lines | the `<!-- note: summary: … -->` line under each rule heading in `src/laws/universal.md` and `src/doctrines/*.md` | presence and placement only (`ruleSummaryProblems`), never accuracy |
734
- | 588 themed constitution titles (42 keys × 14 voices) — `LEX_<ID>` (one per law), `DOC_<ID>` (one per doctrine rule), `PACK_<NAME>` | `themes/*.json` | key presence only — a shipped placeholder is green. `LEX_*` and `DOC_*` are held across the template too, and in both directions; `PACK_*` only across the voices |
817
+ | The themed constitution titles, one key per rule and per pack in each of the 14 voices — `LEX_<ID>` (one per law), `DOC_<ID>` (one per doctrine rule), `PACK_<NAME>` | `themes/*.json` | key presence only — a shipped placeholder is green. `LEX_*` and `DOC_*` are held across the template too, and in both directions; `PACK_*` only across the voices |
735
818
  | The README keyword enumerations | `README.md`, `docs/concepts/rules.md` | nothing |
736
819
  | The per-host map of what lands on a machine | `docs/understand/machine-opencode.md`, `docs/understand/machine-claude.md` | table shape only, never accuracy |
737
820
  | Section labels and page subtitles | `web/src/lib/sections.js`, `web/src/pages/Docs/index.jsx` | nothing |
738
821
  | `THEME_BLURBS` (8 of 14), `ART` (8 of 14) | `js/maintain/setup.mjs`, `js/ui/anim.mjs` | nothing — missing entries fall back silently |
739
822
  | `LOADED_SIGIL` uniqueness | `themes/*.json` | nothing, and it is load-bearing for theme detection |
740
- | The hand-wiring copy of the Claude hooks | `adapters/claude-code/settings.json` — it ships (`files[]` takes `adapters/` whole), and `js/hosts/settings.mjs` sends a user whose `settings.json` has comments to it | nothing compares it with what `claudeHookGroups` emits (§7) |
741
823
  | The emit-size `CEILING` | `tests/unit/emit_smoke.test.mjs` (`const CEILING`) | a hand-transcribed measurement |
742
824
 
743
825
  ---
@@ -747,11 +829,6 @@ only, at best, on its presence.
747
829
  Each is small, and each costs a contributor a wrong turn until it is done. What was found and
748
830
  fixed here before is recorded in [design history](design-history.md).
749
831
 
750
- - **`adapters/claude-code/settings.json` has no gate.** It ships, and the refusal for a commented
751
- `settings.json` tells users to copy hooks from it. It writes `node bin/geneseed-hook.mjs <verb>`,
752
- a path that resolves only from a checkout root, and none of the `--no-*-gate` flags
753
- `claudeHookGroups` emits. Nothing compares the two. Either gate it against the emitter, or point
754
- the refusal at an emitted file and delete it.
755
832
  - **`AGENT_LESSON_PROMPT` has no drift gate.** Its sibling `LEARN_PROMPT_HEAD` is checked for
756
833
  extractability; this one's parity test was retired. Reformat the declaration in
757
834
  `geneseed-learn.js` and the per-agent lesson prompt silently degrades to a two-line fallback.
@@ -772,7 +849,7 @@ gated. Every other appearance is derived at runtime (`.geneseed-version` markers
772
849
  why no test pins a version string and none should.
773
850
 
774
851
  Do not run `npm version`. Bump the two files by hand, add the `CHANGELOG` section, update
775
- `SHIPPED.md`, rebuild `web/dist` if `web/src` moved, run the seven commands from §1, and merge to
852
+ `SHIPPED.md`, rebuild `web/dist` if `web/src` moved, run the commands from §1, and merge to
776
853
  `main`. **The bump is the release** (since 2026-10-23): when CI finishes green on that push,
777
854
  `publish.yml` sees a version npm does not have, re-runs its gates, publishes it, and creates the
778
855
  `v<version>` tag and the GitHub release from the version's CHANGELOG section. A push that does not
@@ -0,0 +1,100 @@
1
+ ---
2
+ group: guides
3
+ order: 24.6
4
+ title: "Auto-merge green PRs"
5
+ kind: "concept"
6
+ section: "Factories"
7
+ description: "Let the forge merge a PR the agent opens once its required checks are green: how to turn it on and off, the forge settings it needs, and the three tiers."
8
+ ---
9
+ Auto-merge ships **off**. When it is off, the agent opens a PR and the merge stays yours. When you
10
+ turn it on, the agent arms the forge's own auto-merge on a PR it opens, and the forge merges the
11
+ PR when its required checks pass. The agent never decides that a PR is green: the forge does
12
+ (`external-gate`).
13
+
14
+ ## Turn it on or off
15
+
16
+ Say **"turn on auto-merge"**. The `rule` skill asks one question, every repo or this project only,
17
+ then shows a standing rule for `user-rules.md` and writes it on your yes:
18
+
19
+ ```
20
+ ## R<n> — Auto-merge green PRs
21
+ (scope: global | source: user, <date>)
22
+ Arm auto-merge on a PR I open, only when the forge has required checks.
23
+ - docs-tests: auto
24
+ - normal: human # human | reviewer
25
+ - sensitive: never
26
+ - Before any further push to a PR with auto-merge armed, disarm it first, then classify, review and arm again on the new head.
27
+ ```
28
+
29
+ The rule files are layered: shared, then host, then project, and the later layer wins. So a
30
+ global rule sets the default and a project's own copy overrides it. To turn it off, say **"turn
31
+ off auto-merge"**: the agent removes the rule, or writes a project copy with all three tier lines
32
+ `never`. When a repo has no rule, the agent tells you once per session in that repo, when it
33
+ opens a PR there, that auto-merge is off and how to turn it on.
34
+
35
+ The rule is your durable authorization for the forge's merge (`deletion-is-deliberate`). It arms
36
+ only that merge. Pushes still follow `consent-before-push`: a plain push of your own branch goes
37
+ through, and a push onto the main branch asks you.
38
+
39
+ ## The tiers
40
+
41
+ The agent sorts each PR by its diff, the first match wins:
42
+
43
+ | Tier | When | Accepted values |
44
+ |---|---|---|
45
+ | `sensitive` | Any file in a sensitive zone: each `sensitive:` zone of the ownership block in the **base** branch's `AGENTS.md` (see [Set up ownership](set-up-ownership.md)), plus auth and authz, secrets and credentials, data migrations and schema, CI and deploy config, dependency manifests and lockfiles, release and versioning, gate and hook config, `AGENTS.md`, `CLAUDE.md`, `CODEOWNERS`, any `user-rules.md`, agent, skill and instruction files, and gate machinery (check scripts, CI-only harnesses, coverage thresholds; not ordinary unit tests) | None: it never arms, whatever the rule says |
46
+ | `docs-tests` | Every file is docs (prose that is neither shipped nor executed) or tests, and no test or assertion is removed, skipped or loosened (that diff is `normal`) | `auto`, `human`, `reviewer`, `never` |
47
+ | `normal` | Anything else | `human`, `reviewer`, `never` (`auto` is not valid) |
48
+
49
+ `auto` arms. `human` arms only when the forge also requires one approving review and dismisses it on a new push. `reviewer` arms
50
+ after the agent's blind reviewer passes, with its verdict added to the PR body first (in a factory,
51
+ the `review-panel` verdict). `never` does not arm. A missing or other value counts as `human`. Use `reviewer` only in a solo repo: GitHub does not
52
+ let you approve your own PR, and a PR the agent opens carries your identity, so `human` would never
53
+ merge there.
54
+
55
+ ## Forge settings it needs
56
+
57
+ The agent arms auto-merge only when it can read all of these. When it cannot, it does not arm, and
58
+ the merge stays yours.
59
+
60
+ | Setting | GitHub (how the agent reads it) | GitLab |
61
+ |---|---|---|
62
+ | Auto-merge allowed | Settings › General › *Allow auto-merge* (`gh repo view --json autoMergeAllowed`) | No switch: GitLab offers auto-merge on every project, so the agent checks this on GitHub only |
63
+ | Required checks on the base branch | A ruleset (`required_status_checks` in `gh api repos/{owner}/{repo}/rules/branches/<base>`) or branch protection (`required_status_checks` in `.../branches/<base>/protection`), with a non-empty list of checks: an empty list requires nothing, and `--auto` then merges at once | *Pipelines must succeed* (`only_allow_merge_if_pipeline_succeeds` in `glab api projects/:id`) |
64
+ | One approving review (`human`) | A ruleset `pull_request` rule, or branch protection, with `required_approving_review_count` of 1 or more | An approval rule with `approvals_required` of 1 or more (`glab api projects/:id/approval_rules`) |
65
+ | Stale approvals (required for `human`) | *Dismiss stale pull request approvals when new commits are pushed* (`dismiss_stale_reviews_on_push` in the ruleset, `dismiss_stale_reviews` in the protection) | *Remove all approvals when commits are added* (`reset_approvals_on_push` in `glab api projects/:id/approvals`) |
66
+ | Backstop on sensitive paths (recommended) | `CODEOWNERS` plus *Require review from Code Owners* | `CODEOWNERS` plus code owner approval on the protected branch |
67
+
68
+ The agent arms on the head it classified and reviewed:
69
+
70
+ ```bash
71
+ gh pr merge <pr> --auto --squash --match-head-commit <sha>
72
+ glab mr merge <mr> --auto-merge --squash --sha <sha>
73
+ ```
74
+
75
+ `glab mr merge` arms auto-merge by default, so the agent always names the flag. On GitHub the
76
+ pinned head is checked only when auto-merge is armed: an armed PR stays armed after a later push by
77
+ someone with write access. So before any further push to an armed PR, the agent disarms it
78
+ (`gh pr merge <pr> --disable-auto`; on GitLab, `POST
79
+ projects/:id/merge_requests/:iid/cancel_merge_when_pipeline_succeeds` through `glab api`), then
80
+ classifies, reviews and arms again on the new head. If the head is already green when the agent
81
+ arms, the forge merges at once.
82
+
83
+ ## On each host
84
+
85
+ The rule is text in the `ship` and `factory` skills. No Geneseed gate guards a merge command, so all
86
+ four hosts behave the same:
87
+
88
+ | Host | What guards `gh pr merge` / `glab mr merge` |
89
+ |---|---|
90
+ | Claude Code | Nothing: the git gate matches only `git commit` and `git push` |
91
+ | OpenClaude | Same as Claude Code |
92
+ | OpenCode | Nothing: the permission globs cover only `git commit*` and `git push*` |
93
+ | Bob | Nothing: consent is a log line |
94
+
95
+ An MCP merge tool (a GitHub MCP server's merge, or a host's own auto-merge tool) is not a shell
96
+ command, so no shell gate sees it on any host. The forge's required checks and reviews are the
97
+ boundary.
98
+
99
+ A [factory](run-a-factory.md) follows the same rule: at the end of a green run it arms auto-merge
100
+ when the rule allows, and otherwise asks you once whether to merge.
@@ -14,7 +14,7 @@ All of these choices are made **at build time**. The build writes them into the
14
14
 
15
15
  ## Theme: the voice
16
16
 
17
- A theme changes how the harness *sounds*: the banner, the readiness sigil the agent opens with, and the vocabulary of its prose. It never changes which rules apply or which files ship. The wizard previews each theme live as you move through the list.
17
+ A theme changes how the harness *sounds*: the banner, the readiness sigil the agent opens with, and the vocabulary of its prose. It never changes which rules apply or which files ship. The wizard lists each theme with a one-line description.
18
18
 
19
19
  `neutral` is plain English. The others are `imperial`, `military`, `pirate`, `wizard`, `cyberpunk`, `gamer`, `sports`, `biker`, `commentator`, `joker`, `marvin`, `mean` and `verstappen`.
20
20
 
@@ -19,6 +19,6 @@ cat issue.md | opencode run "triage this and propose a fix plan" # pipe inp
19
19
 
20
20
  ## Things to know
21
21
 
22
- - **Permission prompts still apply, and in CI nobody can answer them.** Any command the config marks `ask` blocks a non-interactive run: `rm -rf`, and `git commit` and `git push` whenever the *Consent Before Push* rule is built in (it is part of the `process` pack; see [Doctrine packs and single rules](setup-doctrines.md)). A CI job that has to commit should set those commands back to `"allow"` in its own `permission.bash` map, or limit the run to read-only work. Do not disable the guards wholesale.
22
+ - **Permission prompts still apply, and in CI nobody can answer them.** Any command the config marks `ask` blocks a non-interactive run: `git commit` and `git push` whenever the *Consent Before Push* rule is built in (OpenCode's globs cannot see the branch, so they ask for every commit and push, not only those onto the main branch) (it is part of the `process` pack; see [Doctrine packs and single rules](setup-doctrines.md)). A CI job that has to commit should set those commands back to `"allow"` in its own `permission.bash` map, or limit the run to read-only work. Do not disable the guards wholesale.
23
23
  - **`--pure`** runs OpenCode without any local or global config. Use it to reproduce a bug without the harness in the way, or to confirm that a behaviour comes from the harness.
24
24
  - **The plugins still load.** The context plugin injects the repo's docs, and the learn plugin still writes memory when the session goes idle. To change their behaviour for a run, set `GENESEED_GUARD=warn` or `off`, `GENESEED_CONTEXT_INJECT=off`, or `GENESEED_DEBUG=1`. See [Context and memory variables](../reference/env-context.md) and [OpenCode plugins](../reference/opencode-plugins.md).
@@ -13,9 +13,9 @@ geneseed build --emit bob-global # ~/.bob
13
13
  geneseed build --emit bob --out /path/to/repo --root /path/to/repo # one repo
14
14
  ```
15
15
 
16
- Bob is shaped like Claude Code, so it gets the same agents and skills. A read-only agent is limited with Bob's own `groups:` key, because Bob ignores Claude's `disallowedTools`. Per repo, the preamble goes into a root `AGENTS.md` and the rest into `.bob/`. Globally, everything goes under `~/.bob` (`$BOB_CONFIG_DIR` moves it), and the preamble rides `rules/geneseed.md`, because Bob does not auto-load a global `AGENTS.md`. Bob's hooks refuse an action with exit code 2, and Bob has no `SubagentStop` or `PreCompact` events.
16
+ Bob is shaped like Claude Code, so it gets the same agents and skills. A read-only agent is limited with Bob's own `groups:` key, because Bob ignores Claude's `disallowedTools`. Per repo, the preamble goes into a root `AGENTS.md` and the rest into `.bob/`. Globally, everything goes under `~/.bob` (`$BOB_CONFIG_DIR` moves it), and the preamble rides `rules/geneseed.md`, because Bob does not auto-load a global `AGENTS.md`. Bob's hooks refuse an action with exit code 2. Bob has no `SubagentStop` event; Bob 2.2.3 does have `PreCompact` and `PostCompact`, which Geneseed does not wire.
17
17
 
18
- Both scopes open Bob's carrier with a short first-reply override, so the theme's readiness line (for example "🧬 Gene-seed implanted…") starts the first reply. Without it, Bob's own greeting outranked the instruction lower in the file. A bare greeting such as "hi" still gets Bob's fixed welcome; the line appears on the first real request. That much was checked by hand in the Bob IDE (2026-10); the rest of the Bob support has not been verified against a live install.
18
+ Both scopes open Bob's carrier with a short first-reply override, so the theme's readiness line (for example "🧬 Gene-seed implanted…") starts the first reply. Without it, Bob's own greeting outranked the instruction lower in the file. A bare greeting such as "hi" still gets Bob's fixed welcome; the line appears on the first real request. For what was checked against Bob itself, and when, see [What is verified](../concepts/host-matrix.md#what-is-verified); [Verify it works](verify.md) has the steps to check your own install by hand.
19
19
 
20
20
  ---
21
21
 
@@ -8,7 +8,7 @@ description: "Install from a git clone when npm is out of reach, or when you wan
8
8
  ---
9
9
  Clone the repository when npm is out of reach (for example, a corporate network with no registry access), or when you want to change the harness rather than just use it. A clone needs **git** as well as Node 22.7 or newer. git is what updates the clone.
10
10
 
11
- Each OS has a one-step installer at the root of the clone. It checks for Node and git. If one is missing, it names what to install and where to get it, then stops. **It never installs anything itself.** When the checks pass, it runs the setup wizard and offers to open the web console.
11
+ Each OS has a one-step installer at the root of the clone. It checks for Node and git and names what to install and where to get it. A missing Node stops the installer; a missing git only warns, because setup runs without it and updates need it. **It never installs anything itself.** When the checks pass, it runs the setup wizard (it then runs `geneseed link` if `geneseed` is not on your `PATH`) and offers to open the web console.
12
12
 
13
13
  ```bash
14
14
  git clone https://github.com/Arylmera/Geneseed.git
@@ -18,7 +18,7 @@ geneseed build --emit openclaude --out /path/to/repo --root /path/to/repo # one
18
18
  - Per repo, the preamble is written to `.openclaude/CLAUDE.md` rather than a root file, and the hooks go into `.openclaude/settings.local.json`.
19
19
  - `$OPENCLAUDE_CONFIG_DIR` moves the global directory (default `~/.openclaude`).
20
20
 
21
- OpenClaude support has not yet been verified against a live install.
21
+ For what was checked against OpenClaude itself, see [What is verified](../concepts/host-matrix.md#what-is-verified).
22
22
 
23
23
  ---
24
24
 
@@ -16,7 +16,7 @@ The only prerequisite is **Node 22.7 or newer**.
16
16
  npx geneseed setup
17
17
  ```
18
18
 
19
- The command is the same on macOS, Linux and Windows (cmd, PowerShell or any POSIX shell). The setup wizard lists the AI coding tools it found on your `PATH`, then asks for a theme, a posture, a mode, the doctrine packs, an install mode and a footprint. Each one has a safe default, so you can hold Enter through all of them. [Choose your setup](choose-your-setup.md) explains each question. **OpenCode global** is the recommended install mode: you install once and every repo inherits it, with nothing committed into your projects. The wizard then builds the harness and ends with a short summary: the root file your tool loads and where it was written, the hooks it wired (Claude Code, Bob and OpenClaude), whether memory learning is on, which tool to restart, and a link to what was installed. It then offers to run a health check.
19
+ The command is the same on macOS, Linux and Windows (cmd, PowerShell or any POSIX shell). The setup wizard lists the AI coding tools it found on your `PATH` or in the usual per-user folders, then asks for a theme, a posture, a mode, the doctrine packs, the kits, an install mode and a footprint. Each one has a safe default, so you can hold Enter through all of them. [Choose your setup](choose-your-setup.md) explains each question. **OpenCode global** is the recommended install mode: you install once and every repo inherits it, with nothing committed into your projects. The wizard then builds the harness and ends with a short summary: the root file your tool loads and where it was written, the hooks it wired (Claude Code, Bob and OpenClaude), whether memory learning is on, which tool to restart, and a link to what was installed. It then offers to run a health check.
20
20
 
21
21
  To keep the command on your machine:
22
22
 
@@ -28,13 +28,13 @@ geneseed loop next # what to do now, as one JSON
28
28
 
29
29
  Then repeat `geneseed loop next` and act on what it prints:
30
30
 
31
- | `next` prints | You run |
31
+ | The engine prints | You run |
32
32
  | --- | --- |
33
33
  | `{node, validate: true}` | `geneseed loop score --declared` (or, for a setup brick, `--actions … --write-set '…' --intent …`) |
34
34
  | `{node}` | the brick's prompt, then `git status --porcelain \| geneseed loop record --outcome <outcome>` (the iteration head adds `--card '<json>'` when it reports `more`) |
35
35
  | `{verify, run}` | exactly the printed `run` command, which pipes the staged numstat into `geneseed loop score --diff` |
36
36
  | `{awaiting}` | `geneseed loop decide --verdict ok\|no\|amend --note "…"` |
37
- | `{commit: true, message_file}` | `git add -A && git commit -F <message_file> && git push -u origin HEAD:loop/<slug>` |
37
+ | `{commit: true, message_file}` (from `score --diff` or `decide`, never from `next`) | `git add -A && git commit -F <message_file> && git push -u origin HEAD:loop/<slug>` |
38
38
  | `{terminal}` | nothing more: `$close` or `$stop` |
39
39
 
40
40
  Every flag is in `geneseed loop --help`. The full cycle, including discards and notes, is in [Loops](../concepts/loops.md).
@@ -43,7 +43,7 @@ Every flag is in `geneseed loop --help`. The full cycle, including discards and
43
43
 
44
44
  | Symptom | Cause and fix |
45
45
  | --- | --- |
46
- | It stopped as blocking on a small change | The diff touched a file outside the iteration's declared write set, which raises the score to at least the API weight. Check the reasons it shows. Answer ok if the file belongs to the change, or amend with a note to keep it out. |
46
+ | It stopped as blocking on a small change | The diff touched a file outside the iteration's declared write set, which raises the score to at least 0.8 (the default API weight). Check the reasons it shows. Answer ok if the file belongs to the change, or amend with a note to keep it out. |
47
47
  | The git gate asks on every iteration's commit | Only one exact shape is exempt. A `cd …` prefix, `git -C`, a quoted refspec (`"HEAD:loop/x"`), `git commit -m` or a message-file path with a space all fall back to asking. Make sure the session works from the worktree itself. |
48
48
  | The final `close` commit asks | Expected. The loop is over, and that ask is your consent to close it. |
49
49
  | `mutation-check` reported `unavailable` | No mutation tool is configured. The loop continues and records the gap in `LOOP.md`'s notes. Add PIT, Stryker, mutmut or cargo-mutants to make it bite. |