geneseed 4.20.0 → 4.22.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 (71) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/DESIGN.md +1 -1
  3. package/README.md +2 -2
  4. package/SHIPPED.md +1 -1
  5. package/adapters/bob/README.md +5 -0
  6. package/adapters/claude-code/README.md +4 -0
  7. package/adapters/openclaude/README.md +2 -1
  8. package/adapters/opencode/plugins/geneseed-activity.js +2 -2
  9. package/adapters/opencode/plugins/geneseed-guard.js +1 -1
  10. package/bin/geneseed-cli.mjs +1 -1
  11. package/bin/geneseed-hook.mjs +44 -3
  12. package/docs/concepts/hooks.md +4 -0
  13. package/docs/concepts/host-matrix.md +1 -0
  14. package/docs/guides/upgrade.md +1 -1
  15. package/docs/reference/environment.md +1 -0
  16. package/docs/reference/plugin-activity.md +7 -3
  17. package/docs/web-ui.md +13 -11
  18. package/harness.config.json +1 -1
  19. package/js/README.md +3 -2
  20. package/js/cli-table.json +39 -0
  21. package/js/hosts/activity.mjs +429 -0
  22. package/js/hosts/hooks-prims.mjs +47 -4
  23. package/js/hosts/hooks.mjs +6 -9
  24. package/js/hosts/settings.mjs +9 -0
  25. package/js/web/actions.mjs +39 -0
  26. package/js/web/activity.mjs +76 -108
  27. package/js/web/api.mjs +24 -2
  28. package/js/web/handler.mjs +20 -1
  29. package/js/web/jobs.mjs +6 -6
  30. package/js/web/server.mjs +6 -0
  31. package/js/web/usage-api.mjs +24 -3
  32. package/package.json +1 -1
  33. package/src/modes/foreman.md +2 -1
  34. package/src/skills/pipeline.md +2 -2
  35. package/src/skills/rule.md +3 -3
  36. package/web/dist/assets/Activity-DsKkFGhT.js +1 -0
  37. package/web/dist/assets/{ActivityDetail-CMeNtKIN.js → ActivityDetail-BWY-vaiK.js} +1 -1
  38. package/web/dist/assets/Dashboard-BZmw2a7d.js +2 -0
  39. package/web/dist/assets/Docs-CNuRuMin.js +4 -0
  40. package/web/dist/assets/GreenhouseView-BCiZP9f9.js +1 -0
  41. package/web/dist/assets/Installs-xkBX6OjK.js +3 -0
  42. package/web/dist/assets/JournalView-BSR51TKR.js +1 -0
  43. package/web/dist/assets/{KitApply-DZGqaZpV.js → KitApply-BR8AcZ62.js} +1 -1
  44. package/web/dist/assets/{Kits-C1VS-BtR.js → Kits-e0DCj9sT.js} +1 -1
  45. package/web/dist/assets/{Laws-Cu3pj44B.js → Laws-BuG2_HFE.js} +2 -2
  46. package/web/dist/assets/Library-BYfB4mhf.js +2 -0
  47. package/web/dist/assets/Loops-r6L7a1g1.js +2 -0
  48. package/web/dist/assets/OperatorHudView-BLXm0zzn.js +1 -0
  49. package/web/dist/assets/Personal-kEfKCxlh.js +1 -0
  50. package/web/dist/assets/{StackBar-CXARiXzd.js → StackBar-Y_gkoC3t.js} +1 -1
  51. package/web/dist/assets/Tabs-2uMB511T.js +1 -0
  52. package/web/dist/assets/activity-BEWV9er4.js +1 -0
  53. package/web/dist/assets/drawable-ixCquffB.js +1 -0
  54. package/web/dist/assets/{index-BJlfPvpv.css → index-CDSHv_7s.css} +1 -1
  55. package/web/dist/assets/index-Dwo3Gxek.js +2 -0
  56. package/web/dist/assets/jobBuckets-Dpjvbfm1.js +2 -0
  57. package/web/dist/index.html +2 -2
  58. package/web/dist/assets/Activity-nRkdnrgE.js +0 -1
  59. package/web/dist/assets/Dashboard-B5-wUlXC.js +0 -3
  60. package/web/dist/assets/Docs-QmZs08QG.js +0 -4
  61. package/web/dist/assets/GreenhouseView-tHIvpI6U.js +0 -1
  62. package/web/dist/assets/Installs-DDWjgFDY.js +0 -3
  63. package/web/dist/assets/JournalView-DO0pPutM.js +0 -1
  64. package/web/dist/assets/Library-CrTK5XsD.js +0 -2
  65. package/web/dist/assets/Loops-C7DPrKbV.js +0 -2
  66. package/web/dist/assets/OperatorHudView-BN27gXFS.js +0 -1
  67. package/web/dist/assets/Personal-Cz2rcqYw.js +0 -1
  68. package/web/dist/assets/Tabs-ChiCgm2F.js +0 -1
  69. package/web/dist/assets/activity-BGy8Bb_l.js +0 -1
  70. package/web/dist/assets/drawable-r1qCgRMK.js +0 -1
  71. package/web/dist/assets/index-osXUqzdX.js +0 -2
package/CHANGELOG.md CHANGED
@@ -8,6 +8,33 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [4.22.0] — 2026-10-25
12
+
13
+ Minor: the Activity view is fed on every host, and pipelines no longer stall on a silent crew.
14
+
15
+ ### Added
16
+ - **Claude Code, OpenClaude and Bob feed the Activity view**, like OpenCode: `geneseed-hook activity` runs on UserPromptSubmit (and SessionEnd on Claude and OpenClaude), and Claude's full timeline is read from its transcript at Stop. Recording is on by default on every host and follows the same `.geneseed-activity` switch; with it off, the writer is never loaded. Snapshots are redacted with the Law I secret patterns and git-ignored; ended sessions are archived (newest 50, 7 days) instead of deleted, and viewing the page never deletes anything. Run `geneseed rebuild-all` to wire the new hook. Bob is covered by unit tests only (IBM does not publish Bob Shell on npm).
17
+
18
+ ### Changed
19
+ - **Pipelines no longer stall on a silent crew.** The parent now watches every crew it dispatches: an envelope without proof, or a crew that goes silent for 15 minutes with no live child process, is resumed or taken over instead of waited on. A crew lead holds every member's result before it ends, so no member reports past it to the parent.
20
+
21
+ ## [4.21.0] — 2026-10-25
22
+
23
+ Minor: Activity "Today", per-install rebuild, usage in the Library, sync with source in Hosts, a command palette, and `user` as an alias of `global`.
24
+
25
+ ### Added
26
+ - **Activity "Today".** Runs per day over 14 days, gate asks per rule over 30 days and "Waiting on you", above a feed that mixes runs and gate asks by day, with filters — so the page answers what your agents did even with live tracking off.
27
+ - **Rebuild one install.** Each Overview row rebuilds only its own install, and "Rebuild all behind (N)" rebuilds only the installs that need it; both ask first and show progress on the rows they touch. A per-install rebuild on a console running older code than the disk asks you to restart it first.
28
+ - **Usage in the Library.** Each skill and agent shows its call count across installs, the reader shows where and how often it ran over 30 days, and a "Not used yet" filter lists what has not fired since counting began.
29
+ - **Hosts shows each install's sync with source**, and the Server tab is a settings sheet: server pid and uptime, whether the code matches the disk, the request guards, and a danger zone.
30
+ - **Command palette.** "Search or run…" (Ctrl/⌘ K or `/`) finds pages, items and actions in one place; actions that write still ask first.
31
+
32
+ ### Changed
33
+ - **Rule scope `user` is an alias of `global`.** The rule skill documents `project` and `global`; the editor opens a `user` rule on `global` and writes `global` when you save it. Untouched rules keep what they say.
34
+
35
+ ### Fixed
36
+ - The Constitution page's Dictates and Doctrines cells no longer show a light browser-default button background that hid their names in dark mode.
37
+
11
38
  ## [4.20.0] — 2026-10-24
12
39
 
13
40
  Minor: every web console page uses the shared building blocks — one header and one primary action per page, named controls, consistent empty and error states.
package/DESIGN.md CHANGED
@@ -203,7 +203,7 @@ theme file defines a `DIR_*` key, so `laws/` is `laws/` in all fourteen voices.
203
203
  | Generator | `bin/build-driver.mjs` (`geneseed-build`) | — | substitution + `<!-- INCLUDE: -->` inlining, and the eleven `--emit` targets |
204
204
  | CLI, as data | `js/cli-table.json` | — | the owned document the entry point parses its own argv from |
205
205
  | Automation | `bin/geneseed-cli.mjs` (`geneseed`) | — | 25 verbs — `build` / `doctor` / `status` / `prompt` / `diff` / `setup` / `web` / `upgrade` / … |
206
- | Hooks | `bin/geneseed-hook.mjs` (`geneseed-hook`) | — | the five verbs an emitted hook config invokes: `context` / `git-gate` / `rule-gate` / `tool-gate` / `learn` |
206
+ | Hooks | `bin/geneseed-hook.mjs` (`geneseed-hook`) | — | the six verbs an emitted hook config invokes: `context` / `git-gate` / `rule-gate` / `tool-gate` / `learn` / `activity` |
207
207
  | Adapters | `adapters/` | — | optional per-tool glue (hooks, OpenCode plugins) |
208
208
 
209
209
  ## ⚙️ Generator contract
package/README.md CHANGED
@@ -128,7 +128,7 @@ Both launchers are thin shims over the Node CLI: they need `node` (22.7+) on `PA
128
128
 
129
129
  ### 🟩 One runtime — Node, and nothing else
130
130
 
131
- Node ≥ 22.7 is the entire dependency list — every command, all five hook verbs, the web console and both generators run from it, and nothing any bundle ships needs a second interpreter.
131
+ Node ≥ 22.7 is the entire dependency list — every command, all six hook verbs, the web console and both generators run from it, and nothing any bundle ships needs a second interpreter.
132
132
 
133
133
  ### ✅ After installing
134
134
 
@@ -268,7 +268,7 @@ Token cost per host: **[docs/token-footprint.md](docs/token-footprint.md)**.
268
268
  Geneseed/
269
269
  ├── package.json the npm package: three commands, zero dependencies
270
270
  ├── bin/ the Node entry points — geneseed-cli.mjs (the CLI), geneseed-hook.mjs
271
- │ (the five hook verbs), build-driver.mjs (the generator driver)
271
+ │ (the six hook verbs), build-driver.mjs (the generator driver)
272
272
  ├── js/ the Node harness — generator, hooks, web server, doctor, installs
273
273
  │ (js/cli-table.json is the CLI as data; the CLI reads it)
274
274
  ├── geneseed launcher (bash): a shim over bin/geneseed-cli.mjs — bare `./geneseed`
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.20.0**.
23
+ > string. Current label: **4.22.0**.
24
24
 
25
25
  ## Capabilities
26
26
 
@@ -104,6 +104,11 @@ What the global emit writes into `~/.bob/settings/settings.json`:
104
104
  | `SessionStart` | `context --host bob` | plain stdout, as on Claude |
105
105
  | `PreToolUse` | `tool-gate --host bob` — one group, no matcher | Laws I/IV, rigor-5 and ops-2: **exit 2**, reason on stderr — it says no chat confirmation lifts the block, since Bob has no ask tier; process 1/5: a stderr line, exit 0 |
106
106
  | `Stop` | `learn` | never a verdict |
107
+ | `UserPromptSubmit` | `activity --host bob` | never a verdict; records the turn for the web console's Activity view |
108
+
109
+ Every hook also feeds the Activity view after it decides (off with `GENESEED_ACTIVITY=off`).
110
+ Bob sends no transcript, so a Bob session shows only the calls `tool-gate` sees; see
111
+ `docs/reference/plugin-activity.md`.
107
112
 
108
113
  No matcher on `PreToolUse`, deliberately: Bob's tools page already drifts from its own
109
114
  changelog (`web_fetch`, the 2.1.0 Office/IBM-docs tools are undocumented there), so an
@@ -70,6 +70,10 @@ absolute-path hooks instead — `geneseed setup` does that for you.) It:
70
70
  and auto-compaction is the moment that window is about to be summarised away.
71
71
  This captures memory *before* the summary; the SessionStart `context` hook (which
72
72
  also fires on the `compact` source) re-seeds context *after* it.
73
+ - on **UserPromptSubmit** and **SessionEnd**, runs `geneseed-hook activity`, which decides
74
+ nothing and prints nothing: it records the session for the web console's Activity view.
75
+ Every other hook above feeds that view too, after it has decided. `GENESEED_ACTIVITY=off`
76
+ (or the console's toggle) turns it off; see `docs/reference/plugin-activity.md`.
73
77
 
74
78
  This step is **opt-in on a model CLI**: set `GENESEED_LLM` (e.g. `claude -p`,
75
79
  `llm`, `ollama run …`) for `learn` to actually distil. With it unset the hook is
@@ -57,7 +57,8 @@ global config file.
57
57
  The Claude group set, unchanged: `PreToolUse` (git gate on `Bash|PowerShell`, rule gate on
58
58
  writes), `SessionStart` (context on every source — one matcher-less group covers
59
59
  `startup`, `resume`, `clear`, `compact` and `fork` alike), `Stop`,
60
- `SubagentStop` and `PreCompact` (learn). OpenClaude reads Claude's
60
+ `SubagentStop` and `PreCompact` (learn), and `UserPromptSubmit` and `SessionEnd`
61
+ (`activity`, which feeds the web console's Activity view). OpenClaude reads Claude's
61
62
  `hookSpecificOutput.permissionDecision`, so the gates **ask** where Claude asks.
62
63
  The context hook carries `--host openclaude` for one reason. It tells the hook
63
64
  which root file OpenClaude already loads (`AGENTS.md` when present, else
@@ -11,8 +11,8 @@
11
11
  // ONE FILE PER SESSION (`activity/<session_id>.json`), owned exclusively by the
12
12
  // process that created the session — so concurrent `opencode` invocations never
13
13
  // contend on a shared file and no lock is needed. Atomic write (tmp + rename) keeps
14
- // the reader from ever seeing a torn file. The reader prunes entries whose `pid` is
15
- // dead or whose `updated_at` is stale, so a crashed writer's file self-cleans.
14
+ // the reader from ever seeing a torn file. The reader lists an entry whose `pid` is
15
+ // dead or whose `updated_at` is stale as ended, and never deletes it.
16
16
  //
17
17
  // FLAT: one entry per top-level session. Sub-agent fan-out (subtask parts,
18
18
  // parent→children tree) is deferred — child sessions (those with a parentID) and the
@@ -220,7 +220,7 @@ const SECRET_RE = [
220
220
  // as-is rather than silently changing guard behaviour for a parity task.
221
221
  const SECRET_WARN_RE = [/(^|\/)\.env(\.[\w.-]+)?$/i]
222
222
 
223
- // Twin of js/hosts/hooks.mjs's SECRET_RE (Law I's boundary half) — scans WRITE CONTENT for a
223
+ // Twin of js/hosts/hooks-prims.mjs's SECRET_RE (Law I's boundary half) — scans WRITE CONTENT for a
224
224
  // credential-shaped string, not the target path (SECRET_RE above is the path twin, file names
225
225
  // only). High-precision vendor prefixes only, same rationale as the Node side: a generic
226
226
  // "looks like entropy" scan fires on every hash and lockfile. Kept byte-identical by the parity
@@ -348,7 +348,7 @@ async function main(argv) {
348
348
  // just about to become false — it was already claiming a third place for verbs that do
349
349
  // not exist.
350
350
  return die(2, `invalid choice: '${verb}'. This entry point carries only `
351
- + `${Object.keys(VERBS).join(', ')}; the five hook verbs live in `
351
+ + `${Object.keys(VERBS).join(', ')}; the six hook verbs live in `
352
352
  + 'bin/geneseed-hook.mjs.');
353
353
  }
354
354
  // `js/cli-table.json`, the CLI as data. A verb this table dispatches and the file does not
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * The hook entry point — a Node twin of `rituals/harness.py` for the verbs the emitted
4
- * `settings.json` actually invokes (four from the reference, plus `tool-gate` for Bob).
4
+ * `settings.json` actually invokes (four from the reference, plus `tool-gate` for Bob and
5
+ * `activity` for the web console's Activity view).
5
6
  *
6
7
  * WHY IT IS A SECOND BINARY AND NOT A SUBCOMMAND OF `bin/build-driver.mjs`. Three reasons,
7
8
  * and each alone would be enough:
@@ -50,6 +51,11 @@ import '../js/lib/node-floor.mjs';
50
51
  // Not a new module on the hot path: every verb's module imports `js/lib/fs.mjs` too, so this
51
52
  // edge only loads early a file the process would load anyway.
52
53
  import { printErr } from '../js/lib/fs.mjs';
54
+ // Also not a new module: every verb's module imports it. It carries the activity switch, so the
55
+ // off path costs one file read and no import of the writer.
56
+ import { activityOn, readStdin } from '../js/hosts/hooks-prims.mjs';
57
+ import { isatty } from 'node:tty';
58
+ import path from 'node:path';
53
59
 
54
60
  // `--host` selects the verdict dialect (see js/hosts/hooks.mjs's header); the emitter bakes
55
61
  // it into the command for every host that is not Claude Code, so the hook never has to guess
@@ -92,8 +98,37 @@ const VERBS = {
92
98
  switches: { '--consolidate': 'consolidate', '--no-done-gate': 'noDoneGate' },
93
99
  positional: 'file',
94
100
  },
101
+ // UserPromptSubmit and SessionEnd: no verb runs there, and the activity view needs both.
102
+ activity: { load: () => import('../js/hosts/hooks-prims.mjs'), fn: 'cmdActivity', flags: HOSTED },
95
103
  };
96
104
 
105
+ /**
106
+ * Records the payload the verb just answered into `<root>/activity/` (js/hosts/activity.mjs),
107
+ * AFTER the verb has decided and printed, so a verdict never waits on it and never sees it.
108
+ * Here rather than inside each verb because Claude routes its gated tools through THREE verbs
109
+ * (git-gate, rule-gate, tool-gate) and the same payload shape reaches all of them; the stdin they
110
+ * consumed is kept by `readStdin`. Never prints, never changes the exit code. Stands down inside a
111
+ * model-CLI child `learn` spawned (its own hooks would record a phantom session), on a terminal
112
+ * (a hand-run `context` must not block on a stdin nobody will send), and when tracking is off —
113
+ * then the writer module is never imported.
114
+ */
115
+ async function trackActivity(verb, args) {
116
+ try {
117
+ // `learn` names its install by `--memory`, and a `--file` run is a person, not a hook.
118
+ const root = verb === 'learn' ? (args.memory && !args.file ? path.dirname(args.memory) : null)
119
+ : args.root;
120
+ if (!root || process.env.GENESEED_LEARN_CHILD || isatty(0) || !activityOn(root)) return;
121
+ // `context` never read stdin before this writer, and whether Bob's SessionStart pipes one
122
+ // and closes it is unverified: a read there could hold the session's start. A Bob session
123
+ // is first recorded by its first prompt or tool call instead.
124
+ if (verb === 'context' && args.host === 'bob') return;
125
+ const raw = readStdin();
126
+ if (!raw.includes('session_id')) return;
127
+ const { recordActivity } = await import('../js/hosts/activity.mjs');
128
+ recordActivity(root, raw, { host: args.host || 'claude' });
129
+ } catch { /* the activity view is best-effort; a hook that fails is a tool call that fails */ }
130
+ }
131
+
97
132
  function die(code, msg) {
98
133
  // CRLF on Windows, for the same reason the hook verbs' funnels translate: argparse
99
134
  // writes this line through `sys.stderr`, which does. `printErr` owns the `\n`-to-`os.linesep` rule.
@@ -181,7 +216,11 @@ async function main(argv) {
181
216
  // PreToolUse, from the gate deliberately blocking (see I3/B1 above). Print the same message
182
217
  // to stderr for a human debugging the shim, but return 0 with no stdout, exactly like a gate
183
218
  // that chose not to act.
184
- if (GATE_VERBS.has(verb)) { printErr(`geneseed-hook: error: ${parsed.error}\n`); return 0; }
219
+ // `activity` too: it runs on UserPromptSubmit, where exit 2 erases the user's prompt.
220
+ if (GATE_VERBS.has(verb) || verb === 'activity') {
221
+ printErr(`geneseed-hook: error: ${parsed.error}\n`);
222
+ return 0;
223
+ }
185
224
  // `context` and `learn` are not gate verbs, but their own argv errors are not a decision
186
225
  // either, so still 1, not 2 (I3/B1): a `<hook name> hook error` notice, and nothing more.
187
226
  // `learn` is the one that matters here — it runs on Stop/SubagentStop, where exit 2 ALSO has
@@ -189,7 +228,9 @@ async function main(argv) {
189
228
  // `hooks.md`, "Stop, SubagentStop, TaskCompleted, and TeammateIdle").
190
229
  return die(1, parsed.error);
191
230
  }
192
- return (await spec.load())[spec.fn](parsed.args);
231
+ const rc = (await spec.load())[spec.fn](parsed.args);
232
+ await trackActivity(verb, parsed.args);
233
+ return rc;
193
234
  }
194
235
 
195
236
  main(process.argv.slice(2)).then((code) => { process.exitCode = code; });
@@ -22,6 +22,10 @@ Geneseed writes its hooks into the host's settings file. Every hook calls one pr
22
22
  | `Stop` | the agent finishes a reply | `geneseed-hook learn` | distils durable facts into `memory/` | needs `GENESEED_LLM` |
23
23
  | `SubagentStop` | a subagent finishes | `geneseed-hook learn` | records a lesson for that agent in `memory/agents/<name>.md` | needs `GENESEED_LLM` |
24
24
  | `PreCompact` | before auto-compaction | `geneseed-hook learn` | captures memory before the transcript is summarised | needs `GENESEED_LLM` |
25
+ | `UserPromptSubmit` | you send a message | `geneseed-hook activity` | records the turn's start for the web console's Activity view; prints nothing | off with `GENESEED_ACTIVITY=off` |
26
+ | `SessionEnd` | the session closes | `geneseed-hook activity` | marks the session ended and archives it | off with `GENESEED_ACTIVITY=off` |
27
+
28
+ Every hook above also feeds the [Activity view](../reference/plugin-activity.md) after it has decided, unless tracking is off: one file per session under `activity/` beside the install. The gates' verdicts never wait on it.
25
29
 
26
30
  ## What each one does, and what you see
27
31
 
@@ -14,6 +14,7 @@ Every [host](hosts.md) gets the same content. This table is what each one lets G
14
14
  | Agents · Skills · Memory · Notebook | ✅ | ✅ | ✅ | ✅ |
15
15
  | Project context loaded at session start | ⚙️ plugin | 🪝 hook | 🪝 hook¹ | 🪝 hook² |
16
16
  | Memory written back at session end (learn) | ⚙️ plugin | 🪝 hook | 🪝 hook¹ | 🪝 hook² |
17
+ | Live sessions in the web console's [Activity view](../reference/plugin-activity.md) | ⚙️ plugin | 🪝 hook | 🪝 hook, per tool call only (no transcript)¹ | 🪝 hook² |
17
18
  | Real data loss (force-push to `main`, discarding uncommitted work, `rm` of untracked files…) | ⚙️ block³ · 🔒 ask (reflog, gc) | 🪝 ask | 🪝 block¹ | 🪝 ask² |
18
19
  | Secrets kept out of files | ⚙️ block⁴ | 🪝 ask | 🪝 block¹ | 🪝 ask² |
19
20
  | Consent before every commit and push | 🔒 permission ask | 🪝 ask | 🪝 warning¹ | 🪝 ask² |
@@ -50,7 +50,7 @@ The console asks npm for the latest release once a day. An Overview page that st
50
50
 
51
51
  The npm route never uses `sudo` and never retries. If npm refuses (no permission on the global folder, a proxy, a private registry), the job log shows npm's own output. Fix the cause, or run the two commands yourself.
52
52
 
53
- When the update is done, the console restarts and the page reloads. If you ran `git pull` yourself, the Overview shows a banner that the console runs old code. Click **Rebuild** on an install that is behind: the console restarts after the rebuild and reloads the page. If no install is behind, click **Restart** in the banner.
53
+ When the update is done, the console restarts and the page reloads. If you ran `git pull` yourself, the Overview shows a banner that the console runs old code. Click **Rebuild** on an install that is behind, or **Rebuild all behind** in the header. The console asks you to confirm, rebuilds only the installs it names, then restarts and reloads the page. If no install is behind, click **Restart** in the banner.
54
54
 
55
55
  ## What an upgrade keeps
56
56
 
@@ -19,6 +19,7 @@ Where Geneseed writes an install, and what an upgrade re-renders.
19
19
  | Variable | Read by | Effect |
20
20
  | --- | --- | --- |
21
21
  | `GENESEED_HOME` | build / hooks | Directory holding the hook shim `bin/geneseed-hook` (default `~/.geneseed`). Change it, then rebuild, so the emitted hooks point at the new location. |
22
+ | `GENESEED_ACTIVITY` | hooks, OpenCode plugin | `off` (or `0`, `false`, `no`) stops the activity writer; the hooks then load none of its code. Absent means on. See [geneseed-activity](plugin-activity.md). |
22
23
  | `GENESEED_NO_SHIM_CHECK` | CLI | `1` silences the warning every `geneseed` command prints when the hook shim points at a path that no longer exists. For scripted callers; the `status` gates row still says `DEAD`. |
23
24
  | `OPENCODE_CONFIG_DIR` | OpenCode emits, `diff`, plugins | OpenCode's config dir — where the global install is written. OpenCode still loads `$XDG_CONFIG_HOME/opencode` beside it, so `status` and `doctor` warn when both hold a Geneseed install. |
24
25
  | `XDG_CONFIG_HOME` | OpenCode emits, plugins | Used when `OPENCODE_CONFIG_DIR` is unset: the install goes to `$XDG_CONFIG_HOME/opencode` (default `~/.config/opencode`). |
@@ -8,13 +8,17 @@ description: "Feeds the web console's Activity view, one small file per session.
8
8
  ---
9
9
  One of the [OpenCode plugins](opencode-plugins.md). [Environment variables](environment.md) points here for its switches.
10
10
 
11
- **What it does.** Feeds the web console's **Activity** view: one small JSON file per session under `activity/` beside OpenCode's config, recording what the session is doing — phase, model, token and cost totals, files touched, plan, last error. The console reads and prunes those files; the two only meet on disk, so a crash on either side never blocks a session.
11
+ **What it does.** Feeds the web console's **Activity** view: one small JSON file per session under `activity/` beside OpenCode's config, recording what the session is doing — phase, model, token and cost totals, files touched, plan, last error. The console only reads those files; the two only meet on disk, so a crash on either side never blocks a session.
12
12
 
13
- **When it runs.** On session events, for top-level sessions only (sub-agents and learn's sessions are skipped). Entries whose process died or went stale are pruned by the reader.
13
+ **When it runs.** On session events, for top-level sessions only (sub-agents and learn's sessions are skipped). A session whose process died, went stale (30 minutes untouched) or ended leaves the live list and is listed as ended; the reader never deletes a file.
14
+
15
+ **Claude Code, OpenClaude and Bob.** Their hooks write the same files into `activity/` beside the install (`~/.claude/activity/`, `<repo>/.claude/activity/`, `~/.bob/activity/`). No hook is added per tool call: the writer runs after the hooks that already run — the gates, `context` and `learn` — plus `geneseed-hook activity` on `UserPromptSubmit` and, on Claude Code and OpenClaude, `SessionEnd`. So a Claude session's phase moves on the gated tools (`Bash`, `PowerShell`, `Write`, `Edit`, `NotebookEdit`, `Skill`, `Agent`, `Task`), and the rest of the turn — every tool call, the model, the token totals, the last reply — arrives at `Stop`, read from the transcript where the previous `Stop` left off (at most 2 MB per turn). Bob sends no transcript, so a Bob session shows only the calls its `tool-gate` sees, and leaves the live list by staleness alone (Bob has no `SessionEnd`). Bob's `SessionStart` is not recorded either — whether Bob pipes a payload there is unverified, and reading one that never closes would hold the session's start — so a Bob session first appears at its first prompt or tool call. These writers have no resident process, so their snapshots carry `pid: null` and stay live by staleness alone. Recorded: tool names, file basenames, line counts, todo text, and 240-character snippets of the prompt and the last reply — never a shell command, a file's content or an edit's text — and any credential the secrets gate would catch in a snippet is written as `[redacted]`. A project install's `activity/` gets its own `.gitignore` (`*`), and the writer never writes through, or sweeps, an `activity/` or `activity/archive/` that is a link. Nothing is recorded in a repo listed in `excludes.json`, or inside a model CLI that `learn` started.
16
+
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.
14
18
 
15
19
  **What you see.** A card per live session in **Activity** (`geneseed web`).
16
20
 
17
21
  **Switches.**
18
- - `GENESEED_ACTIVITY=off` — kill switch at startup.
22
+ - `GENESEED_ACTIVITY=off` — kill switch: at startup for the plugin, on every call for the hooks (which then load no writer code at all).
19
23
  - The Activity page's own toggle writes a `.geneseed-activity` flag file, read per event — no restart needed.
20
24
  - `GENESEED_DEBUG=1` — logs each write as `[geneseed-activity] …`.
package/docs/web-ui.md CHANGED
@@ -101,7 +101,7 @@ streams the output of background jobs and keeps their history across reloads.
101
101
 
102
102
  - **Rules** (`#/rules`) — your own standing rules, read from and written to the
103
103
  `user-rules.md` beside the deployed AGENT.md (the seed-once file no update ever
104
- touches). List with scope (project/user/global, or any other scope written by hand, which a
104
+ touches). List with scope (project/global — a hand-written `user` opens as global — or any other scope written by hand, which a
105
105
  save keeps as written) and trial chips, add/edit/retire forms (a body line starting
106
106
  `## ` is refused: the file would read it as a new rule heading), a
107
107
  **Graduate** action that adopts a trial rule for good, and a budget meter that turns
@@ -179,7 +179,8 @@ streams the output of background jobs and keeps their history across reloads.
179
179
  ### 🩺 Care
180
180
 
181
181
  - **Activity** (`#/activity`) — the agent sessions on this machine: each one's status,
182
- the files it touched and its todo progress; open one for its detail.
182
+ the files it touched and its todo progress; open one for its detail. Every host records it:
183
+ the OpenCode plugin, and `geneseed-hook activity` on Claude Code, OpenClaude and Bob.
183
184
  - **Changes** (`#/diff`) — the diff between the deployed harness and the source: edited /
184
185
  added / missing files, and files only behind the source (unedited; a rebuild updates them)
185
186
  listed apart under **Behind source**, with per-file expansion and coloured unified-diff lines. Select
@@ -195,7 +196,9 @@ streams the output of background jobs and keeps their history across reloads.
195
196
  ### 🎨 Setup
196
197
 
197
198
  - **Harness** (`#/harness`) — this machine's own install first (path, voice, footprint,
198
- and when it was built), then the **Voice** reference, then every detected install.
199
+ and when it was built), then the **Voice** reference, then every detected install. A
200
+ **Sync with source** column says whether each install is behind the source (and by how many
201
+ files), in sync or not checked, shows hand edits apart from stale files, and links to Local edits.
199
202
  `#/harnesses` and `#/themes` both still resolve here, so old links and bookmarks keep
200
203
  working.
201
204
  - The **Voice** card is the former Themes tab, kept as a REFERENCE rather than a second
@@ -224,14 +227,13 @@ streams the output of background jobs and keeps their history across reloads.
224
227
  row's staging only when that install's kits changed. A failed rebuild keeps it and says so,
225
228
  and a reload asks first while anything is staged. Files you edited in a kit that is now off are kept,
226
229
  and the row lists them.
227
- - **Settings** (`#/settings`) — a **Console direction** picker (the visual flavour of the
228
- console: Cultivar, Operator, Matrix or Atlas) with a **Dashboard layout** control (Auto follows each theme's designed Status
229
- lens; Cultivar / Greenhouse / Operator / Journal force one regardless of skin), the
230
- install snapshot (deployed/target/theme/version/memory store), a Maintenance card (PATH
231
- link/unlink and Update; each install is uninstalled from its own panel in Hosts), an
232
- offline package download, server controls (Stop), and the **About** colophon — project + creator credits and the source link, folded in from the
233
- retired `#/about` tab (which still resolves here). Build, update, and MCP wiring live in
234
- the Harness tab.
230
+ - **Server** (`#/installs/server`; `#/settings` and `#/about` resolve here) — a settings sheet
231
+ with a section index. **Appearance**: accent, Overview view, console direction. **Machine**:
232
+ version + Update, Add to PATH, the viewed install's footprint. **Server**: running · port ·
233
+ pid · uptime, whether the code matches the disk (with Restart), start-at-login state (read
234
+ only), and the four request guards. **About**: version, changelog, credits, source, creator.
235
+ **Danger zone**: Stop server, Remove from PATH, and a pointer to each install's own
236
+ Uninstall in Hosts.
235
237
 
236
238
  ## Rebuilding the UI
237
239
 
@@ -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.20.0"
5
+ "version": "4.22.0"
6
6
  }
package/js/README.md CHANGED
@@ -93,7 +93,8 @@ user co-owns, and the hook verbs those emitted configs then run.
93
93
  | `hooks-context.mjs` | The `context` verb — SessionStart: session files plus the repo's context docs |
94
94
  | `hooks-done.mjs` | The done gate (#289): on Stop, inside `learn` and before its spawn, blocks a turn that edited files until `.geneseed/done-checks.txt`'s checks passed after the last edit |
95
95
  | `hooks-learn.mjs` | The `learn` verb — Stop/SubagentStop/PreCompact distiller; the hook path's ONE spawn (`$GENESEED_LLM`) |
96
- | `hooks-prims.mjs` | The Python path/text primitives the hook verbs share (`splitLines`, `readStdin`, a never-throwing `isFile`) |
96
+ | `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 |
97
+ | `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 |
97
98
  | `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 |
98
99
  | `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 |
99
100
  | `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 |
@@ -241,7 +242,7 @@ the deployed harness as JSON.
241
242
  | `api.mjs` | The dashboard and settings reads: overview, recent, themes, setup, doctor, diff, installs, excludes, loops |
242
243
  | `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` |
243
244
  | `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) |
244
- | `usage-api.mjs` | `GET /api/usage`: the 30-day skill and agent call counts across every installed harness, the never-fired list, and the 90-day prune of each `notebook/usage.jsonl` |
245
+ | `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` |
245
246
  | `user-files.mjs` | The fingerprint-guarded editors for `user-rules.md` (incl. memory promotion) and `PROFILE.md`, read and write |
246
247
  | `actions.mjs` | The other mutating endpoints — memory delete, MCP, excludes, installs, view, restore — plus install/deploy argv |
247
248
  | `daemon.mjs` | Detached web start/stop/status/restart, the `.geneseed-web.json` record, and `openUrl` |
package/js/cli-table.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "prog": "geneseed",
3
3
  "commands": [
4
+ {
5
+ "name": "activity",
6
+ "help": "UserPromptSubmit/SessionEnd hook: records the session into <root>/activity/ for the web console's live view; decides nothing and prints nothing (off with $GENESEED_ACTIVITY=off or the console toggle)",
7
+ "description": "",
8
+ "positionals": [],
9
+ "options": [
10
+ {
11
+ "names": [
12
+ "--root"
13
+ ],
14
+ "dest": "root",
15
+ "metavar": null,
16
+ "help": "the install's own dir (set by the emitted hook); the snapshots go to <root>/activity/",
17
+ "choices": null,
18
+ "default": null,
19
+ "required": false,
20
+ "nargs": null,
21
+ "is_flag": false,
22
+ "type": null,
23
+ "hidden": false
24
+ },
25
+ {
26
+ "names": [
27
+ "--host"
28
+ ],
29
+ "dest": "host",
30
+ "metavar": null,
31
+ "help": "the host that sent the payload (set by the emitted hook): 'claude' (default), 'openclaude' or 'bob'; recorded in the snapshot",
32
+ "choices": null,
33
+ "default": null,
34
+ "required": false,
35
+ "nargs": null,
36
+ "is_flag": false,
37
+ "type": null,
38
+ "hidden": false
39
+ }
40
+ ],
41
+ "mutex": []
42
+ },
4
43
  {
5
44
  "name": "bootstrap",
6
45
  "help": "update everything (sync + upgrade) with a progress UI, then run setup",