geneseed 4.32.0 → 5.0.1

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 (246) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/DESIGN.md +2 -2
  3. package/README.md +6 -5
  4. package/SHIPPED.md +4 -3
  5. package/adapters/bob/README.md +6 -5
  6. package/adapters/claude-code/README.md +4 -3
  7. package/adapters/claude-code/skills/geneseed/SKILL.md +1 -1
  8. package/adapters/openclaude/README.md +4 -3
  9. package/adapters/opencode/GLOBAL-HARNESS-SPEC.md +3 -1
  10. package/adapters/opencode/HOW-OPENCODE-LOADS.md +2 -1
  11. package/adapters/opencode/README.md +18 -18
  12. package/adapters/opencode/plugins/geneseed-activity.js +57 -1
  13. package/adapters/opencode/plugins/geneseed-context.js +85 -18
  14. package/adapters/opencode/plugins/geneseed-guard.js +437 -76
  15. package/adapters/opencode/plugins/geneseed-learn.js +97 -23
  16. package/bin/geneseed-cli.mjs +17 -25
  17. package/bin/geneseed-hook.mjs +23 -8
  18. package/docs/DESIGN.md +175 -0
  19. package/docs/PRD.md +111 -0
  20. package/docs/README.md +3 -2
  21. package/docs/architecture.md +145 -0
  22. package/docs/concepts/agents.md +1 -1
  23. package/docs/concepts/collaboration.md +1 -1
  24. package/docs/concepts/enforcement-table.md +1 -1
  25. package/docs/concepts/exclusions.md +5 -5
  26. package/docs/concepts/footprint.md +1 -1
  27. package/docs/concepts/foreman-mode.md +2 -2
  28. package/docs/concepts/hooks.md +22 -8
  29. package/docs/concepts/host-matrix.md +2 -2
  30. package/docs/concepts/hosts.md +1 -1
  31. package/docs/concepts/kits.md +3 -1
  32. package/docs/concepts/ownership.md +1 -1
  33. package/docs/concepts/rules.md +15 -2
  34. package/docs/concepts/shared-tier.md +73 -0
  35. package/docs/concepts/skills.md +2 -2
  36. package/docs/concepts/themes.md +1 -1
  37. package/docs/extending.md +13 -12
  38. package/docs/guides/install-claude-code.md +1 -1
  39. package/docs/guides/install-opencode.md +1 -1
  40. package/docs/guides/migrate.md +8 -4
  41. package/docs/guides/project-context.md +2 -2
  42. package/docs/guides/setup-footprint.md +1 -1
  43. package/docs/guides/uninstall.md +2 -1
  44. package/docs/guides/upgrade-to-5.md +118 -0
  45. package/docs/guides/upgrade.md +21 -9
  46. package/docs/guides/wiki.md +3 -3
  47. package/docs/reference/env-context.md +5 -3
  48. package/docs/reference/environment.md +1 -1
  49. package/docs/reference/glossary.md +2 -0
  50. package/docs/reference/opencode-plugins.md +3 -3
  51. package/docs/reference/plugin-activity.md +1 -1
  52. package/docs/reference/plugin-context.md +1 -0
  53. package/docs/reference/plugin-guard.md +14 -6
  54. package/docs/reference/plugin-learn.md +13 -6
  55. package/docs/reference/troubleshoot-hooks.md +3 -3
  56. package/docs/reference/troubleshoot-update.md +14 -0
  57. package/docs/token-footprint.md +4 -3
  58. package/docs/understand/a-day.md +2 -2
  59. package/docs/understand/design-choices-install.md +2 -1
  60. package/docs/understand/enforced-vs-asked.md +1 -1
  61. package/docs/understand/machine-bob.md +2 -0
  62. package/docs/understand/machine-claude.md +7 -5
  63. package/docs/understand/machine-opencode.md +7 -5
  64. package/docs/understand/on-your-machine.md +4 -0
  65. package/docs/understand/take-it-out.md +1 -1
  66. package/docs/web-ui.md +135 -70
  67. package/harness.config.json +1 -1
  68. package/js/README.md +12 -7
  69. package/js/build/args.mjs +10 -8
  70. package/js/build/bundle.mjs +11 -13
  71. package/js/build/driver.mjs +66 -65
  72. package/js/build/emit-claude.mjs +22 -16
  73. package/js/build/emit-common.mjs +4 -5
  74. package/js/build/emit-opencode.mjs +22 -22
  75. package/js/build/fold.mjs +515 -0
  76. package/js/build/generate.mjs +41 -52
  77. package/js/build/render.mjs +115 -29
  78. package/js/build/rule-decide.mjs +273 -0
  79. package/js/build/source.mjs +4 -1
  80. package/js/build/stubs.mjs +70 -9
  81. package/js/build/version.mjs +10 -10
  82. package/js/cli-table.json +23 -83
  83. package/js/hosts/activity.mjs +2 -2
  84. package/js/hosts/geneseed-dir.mjs +1 -1
  85. package/js/hosts/hooks-context.mjs +389 -99
  86. package/js/hosts/hooks-learn.mjs +38 -7
  87. package/js/hosts/hooks-prims.mjs +4 -2
  88. package/js/hosts/hooks.mjs +114 -39
  89. package/js/hosts/hosts.mjs +150 -51
  90. package/js/hosts/installs.mjs +59 -171
  91. package/js/hosts/link.mjs +3 -5
  92. package/js/hosts/mcp.mjs +1 -1
  93. package/js/hosts/memory-files.mjs +219 -17
  94. package/js/hosts/ownership-gate.mjs +1 -1
  95. package/js/hosts/settings.mjs +18 -13
  96. package/js/hosts/shim.mjs +4 -33
  97. package/js/hosts/store-watch.mjs +191 -0
  98. package/js/inspect/checks-authoring.mjs +3 -3
  99. package/js/inspect/checks-build.mjs +45 -18
  100. package/js/inspect/checks-counts.mjs +4 -4
  101. package/js/inspect/checks-repo.mjs +13 -14
  102. package/js/inspect/cost.mjs +24 -2
  103. package/js/inspect/diff.mjs +123 -123
  104. package/js/inspect/doctor.mjs +22 -27
  105. package/js/inspect/excludes.mjs +181 -62
  106. package/js/inspect/inventory.mjs +22 -27
  107. package/js/inspect/registry.mjs +110 -32
  108. package/js/inspect/scan.mjs +5 -5
  109. package/js/inspect/status.mjs +141 -119
  110. package/js/inspect/validate.mjs +22 -24
  111. package/js/lib/fs.mjs +47 -50
  112. package/js/lib/json.mjs +10 -17
  113. package/js/lib/machine-dir.mjs +73 -0
  114. package/js/lib/paths.mjs +35 -33
  115. package/js/lib/proc.mjs +1 -1
  116. package/js/lib/prompt.mjs +19 -27
  117. package/js/lib/text.mjs +8 -12
  118. package/js/lib/udiff.mjs +11 -15
  119. package/js/loop/catalog.mjs +2 -3
  120. package/js/maintain/memory.mjs +17 -17
  121. package/js/maintain/migrate.mjs +120 -92
  122. package/js/maintain/setup.mjs +43 -32
  123. package/js/maintain/uninstall.mjs +43 -61
  124. package/js/maintain/update.mjs +200 -93
  125. package/js/ui/anim.mjs +21 -35
  126. package/js/ui/cli.mjs +36 -58
  127. package/js/ui/menu.mjs +22 -45
  128. package/js/ui/tui.mjs +27 -67
  129. package/js/web/actions.mjs +34 -34
  130. package/js/web/api.mjs +142 -79
  131. package/js/web/catalog.mjs +175 -46
  132. package/js/web/docs.mjs +33 -12
  133. package/js/web/doctor-worker.mjs +14 -0
  134. package/js/web/handler.mjs +16 -5
  135. package/js/web/routes.mjs +24 -22
  136. package/js/web/state.mjs +78 -19
  137. package/js/web/update-check.mjs +27 -12
  138. package/js/web/user-files.mjs +76 -104
  139. package/package.json +7 -4
  140. package/registry.json +48 -55
  141. package/src/AGENT.md.tmpl +13 -14
  142. package/src/agents/_self-improvement.md +1 -1
  143. package/src/agents/_template.md +1 -1
  144. package/src/agents/advocate.md +1 -1
  145. package/src/agents/architect.md +1 -1
  146. package/src/agents/developer.md +1 -1
  147. package/src/agents/devops-engineer.md +1 -1
  148. package/src/agents/docker-expert.md +1 -1
  149. package/src/agents/docs.md +1 -1
  150. package/src/agents/empiricist.md +1 -1
  151. package/src/agents/explorer.md +1 -1
  152. package/src/agents/framer.md +1 -1
  153. package/src/agents/historian.md +1 -1
  154. package/src/agents/kubernetes-specialist.md +1 -1
  155. package/src/agents/memory-curator.md +2 -2
  156. package/src/agents/operator.md +1 -1
  157. package/src/agents/performance.md +1 -1
  158. package/src/agents/pragmatist.md +1 -1
  159. package/src/agents/react-engineer.md +1 -1
  160. package/src/agents/react-reviewer.md +1 -1
  161. package/src/agents/researcher.md +1 -1
  162. package/src/agents/reviewer.md +1 -1
  163. package/src/agents/security.md +1 -1
  164. package/src/agents/skeptic.md +1 -1
  165. package/src/agents/spring-boot-engineer.md +1 -1
  166. package/src/agents/spring-reviewer.md +1 -1
  167. package/src/agents/spring-security.md +1 -1
  168. package/src/agents/steward.md +1 -1
  169. package/src/agents/tester.md +1 -1
  170. package/src/agents/user-advocate.md +1 -1
  171. package/src/agents/visionary.md +1 -1
  172. package/src/memory/README.md +1 -1
  173. package/src/skills/_self-improvement.md +2 -2
  174. package/src/skills/daydream/SKILL.md +2 -2
  175. package/src/skills/daydream/instructions.md +1 -1
  176. package/src/skills/geneseed.md +1 -1
  177. package/src/skills/learn-mode.md +1 -2
  178. package/src/skills/profile.md +2 -2
  179. package/src/skills/rule/approve.md +75 -0
  180. package/src/skills/rule/consolidate.md +3 -3
  181. package/src/skills/rule.md +14 -5
  182. package/src/skills/skill-forge.md +1 -1
  183. package/src/skills/teach.md +29 -12
  184. package/src/skills/wiki.md +1 -1
  185. package/themes/_TEMPLATE.json +1 -2
  186. package/themes/biker.json +1 -2
  187. package/themes/commentator.json +1 -2
  188. package/themes/cyberpunk.json +1 -2
  189. package/themes/gamer.json +1 -2
  190. package/themes/imperial.json +1 -2
  191. package/themes/joker.json +1 -2
  192. package/themes/marvin.json +1 -2
  193. package/themes/mean.json +1 -2
  194. package/themes/military.json +1 -2
  195. package/themes/neutral.json +1 -2
  196. package/themes/pirate.json +1 -2
  197. package/themes/sports.json +1 -2
  198. package/themes/verstappen.json +1 -2
  199. package/themes/wizard.json +1 -2
  200. package/web/dist/assets/Activity-Ci4PZco3.js +1 -0
  201. package/web/dist/assets/ActivityDetail-C8hroCND.js +1 -0
  202. package/web/dist/assets/AgentGlyph-k6o3gCM1.js +1 -0
  203. package/web/dist/assets/Bonsai-C1iBAt4v.js +1 -0
  204. package/web/dist/assets/{CopyButton-C5Li6awl.js → CopyButton-DJ3a4N88.js} +1 -1
  205. package/web/dist/assets/Dashboard-C_On4KXw.js +2 -0
  206. package/web/dist/assets/Docs-Kffdg5uV.js +5 -0
  207. package/web/dist/assets/GreenhouseView-k56_cBSF.js +1 -0
  208. package/web/dist/assets/Installs-DtEKLC9h.js +3 -0
  209. package/web/dist/assets/JournalView-RQnk5l7I.js +1 -0
  210. package/web/dist/assets/Kits-CXkEBpnf.js +1 -0
  211. package/web/dist/assets/Laws-DhhIVqmh.js +3 -0
  212. package/web/dist/assets/Library-CAUiEoJo.js +3 -0
  213. package/web/dist/assets/{Loops-CzitjxGV.js → Loops-LKD8mF4E.js} +2 -2
  214. package/web/dist/assets/{Markdown-C4S4tTA7.js → Markdown-0ORz7tAc.js} +21 -21
  215. package/web/dist/assets/OperatorHudView-CM5jNPwL.js +1 -0
  216. package/web/dist/assets/Personal-B6Uoly3C.js +2 -0
  217. package/web/dist/assets/{RailCats-D5weYPCS.js → RailCats-DQxxYBEP.js} +1 -1
  218. package/web/dist/assets/Settings-BTe6-wda.js +1 -0
  219. package/web/dist/assets/Tabs-CbdDWTp_.js +1 -0
  220. package/web/dist/assets/api-D_r0Jtla.js +1 -0
  221. package/web/dist/assets/controls-D4wmg_pl.js +1 -0
  222. package/web/dist/assets/index-HfGmYXab.js +3 -0
  223. package/web/dist/assets/index-ao3M-Fhm.css +1 -0
  224. package/web/dist/assets/motion-RlUl1osO.js +1 -0
  225. package/web/dist/assets/{sections-ChwaobfW.js → sections-CtFz7HFH.js} +1 -1
  226. package/web/dist/index.html +5 -5
  227. package/src/skills/quiz.md +0 -44
  228. package/web/dist/assets/Activity-Bjy64wHC.js +0 -1
  229. package/web/dist/assets/ActivityDetail-B0AaipP8.js +0 -1
  230. package/web/dist/assets/Bonsai-CJniRqaH.js +0 -1
  231. package/web/dist/assets/Dashboard-B-6DTmae.js +0 -2
  232. package/web/dist/assets/Docs-LRc30XL9.js +0 -5
  233. package/web/dist/assets/GreenhouseView-CcoYlaWo.js +0 -1
  234. package/web/dist/assets/Installs-dp1epTcE.js +0 -3
  235. package/web/dist/assets/JournalView-nFP4poCf.js +0 -1
  236. package/web/dist/assets/KitApply-DwyZUj57.js +0 -1
  237. package/web/dist/assets/Kits-C0IEdZXe.js +0 -1
  238. package/web/dist/assets/Laws-CkykmQWu.js +0 -3
  239. package/web/dist/assets/Library-Guh9HBZU.js +0 -2
  240. package/web/dist/assets/OperatorHudView-DLGNulIY.js +0 -1
  241. package/web/dist/assets/Personal-BMtberL8.js +0 -2
  242. package/web/dist/assets/Tabs-uYJqfuQt.js +0 -1
  243. package/web/dist/assets/api-BxjLd7Qd.js +0 -1
  244. package/web/dist/assets/index-DA7BiaE5.js +0 -3
  245. package/web/dist/assets/index-dbbDGFDq.css +0 -1
  246. package/web/dist/assets/motion-Bccx3zE8.js +0 -1
package/docs/web-ui.md CHANGED
@@ -44,6 +44,8 @@ so other sites can't trigger builds, deletes, or shutdown. Mutating actions (bui
44
44
  update, export, restore, memory-delete, uninstall) run in the background and report back
45
45
  as toasts (fire-and-notify). Read-only browsing needs no token.
46
46
 
47
+ **The token stops other sites, not other programs.** Anything on this machine that can read it, from the served page or `.geneseed-web.json`, can call the console API. So the console is no boundary against an agent with a shell, the same as the shell itself. That includes a rule decision: the [change report](concepts/hooks.md#the-change-report) still lists it, for this reason.
48
+
47
49
  Every request passes one guard first: the `Host` must be `127.0.0.1`, `localhost` or `[::1]`
48
50
  **at the server's own port** (DNS rebinding, other local servers), `/api/*` refuses a
49
51
  `Sec-Fetch-Site` of `cross-site`/`same-site` or a foreign `Origin` (so another site cannot read
@@ -60,13 +62,13 @@ A request can name the install it reads or writes. A read takes two query parame
60
62
  `host` and `path` in its JSON body. The pair is a row of `/api/installs`, and the server checks
61
63
  it against the same detected-install allowlist as the install toggle. An unknown or half pair
62
64
  gets a 404 and never falls through to another install's folder. The writes that take the pair
63
- are `/api/activity`, `/api/memory/delete`, `/api/rules`, `/api/rules/promote`, `/api/profile`,
64
- and the `restore` and `build` actions. In `/api/install`, the `install` and
65
+ are `/api/activity`, `/api/memory/delete`, `/api/rules`, `/api/rules/promote`, `/api/rules/decide`, `/api/profile`,
66
+ and the `restore` and `build` actions. In `/api/install`, `/api/default-install`, the `install` and
65
67
  `deploy` actions, `/api/excludes` and `/api/reveal`, `host`/`path` keep their own meaning.
66
68
 
67
69
  Every `/api/*` read takes and checks the pair, with these exceptions:
68
70
  - `/api/ping` and `/api/jobs` ignore it.
69
- - The machine-wide reads also ignore it: `/api/update`, `/api/installs`, `/api/fleet`,
71
+ - The machine-wide reads also ignore it: `/api/update`, `/api/installs`, `/api/fleet`, `/api/migrate/preview`,
70
72
  `/api/kits`, `/api/usage`, `/api/gates`, `/api/excludes`, `/api/mcp`, `/api/loops/active`,
71
73
  `/api/activity`, and the Library's skill, agent, memory and notebook lists,
72
74
  `/api/catalog/skills`, `/api/catalog/agents`, `/api/catalog/memory` and
@@ -76,7 +78,9 @@ Every `/api/*` read takes and checks the pair, with these exceptions:
76
78
 
77
79
  The skill, agent, memory and notebook lists read every active install (memory and notebook
78
80
  entries are your own files, so a fact's Forget and Promote act on the install of the copy on
79
- screen, and Promote writes to that install's `user-rules.md`). Each row is one id (kind and name), and
81
+ screen, and Promote writes to that install's `user-rules.md`). The installs that read the shared
82
+ tier hold one memory store: it is listed under the first of them, and `/api/catalog/memory` names
83
+ them all in `sharedInstalls`. Each row is one id (kind and name), and
80
84
  its `installs` field names the installs that have it, as `host:scope:root` keys (the same keys
81
85
  as `/api/usage`). An id that only some installs have lists only those installs, so an exclusion
82
86
  stays visible. The other catalog sections stay install-scoped. `/api/item/skill/<name>` and
@@ -87,9 +91,15 @@ it. The order is the host order (OpenCode, Claude Code, Bob, OpenClaude), then g
87
91
  project. The item's `install` field names the copy, and its `installs` field names every
88
92
  install that has the id.
89
93
 
90
- A request that names no install reads the **default install**: the first active one in the console's one
91
- install order (`fleetSort`): host order (opencode, claude, bob, openclaude), then global before
92
- project. `/api/installs` marks
94
+ A request that names no install reads the **default install**: the one you chose on the Installs
95
+ page (*Make default* on an active row), while it stays active. With no choice, it is the first
96
+ active one in the console's one install order (`fleetSort`): host order (opencode, claude, bob,
97
+ openclaude), then global before project. The choice is machine-wide and lives in
98
+ `default-install.json` in the shared tier. `POST /api/default-install` with `{host, path}` sets it
99
+ and refuses anything else with a 409, an empty or malformed body included, and the choice stays.
100
+ The console has no way to clear it: choose another install, or delete the file. A choice that no
101
+ longer names an active install is ignored, and it applies again if that install comes back. The
102
+ `install` and `theme` lines of `geneseed status` follow the same choice. `/api/installs` marks
93
103
  that row `default: true`. There is no console-wide install and no `POST /api/view`: a page that
94
104
  acts on one install names it on each request, through a picker placed beside the entry or form it
95
105
  applies to (see below).
@@ -98,31 +108,67 @@ of them.
98
108
 
99
109
  ## The rail
100
110
 
101
- The left rail mirrors the harness's own shape:
111
+ The left rail has one flat list, and three entries at its foot:
102
112
 
103
- | Group | Views |
113
+ | Entry | Holds |
104
114
  | --- | --- |
105
- | *(ungrouped)* | Dashboard |
106
- | **📖 Codex** | Constitution · Rules · Profile · Skills · Agents · Library · Loops · Docs |
107
- | **🩺 Care** | Activity · Changes · Doctor |
108
- | **🎨 Setup** | Harness · Settings |
109
-
110
- At the foot of the rail sits a **vitals** card — the doctor's verdict, drift, how long ago the
115
+ | **Overview** (`#/`) | The fleet: every install on one Ledger, and *Needs you* |
116
+ | **Constitution** (`#/laws`) | Ethos, Rules and doctrines |
117
+ | **Library** (`#/library`) | Skills, agents, the wiki and the setup files |
118
+ | **Kits** (`#/kits`) | The kit catalogue |
119
+ | **Loops** (`#/loops`) | Tabs: Templates · Bricks · Active |
120
+ | **Personal** (`#/personal`) | Tabs: Rules · Profile · Memory · Notebook |
121
+ | **Installs** (`#/installs`) | Tabs: Hosts · Local edits · Doctor |
122
+ | **Docs**, **Activity**, **Settings** (foot) | The documentation, the agent sessions on this machine, and this copy of Geneseed with its server |
123
+
124
+ The old flat routes still resolve to their tab (`VIEW_ALIAS`, `web/src/lib/router.js`): `#/rules`,
125
+ `#/profile`, `#/harness`, `#/harnesses`, `#/themes`, `#/diff`, `#/doctor`, `#/about`. Addresses of
126
+ what moved open its one home: `#/installs/kits` the Kits page, `#/installs/server` Settings, and
127
+ `#/section/memory`, `#/section/notebook`, `#/item/memory/<name>` and `#/item/notebook/<name>` the
128
+ Personal tabs. The view notes below keep those older names and their old grouping.
129
+
130
+ **A rail badge equals what its page lists.** Every count covers every install, deduped by name, and
131
+ `/api/overview` `counts` is the size of the same lists the pages show (`fleetCounts`,
132
+ `js/web/catalog.mjs`). A folder's index and README (`MEMORY.md`, `NOTEBOOK.md`) are in no list and no
133
+ count, and stay readable by name. Constitution counts its rules, on or off, and not the Ethos
134
+ sections. Library is the sum of its kinds. Installs counts what is installed, on or off. A number
135
+ measured on one install, such as a root file's size on an Overview row, is a measurement and stays
136
+ on its row. An install that cannot be read is skipped, and the rest still count. The Loops badge is
137
+ the union across installs, and its title says so; the page lists the picked install's templates.
138
+ `web/src/__tests__/railCounts.test.jsx` and `tests/unit/web_counts.test.mjs` hold this.
139
+
140
+ **A read still out is not a failed one.** Each card tells three states apart: `Loading.jsx` while the
141
+ first read is out, a sentence when it failed, and what it found when it is empty. No count appears
142
+ before its data. The Constitution waits for the picked install's own overview too: a gate read
143
+ before it would read as armed.
144
+
145
+ At the foot of the rail sits a **vitals** card — the doctor's verdict, local edits, how long ago the
111
146
  harness was built, and a Voice button — so those facts are on screen from every page. It is
112
147
  hidden where the rail collapses to icons (≤960px) and returns with the phone drawer. The topbar's
113
148
  breadcrumb starts at the page: it names no install.
114
149
 
115
- **Install pickers.** The console has no install switch. Where a page acts on one install, an
116
- `InstallPicker` sits beside what it applies to, labelled for it (*Write to:*, *Doctor for:*), and
117
- starts on the default install; with one active install it is not shown. Rules and Profile list
118
- every active install's entries together, each tagged with its install, and write back to the
119
- install an entry came from; so do Memory and Notebook, whose Forget and Promote act on the
120
- install of the copy on screen. Doctor, Local edits, Server, the Constitution (*Constitution of:*,
121
- for its gate switches and doctrine Apply), Loops (*Templates and bricks of:*) and the rail's Voice
122
- popover (*Rebuild:*) each keep their own pick (in the browser's localStorage). The Overview is
123
- fleet-wide: each install's own facts (voice, footprint, posture, mode, memory facts, drift) sit on
124
- its row, and a figure still read off the default install (a suggestion, a tab badge, an older
125
- Overview view, Personal's Rule budget) names that install once two or more are active.
150
+ **Install pickers.** The console has no install switch. Where a page acts on one install, one
151
+ `InstallPicker`, always labelled *Install:*, sits right above the heading of the view it acts on
152
+ (under the tabs on a tabbed page, over the h1 on a page with none), and starts on the default install; with one active install it is not shown. A form or popover that
153
+ acts on its own install holds the same control: the new-rule form, the rail's Voice popover, and a
154
+ Library entry with several copies. The Personal page names no harness for what the harnesses share:
155
+ every global install reads one set of rules, one profile and one memory store in the shared tier
156
+ (`~/.config/geneseed`), so Rules, Profile and Memory list each once. Its header states that scope
157
+ once, a list head or profile card says `shared`, and a project install keeps its own, named by its
158
+ install. Each `/api/installs` and `/api/fleet` row carries `shared`, which the pages read from
159
+ `useInstalls`; `sharedTier` is only a project install's switch. A write goes back to the file an
160
+ entry came from. Notebook stays per install, and its Forget acts on the install of the copy on
161
+ screen. Doctor, Local edits, the Constitution (for its gate switches and doctrine Apply), Loops and
162
+ the rail's Voice popover each keep their own pick (in the browser's localStorage). The Overview is
163
+ fleet-wide: each install's own facts (voice, footprint, posture, mode, local edits) sit on
164
+ its row, and a figure still read off a project install set as the default (a suggestion, a lens)
165
+ names that install once two or more are active. A *Needs you*
166
+ suggestion about a shared file or the shared memory store appears once and names no harness.
167
+
168
+ The Loaded every turn card also shows the session-start hook output against its 9 000-character
169
+ budget, measured without project context, for the install whose content was cut, else the
170
+ largest. It turns amber at 85% of the budget or whenever content was cut, and Needs you adds one
171
+ suggestion at the same point.
126
172
 
127
173
  A global **Spotlight** search lives in the topbar — press <kbd>/</kbd> to focus it (or
128
174
  <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>K</kbd>, which also works from inside a text field), type
@@ -136,10 +182,14 @@ streams the output of background jobs and keeps their history across reloads.
136
182
 
137
183
  ### Dashboard
138
184
 
139
- - **Dashboard** (`#/`) — a live readout of what's deployed. Three lenses: **Status**
140
- (readiness ring, a KPI band, a genome grid, recent activity), **Lineage** (the
141
- source → render → deployed timeline and the genome-by-volume strand chart), and
142
- **Operator** (a searchable table of every deployed capability). Every lens hero carries the
185
+ - **Overview** (`#/`) — the header's **View** control is the one home of the lens: **Overview** (the
186
+ Ledger), **Genome**, **Greenhouse**, **HUD** and **Journal**. A lens never takes a skin's name, and
187
+ a browser that stored the old `cultivar` or `operator` keeps its lens (`resolveLayout`). All five
188
+ views share one header: the title, the install count, the version chip and the View control.
189
+ Beside the Ledger, a lens has a row with the facts it reads and *Run doctor* and *Rebuild*, then
190
+ three sub-views: **Status** (laid out by the lens), **Lineage** (the source → render → deployed
191
+ timeline and the genome-by-volume strand chart), and **Readout** (a searchable table of every
192
+ deployed capability). Every lens hero carries the
143
193
  fleet verdict badge (the Ledger's `fleetVerdict`). The headline speaks the theme's voice only
144
194
  while that verdict is good or still loading; a warn, bad or unreachable fleet reads plain
145
195
  *Deployed*. Recent-run previews read `verb · scope · result · duration`, and the raw command
@@ -149,21 +199,30 @@ streams the output of background jobs and keeps their history across reloads.
149
199
  labelled *Dictates* (the name AGENT.md gives the laws) and not *Constitution* on purpose: its value is the law count
150
200
  alone, and calling it the constitution would under-report the ontology and the doctrine
151
201
  packs. The two Status *layouts* that have room for it add the missing half: Greenhouse
152
- puts an active-packs fraction under the tile (`3/4 packs · N rules`), and the Operator HUD
202
+ puts an active-packs fraction under the tile (`3/4 packs · N rules`), and the HUD
153
203
  gives it its own cell (`PACKS 3/4`). That is what makes a narrowed install *look* different
154
204
  from a full one at a glance.
155
205
 
156
206
  ### 📖 Codex
157
207
 
158
208
  - **Rules** (`#/rules`) — your own standing rules, read from and written to the
159
- `user-rules.md` beside the deployed AGENT.md (the seed-once file no update ever
160
- touches) of every active install, listed together and tagged with their install; an edit,
161
- graduate or retire writes back to the rule's own install, and a new rule goes to the install
162
- its form's *Write to:* picker names. List with scope (project/global — a hand-written `user` opens as global — or any other scope written by hand, which a
209
+ `user-rules.md` (the seed-once file no update ever touches): the shared file every global
210
+ install reads, listed once under a `shared` head, beside each project install's own, under its
211
+ install's name. An edit, graduate or retire writes back to the rule's own file, and a new rule goes
212
+ to the file its form's *Install:* picker names. List with scope (project/global — a hand-written `user` opens as global — or any other scope written by hand, which a
163
213
  save keeps as written) and trial chips, add/edit/retire forms (retire moves the rule to `user-rules-retired.md`, which is never loaded; its id is never reused) (a body line starting
164
214
  `## ` is refused: the file would read it as a new rule heading), a
165
- **Graduate** action that adopts a trial rule for good, and a budget meter that turns
166
- amber as the always-loaded set gets heavy. Every write carries the fingerprint of the
215
+ **Graduate** action that adopts a trial rule for good. Each rule row shows its token cost
216
+ (code points / 4 of its own block), and each list's head shows the one rule count and total, such
217
+ as `4 rules · ≈1,055 tokens every turn · scope global unless marked`, which counts the file's
218
+ header too. A row shows a scope only when it differs from that. There is no ceiling.
219
+ A **Pending** section lists what waits undecided in `user-rules.draft.md`, and a pending rule still
220
+ binds on its host. *Approve* and *Reject* decide a rule; a profile or wiki pointer shows both files,
221
+ with *Use the host file*, *Use the shared file* and *Keep both*. These apply the rule skill's own
222
+ steps (`js/build/rule-decide.mjs`), and a decision that moves a file offers *Rebuild all*. No decision
223
+ applies while a job runs. The [change report](concepts/hooks.md#the-change-report) lists a decision like
224
+ any other console write, and says it may be yours.
225
+ Every write carries the fingerprint of the
167
226
  content the page last read — if an agent session edited the file meanwhile, the save
168
227
  409s and the page reloads instead of clobbering it.
169
228
  - **Constitution** (`#/laws`) — the whole governance surface on one page, in three bands:
@@ -189,18 +248,23 @@ streams the output of background jobs and keeps their history across reloads.
189
248
  shapes that cannot collide, because a slug carries a colon no numeral has, a doctrine
190
249
  address carries a dot, and `ownership`, which opens the Ownership row at its gate, is a word
191
250
  no rule uses.
192
- - **Library** (`#/library`) — browse the content that has no tab of its own: **Memory ·
193
- Notebook · Knowledge** (the wiki chip, which also carries the two setup manifests).
194
- Constitution, Skills and Agents each have their own rail entry instead. Drill into a section, then an item, to read its
195
- rendered markdown body and follow its cross-links. On a memory fact, a **Forget this
251
+ - **Library** (`#/library`) — browse the catalogue: **Skills · Agents · Wiki · Setup files**.
252
+ Constitution has its own rail entry, and Memory and Notebook are Personal's tabs, their one home:
253
+ the same reader, locked to one kind, with one empty state each. Drill into a section, then an item, to read its
254
+ rendered markdown body and follow its cross-links. On a memory fact in Personal, a **Forget this
196
255
  fact** control deletes it (token-gated; bare-slug guarded server-side), and a
197
256
  **Promote to rule** control turns a recurring lesson into a trial rule in
198
257
  `user-rules.md` — provenance recorded, the source fact deleted so it isn't loaded
199
- twice — landing you on the Rules page.
258
+ twice — landing you on Personal's Rules tab.
200
259
  - **Kits** (`#/kits`, `#/kits/<kit>`) — a card per shipped kit over a kits × installs matrix of
201
260
  switches; a staged-changes bar applies one install at a time (the server runs one job at a
202
261
  time). `#/kits/<kit>` is the kit's page: rules, word budget, banned APIs, upstream credits,
203
- members and one switch per install.
262
+ members and one switch per install. This page is the one home of the kit switches. Toggling only
263
+ stages the set; **Apply** asks first, then rebuilds that install with exactly that set as a console
264
+ job. Staged switches are held for the whole console: they survive leaving the page. A refetch drops
265
+ a row's staging only when that install's kits changed. A failed rebuild keeps it and says so, and
266
+ a reload asks first while anything is staged. Files you edited in a kit that is now off are kept,
267
+ and the matrix lists them under their install.
204
268
  `GET /api/kits` carries `rules`, `rulesWordBudget`, `banned` and `credits` per kit; the
205
269
  catalog and item endpoints for skills and agents carry `kit` (the owning kit or `null`),
206
270
  which the Library shows as a `kit:` badge.
@@ -221,7 +285,7 @@ streams the output of background jobs and keeps their history across reloads.
221
285
  for *mutate*, *human gate*, what they override and *unavailable*; the reader shows the
222
286
  frontmatter facts (outcomes as pills, availability with its reason), then the body rendered as
223
287
  markdown, with a **View source** toggle for the file as parsed, frontmatter and all. Templates and
224
- Bricks read `GET /api/loops` for the install the page's *Templates and bricks of:* picker
288
+ Bricks read `GET /api/loops` for the install the page's *Install:* picker
225
289
  names (its own remembered pick, starting on the default; hidden with one install and on
226
290
  Active), resolved from that install's root, so a project install shows its `.geneseed/` bricks
227
291
  and templates. **Active** is every loop
@@ -231,25 +295,27 @@ streams the output of background jobs and keeps their history across reloads.
231
295
  the page's only write), what an awaiting loop waits on (launch / declared / actual / a
232
296
  human gate, with its node) — the answer is given in the agent's session, never here — and
233
297
  its ring with the current node filled, with its iteration history under it.
234
- - **Profile** (`#/profile`) — `PROFILE.md` beside the deployed AGENT.md: who you are and
235
- how you like to work, one card per active install, each saving to its own. Opens rendered; **Edit** is a whole-file editor. The save carries
298
+ - **Profile** (`#/profile`) — `PROFILE.md`: who you are and how you like to work, one card
299
+ per file: the shared one every global install reads, tagged `shared`, and each project
300
+ install's own. Opens rendered; **Edit** is a whole-file editor. The save carries
236
301
  the fingerprint it loaded — if an agent session changed the file first, your edit stays
237
302
  on screen and a second Save replaces the newer version.
238
303
  - **Skills** (`#/skills`) and **Agents** (`#/agents`) — the deployed catalogue of every
239
304
  installed harness, each entry with its purpose line and full spec. Each row is one skill or
240
305
  agent; when more than one install is active, it carries a badge for each install that has it
241
306
  (`opencode · global`; a project install by its folder). The reader shows the first install's copy. When more installs have the entry,
242
- a **Viewing copy from** picker beside the copy opens another install's version, for that
243
- entry only. While Skills is selected, its skill types sit nested
307
+ an *Install:* picker beside the copy opens another install's version, for that entry only. While Skills is selected, its skill types sit nested
244
308
  under it in the rail, each with its count, above a thin bar of their shares; pick one to
245
- narrow the list.
309
+ narrow the list. A skill the registry does not know sits under *Custom*.
246
310
  - **Docs** (`#/docs`) — rendered documentation: markdown pages, concept pages, a CLI
247
311
  reference (generated from the harness argument parser), and a glossary, in a reader: one
248
312
  nav column holding the parts (Understand / Guides / Concepts / Reference) with their page
249
313
  counts, the open part's sections (pick one to narrow the list) and the part's pages with a
250
314
  filter; then the page, with its breadcrumb, section and reading time, a Copy button on each
251
315
  code block, an outline that marks the heading being read, and Previous / Next within the
252
- section. Filtered for one host (OpenCode, Claude
316
+ section. On a phone the page comes first and the parts and pages follow, in the DOM as on screen.
317
+ A page's title is its H1 and its first heading an H2, whatever level the source starts at.
318
+ Filtered for one host (OpenCode, Claude
253
319
  Code, Bob or OpenClaude; Claude-family pages show to all three Claude-engine hosts, a page
254
320
  tagged with a list of hosts only to those); with no
255
321
  choice stored it follows the deployed install.
@@ -282,30 +348,32 @@ streams the output of background jobs and keeps their history across reloads.
282
348
  are tied together in red (same worktree) or dashed amber (two worktrees of the repo): tangled
283
349
  roots in the moss when they stand side by side, a thread under the pots when they do not.
284
350
  Hover a tree for its model, turns, context and compactions, or a pad for its author's files;
285
- click it to open the session. Past ten trees, quiet shelves (no session working or waiting on
286
- you) fold into chips, the largest first; the last standing shelf never folds. **Sakura** repaints the crowns pink, nothing more.
351
+ click it to open the session. With no mouse, tap a pad to show its files (a second tap clears them,
352
+ and neither opens the session), or focus the tree and walk its pads with the arrow keys; Escape leaves. Past ten trees, quiet shelves (no session working or waiting on
353
+ you) fold into chips, the largest first; the last standing shelf never folds. **Pink blossom** repaints the crowns pink, nothing more.
287
354
  A session's detail page shows its tree too, live or ended, with the same pad hovers and a
288
355
  legend of its turns, context, compactions and sub-agents; an ended session's tree stands still, without the `!`.
289
- - **Changes** (`#/diff`) — the diff between the install its *Local edits of:* picker names and the source: edited /
356
+ - **Local edits** (`#/diff`) — the diff between the install its *Install:* picker names and the source: edited /
290
357
  added / missing files, and files only behind the source (unedited; a rebuild updates them)
291
358
  listed apart under **Behind source**, with per-file expansion and coloured unified-diff lines. Select
292
359
  files to **export an `improvements.md`** back-port, or **restore** them to source.
293
360
  Restore acts only on files the diff lists, and never on your own files (`user-rules.md`,
294
361
  `PROFILE.md`, `memory/`, `notebook/`). An added file is moved into
295
362
  `archived-restore/<date-time>/` in the install, not deleted.
296
- - **Doctor** (`#/doctor`) — runs, for the install its *Doctor for:* picker names, the same health engine as the `doctor` command (every
297
- theme, parity, links, authoring gates, drift), grouping any problems per check. It shows
363
+ - **Doctor** (`#/doctor`) — runs, for the install its *Install:* picker names, the same health engine as the `doctor` command (that
364
+ install's voice, parity, links, authoring gates, local edits), grouping any problems per check. It shows
298
365
  the server's last run for that install — warmed at start, redone after a job or an install
299
- toggle — and **Re-run checks** runs every check again on demand.
366
+ toggle — and **Run doctor** runs every check again on demand.
300
367
 
301
368
  ### 🎨 Setup
302
369
 
303
- - **Harness** (`#/harness`) — this machine's own install first (path, voice, footprint,
370
+ - **Hosts** (`#/installs/hosts`; `#/harness` resolves here) — this machine's own install first (path, voice, footprint,
304
371
  and when it was built), then the **Voice** reference, then every detected install. A
305
372
  **Sync with source** column says whether each install is behind the source (and by how many
306
- files), in sync or not checked, shows hand edits apart from stale files, and links to Local edits.
373
+ files), in sync or not checked, shows local edits apart from stale files, and links to Local edits.
307
374
  `#/harnesses` and `#/themes` both still resolve here, so old links and bookmarks keep
308
- working.
375
+ working. *Make default* on an active row sets the default install (above), and a per-repo
376
+ install's panel has the **Shared tier** switch, with its benefit and cost beside it.
309
377
  - The **Voice** card is the former Themes tab, kept as a REFERENCE rather than a second
310
378
  control: a collapsed row that opens to every shipped voice with its tagline, the
311
379
  deployed one pinned first and marked. It is the one place you can read what a voice
@@ -315,7 +383,8 @@ streams the output of background jobs and keeps their history across reloads.
315
383
  - **Every install** lists each detected install (host × scope), one row each. An
316
384
  ACTIVE row carries per-row **Voice**, **Footprint**, **Posture** and **Mode**
317
385
  pickers plus **Apply**, an on/off switch, and remove; a host that is NOT installed
318
- yet shows a single **Install…** that discloses the same four choices as steps.
386
+ yet shows a single **Install…** that discloses the same four choices as steps. The panel is the
387
+ footprint's one home: a line under the pickers says what the chosen footprint does.
319
388
  **Posture** is the relationship register (peer/mentor/expert/assistant/artisan —
320
389
  default **peer**); **Mode** is the operating register (direct/foreman — default
321
390
  **direct**; foreman triages tasks into isolated pipelines instead of working every
@@ -325,21 +394,17 @@ streams the output of background jobs and keeps their history across reloads.
325
394
  card (shown once a global install exists) manages sovereign repos — folders where every
326
395
  global harness goes dormant (hooks stay silent, the global preamble never loads);
327
396
  add or remove one here, the web mirror of `harness exclude add|remove|list`.
328
- - **Kits** (`#/installs/kits`) — every install (disabled ones read-only) as a panel with one switch per kit.
329
- Toggling only stages the set; **Apply** asks first, then rebuilds that install with
330
- exactly that set as a console job. Staged switches are held for the whole console: they
331
- survive leaving the page, and the Kits page and Installs › Kits share them. A refetch drops a
332
- row's staging only when that install's kits changed. A failed rebuild keeps it and says so,
333
- and a reload asks first while anything is staged. Files you edited in a kit that is now off are kept,
334
- and the row lists them.
335
- - **Server** (`#/installs/server`; `#/settings` and `#/about` resolve here) — a settings sheet
336
- with a section index. **Appearance**: skin, accent (a skin change resets it to the skin's own), Overview view. **Machine**:
397
+ - **Settings** (`#/settings`; `#/about` and `#/installs/server` resolve here) — a rail entry of its
398
+ own, about the tool and never one install: a sheet with a section index. **Machine**:
337
399
  version + Update (labelled by how this copy updates: git pull, npm install -g, or the command
338
- to run by hand), Add to PATH, the footprint of the install the head's *Footprint of:* picker names (read-only, links to Hosts). **Server**: running · port ·
400
+ to run by hand; on the Overview the button shows only when the pull can run), Add to PATH. **Server**: running · port ·
339
401
  pid · uptime, whether the code matches the disk (with Restart), start-at-login state (read
340
402
  only), and the four request guards; the index marks Server with a good/warn dot. **About**: version, changelog, credits, source, creator.
341
403
  **Danger zone**: Stop server, Remove from PATH, and a pointer to each install's own
342
404
  Uninstall in Hosts.
405
+ - **Appearance** (the topbar's popover, on every page) — the one home of the skin and the accent (a
406
+ skin change resets it to the skin's own), each with a line that says what it does. Both are this
407
+ browser's alone, and nothing here rebuilds.
343
408
 
344
409
  ## Rebuilding the UI
345
410
 
@@ -2,5 +2,5 @@
2
2
  "_comment": "version is a human-readable release label only; the canonical identity of an installed harness is the source fingerprint stamped in .geneseed-version (see `harness version`), not this string.",
3
3
  "theme": "neutral",
4
4
  "product": "Geneseed",
5
- "version": "4.32.0"
5
+ "version": "5.0.1"
6
6
  }
package/js/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `js/` — the module map
2
2
 
3
- Every module under `js/`, in eight folders. This page is the address book: **what each one owns**, and
3
+ Every module under `js/`, in eight folders. For how to prove a change, read the repo guide, [`AGENTS.md`](../AGENTS.md), first. This page is the address book: **what each one owns**, and
4
4
  **which file to open first** for a given task. It is not documentation of behaviour — every module
5
5
  has a docblock for that, and the docblock is the thing to read before editing.
6
6
 
@@ -13,7 +13,7 @@ a module that does not exist, is a test failure. `geneseed doctor` reports the s
13
13
 
14
14
  ```
15
15
  bin/geneseed-cli.mjs the `geneseed` CLI — 20+ verbs, may NOT spawn
16
- bin/geneseed-hook.mjs the hook entry — 5 verbs, loads on EVERY tool call (~14 ms)
16
+ bin/geneseed-hook.mjs the hook entry — 6 verbs, loads on EVERY tool call (~14 ms)
17
17
  bin/build-driver.mjs `geneseed-build` — a thin entry over js/build/driver.mjs
18
18
 
19
19
  js/build/ src/ + themes/ → rendered text → a bundle → a per-host install
@@ -42,7 +42,7 @@ layers. These pairs import each other (relative imports between folders, measure
42
42
  | build ↔ web | 1 / 9 | `build/generate.mjs` lazily imports `web/daemon.mjs` to restart a stale console after `rebuild-all` |
43
43
  | hosts ↔ inspect | 1 / 36 | `hosts/installs.mjs` reads `inspect/registry.mjs`'s deploy roots |
44
44
  | ui ↔ web | 1 / 1 | `ui/menu.mjs` starts the daemon; `web/docs.mjs` renders `ui/cli.mjs`'s CLI reference |
45
- | maintain ↔ web | 1 / 6 | `maintain/update.mjs` lazily imports `web/daemon.mjs` for the same restart |
45
+ | maintain ↔ web | 1 / 7 | `maintain/update.mjs` lazily imports `web/daemon.mjs` for the same restart |
46
46
 
47
47
  The only gates over the import graph are the transitive closure walks in
48
48
  `tests/unit/hook_cli.test.mjs`. They pin which modules the generator and CLI entries may pull
@@ -64,6 +64,8 @@ as a per-host install at project or global scope.
64
64
  | `emit-claude.mjs` | The Claude/Bob/OpenClaude emit — the render half plus the settings + CLAUDE.md managed-block wire |
65
65
  | `emit-opencode.mjs` | The OpenCode emits — a project's `.opencode/` and the global config dir. Deliberate twin of the above |
66
66
  | `emit-common.mjs` | Constants, tree walkers, and the three writers BOTH global emits share. Decides no host |
67
+ | `fold.mjs` | The fold: moves a global install's stores into the shared tier, in the emit. Moves aside, never deletes; a second run writes nothing |
68
+ | `rule-decide.mjs` | The decisions on the draft: the approval flow of `src/skills/rule/approve.md`, as the console applies it. Write order: target, ledger, draft |
67
69
  | `stubs.mjs` | Write-once seed files: context, wiki, rules, excludes, profile, `.gitignore`, memory/notebook indexes |
68
70
  | `version.mjs` | The release marker: fingerprint the sources, read/compare/write an install's version, warn on downgrade |
69
71
  | `driver.mjs` | The generator driver: the nine emit targets, per-host emit orchestration, the prune and the manifest. `bin/build-driver.mjs` is only its entry |
@@ -90,15 +92,16 @@ user co-owns, and the hook verbs those emitted configs then run.
90
92
  |---|---|
91
93
  | `hosts.mjs` | The four host config dirs (opencode/claude/bob/openclaude), their `family` (`CLAUDE_STYLE`), plus `resolvePath`/`expanduser` |
92
94
  | `hooks.mjs` | The gate verbs, run on every tool call: `git-gate`, `rule-gate`, `tool-gate` (the two gates fused, for Bob), plus `ask`/the gate ledger/`guardGate`. `--host` picks the verdict dialect |
93
- | `hooks-context.mjs` | The `context` verb — SessionStart: session files plus the repo's context docs |
95
+ | `hooks-context.mjs` | The `context` verb — SessionStart: session files (shared tier first on a global install, wiki rendered) plus the repo's context docs; `sessionStartSize`, the console's read of the same payload |
94
96
  | `ownership-gate.mjs` | The ownership first-write gate, last in `rule-gate`: in an application repo (git root + build manifest) whose root `AGENTS.md` has no `## Ownership` section, denies the session's first write once (a tmpdir marker per session). Builtins + `gitRootOf` only. Twin: the OpenCode guard plugin |
95
97
  | `hooks-done.mjs` | The done gate (#289): on Stop, inside `learn` and before its spawn, judges a turn that edited files against the project's checks — blocks until `.geneseed/done-checks.txt`'s checks passed after the last edit; without that file, the inferred checks are advisory (a `systemMessage`, never a block) |
96
98
  | `done-checks.mjs` | Where the done gate's checks come from: `.geneseed/done-checks.txt`, else inferred from the git root's manifests (package.json scripts, pom.xml, Gradle, pyproject.toml, Cargo.toml, go.mod), each a group of accepted command forms; plus `doneLine`, the SessionStart line `context` prints. Spawn-free: `context` is in the CLI's closure. Twin: the OpenCode context plugin |
97
99
  | `hooks-learn.mjs` | The `learn` verb — Stop/SubagentStop/PreCompact distiller; the hook path's ONE spawn (`$GENESEED_LLM`) |
98
100
  | `hooks-prims.mjs` | The Python path/text primitives the hook verbs share (`splitLines`, `readStdin`, a never-throwing `isFile`), plus the activity off switch (`activityOn`) and the do-nothing `activity` verb |
101
+ | `store-watch.mjs` | The change report: a session's baseline of the rule and memory files (`writeBaseline`, from the hook entry after `context`), the compare at Stop (`storeReport`, from `learn`), and `recordOwnWrites`, around Geneseed's own writers. It detects; it prevents nothing. The OpenCode guard holds the twin |
99
102
  | `activity.mjs` | The hook-side activity writer and the owner of snapshot liveness: `recordActivity` (one payload into `<root>/activity/`), `readTranscriptDelta`, `sweepActivity` (archive, newest 50, 7 days). Loaded only when tracking is on; never prints |
100
103
  | `usage.mjs` | The usage counter `tool-gate` runs: one `{day, kind, name}` line per Skill or subagent call into `notebook/usage.jsonl`. Hook path: builtins only, silent, never throws |
101
- | `memory-files.mjs` | The memory store's file format — `frontmatter`, `MEMORY.md` index writes, agent lessons, consolidate. No spawn: the CLI and web console import it |
104
+ | `memory-files.mjs` | The memory store's file format — `frontmatter`, `MEMORY.md` index writes, agent lessons, consolidate — the `user-rules.md` parser, the draft's format and the fold's ledger reader. No spawn: the CLI, web console and fold import it |
102
105
  | `geneseed-dir.mjs` | The Node writers into a project's `<git root>/.geneseed/`: the personal-by-default `.gitignore` (`GENESEED_GITIGNORE`, pinned to the two OpenCode copies), and the protected-checks seed every project emit runs (`seedProtectedChecks`: seed once when absent, then the user's — never recorded, rewritten or uninstalled). Never throws, never writes through a link. Spawn-free |
103
106
  | `gitref.mjs` | fs/path-only: `gitRootOf`, `gitDirOf`, `gitCommonDirOf`, `currentBranch`, `protectedBranches`, `stashExists`, `loopLaunched` — read straight off `.git`, never spawn git. Shared by `hooks.mjs`'s git-gate, `loss.mjs` and `js/loop/cli.mjs`'s commit-message writer |
104
107
  | `loss.mjs` | Law IV calibrated to real loss: `lossReason` decides whether a command would really lose data (protected branch, unpushed branch, dirty tree, stash, reflog, files git cannot restore) and fails closed. The gate path's one `git` spawn, reached only after `LOSS_CANDIDATE_RE` matched. Twin: the OpenCode guard plugin |
@@ -137,7 +140,7 @@ Everything that inspects an already-built or already-deployed harness and report
137
140
  | `status.mjs` | `geneseed status` and `version` — the panel data, counts, accent colour, version verdict |
138
141
  | `cost.mjs` | What one install injects every session, by part (root file, skill and agent lists, session files), in characters; owns `CARRIER_CEILING`, which the smoke test gates and the console draws |
139
142
  | `diff.mjs` | `geneseed diff` — what a deployed install has that a fresh render of `src/` does not |
140
- | `excludes.mjs` | `geneseed exclude add|remove|list` — the WRITER for `excludes.json`; `hooks.mjs` only reads it |
143
+ | `excludes.mjs` | `geneseed exclude add|remove|list` — the WRITER for `excludes.json` and the shared list in the machine tier; `hosts.mjs` `sovereignBypass` reads both |
141
144
  | `registry.mjs` | `installs.json` under XDG — the persistent deploy-root list `rebuild-all` re-emits into |
142
145
  | `scorecard.mjs` | `geneseed scorecard` — a port of the AI Harness Scorecard (upstream pinned in its docblock): the repo walk, the CI-YAML parsing, `assessRepo`, the text/JSON renderers. Pure: no spawn, no network |
143
146
  | `scorecard-yaml.mjs` | The YAML 1.1 subset the scorecard reads CI configs with, plus Python's `str()`/`bool()` over its values; `scorecard.mjs` re-exports it. Its ceiling is in its `ponytail:` note |
@@ -164,6 +167,7 @@ into files users have committed, so change the test that states it in the same c
164
167
  | `udiff.mjs` | `geneseed diff`'s own difflib clone — the alignment IS the printed hunks — plus `splitLines` |
165
168
  | `proc.mjs` | One constant: the `windowsHide` flag every spawn in `js/` must reuse |
166
169
  | `prompt.mjs` | The line-mode stdin readers — `ask`, `promptLine`, `confirm`, `askChoice` — read a byte at a time so they stop where Enter stops. Shared by `setup`, `uninstall` and `web` without dragging in the wizard |
170
+ | `machine-dir.mjs` | `machineDir()`, `sharedPaths()`, `readDefaultInstall()` and `WIKI_NAMES`: the one home of `$XDG_CONFIG_HOME/geneseed`, the names beneath it, the reader of the chosen default install, and the wiki manifest's names. Spawn-free, so the hook and driver may import it |
167
171
  | `node-floor.mjs` | The first import of all three binaries: below Node 22.7, one sentence on stderr and exit 1 (0 in the hook) instead of a stack trace |
168
172
 
169
173
  **Before editing:** parse with `parseJson`, never `JSON.parse` — the latter collapses int `1` and
@@ -205,7 +209,7 @@ Verbs that change an install that already exists, as opposed to rendering one.
205
209
 
206
210
  | module | owns |
207
211
  |---|---|
208
- | `update.mjs` | `upgrade`/`sync-self`/`bootstrap` — git pull, doctor gate, rebuild, each via a respawn |
212
+ | `update.mjs` | `upgrade`/`bootstrap` — git pull, doctor gate, rebuild, each via a respawn |
209
213
  | `setup.mjs` | The install wizard. Its prompts go through `js/lib/prompt.mjs`'s stdin readers |
210
214
  | `uninstall.mjs` | Removes or disables an install: manifest-driven reversal, plus stash deactivate/reactivate |
211
215
  | `migrate.mjs` | `geneseed migrate` — all-or-nothing re-emit moving installs onto the npm install shape |
@@ -240,6 +244,7 @@ the deployed harness as JSON.
240
244
  | `server.mjs` | `serve()`/`cmdWeb`: UI-build precheck, socket bind, token mint, daemon record wiring |
241
245
  | `routes.mjs` | The route tables — `STATE_ROUTES`, `PREFIX_ROUTES`, `POST_ROUTES` (+ its 409 column) — and the inline lists |
242
246
  | `handler.mjs` | One function per request: per-request install (`?host=&path=` on every read but `MACHINE_GETS`, or the body on `VIEW_POSTS`), dispatch, gzip, `requestGuard` (Host+port, Origin/Sec-Fetch-Site on `/api`, constant-time CSRF token) and body cap (before the body is read), `securityHeaders` (CSP nonce, framing), static SPA fallback |
247
+ | `doctor-worker.mjs` | The warm-up doctor's thread: one `doctorCollect`, one message back (`warmDoctor` in `state.mjs`) |
243
248
  | `state.mjs` | `webState` — the resolved install view every endpoint reads, with its cached inventory and doctor, `defaultView` (the install a request naming none reads) and `fleetSort` (the one install order); per-install views (`installView` in `actions.mjs`) hang off it, pinned, refreshed with it |
244
249
  | `catalog.mjs` | The Library read model: inventory, constitution tiers, memory/notebook/wiki/config items, `apiCatalog`/`apiItem`, `NotFound`. Skills and agents are listed across every active install (`FLEET_SECTIONS`; `routes.mjs` builds the fleet), each item served from one install's copy |
245
250
  | `api.mjs` | The dashboard and settings reads: overview, recent, themes, setup, doctor, diff, installs, excludes, loops |
package/js/build/args.mjs CHANGED
@@ -23,12 +23,12 @@ const EMITS = ['files', 'opencode', 'opencode-global', 'claude', 'claude-global'
23
23
  'bob', 'bob-global', 'openclaude', 'openclaude-global'];
24
24
 
25
25
  /**
26
- * build.py:307-321 — the three defaults that come from `harness.config.json`.
26
+ * The three defaults that come from `harness.config.json`.
27
27
  *
28
28
  * The corrupt-file branch is reproduced including its imprecision: the warning says only
29
- * "using theme 'neutral'", but the branch also resets posture and mode. Matching the
30
- * Python text mattered more than fixing it here, because the two CLIs' stderr was compared
31
- * byte-for-byte by the former Python golden harness; nothing pins the wording now.
29
+ * "using theme 'neutral'", but the branch also resets posture and mode. The wording
30
+ * stays as it was: stderr was once compared byte-for-byte across the two CLIs, and nothing
31
+ * pins it now.
32
32
  */
33
33
  export function configDefaults() {
34
34
  const d = {
@@ -97,7 +97,7 @@ export function configDefaults() {
97
97
  const VALUED = {
98
98
  '--theme': 'theme', '--posture': 'posture', '--mode': 'mode', '--trust': 'trust',
99
99
  '--doctrines': 'doctrines', '--exclude-rules': 'excludeRules', '--exclude-skills': 'excludeSkills',
100
- '--kits': 'kits',
100
+ '--kits': 'kits', '--shared-tier': 'sharedTier',
101
101
  '--out': 'out', '--target': 'out', '--emit': 'emit',
102
102
  '--footprint': 'footprint', '--root': 'root', '--config-dir': 'cfgDir',
103
103
  };
@@ -151,6 +151,7 @@ function choicesFor() {
151
151
  '--posture': discoverNames('postures', 'peer'),
152
152
  '--mode': discoverNames('modes', 'direct'),
153
153
  '--trust': Object.keys(PRESETS),
154
+ '--shared-tier': ['on', 'off'],
154
155
  };
155
156
  }
156
157
 
@@ -333,6 +334,7 @@ export function parseArgs(argv, defaults) {
333
334
  excludeRules: defaults.excludeRules,
334
335
  excludeSkills: defaults.excludeSkills ?? [],
335
336
  kits: defaults.kits ?? [],
337
+ sharedTier: 'off',
336
338
  out: 'Harness', emit: 'files', footprint: 'lean', root: null,
337
339
  syncThemes: false, validateOnly: false, verbose: false,
338
340
  ...Object.fromEntries(GATE_SWITCHES.map((g) => [g.arg, false])),
@@ -385,7 +387,7 @@ export function parseArgs(argv, defaults) {
385
387
  *
386
388
  * `geneseed validate` takes every render flag but `--sync-themes`/`--config-dir` (it refuses
387
389
  * those two, and prints its own `-h` before this parser can print the generator's) — the reference's
388
- * `--validate-only` reads exactly the flags `build.py`'s parser already produced, so the port
390
+ * `--validate-only` reads exactly the flags this parser produces, so validate
389
391
  * hands the CLI this parser rather than a second one beside it. That is not tidiness: a
390
392
  * hand-rolled copy would have its own `--target` alias, its own `choices` lists and its own
391
393
  * `-h`, and `tests/unit/node_driver.test.mjs`'s '--help names every flag the parser takes' gates only
@@ -409,8 +411,8 @@ function choice(flag, value, allowed) {
409
411
  * argparse's error exit — a THROW since P5f, where it used to be `process.exit(code)`.
410
412
  *
411
413
  * `harness rebuild-all` re-emits every active install and its whole contract is "continue
412
- * past a failure so one broken install never blocks the rest". The Python gets that for free:
413
- * each rebuild is a SUBPROCESS, and a child that exits 2 hands back a return code. Here the
414
+ * past a failure so one broken install never blocks the rest". A subprocess per rebuild would
415
+ * get that for free, since a child that exits 2 hands back a return code. Here the
414
416
  * driver is a module in the same process, so `process.exit` would take the loop, the CLI and
415
417
  * every remaining install with it — the one place where importing rather than spawning is not
416
418
  * transparent, and it turns a per-install failure into a total one.
@@ -59,7 +59,7 @@ function missingReferencedSpecs(cfg) {
59
59
  /**
60
60
  * `_build_render.assert_source_complete`.
61
61
  *
62
- * Python raises `SystemExit(1)` after writing to stderr. Here the message goes to the
62
+ * The message goes to the
63
63
  * captured stderr buffer and the throw carries the exit code, which the driver turns
64
64
  * into a process status by `bin/build-driver.mjs`'s `main` — so the caller sees the same stream
65
65
  * bytes and the same exit status whichever runtime rendered.
@@ -107,8 +107,8 @@ function writeSrcDirsMarker(out, resolved) {
107
107
  *
108
108
  * `.geneseed-srcdirs.json` is a plain file a user (or another tool) can edit, and the
109
109
  * name in it is joined onto `out` and handed to a recursive delete. `".."` would take out
110
- * the bundle's PARENT, an absolute path replaces `out` entirely under Python's
111
- * `Path.__truediv__`, and `"a/b"` reaches into nested content. Only a plain
110
+ * the bundle's PARENT, an absolute path replaces `out` entirely when joined, and
111
+ * `"a/b"` reaches into nested content. Only a plain
112
112
  * single-segment name resolving directly under `out` is ever deleted.
113
113
  */
114
114
  function safePriorDirName(out, priorName) {
@@ -161,9 +161,9 @@ export function phaseLog(phase) {
161
161
  /**
162
162
  * `_build_render.build` — render the bundle into `out`.
163
163
  *
164
- * `out` arrives as the STRING Python already resolved, and is echoed into the progress
165
- * lines verbatim: Python interpolates `str(Path)`, which is backslash-separated on
166
- * Windows, and re-deriving it here would differ by separator in every message.
164
+ * `out` arrives as an already-resolved STRING and is echoed into the progress lines
165
+ * verbatim: it is backslash-separated on Windows, and re-deriving it here would differ by
166
+ * separator in every message.
167
167
  */
168
168
  export function build(cfg, themeName, out, { footprint = 'full', nativeCatalog = false } = {}) {
169
169
  phaseLog('RENDER');
@@ -177,17 +177,15 @@ export function build(cfg, themeName, out, { footprint = 'full', nativeCatalog =
177
177
  const priorSrcDirs = isBundle ? readPriorSrcDirs(out) : {};
178
178
  const resolvedSrcDirs = {};
179
179
  for (const srcDir of OWNED_SRC_DIRS) {
180
- // `theme.get(token, srcDir)` — `??` agrees with it except for an explicit JSON null,
181
- // where Python would go on to join `None` onto a path and raise. No theme has one.
180
+ // `??` falls back on an explicit JSON null too. No theme has one.
182
181
  const dirname = theme[SRC_DIR_TOKENS[srcDir]] ?? srcDir;
183
182
  resolvedSrcDirs[srcDir] = dirname;
184
183
  const managed = path.join(out, dirname);
185
184
 
186
- // `isTruthy`, not `priorName &&`: the marker is user-editable JSON, and Python's
187
- // `if prior_name` is false for `[]`, `{}` and `0` where JS's is true for the first
188
- // two. Getting that wrong warns about a value Python skips in silence — a stderr
189
- // divergence reachable only from a hand-edited file, which is the one place nobody
190
- // would look for it.
185
+ // `isTruthy`, not `priorName &&`: the marker is user-editable JSON, and an
186
+ // empty `[]`, `{}` or `0` must count as absent although JS's `&&` treats the first two
187
+ // as set. Getting that wrong warns about a value that is silently skipped — reachable
188
+ // only from a hand-edited file, which is the one place nobody would look for it.
191
189
  const priorName = priorSrcDirs[srcDir];
192
190
  if (isBundle && isTruthy(priorName) && priorName !== dirname) {
193
191
  if (safePriorDirName(out, priorName)) {