geneseed 4.30.0 → 4.31.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 (50) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/SHIPPED.md +1 -1
  3. package/docs/concepts/footprint.md +1 -1
  4. package/docs/reference/plugin-activity.md +1 -1
  5. package/docs/web-ui.md +86 -16
  6. package/harness.config.json +1 -1
  7. package/js/README.md +5 -5
  8. package/js/hosts/hooks.mjs +6 -4
  9. package/js/web/actions.mjs +41 -20
  10. package/js/web/activity.mjs +139 -23
  11. package/js/web/api.mjs +29 -11
  12. package/js/web/catalog.mjs +108 -23
  13. package/js/web/handler.mjs +37 -12
  14. package/js/web/routes.mjs +69 -15
  15. package/js/web/server.mjs +14 -13
  16. package/js/web/state.mjs +57 -16
  17. package/js/web/usage-api.mjs +7 -3
  18. package/package.json +1 -1
  19. package/web/dist/assets/Activity-B7cFtS00.js +1 -0
  20. package/web/dist/assets/ActivityDetail-C-GbMmuW.js +1 -0
  21. package/web/dist/assets/{Bonsai-CN4rRAHc.js → Bonsai-_YyexVC5.js} +1 -1
  22. package/web/dist/assets/{CopyButton-CRAUXSG7.js → CopyButton-IXnXzH4Y.js} +1 -1
  23. package/web/dist/assets/{Dashboard-CaqOqtkG.js → Dashboard-sCfEjowQ.js} +2 -2
  24. package/web/dist/assets/{Docs-BFxyAVdN.js → Docs-w3Y7M5Ts.js} +2 -2
  25. package/web/dist/assets/{GreenhouseView-19roNb5W.js → GreenhouseView-BWWbMKmg.js} +1 -1
  26. package/web/dist/assets/Installs-CnkdJ-VA.js +3 -0
  27. package/web/dist/assets/{JournalView-BgU2ybaq.js → JournalView-C7bPD3fZ.js} +1 -1
  28. package/web/dist/assets/{KitApply-Ckc0P5kt.js → KitApply-CQQbnThf.js} +1 -1
  29. package/web/dist/assets/{Kits-BZqWGWMu.js → Kits-aj07N7mT.js} +1 -1
  30. package/web/dist/assets/Laws-DZ38nl_H.js +3 -0
  31. package/web/dist/assets/Library-QCGXPV5h.js +2 -0
  32. package/web/dist/assets/Loops-C5u7fQOR.js +2 -0
  33. package/web/dist/assets/{OperatorHudView-xs7SCwCe.js → OperatorHudView-Blu1lqiZ.js} +1 -1
  34. package/web/dist/assets/Personal-ox_MktWO.js +2 -0
  35. package/web/dist/assets/Tabs-CIPyMAX-.js +1 -0
  36. package/web/dist/assets/api-BxjLd7Qd.js +1 -0
  37. package/web/dist/assets/index-0GCxkY7m.css +1 -0
  38. package/web/dist/assets/index-CzDi9JpF.js +3 -0
  39. package/web/dist/index.html +3 -3
  40. package/web/dist/assets/Activity-DfETiyWm.js +0 -1
  41. package/web/dist/assets/ActivityDetail-CnP3GPAN.js +0 -1
  42. package/web/dist/assets/Installs-BSoQN7w7.js +0 -3
  43. package/web/dist/assets/Laws-CnUWiNIx.js +0 -3
  44. package/web/dist/assets/Library-rYO8owx_.js +0 -2
  45. package/web/dist/assets/Loops-CljFhhQV.js +0 -2
  46. package/web/dist/assets/Personal-CMPwtl36.js +0 -2
  47. package/web/dist/assets/Tabs-CEfSUVQp.js +0 -1
  48. package/web/dist/assets/api-BfpZmUMI.js +0 -1
  49. package/web/dist/assets/index-FLVXXvV3.js +0 -3
  50. package/web/dist/assets/index-XTGBLKQr.css +0 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,28 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [4.31.0] — 2026-10-31
12
+
13
+ Minor: the web console becomes one hub over every install. The top install switch is gone; Activity, Library, Rules, Profile, Memory and Notebook cover every install, and a page or control that acts on one install has its own picker next to it. Run `geneseed web restart` after updating, so the console serves the new UI.
14
+
15
+ ### Changed
16
+ - **The web console's Activity view covers every install.** It reads the `activity/` folder of every active install (OpenCode, Claude Code, Bob, OpenClaude; global and project) and shows one garden: each card carries a host chip, shelves stay grouped by repo, and collisions and loops are found across hosts. A session that two installs record in one checkout (a global and a project install of one host) is one card. The tracking switch is one row per install, and the daemon sweeps every install's old cards. An OpenCode project install has no row of its own: its sessions appear under, and follow the switch of, the OpenCode global install.
17
+ - **The web console's Library covers every install.** Skills and agents are listed once each across every active install, with a badge for each install that has it, so a skill one install leaves out stays visible. The reader shows the first install's copy (host order, global before project) and, when several installs have the entry, a "Viewing copy from" picker for that entry only. The rail counts match the combined list.
18
+ - **The web console has no install switch any more: it is one hub over every install.** The topbar selector and `POST /api/view` are gone, and the breadcrumb is the page name. A page or control that acts on one install carries its own labelled picker next to it, shown only when two or more installs are active: Doctor, Local edits and Server each remember theirs; the Constitution's gate switches and doctrine Apply, Loops and the Voice rebuild act on the install they name. Rules, Profile, Memory and Notebook list every install, each entry tagged; an edit, Forget or Promote writes back to the entry's own install, and a new rule goes where its form's "Write to:" picker says. Every per-install figure on a combined page names its install (the gate "off" badge reads "off · claude global"). The Overview is fleet-only, with each install's voice, footprint, posture, mode and memory count in its row. A request that names no install reads the default install: the first active one in host order, global before project.
19
+
20
+ ### Fixed
21
+ - **The web console sees an OpenCode project install.** That install keeps its manifest and the skills and agents OpenCode loads under `<repo>/.opencode/`, and the console looked for the manifest only at the repo root. So it called the install "not deployed", listed the full source catalogue instead of what the install has (skills it left out included), refused Build, could jump to another install on refresh, and built its "never used" list from the root bundle. It now reads the manifest at either place, reads skills and agents from `.opencode/`, and Build rebuilds such an install in place with the same command `rebuild-all` uses. Diff and Restore are unchanged: as for every project install, no drift check exists.
22
+
23
+ ## [4.30.1] — 2026-10-31
24
+
25
+ Patch: Bob can read a protected check again (a regression in 4.29.0 and 4.30.0). Run `geneseed rebuild-all` once after updating.
26
+
27
+ ### Changed
28
+ - **The web console: each request may name its install.** Reads take `?host=&path=` and install-scoped writes take `{host, path}`, so a page that picks its own install no longer re-points every other page through one shared viewed install. A request without the pair still uses the viewed install, and an unknown pair is refused (404). No page names its install yet, so nothing changes on screen.
29
+
30
+ ### Fixed
31
+ - **Bob can read a protected check again.** Bob runs the gate on every tool, reads included, and since 4.29.0 a project emit seeds `.geneseed/protected-checks.txt` with the manifests, CI files and lint/test config. The gate refused every Bob read of those files, `package.json` included; now only a Bob write to a protected check, the list or `.geneseed/done-checks.txt` is blocked. A write is told by its tool name (`write`, `edit`, `diff`, `replace`, `insert`), the same rule the gate-configuration check already used.
32
+
11
33
  ## [4.30.0] — 2026-10-31
12
34
 
13
35
  Minor: the ownership and learn-mode state files stay short (general preferences, no per-checkpoint writes), and OpenCode activity cards land on their own repo shelf. Run `geneseed rebuild-all` once after updating to get the new Rite text.
package/SHIPPED.md CHANGED
@@ -20,7 +20,7 @@ historical references, not files distributed with the repo.
20
20
  > **On version numbers.** [`harness.config.json`](harness.config.json)'s `version` is a
21
21
  > human-readable label only. The canonical identity of an installed harness is the
22
22
  > **source fingerprint** stamped in `.geneseed-version` (see `geneseed version`), not the
23
- > string. Current label: **4.30.0**.
23
+ > string. Current label: **4.31.0**.
24
24
 
25
25
  ## Capabilities
26
26
 
@@ -42,7 +42,7 @@ Footprint is stored in a `.geneseed-footprint` marker in the install and kept ac
42
42
  geneseed setup
43
43
  ```
44
44
 
45
- - **Web console** — each install's own panel on the Hosts page changes its footprint and rebuilds it; Settings shows the viewed install's footprint and links there. A new install or deploy from the console starts lean, as from the command line.
45
+ - **Web console** — each install's own panel on the Hosts page changes its footprint and rebuilds it; Settings shows the footprint of the install its own picker names and links there. A new install or deploy from the console starts lean, as from the command line.
46
46
  - **Command line** — with the emit target of the install you are changing:
47
47
 
48
48
  ```bash
@@ -16,7 +16,7 @@ One of the [OpenCode plugins](opencode-plugins.md). [Environment variables](envi
16
16
 
17
17
  **Archive.** On `SessionStart` and `SessionEnd` the hook writer moves every snapshot that is no longer live into `activity/archive/`, keeping the newest 50 and none older than 7 days. `/api/activity` returns them, with the stale and dead ones still in `activity/`, in its `ended` list — capped there by the same rule, since the OpenCode plugin never sweeps.
18
18
 
19
- **What `/api/activity` returns.** `activity` (the live sessions), `ended`, and `collisions`. Each session carries the snapshot as written, plus the v2 fields: `root` (the git root of the session's own checkout, read from the session's directory: never the plugin instance's, since one `opencode serve` hosts an instance per opened project and each hears every session; `null` outside any repository), `repo` (its main worktree), `agents` (`{id, type, status, started}`), `attribution` (`false` only on a Bob session that ran a sub-agent, else `null`), `turns`, `context` (`{used, window}`), `compactions`, `compacted_at` and `context_at_compaction` (either `context` field can be `null`, right after a compaction for one), and `repo_key`, the repo (else the root) case-folded on Windows, to group a repo's sessions whatever case each host spelled it in. A v1 snapshot reads `null` for those, `[]` for `agents` and `0` for the counts. A live session also gets `files_all`, the uncapped file rows from its detail file (`files` stays the capped summary), and `loops`: `{title, iteration, status}` for each loop registered on its `root`, a finished or unreadable loop left out. `collisions` lists each `{repo, path}` that two or more writers changed among the live sessions — a writer is a session or one of its sub-agents (`{sid, by, root}`) — with `kind: "same-worktree"` when two of them share a `root`, else `"cross-worktree"`. A file outside the root is stored with `path: null` (its `file` keeps the basename) and takes no part in a collision. Roots and paths compare case-folded on Windows, and a session root is resolved to its real path before the loop join, as the loop registry stores it. `/api/activity/<id>` returns the same fields for one session, an archived one included.
19
+ **What `/api/activity` returns.** One list over every active install on the machine (each install's `activity/` folder), so it ignores a `?host=&path=` pair. It returns `enabled`, `installs`, `activity` (the live sessions), `ended`, and `collisions`. `installs` has one `{install, host, scope, path, enabled}` row per active install, in the same fixed order: `install` is the `host:scope:root` key that `/api/usage` also uses, `path` is the install root as `/api/installs` gives it, and `enabled` is that install's own on/off flag. An install that is off gives no session. The top-level `enabled` is true when any install is on, or when no install is active. `ended` keeps the newest 50 over all installs. A global and a project install of one host both record the same session (both hooks run), so the copies that share a session id and a checkout (the same `root`, case-folded on Windows, or the same `cwd` when there is no root) are one session. Its data comes from the newest copy. `installs` lists every install that recorded it in a fixed order (host order: OpenCode, Claude Code, Bob, OpenClaude; then global before project; then detection order), and `install`, the first of them, names the install the chip shows and the detail link reads. The order never follows recency, because two installs write one session milliseconds apart. The session also has a `key` (its id and its checkout, with a trailing separator dropped) that never names an install, so the console keeps the same card from poll to poll. A detail page that is already open keeps reading the install its link names. Such a session never collides with itself. The same id in two checkouts stays two sessions. Each collision writer carries `install` too. An OpenCode project install has no `installs` row: the plugin always writes its sessions and reads its on/off flag in the global OpenCode config folder, so OpenCode project sessions appear under, and follow the switch of, the OpenCode global install. Each session carries the snapshot as written, plus the v2 fields: `root` (the git root of the session's own checkout, read from the session's directory: never the plugin instance's, since one `opencode serve` hosts an instance per opened project and each hears every session; `null` outside any repository), `repo` (its main worktree), `agents` (`{id, type, status, started}`), `attribution` (`false` only on a Bob session that ran a sub-agent, else `null`), `turns`, `context` (`{used, window}`), `compactions`, `compacted_at` and `context_at_compaction` (either `context` field can be `null`, right after a compaction for one), and `repo_key`, the repo (else the root) case-folded on Windows, to group a repo's sessions whatever case each host spelled it in. A v1 snapshot reads `null` for those, `[]` for `agents` and `0` for the counts. A live session also gets `files_all`, the uncapped file rows from its detail file (`files` stays the capped summary), and `loops`: `{title, iteration, status}` for each loop registered on its `root`, a finished or unreadable loop left out. `collisions` lists each `{repo, path}` that two or more writers changed among the live sessions — a writer is a session or one of its sub-agents (`{sid, by, root, install}`), and sessions from different installs collide too — with `kind: "same-worktree"` when two of them share a `root`, else `"cross-worktree"`. A file outside the root is stored with `path: null` (its `file` keeps the basename) and takes no part in a collision. Roots and paths compare case-folded on Windows, and a session root is resolved to its real path before the loop join, as the loop registry stores it. `/api/activity/<id>?host=&path=` returns the same fields for one session of the install the pair names (the console's link carries it), an archived one included; with no pair it reads the default install (the first active one). `POST /api/activity` with `{enabled, host, path}` turns tracking on or off for that install only.
20
20
 
21
21
  **What you see.** A card per live session in **Activity** (`geneseed web`).
22
22
 
package/docs/web-ui.md CHANGED
@@ -53,6 +53,49 @@ strict CSP (`frame-ancestors 'none'`, same-origin only, the one inline token scr
53
53
  a per-response nonce). `?fresh=1` on the doctor re-runs at most once per 3 s, and the server
54
54
  drops a request whose headers take over 10 s or whose whole request takes over 30 s.
55
55
 
56
+ ## Which install a request reads
57
+
58
+ A request can name the install it reads or writes. A read takes two query parameters,
59
+ `?host=<host>&path=<install root>` (two, because a Windows path holds a colon). A write takes
60
+ `host` and `path` in its JSON body. The pair is a row of `/api/installs`, and the server checks
61
+ it against the same detected-install allowlist as the install toggle. An unknown or half pair
62
+ 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
+ `deploy` actions, `/api/excludes` and `/api/reveal`, `host`/`path` keep their own meaning.
66
+
67
+ Every `/api/*` read takes and checks the pair, with these exceptions:
68
+ - `/api/ping` and `/api/jobs` ignore it.
69
+ - The machine-wide reads also ignore it: `/api/update`, `/api/installs`, `/api/fleet`,
70
+ `/api/kits`, `/api/usage`, `/api/gates`, `/api/excludes`, `/api/mcp`, `/api/loops/active`,
71
+ `/api/activity`, and the Library's skill, agent, memory and notebook lists,
72
+ `/api/catalog/skills`, `/api/catalog/agents`, `/api/catalog/memory` and
73
+ `/api/catalog/notebook`. Such a read does not check the pair, and its answer does not change
74
+ with the pair. The Activity detail (`/api/activity/<id>`) and the Activity toggle still take
75
+ the pair.
76
+
77
+ The skill, agent, memory and notebook lists read every active install (memory and notebook
78
+ 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
80
+ its `installs` field names the installs that have it, as `host:scope:root` keys (the same keys
81
+ as `/api/usage`). An id that only some installs have lists only those installs, so an exclusion
82
+ stays visible. The other catalog sections stay install-scoped. `/api/item/skill/<name>` and
83
+ `/api/item/agent/<name>` stay install-scoped too, because each install renders its own copy in
84
+ its own theme and footprint. With a pair, the item is that install's copy, and an id that
85
+ install lacks gets a 404. Without a pair, the item is the copy of the first install that has
86
+ it. The order is the host order (OpenCode, Claude Code, Bob, OpenClaude), then global before
87
+ project. The item's `install` field names the copy, and its `installs` field names every
88
+ install that has the id.
89
+
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
93
+ that row `default: true`. There is no console-wide install and no `POST /api/view`: a page that
94
+ acts on one install names it on each request, through a picker placed beside the entry or form it
95
+ applies to (see below).
96
+ Each named install keeps its own cached doctor run and inventory, and a mutation refreshes all
97
+ of them.
98
+
56
99
  ## The rail
57
100
 
58
101
  The left rail mirrors the harness's own shape:
@@ -66,9 +109,20 @@ The left rail mirrors the harness's own shape:
66
109
 
67
110
  At the foot of the rail sits a **vitals** card — the doctor's verdict, drift, how long ago the
68
111
  harness was built, and a Voice button — so those facts are on screen from every page. It is
69
- hidden where the rail collapses to icons (≤960px) and returns with the phone drawer. When two
70
- or more installs are active, the topbar's first breadcrumb is the picker for the install the
71
- console views.
112
+ hidden where the rail collapses to icons (≤960px) and returns with the phone drawer. The topbar's
113
+ breadcrumb starts at the page: it names no install.
114
+
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.
72
126
 
73
127
  A global **Spotlight** search lives in the topbar — press <kbd>/</kbd> to focus it (or
74
128
  <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>K</kbd>, which also works from inside a text field), type
@@ -103,7 +157,9 @@ streams the output of background jobs and keeps their history across reloads.
103
157
 
104
158
  - **Rules** (`#/rules`) — your own standing rules, read from and written to the
105
159
  `user-rules.md` beside the deployed AGENT.md (the seed-once file no update ever
106
- touches). List with scope (project/global — a hand-written `user` opens as global — or any other scope written by hand, which a
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
107
163
  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
108
164
  `## ` is refused: the file would read it as a new rule heading), a
109
165
  **Graduate** action that adopts a trial rule for good, and a budget meter that turns
@@ -155,8 +211,10 @@ streams the output of background jobs and keeps their history across reloads.
155
211
  for *mutate*, *human gate*, what they override and *unavailable*; the reader shows the
156
212
  frontmatter facts (outcomes as pills, availability with its reason), then the body rendered as
157
213
  markdown, with a **View source** toggle for the file as parsed, frontmatter and all. Templates and
158
- Bricks read `GET /api/loops`, resolved from the selected install's root, so a project
159
- install shows its `.geneseed/` bricks and templates. **Active** is every loop
214
+ Bricks read `GET /api/loops` for the install the page's *Templates and bricks of:* picker
215
+ names (its own remembered pick, starting on the default; hidden with one install and on
216
+ Active), resolved from that install's root, so a project install shows its `.geneseed/` bricks
217
+ and templates. **Active** is every loop
160
218
  `geneseed loop init` registered on this machine (`GET /api/loops/active`, polled every
161
219
  5 s), grouped awaiting, running, done/stopped, finished/unreadable; the reader shows its
162
220
  branch, `iteration N / max`, current node and a preset picker (`POST /api/loops/preset`,
@@ -164,11 +222,15 @@ streams the output of background jobs and keeps their history across reloads.
164
222
  human gate, with its node) — the answer is given in the agent's session, never here — and
165
223
  its ring with the current node filled, with its iteration history under it.
166
224
  - **Profile** (`#/profile`) — `PROFILE.md` beside the deployed AGENT.md: who you are and
167
- how you like to work. Opens rendered; **Edit** is a whole-file editor. The save carries
225
+ 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
168
226
  the fingerprint it loaded — if an agent session changed the file first, your edit stays
169
227
  on screen and a second Save replaces the newer version.
170
- - **Skills** (`#/skills`) and **Agents** (`#/agents`) — the deployed catalogue, each entry
171
- with its purpose line and full spec. While Skills is selected, its skill types sit nested
228
+ - **Skills** (`#/skills`) and **Agents** (`#/agents`) — the deployed catalogue of every
229
+ installed harness, each entry with its purpose line and full spec. Each row is one skill or
230
+ agent; when more than one install is active, it carries a badge for each install that has it
231
+ (`opencode · global`; a project install by its folder). The reader shows the first install's copy. When more installs have the entry,
232
+ a **Viewing copy from** picker beside the copy opens another install's version, for that
233
+ entry only. While Skills is selected, its skill types sit nested
172
234
  under it in the rail, each with its count, above a thin bar of their shares; pick one to
173
235
  narrow the list.
174
236
  - **Docs** (`#/docs`) — rendered documentation: markdown pages, concept pages, a CLI
@@ -184,8 +246,16 @@ streams the output of background jobs and keeps their history across reloads.
184
246
 
185
247
  ### 🩺 Care
186
248
 
187
- - **Activity** (`#/activity`) — the agent sessions on this machine: each one's status,
188
- the files it touched and its todo progress; open one for its detail. Sessions that ended in the last 7 days are listed under
249
+ - **Activity** (`#/activity`) — the agent sessions on this machine, from every active install
250
+ in one view: each one's status, the files it touched and its todo progress; open one for its
251
+ detail. Each card has a chip that names its install: the host, then the scope when a host has
252
+ two installs, then the project folder when a host has two project installs, and more of the
253
+ folder's path (up to the whole path) when two folders have the same name. A session that two
254
+ installs of one host both recorded is one card. Its chip and link name the first of those
255
+ installs in a fixed order (host order, then global before project), so they do not change
256
+ between polls. Tracking is on or off per install: the tracking
257
+ card has one switch per install, and each switch changes only that install. OpenCode project
258
+ installs have no switch: their sessions appear under, and follow, the OpenCode global switch. Sessions that ended in the last 7 days are listed under
189
259
  **Recently ended**, below the live ones. Every host records it:
190
260
  the OpenCode plugin, and `geneseed-hook activity` on Claude Code, OpenClaude and Bob.
191
261
  The live sessions open in the **Garden** by default; a **List | Garden** switch (kept in the
@@ -206,17 +276,17 @@ streams the output of background jobs and keeps their history across reloads.
206
276
  you) fold into chips, the largest first; the last standing shelf never folds. **Sakura** repaints the crowns pink, nothing more.
207
277
  A session's detail page shows its tree too, live or ended, with the same pad hovers and a
208
278
  legend of its turns, context, compactions and sub-agents; an ended session's tree stands still, without the `!`.
209
- - **Changes** (`#/diff`) — the diff between the deployed harness and the source: edited /
279
+ - **Changes** (`#/diff`) — the diff between the install its *Local edits of:* picker names and the source: edited /
210
280
  added / missing files, and files only behind the source (unedited; a rebuild updates them)
211
281
  listed apart under **Behind source**, with per-file expansion and coloured unified-diff lines. Select
212
282
  files to **export an `improvements.md`** back-port, or **restore** them to source.
213
283
  Restore acts only on files the diff lists, and never on your own files (`user-rules.md`,
214
284
  `PROFILE.md`, `memory/`, `notebook/`). An added file is moved into
215
285
  `archived-restore/<date-time>/` in the install, not deleted.
216
- - **Doctor** (`#/doctor`) — runs the same health engine as the `doctor` command (every
286
+ - **Doctor** (`#/doctor`) — runs, for the install its *Doctor for:* picker names, the same health engine as the `doctor` command (every
217
287
  theme, parity, links, authoring gates, drift), grouping any problems per check. It shows
218
- the server's last run — warmed at start, redone after a job, an install toggle or a view
219
- switch — and **Re-run checks** runs every check again on demand.
288
+ the server's last run for that install — warmed at start, redone after a job or an install
289
+ toggle — and **Re-run checks** runs every check again on demand.
220
290
 
221
291
  ### 🎨 Setup
222
292
 
@@ -255,7 +325,7 @@ streams the output of background jobs and keeps their history across reloads.
255
325
  - **Server** (`#/installs/server`; `#/settings` and `#/about` resolve here) — a settings sheet
256
326
  with a section index. **Appearance**: skin, accent (a skin change resets it to the skin's own), Overview view. **Machine**:
257
327
  version + Update (labelled by how this copy updates: git pull, npm install -g, or the command
258
- to run by hand), Add to PATH, the viewed install's footprint (read-only, links to Hosts). **Server**: running · port ·
328
+ 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 ·
259
329
  pid · uptime, whether the code matches the disk (with Restart), start-at-login state (read
260
330
  only), and the four request guards; the index marks Server with a good/warn dot. **About**: version, changelog, credits, source, creator.
261
331
  **Danger zone**: Stop server, Remove from PATH, and a pointer to each install's own
@@ -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.30.0"
5
+ "version": "4.31.0"
6
6
  }
package/js/README.md CHANGED
@@ -239,19 +239,19 @@ the deployed harness as JSON.
239
239
  |---|---|
240
240
  | `server.mjs` | `serve()`/`cmdWeb`: UI-build precheck, socket bind, token mint, daemon record wiring |
241
241
  | `routes.mjs` | The route tables — `STATE_ROUTES`, `PREFIX_ROUTES`, `POST_ROUTES` (+ its 409 column) — and the inline lists |
242
- | `handler.mjs` | One function per request: 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 |
243
- | `state.mjs` | `webState` — the resolved install view every endpoint reads, with its cached inventory and doctor |
244
- | `catalog.mjs` | The Library read model: inventory, constitution tiers, memory/notebook/wiki/config items, `apiCatalog`/`apiItem`, `NotFound` |
242
+ | `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 |
243
+ | `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
+ | `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
245
  | `api.mjs` | The dashboard and settings reads: overview, recent, themes, setup, doctor, diff, installs, excludes, loops |
246
246
  | `update-check.mjs` | Is a newer release on npm? Answers from memory, refreshes in the background (a day when it got an answer, an hour when it did not), `null` on any failure, never asked under `node --test` |
247
247
  | `gates-api.mjs` | `GET /api/gates`: gate asks per rule per day over 30 days, read off every installed harness's `notebook/gates.jsonl` (the Overview's sparklines) |
248
248
  | `usage-api.mjs` | `GET /api/usage`: the 30-day skill and agent call counts across every installed harness, the never-fired list, a fleet-wide `names` list (per-name 30-day counts, installs, daily series, last day seen), and skips lines older than 90 days in each `notebook/usage.jsonl` |
249
249
  | `user-files.mjs` | The fingerprint-guarded editors for `user-rules.md` (incl. memory promotion) and `PROFILE.md`, read and write |
250
- | `actions.mjs` | The other mutating endpoints — memory delete, MCP, excludes, installs, view, restore — plus install/deploy argv |
250
+ | `actions.mjs` | The other mutating endpoints — memory delete, MCP, excludes, installs, view, restore — plus install/deploy argv, and `installView`, the per-request install behind the one (host, path) allowlist |
251
251
  | `daemon.mjs` | Detached web start/stop/status/restart, the `.geneseed-web.json` record, and `openUrl` |
252
252
  | `jobs.mjs` | `JobManager` and the action→argv table. The only module here that spawns job children |
253
253
  | `docs.mjs` | The Docs tab: the `docs/<folder>/` page registry, `?harness=` filtering, link rewriting, the six page kinds |
254
- | `activity.mjs` | The `activity/` session files: pid-liveness prune, list, detail, and the on/off flag |
254
+ | `activity.mjs` | The `activity/` session files of every active install: one merged list (`activitySummary`), the per-install detail and on/off flag, and the daemon's sweep over all installs (`sweepInstalls`) |
255
255
 
256
256
  **Before editing:** `makeHandler(state, jm, token, dist, holder)`'s arity is load-bearing — three
257
257
  test call sites construct one directly and drive it without a socket. `routes.mjs`'s tables
@@ -769,17 +769,19 @@ function ruleDecide(args, payload) {
769
769
  + 'credential-shaped string. Secrets live in .env or a secret manager, never in a '
770
770
  + 'tracked file.');
771
771
  }
772
- const sensor = protectedCheck(p);
772
+ // Bob routes reads here too (`read_file` carries a path): only a write is External Gate's business.
773
+ // shortcut: a write is told by its tool name, so a Bob write tool named outside WRITE_NAME_RE
774
+ // passes both gates; switch to an allowlist of Bob's read tools if Bob adds or renames one.
775
+ const bobRead = HOST === 'bob' && !WRITE_NAME_RE.test(String((payload && payload.tool_name) || ''));
776
+ const sensor = !bobRead && protectedCheck(p);
773
777
  if (sensor) {
774
778
  return ask(args, 'rule-gate', 'rigor-5', `Geneseed (External Gate) — ${p} is a protected `
775
779
  + `check (${sensor === DONE_LIST ? 'the done gate list itself'
776
780
  : `${sensor}, listed in ${SENSOR_LIST}`}). A check the agent can edit is not a `
777
781
  + 'check: fix the code, not the check, unless the user asks for this edit.');
778
782
  }
779
- // Bob routes reads here too (`read_file` carries a path): only a write is this gate's business.
780
783
  // Bob never reads `opencode.json(c)`, OpenCode's whole host config: it is not gated from Bob.
781
- const bobWrite = HOST !== 'bob' || (WRITE_NAME_RE.test(String((payload && payload.tool_name) || ''))
782
- && !/^opencode\.jsonc?$/i.test(path.basename(p)));
784
+ const bobWrite = !bobRead && !(HOST === 'bob' && /^opencode\.jsonc?$/i.test(path.basename(p)));
783
785
  if (bobWrite && gateConfig(p, args.root)) {
784
786
  // Bob: a hook-settings file is the user's shared host config — refused only when the write
785
787
  // touches Geneseed's wiring (`bobSettingsChange`); a pass falls through to the checks below.
@@ -65,6 +65,7 @@ import { memoryDelete } from '../maintain/memory.mjs';
65
65
  import { installDeactivate, installReactivate, installUninstall } from '../maintain/uninstall.mjs';
66
66
  import { emitChoices, themeChoices, viewCfg } from './api.mjs';
67
67
  import { actionCommands } from './jobs.mjs';
68
+ import { webState } from './state.mjs';
68
69
  import { NotFound, deployed, memoryDir } from './catalog.mjs';
69
70
 
70
71
  /** One body field, `dflt` when the body is not an object or does not carry the key. */
@@ -176,7 +177,8 @@ function bodyAxes(body, dflt) {
176
177
 
177
178
  /**
178
179
  * The DETECTED install a body's (host, path) pair names — `[host, scope, root]` — or a
179
- * `NotFound`. THE ALLOWLIST three endpoints share (view select, rebuild, deactivate/remove), and
180
+ * `NotFound`. THE ALLOWLIST every install-naming endpoint shares (a per-request install, rebuild,
181
+ * deactivate/remove), and
180
182
  * one copy of it: two copies of a security check drift, and the copy that drifts is the one
181
183
  * nobody re-read.
182
184
  *
@@ -192,6 +194,43 @@ function detectedInstall(body) {
192
194
  return hit;
193
195
  }
194
196
 
197
+ /**
198
+ * The state a request reads: the install its `{host, path}` names, or `base` (the daemon's
199
+ * own, on the default install, `defaultView`) when it names neither.
200
+ *
201
+ * NAMING ONE IS AN ALLOWLIST LOOKUP, EVERY TIME: `detectedInstall` runs on a cache hit too, so
202
+ * a half pair, an unknown pair or an install removed since is a `NotFound` (404), never a fall
203
+ * through to another dir. The state is cached per install on `base._views` because its doctor
204
+ * and inventory caching is behaviour (see `webState`); it is PINNED, so `refresh` never
205
+ * re-points it, and its `refresh` is `base.refresh`, which reaches every view. The daemon's
206
+ * own hooks (`daemonStale`, `jobBusy`) are read through to `base`, where `serve()` sets them.
207
+ */
208
+ export function installView(base, sel) {
209
+ if (bget(sel, 'host') == null && bget(sel, 'path') == null) return base;
210
+ return targetView(base, detectedInstall(sel));
211
+ }
212
+
213
+ /**
214
+ * The cached view of one `[host, scope, root]` that `installTargets()` yielded — the allowlist
215
+ * already passed, so a caller holding a whole scan (the Library's fleet, `routes.mjs`) makes no
216
+ * second scan per install. Never call it with a pair a request supplied: that is `installView`.
217
+ */
218
+ export function targetView(base, [host, scope, root]) {
219
+ const key = JSON.stringify([host, String(root)]);
220
+ let v = base._views.get(key);
221
+ if (v === undefined) {
222
+ const target = viewCfg(host, scope, root);
223
+ v = webState(null, target);
224
+ v.selectView(target, root);
225
+ v.pinned = true;
226
+ v.refresh = base.refresh;
227
+ v.daemonStale = () => base.daemonStale?.();
228
+ v.jobBusy = () => base.jobBusy?.();
229
+ base._views.set(key, v);
230
+ }
231
+ return v;
232
+ }
233
+
195
234
  // ---- OS-native folder picker ---------------------------------------------------------------
196
235
 
197
236
  /**
@@ -441,24 +480,6 @@ export function mcpTargetPaths() {
441
480
  return known;
442
481
  }
443
482
 
444
- // ---- the harness selector ------------------------------------------------------------------
445
-
446
- /**
447
- * Re-point the whole console at a detected install.
448
- *
449
- * The (host, path) PAIR must be one of the detected targets, and the ROOT is threaded through
450
- * beside the data dir: markers and sigils live at the install root, not in the data dir, and
451
- * without it a claude/bob PROJECT view mis-detects as opencode/neutral.
452
- *
453
- * The pair is SERIALISED into the key rather than concatenated with a separator: the path
454
- * comes straight out of a request body, and any separator it could contain would let one
455
- * pair impersonate another in a lookup whose whole job is to be an allowlist.
456
- */
457
- export function apiSelectView(state, body) {
458
- const [host, scope, root] = detectedInstall(body);
459
- state.selectView(viewCfg(host, scope, root), root);
460
- return { ok: true, target: state.target, theme: state.theme, emit: state.emit };
461
- }
462
483
 
463
484
  // ---- restore, and the two build-command resolvers ---------------------------------------
464
485
 
@@ -675,7 +696,7 @@ const EMIT_FOR = new Map([
675
696
  * already-active one (an in-place re-emit, the same command either way).
676
697
  *
677
698
  * The (host, path) pair MUST be one of the detected targets — the same allowlist
678
- * `apiSelectView` uses, and the reason the target is never built from raw body input — and
699
+ * `installView` uses, and the reason the target is never built from raw body input — and
679
700
  * it must not be `disabled` (reactivate first). Every other field follows the same rule: a
680
701
  * VALID picked value wins, else the install's own, so a re-theme never silently flips the
681
702
  * footprint, the register or the mode, and a bogus body value cannot reach the argv.