geneseed 4.23.0 → 4.24.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 (59) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/SHIPPED.md +1 -1
  3. package/adapters/opencode/plugins/geneseed-context.js +1 -1
  4. package/docs/concepts/footprint.md +2 -2
  5. package/docs/concepts/foreman-mode.md +20 -12
  6. package/docs/guides/choose-your-setup.md +2 -2
  7. package/docs/guides/setup-footprint.md +1 -1
  8. package/docs/reference/glossary.md +1 -1
  9. package/docs/web-ui.md +5 -4
  10. package/harness.config.json +1 -1
  11. package/js/hosts/hooks-context.mjs +1 -1
  12. package/js/maintain/memory.mjs +1 -0
  13. package/js/maintain/setup.mjs +1 -1
  14. package/js/web/actions.mjs +27 -1
  15. package/js/web/catalog.mjs +10 -2
  16. package/js/web/daemon.mjs +27 -8
  17. package/js/web/handler.mjs +29 -9
  18. package/js/web/update-check.mjs +6 -4
  19. package/js/web/user-files.mjs +34 -11
  20. package/package.json +1 -1
  21. package/src/AGENT.md.tmpl +1 -1
  22. package/src/modes/README.md +1 -1
  23. package/src/modes/foreman.md +45 -26
  24. package/src/skills/pipeline.md +2 -2
  25. package/src/skills/rule.md +2 -1
  26. package/web/dist/assets/Activity-DvmB7N8g.js +1 -0
  27. package/web/dist/assets/{ActivityDetail-BsVbLWoA.js → ActivityDetail-Bd1ul_B-.js} +1 -1
  28. package/web/dist/assets/CopyButton-BnPdDHls.js +1 -0
  29. package/web/dist/assets/Dashboard-DtJ0xrcA.js +2 -0
  30. package/web/dist/assets/Docs-Bt9FAScn.js +5 -0
  31. package/web/dist/assets/GreenhouseView-BBCsUAcJ.js +1 -0
  32. package/web/dist/assets/Installs-BHxWO-Ev.js +3 -0
  33. package/web/dist/assets/{JournalView-e6BBAz6i.js → JournalView-CLf3j4Ar.js} +1 -1
  34. package/web/dist/assets/{KitApply-Bz6_5yec.js → KitApply-BaDKgnO8.js} +1 -1
  35. package/web/dist/assets/Kits-DmqZkK4K.js +1 -0
  36. package/web/dist/assets/Laws-BcUWCQvl.js +3 -0
  37. package/web/dist/assets/Library-CuRHfeqT.js +2 -0
  38. package/web/dist/assets/Loops-D7VflI8x.js +2 -0
  39. package/web/dist/assets/OperatorHudView-BxKeM_Lk.js +1 -0
  40. package/web/dist/assets/{Personal-BwZ33bqc.js → Personal-Bpl90lqc.js} +1 -1
  41. package/web/dist/assets/RailCats-BuJD4Jou.js +1 -0
  42. package/web/dist/assets/{Tabs-ByiD3mPQ.js → Tabs-kIqas9Tj.js} +1 -1
  43. package/web/dist/assets/index-IuDNqPEl.css +1 -0
  44. package/web/dist/assets/index-UNxZecs3.js +3 -0
  45. package/web/dist/index.html +2 -2
  46. package/web/dist/sw.js +10 -2
  47. package/web/dist/assets/Activity-GdsfJgQQ.js +0 -1
  48. package/web/dist/assets/Dashboard-CnO_bsfz.js +0 -2
  49. package/web/dist/assets/Docs-DctLhPHX.js +0 -4
  50. package/web/dist/assets/GreenhouseView-CC1wDg4u.js +0 -1
  51. package/web/dist/assets/Installs-D3fE87tF.js +0 -3
  52. package/web/dist/assets/Kits-BtNHZ7_Z.js +0 -1
  53. package/web/dist/assets/Laws-B2X2jIE9.js +0 -3
  54. package/web/dist/assets/Library-BXHx4pFJ.js +0 -2
  55. package/web/dist/assets/Loops-B_wNVFEN.js +0 -2
  56. package/web/dist/assets/OperatorHudView-BcPPpykd.js +0 -1
  57. package/web/dist/assets/RailCats-BtIstKaH.js +0 -1
  58. package/web/dist/assets/index-BX3zc2Yi.css +0 -1
  59. package/web/dist/assets/index-D2VlAlpK.js +0 -3
package/CHANGELOG.md CHANGED
@@ -8,6 +8,26 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [4.24.0] — 2026-10-25
12
+
13
+ Minor: wave V7 — the audit's open findings: server hardening (generic 500s, one folder dialog, safe Reveal, 404 for missing assets), retired rules in a never-loaded file, a service worker that caches real assets only, confirms before Update and Rebuild all, an accessibility pass and a design pass; plus memory topics and run chips.
14
+
15
+ ### Fixed
16
+ - **Accessibility**: Genome cells are links; loop rings are labelled groups with no dead tab stops; off-pack rule rows keep full contrast and an unclipped focus ring; the command palette shows focus; accent and chart colours use text tokens in every mode; touch targets reach 44 px on coarse pointers; the docs outline moves focus; docs pages, Copy buttons and status hints have real names; a blocked session is announced.
17
+ - **Console design pass**: voice accent dots removed (they promised a tint that never applied); a skin change resets a custom accent; Update is labelled by install kind; the Settings footprint is read-only with a link to Hosts; Docs article first, constitution map and loop flows legible on phones; Activity panels fold to one column; dead CSS removed.
18
+ - **Retire keeps the rule's text**: it moves to `user-rules-retired.md` beside user-rules.md, a file no session loads or lists; retired ids are never reused. A server fault answers a fixed message (the detail goes to the server log); a name with a control character is refused; a missing asset is a 404, not the page shell; the folder picker opens one dialog at a time; Reveal opens folders in Explorer directly, so `%VAR%` in a path is never expanded.
19
+ - **Update and Rebuild all ask first** and name the active installs; a per-project install inside a worktree is flagged; onboarding shows only when no install is active; the Ledger's Open goes to Hosts and reports a refused selection; an update check in flight reads "checking…"; while a job runs every kit Apply waits; kit member chips no longer say "not installed" for a kit that is on elsewhere.
20
+ - **The service worker no longer caches an HTML fallback as a script**, which broke a page after a rebuild until its cache was cleared; the cache is renamed so the bad copy is dropped everywhere.
21
+ - **Console robustness**: the boot splash gives up after 8 s with Retry; a failed harness switch says so; a preset write error survives the poll; a stale loop link says it is gone; loop rings stay in their box; "Today" counts by calendar day; Constitution survives odd hashes and a zero rule budget; Library clears stale errors and guesses the right skill path; Docs About renders its text and shows the version; one shared Copy button reports a failed copy.
22
+
23
+ ### Changed
24
+ - **Memory facts are grouped by topic** in the Library and Personal › Memory: each catalog row carries its `topic` (frontmatter `topic`, else `type`, else `misc`, slugged as the memory store does).
25
+ - **The Greenhouse, Operator and Operator HUD dashboards show recent runs as run chips**: adjacent identical runs fold into one chip (×N), with outcome, scope, age and duration bars; the raw command stays a tooltip.
26
+
27
+ ## [4.23.1] — 2026-10-25
28
+
29
+ Patch: the Overview cost card follows the viewed install and names its parts.
30
+
11
31
  ## [4.23.0] — 2026-10-25
12
32
 
13
33
  Minor: the web console redesign (wave V6b) — every page rebuilt from the approved mockups, the reader at full width, recently ended sessions in Activity, and parallel-agents watching its units.
@@ -28,6 +48,7 @@ Minor: the web console redesign (wave V6b) — every page rebuilt from the appro
28
48
  - **parallel-agents watches its units** the way the pipeline watches a crew: a result without its check, or one still waiting, is acted on at once, never waited on.
29
49
 
30
50
  ### Fixed
51
+ - **The Overview's cost card follows the install you view** and says what it measures: "Loaded every turn", that install's total, its parts with their tokens, and the range across all installs on one line.
31
52
  - **The Overview's root-file card follows the install you view** (the topbar picker) instead of always showing the fleet's worst; `/api/fleet` rows carry `selected`.
32
53
  - **The Library reader's text takes the full width** of the reader instead of stopping at 76 characters, and usage is one card: the count, then the last day, window and hosts on one line, over a sparkline that spans the card.
33
54
  - **Console bars say each number once.** Gate asks, Doctrine packs and the context budget no longer print a legend under the bar repeating the name and count beside it; pack rows line up in one grid; the Library reader shows usage to the right of the description when wide enough, under it otherwise.
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.23.0**.
23
+ > string. Current label: **4.24.0**.
24
24
 
25
25
  ## Capabilities
26
26
 
@@ -507,7 +507,7 @@ async function discover(root) {
507
507
  if (!e.isFile()) continue
508
508
  const abs = path.join(root, e.name)
509
509
  if (EAGER_ROOT.has(e.name)) add(eager, abs)
510
- else if (isDoc(e.name)) add(lazy, abs) // misc root .md / .adoc
510
+ else if (isDoc(e.name) && e.name !== "user-rules-retired.md") add(lazy, abs) // retired rules are never loaded // misc root .md / .adoc
511
511
  }
512
512
 
513
513
  // 2. Doc trees (recursive) -> lazy.
@@ -5,7 +5,7 @@ title: "Footprint (lean vs full)"
5
5
  kind: "concept"
6
6
  section: "Configuration"
7
7
  description: "Lean or full: how much of the constitution rides inline every turn."
8
- link: {"hash": "#/settings", "label": "Toggle it in Settings →"}
8
+ link: {"hash": "#/installs/hosts", "label": "Change it on Hosts →"}
9
9
  ---
10
10
  **Footprint** decides how much of the [constitution](rules.md) the agent carries *inline* in its instructions file on every turn. It has two settings, **lean** (the default) and **full**, chosen per install. It is a token-cost dial, not a rules dial: every rule the install adopted is in force at either setting.
11
11
 
@@ -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** — the **Footprint** toggle in Settings flips the current install and rebuilds it; on the Harness page, each install has its own dropdown. 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 viewed install's footprint 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
@@ -4,14 +4,14 @@ order: 16
4
4
  title: "Foreman mode"
5
5
  kind: "concept"
6
6
  section: "Working together"
7
- description: "Direct or foreman: whether the session does the work or hands it to a crew."
7
+ description: "Direct or foreman: whether the session does the work or hands it to a task worker."
8
8
  link: {"hash": "#/harness", "label": "Set the mode in Harness →"}
9
9
  ---
10
- **Mode** decides how work gets executed in a session. Two modes ship: **direct**, the default, where the agent does every task itself, and **foreman**, where the session hands substantial tasks to a crew of [agents](agents.md) and keeps talking to you while they work.
10
+ **Mode** decides how work gets executed in a session. Two modes ship: **direct**, the default, where the agent does every task itself, and **foreman**, where the session hands each task that would block it to a background [agent](agents.md) and keeps talking to you while it works.
11
11
 
12
12
  > **You already know this:** a tech lead with a team. Quick questions get answered on the spot; a real feature becomes a ticket that someone builds on a branch, and the lead reviews the result before it is merged.
13
13
 
14
- Mode is chosen at build time, so it does not drift mid-session, and kept across every rebuild and re-theme. It is separate from [posture](collaboration.md) (the relationship register), the doctrine packs ([Rules](rules.md)) and [footprint](footprint.md). It is also separate from a [loop](loops.md) — a pipeline is a one-shot, uncommitted crew for a single task; a loop is a long-running state machine that commits each validated iteration on its own branch.
14
+ Mode is chosen at build time, so it does not drift mid-session, and kept across every rebuild and re-theme. It is separate from [posture](collaboration.md) (the relationship register), the doctrine packs ([Rules](rules.md)) and [footprint](footprint.md). It is also separate from a [loop](loops.md) — a task worker or a pipeline is a one-shot, uncommitted run for a single task; a loop is a long-running state machine that commits each validated iteration on its own branch.
15
15
 
16
16
  ### direct — the default
17
17
 
@@ -21,16 +21,24 @@ The agent works every task itself, turn by turn. Nothing is spawned; you talk to
21
21
 
22
22
  The session sorts every request:
23
23
 
24
- - **Substantial** — handed to a **pipeline** running in the background. The session tells you it is running and stays free to answer you. A task counts as substantial when any one of these holds: it changes two or more files, it needs a new or changed test, it needs about five reads or searches before the first edit, or it asks for a feature, a fix, a review, an audit or an investigation.
25
- - **Trivial** — none of those holds: a question answered from what is already in context, a one-file tweak, a single command. Done directly, as in direct mode.
24
+ - **Delegated** — handed to one **task worker** running in the background. The session tells you it is running and stays free to answer you. A task is delegated when any one of these holds: it will run a command longer than about a minute (a test suite, a build, a canary), it will change three or more files, or it can run beside work already in flight while you keep talking.
25
+ - **Inline** — none of those holds: a question, a read-and-explain, an edit to one or two files with a quick check, a short investigation. Done directly, as in direct mode.
26
26
 
27
- When the session is unsure, it delegates. The count exists because "substantial" left to judgement lost every time to the host's own default of doing small work in place.
27
+ When the session is unsure, it delegates. The test is still a count, because "substantial" left to judgement lost every time to the host's own default of doing small work in place. The count asks what would block the session, not how big the task looks.
28
28
 
29
- Expect a substantial task to cost more (a crew runs instead of one agent) in exchange for a session that never blocks on a long job.
29
+ ### The task worker
30
+
31
+ A task worker is one `developer` agent in its own git worktree. It explores, implements and tests in a single context, loading skills as it needs them, so nothing it read is lost in a hand-off. After two repair rounds on its own failing tests it returns with its findings instead of looping.
32
+
33
+ When a worker returns green with a diff that touches two or more files or changes logic, the session sends a `reviewer` only your request and the diff — never the worker's reasoning — for a blind check. A failing verdict goes back to the same worker.
34
+
35
+ The session keeps a ledger in its notebook (`notebook/foreman-ledger.md`), one line per task: the task, the agent id, the worktree and the state. A correction, a follow-up or a reviewer finding goes back to **the same worker**, which resumes with everything it already knows. A new worker starts only when the old one cannot be resumed, and it receives a note of the ask, the diff so far and what was tried. A worker serves one task and retires once that task is merged or dropped.
36
+
37
+ > **Why not a crew by default?** Splitting a task by role — one agent reads, the next builds, the next tests — passes each result on as a summary, and the next agent reads the code again. Anthropic's guide [When to fold subagents into your main agent loop](https://claude.com/resources/articles/building-agents-when-to-fold-subagents-into-your-main-agent-loop) found one loop with skills usually beats that, and keeps separate agents for verification, parallel work and context that would overflow. The blind reviewer is that kind of split.
30
38
 
31
39
  ### What a pipeline is
32
40
 
33
- A **pipeline** is a small crew of agents working one task in isolation. The minimum crew depends on the task:
41
+ A **pipeline** is the opt-in alternative: a small crew of agents working one task in isolation. The session runs one when you ask for a pipeline or a crew, or when a large task needs several specialists. The minimum crew depends on the task:
34
42
 
35
43
  | Task | Minimum crew |
36
44
  | --- | --- |
@@ -45,15 +53,15 @@ The crew works in its own git worktree and branch. When worktrees are unavailabl
45
53
 
46
54
  Inside the crew, the developer implements and the tester runs the tests and lint. Failures go back to the developer for at most two repair rounds, then to one fresh developer carrying the tester's findings; if that fails too, the crew stops and reports the failure, leaving the branch for you to inspect.
47
55
 
48
- ### A pipeline never commits or merges
56
+ ### Neither commits nor merges
49
57
 
50
- When the crew is done, it hands back its worktree **uncommitted**, with the raw test and lint output and the list of files it changed. Then the session:
58
+ When a worker or a crew is done, it hands back its worktree **uncommitted**, with the raw test and lint output and the list of files it changed. Then the session:
51
59
 
52
- 1. re-runs the tests and lint itself — the crew's log is the crew's account, not proof;
60
+ 1. re-runs the tests and lint itself — its log is its own account, not proof;
53
61
  2. shows you the diff and the green output;
54
62
  3. commits and merges **only once you accept**.
55
63
 
56
- Commit, push and merge belong to the session alone, under *Consent Before Push* ([Rules](rules.md)). A crew that cannot get to green reports back instead of landing broken work.
64
+ Commit, push and merge belong to the session alone, under *Consent Before Push* ([Rules](rules.md)). A worker or crew that cannot get to green reports back instead of landing broken work.
57
65
 
58
66
  You can also start a pipeline without foreman mode: ask the agent to "run a pipeline" for a task, and the `pipeline` [skill](skills.md) takes it from there.
59
67
 
@@ -43,9 +43,9 @@ Pick **peer** unless you know you want another register. A theme changes the pro
43
43
  ## Mode: who does the work
44
44
 
45
45
  - **direct** *(default)*: the agent works every task itself, turn by turn.
46
- - **foreman**: the session sorts each incoming task. A trivial task gets a direct answer. A substantial task goes to a small crew of agents (a **pipeline**) running in its own git worktree, while the session keeps answering you.
46
+ - **foreman**: the session sorts each incoming task. A small task gets done inline. A task that would block the session goes to one background **task worker** in its own git worktree, while the session keeps answering you; corrections go back to the same worker. A crew of agents (a **pipeline**) runs only when you ask for one.
47
47
 
48
- A pipeline never commits or merges. It hands back its worktree uncommitted, together with its test and lint output. The session then re-runs those commands itself, shows you the diff and the passing output, and commits and merges only after you accept. Foreman mode costs more per substantial task, because several agents run instead of one. In exchange, the session stays responsive.
48
+ A worker never commits or merges. It hands back its worktree uncommitted, together with its test and lint output. The session then re-runs those commands itself, shows you the diff and the passing output, and commits and merges only after you accept. Foreman mode costs more per delegated task, because a worker and sometimes a reviewer run beside the session. In exchange, the session stays responsive.
49
49
 
50
50
  ```
51
51
  geneseed build --emit opencode-global --mode foreman
@@ -40,7 +40,7 @@ geneseed build --emit opencode-global --trust prudent
40
40
  You have three ways to change a choice:
41
41
 
42
42
  - **Re-run the wizard** with `geneseed setup`. It pre-selects what the install already has, so holding Enter cannot widen a set you narrowed on purpose. The wizard does not ask about single rules, but it keeps any rule exclusions already in place.
43
- - **Use the web console** (`geneseed web`). **Settings** and the **Harnesses** page change theme, footprint and the rest per install. **Constitution** toggles packs and rules.
43
+ - **Use the web console** (`geneseed web`). the **Hosts** page changes theme, footprint and the rest per install. **Constitution** toggles packs and rules.
44
44
  - **Run the build yourself.** Watch out: a flag you leave out takes the *generator's* default, not your install's current value. `geneseed status --json` prints, for every install, the exact `geneseed build` command that rebuilds it as it is. Start from that command and change the one flag you want.
45
45
 
46
46
  ---
@@ -26,7 +26,7 @@ Every word Geneseed uses that you would not find in a general programming glossa
26
26
  | Wiki | WIKI | the machine-wide knowledge base | your personal notes, shared with the agent |
27
27
  | Pact | PACT | the two-way collaboration contract, stated in Telos, the first Ethos section | a working agreement |
28
28
  | Posture | — | the relationship register the agent works in (peer, mentor, expert, assistant, artisan) | pairing style |
29
- | Mode | — | how work gets executed — direct (the agent works every task itself) or foreman (substantial tasks spawn an isolated pipeline) | solo vs. delegating to a sub-team |
29
+ | Mode | — | how work gets executed — direct (the agent works every task itself) or foreman (tasks that would block the session go to a background task worker) | solo vs. delegating to a sub-team |
30
30
  | Footprint | — | how much of the Rules loads inline each turn (full vs lean) | eager vs. lazy loading |
31
31
  | Kit | — | an opt-in bundle of skills, agents and rules for one stack, switched on per install with `--kits`; not a doctrine pack | an optional dependency group (`pkg[extra]`) |
32
32
  | Loop | — | a requirement worked as small, validated, committed iterations on their own branch, driven by `geneseed loop` | a state machine over a ticket's steps |
package/docs/web-ui.md CHANGED
@@ -34,7 +34,7 @@ always get the command list.
34
34
  - **Installable (PWA).** A manifest + service worker make it installable as a standalone
35
35
  app; immutable assets are cached, while HTML and `/api/*` stay on the network so the
36
36
  CSRF token never goes stale.
37
- - **First run with nothing deployed.** The Dashboard shows an **onboarding wizard**
37
+ - **First run with nothing active.** When no install on the machine is active, the Overview shows an **onboarding wizard**
38
38
  (pick a voice → install mode → deploy) instead of a dead end.
39
39
 
40
40
  ## Security model
@@ -104,7 +104,7 @@ streams the output of background jobs and keeps their history across reloads.
104
104
  - **Rules** (`#/rules`) — your own standing rules, read from and written to the
105
105
  `user-rules.md` beside the deployed AGENT.md (the seed-once file no update ever
106
106
  touches). List with scope (project/global — a hand-written `user` opens as global — or any other scope written by hand, which a
107
- save keeps as written) and trial chips, add/edit/retire forms (a body line starting
107
+ 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
108
  `## ` is refused: the file would read it as a new rule heading), a
109
109
  **Graduate** action that adopts a trial rule for good, and a budget meter that turns
110
110
  amber as the always-loaded set gets heavy. Every write carries the fingerprint of the
@@ -234,8 +234,9 @@ streams the output of background jobs and keeps their history across reloads.
234
234
  and a reload asks first while anything is staged. Files you edited in a kit that is now off are kept,
235
235
  and the row lists them.
236
236
  - **Server** (`#/installs/server`; `#/settings` and `#/about` resolve here) — a settings sheet
237
- with a section index. **Appearance**: skin, accent, Overview view. **Machine**:
238
- version + Update, Add to PATH, the viewed install's footprint. **Server**: running · port ·
237
+ with a section index. **Appearance**: skin, accent (a skin change resets it to the skin's own), Overview view. **Machine**:
238
+ version + Update (labelled by how this copy updates: git pull, npm install -g, or the command
239
+ to run by hand), Add to PATH, the viewed install's footprint (read-only, links to Hosts). **Server**: running · port ·
239
240
  pid · uptime, whether the code matches the disk (with Restart), start-at-login state (read
240
241
  only), and the four request guards; the index marks Server with a good/warn dot. **About**: version, changelog, credits, source, creator.
241
242
  **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.23.0"
5
+ "version": "4.24.0"
6
6
  }
@@ -229,7 +229,7 @@ export function discoverContext(root, host = HOST) {
229
229
  const name = path.basename(full);
230
230
  if (native.includes(name)) continue;
231
231
  if (EAGER_ROOT.includes(name)) eager.set(full, null);
232
- else if (isDoc(name)) lazy.set(full, null);
232
+ else if (isDoc(name) && name !== 'user-rules-retired.md') lazy.set(full, null); // retired rules are never loaded
233
233
  }
234
234
  for (const d of LAZY_DIRS) {
235
235
  const sub = path.join(root, d);
@@ -47,6 +47,7 @@ const RESERVED = ['memory', 'readme'];
47
47
  /** Whether `name` is a fact this verb may act on — the endpoint's rule, plus the case fold. */
48
48
  export function isFactName(name) {
49
49
  return Boolean(name) && !name.includes('/') && !name.includes('\\')
50
+ && ![...name].some((c) => c.charCodeAt(0) < 0x20 || c.charCodeAt(0) === 0x7f)
50
51
  && !RESERVED.includes(name.toLowerCase());
51
52
  }
52
53
 
@@ -90,7 +90,7 @@ const POSTURE_BLURBS = {
90
90
  /** `_harness_setup.MODE_BLURBS`. */
91
91
  const MODE_BLURBS = {
92
92
  direct: 'the agent works every task itself, turn by turn (default)',
93
- foreman: 'triages tasks, spawns pipelines for substantial work',
93
+ foreman: 'triages tasks, hands blocking work to task workers',
94
94
  };
95
95
 
96
96
  /**
@@ -278,8 +278,13 @@ function runPicker(cmd, args, done, resultOf) {
278
278
  * (no GUI session, or a platform with no branch below), the process still answers — an
279
279
  * `{error}` — never a hang, because `runPicker`'s timeout and `error` handlers both fire
280
280
  * `done` on their own.
281
+ *
282
+ * ONE DIALOG AT A TIME (`singleFlight`, below): a second click while one is open would stack
283
+ * another dialog behind it, each held up to the picker's timeout.
281
284
  */
282
- export function apiPickFolder(done) {
285
+ export const apiPickFolder = singleFlight(pickFolderOnce);
286
+
287
+ function pickFolderOnce(done) {
283
288
  if (process.platform === 'win32') {
284
289
  // `which`, never a bare name: Windows resolves a bare name against the cwd first.
285
290
  const powershell = which('powershell');
@@ -301,6 +306,27 @@ export function apiPickFolder(done) {
301
306
  return done({ error: 'no native folder dialog on this platform' });
302
307
  }
303
308
 
309
+ /**
310
+ * `fn(done)` with at most one call pending. A call made while one is pending answers busy at
311
+ * once — with an `error`, because the three clients read only `path` and `error`. The latch
312
+ * is released inside the wrapped `done`, so it lasts exactly as long as the pick: an answer
313
+ * given synchronously (no powershell, no dialog branch) never holds it, and `runPicker`'s
314
+ * close, error and timeout paths all end in `done`.
315
+ */
316
+ export function singleFlight(fn) {
317
+ let pending = false;
318
+ return (done) => {
319
+ if (pending) return done({ busy: true, error: 'a folder dialog is already open on this machine' });
320
+ pending = true;
321
+ try {
322
+ return fn((result) => { pending = false; done(result); });
323
+ } catch (e) {
324
+ pending = false; // a throw before any child exists must not latch the picker shut
325
+ throw e;
326
+ }
327
+ };
328
+ }
329
+
304
330
  // ---- memory ------------------------------------------------------------------------------
305
331
 
306
332
  /**
@@ -15,7 +15,7 @@ import path from 'node:path';
15
15
 
16
16
  import { GLOBAL_MANIFEST, resolvePath } from '../hosts/hosts.mjs';
17
17
  import { doctrinesForBuild, excludedRulesOfDir, readMaybe } from '../hosts/installs.mjs';
18
- import { frontmatter } from '../hosts/memory-files.mjs';
18
+ import { frontmatter, readFacts } from '../hosts/memory-files.mjs';
19
19
  import {
20
20
  SKILL_CLASS, entityStatus, loadRegistry, tuiInventory,
21
21
  } from '../inspect/inventory.mjs';
@@ -164,9 +164,15 @@ function globMd(dir) {
164
164
  /** Filename without its extension — single owner, imported by `js/web/activity.mjs` too. */
165
165
  export const stemOf = (name) => name.slice(0, name.length - path.extname(name).length);
166
166
 
167
+ /**
168
+ * Each fact row carries the `topic` the store files it under, so the console can group the list.
169
+ * Read through `readFacts`, the store's own reader, so the slug rule (`topic:`, else `type:`,
170
+ * else `misc`) has one home. MEMORY and README are not facts there, so their rows have none.
171
+ */
167
172
  export function memoryItems(state) {
168
173
  const d = memoryDir(state);
169
174
  if (!isDir(d)) return [];
175
+ const facts = readFacts(d);
170
176
  return globMd(d).map((n) => {
171
177
  const p = path.join(d, n);
172
178
  const [fm] = frontmatter(readMaybe(p) ?? '');
@@ -175,6 +181,7 @@ export function memoryItems(state) {
175
181
  name: stem,
176
182
  title: fm.has('name') ? fm.get('name') : stem,
177
183
  desc: fm.has('description') ? fm.get('description') : '',
184
+ topic: facts.get(stem)?.topic,
178
185
  source: resolvePath(p),
179
186
  };
180
187
  });
@@ -373,7 +380,8 @@ function apiWikiItem(state, name) {
373
380
  */
374
381
  function flatName(name) {
375
382
  if (!name || name.includes('/') || name.includes('\\') || name.includes('..')
376
- || name.includes(':')) {
383
+ || name.includes(':') || [...name].some((c) => c.charCodeAt(0) < 0x20 || c.charCodeAt(0) === 0x7f)) {
384
+ // Control characters too: a NUL made the fs layer throw, surfacing as a 500 (SE-8).
377
385
  throw new NotFound(name);
378
386
  }
379
387
  }
package/js/web/daemon.mjs CHANGED
@@ -218,14 +218,8 @@ export function requestRestart(theme) {
218
218
  * Every failure here is swallowed — a machine with no browser opener configured must not
219
219
  * crash a server that is otherwise working fine.
220
220
  */
221
- export function openUrl(url) {
222
- const [file, args, extra] = process.platform === 'win32'
223
- // `start` is a cmd BUILTIN, not a program. The empty `""` is its title argument —
224
- // without it `start "http://…"` treats the quoted URL as the window title and opens
225
- // nothing. Verbatim args because Node would otherwise re-quote the whole string.
226
- ? [process.env.COMSPEC || 'cmd.exe', ['/d', '/s', '/c', `start "" "${url}"`],
227
- { windowsVerbatimArguments: true }]
228
- : (process.platform === 'darwin' ? ['open', [url], {}] : ['xdg-open', [url], {}]);
221
+ export function openUrl(url, folder = false) {
222
+ const [file, args, extra] = openerCommand(url, folder);
229
223
  try {
230
224
  const child = spawn(file, args, {
231
225
  detached: true, stdio: 'ignore', windowsHide: true, ...extra,
@@ -244,6 +238,31 @@ export function openUrl(url) {
244
238
  } catch { /* spawn itself can still throw synchronously on some platforms; same rule */ }
245
239
  }
246
240
 
241
+ /** Reveal: a folder in Explorer / Finder / the file manager. */
242
+ export const openFolder = (dir) => openUrl(dir, true);
243
+
244
+ /**
245
+ * `[file, args, spawnOptions]` for `openUrl` — pure, so the argv is testable without putting a
246
+ * window on screen.
247
+ *
248
+ * A WINDOWS FOLDER GOES TO EXPLORER, NEVER THROUGH cmd. A folder is a filesystem string, and
249
+ * `cmd /c start "" "<dir>"` expands any `%VAR%` inside it even quoted. `explorer.exe <dir>`
250
+ * takes it as one argv element, quoted by Node. By ABSOLUTE path, since Windows resolves a
251
+ * bare name against the cwd first.
252
+ * @returns {[string, string[], { windowsVerbatimArguments?: boolean }]}
253
+ */
254
+ export function openerCommand(target, folder = false) {
255
+ if (process.platform === 'win32') {
256
+ if (folder) return [join(process.env.SystemRoot || 'C:\\Windows', 'explorer.exe'), [target], {}];
257
+ // `start` is a cmd BUILTIN, not a program. The empty `""` is its title argument —
258
+ // without it `start "http://…"` treats the quoted URL as the window title and opens
259
+ // nothing. Verbatim args because Node would otherwise re-quote the whole string.
260
+ return [process.env.COMSPEC || 'cmd.exe', ['/d', '/s', '/c', `start "" "${target}"`],
261
+ { windowsVerbatimArguments: true }];
262
+ }
263
+ return process.platform === 'darwin' ? ['open', [target], {}] : ['xdg-open', [target], {}];
264
+ }
265
+
247
266
  export async function startDaemon(theme, port, openBrowser = true) {
248
267
  const { target } = webState(theme);
249
268
  const st = await liveDaemon(target);
@@ -18,7 +18,7 @@ import {
18
18
  apiDeployCmd, apiInstallCmd, apiPickFolder, apiRestore, buildActionCmds, mcpTargetPaths, rebuildCmds,
19
19
  } from './actions.mjs';
20
20
  import { BadRequest, NotFound } from './catalog.mjs';
21
- import { openUrl, requestRestart } from './daemon.mjs';
21
+ import { openFolder, requestRestart } from './daemon.mjs';
22
22
  import { apiDocs, apiDocsPage } from './docs.mjs';
23
23
  import { actionCommands, updatePlan } from './jobs.mjs';
24
24
  import { POST_ROUTES, PREFIX_ROUTES, STATE_ROUTES, readJsonBody } from './routes.mjs';
@@ -165,6 +165,11 @@ export function makeHandler(state, jm, token, dist, holder = null) {
165
165
  // STRICTLY under `dist`: `fp === dist` itself must also take the fallback below, which
166
166
  // is why this checks `fp !== distReal` and not just the prefix.
167
167
  if (!(fp.startsWith(distReal + sep) && fp !== distReal) && fp !== index) fp = index;
168
+ // A missing /assets/* file is a 404, never the HTML shell: served as 200, a rebuild's
169
+ // momentary gap got cached under a chunk URL and broke the page (SH-27).
170
+ if (!isFile(fp) && rel.startsWith('assets/')) {
171
+ return sendJson(res, { error: 'not found' }, 404, acceptEncoding);
172
+ }
168
173
  if (!isFile(fp)) fp = index;
169
174
  if (!isFile(fp)) {
170
175
  return sendJson(res, { error: 'web/dist missing — run the UI build' }, 500, acceptEncoding);
@@ -256,9 +261,8 @@ export function makeHandler(state, jm, token, dist, holder = null) {
256
261
  // it is the same allowlist — `mcpTargetPaths()`, one function with two callers rather than
257
262
  // two copies that drift. An unlisted path is a 404 before anything is opened. Without it
258
263
  // this is "ask the desktop to open any path on the machine", behind a CSRF token and
259
- // nothing else, and on Windows `openUrl` interpolates into a `cmd` command line with
260
- // `windowsVerbatimArguments` — so the exact-match lookup is also what bounds the strings
261
- // that can ever reach a shell to the ones the machine's own install registry produced.
264
+ // nothing else. (No shell sees the path: on Windows `openFolder` hands it to explorer.exe
265
+ // as one argv element, so a `%VAR%` in a folder name is never expanded.)
262
266
  //
263
267
  // THE FOLDER, NOT THE FILE. `open`/`start`/`xdg-open` on a `.json` hands it to whatever
264
268
  // claims that extension — which on a stock Windows box is a browser, i.e. a read-only view
@@ -270,10 +274,10 @@ export function makeHandler(state, jm, token, dist, holder = null) {
270
274
  return sendJson(res, { error: `not found: ${want || '(none)'}` }, 404, ae);
271
275
  }
272
276
  const dir = dirname(want);
273
- // `openUrl` SWALLOWS EVERY FAILURE BY DESIGN (a headless box has no opener), so `ok` here
277
+ // `openFolder` SWALLOWS EVERY FAILURE BY DESIGN (a headless box has no opener), so `ok` here
274
278
  // means "the path was allowed and the request was made", never "a window appeared". The
275
279
  // response says which directory, so the UI can print it as the fallback instruction.
276
- openUrl(dir);
280
+ openFolder(dir);
277
281
  return sendJson(res, { ok: true, dir }, 200, ae);
278
282
  }
279
283
  if (path === '/api/pick-folder') {
@@ -452,24 +456,40 @@ export function makeHandler(state, jm, token, dist, holder = null) {
452
456
  } catch (e) {
453
457
  // `apiSelectView`, `apiMemoryDelete`, `apiRulesMutate` and `apiRulesPromote` all
454
458
  // raise `NotFound` for an unknown target, mapped to 404
455
- // here; anything else falls to the 500 arm below, carrying its own message.
459
+ // here; anything else falls to the generic 500 (`SERVER_FAULT`, below).
456
460
  if (e instanceof NotFound) {
457
461
  return sendJson(res, { error: `not found: ${e.message}` }, 404, ae);
458
462
  }
459
463
  // A body the route refused on its content (a rule body with a `## ` heading) is
460
464
  // the caller's to fix: 400, not the 500 of a server fault.
461
465
  if (e instanceof BadRequest) return sendJson(res, { error: e.message }, 400, ae);
462
- return sendJson(res, { error: String(e && e.message ? e.message : e) }, 500, ae);
466
+ logFault(req, path, e);
467
+ return sendJson(res, SERVER_FAULT, 500, ae);
463
468
  }
464
469
  });
465
470
  }
466
471
  return sendJson(res, { error: 'not found' }, 404, ae);
467
472
  } catch (e) {
468
- return sendJson(res, { error: String(e && e.message ? e.message : e) }, 500, ae);
473
+ logFault(req, path, e);
474
+ return sendJson(res, SERVER_FAULT, 500, ae);
469
475
  }
470
476
  };
471
477
  }
472
478
 
479
+ /** What every 500 answers: one fixed string, so no fault ever echoes its own message. */
480
+ const SERVER_FAULT = { error: 'internal error — the details are in the server log' };
481
+
482
+ /**
483
+ * A server fault: the detail to stderr, a fixed string to the client. A thrown message carries
484
+ * whatever the route held — `path.join` puts an absolute path in it — and the page that shows
485
+ * `error` is no place for that. The daemon's stderr IS `.geneseed-web.log` (`spawnDetached`);
486
+ * a foreground server prints it to its terminal, which is why the message names neither.
487
+ * Method and path only, never headers or body: the token rides in a header.
488
+ */
489
+ function logFault(req, path, e) {
490
+ process.stderr.write(`[geneseed web] 500 ${req.method} ${path}: ${(e && e.stack) || String(e)}\n`);
491
+ }
492
+
473
493
  /**
474
494
  * `Handler._harness` — the `?harness=` query param, `null` when absent.
475
495
  *
@@ -49,9 +49,10 @@ async function npmLatest() {
49
49
  }
50
50
 
51
51
  /**
52
- * `{ current, latest, available, checked_at }`. `available` is true only when `latest` is
53
- * semver-greater than `current`, so a checkout ahead of the last release never shows one;
54
- * null when either side is unknown. `fetcher` and `now` are injectable for the tests, which
52
+ * `{ current, latest, available, checked_at, checking }`. `available` is true only when
53
+ * `latest` is semver-greater than `current`, so a checkout ahead of the last release never
54
+ * shows one; null when either side is unknown. `checking` is true while the ask is in flight:
55
+ * the chip says "checking…" and re-asks soon, not "unavailable" for up to an hour. `fetcher` and `now` are injectable for the tests, which
55
56
  * must never reach the network.
56
57
  */
57
58
  export function updateStatus(state, current, { fetcher = npmLatest, now = Date.now() } = {}) {
@@ -60,7 +61,8 @@ export function updateStatus(state, current, { fetcher = npmLatest, now = Date.n
60
61
  const c = daily(state, '_update', fetcher, now,
61
62
  fetcher === npmLatest && process.env.NODE_TEST_CONTEXT);
62
63
  const available = current && c.value ? semverGreater(c.value, current) : null;
63
- return { current: current ?? null, latest: c.value, available, checked_at: c.checked_at };
64
+ return { current: current ?? null, latest: c.value, available, checked_at: c.checked_at,
65
+ checking: c.inflight };
64
66
  }
65
67
 
66
68
  /**
@@ -186,8 +186,8 @@ function ruleBlock(rid, title, scope, source, trialUntil, body) {
186
186
  }
187
187
 
188
188
  /**
189
- * Validate and normalise a rule's writable fields. Throws (→ the shell's JSON 500 carrying
190
- * the message) on an unusable rule.
189
+ * Validate and normalise a rule's writable fields. Throws `BadRequest` (→ the shell's 400,
190
+ * carrying the message) on an unusable rule.
191
191
  *
192
192
  * `\p{Nd}` here and not `\d`, unlike `RULE_HEAD_RE` above: this is a pure predicate over a
193
193
  * string that stays a string, so accepting any Unicode decimal digit costs nothing and
@@ -239,7 +239,19 @@ function ruleId(v) {
239
239
  }
240
240
 
241
241
  /**
242
- * Add / update / delete on user-rules.md.
242
+ * Where a retired rule goes: a SEPARATE file beside user-rules.md that nothing ever loads. It is
243
+ * not a session file, so its text never reaches an agent's context and cannot be obeyed by
244
+ * mistake; it exists so a retire never loses the text. Like user-rules.md it is the user's: no
245
+ * install manifest claims it, so no uninstall deletes it.
246
+ */
247
+ export const RETIRED_RULES_FILE = 'user-rules-retired.md';
248
+ const RETIRED_HEADER = '# Retired rules — not in force, never loaded into any session.\n';
249
+ const isBlank = (line) => !stripWhitespace(line);
250
+
251
+ /**
252
+ * Add / update / retire on user-rules.md. Retire is op `delete` on the wire (the client's
253
+ * name for it), but it never loses the text: the block moves, verbatim, to the end of
254
+ * `RETIRED_RULES_FILE`, which the first retire creates.
243
255
  *
244
256
  * EVERY MUTATION REQUIRES THE FINGERPRINT OF THE CONTENT THE CLIENT LAST READ. An agent
245
257
  * session may be editing the same file mid-flight, so a stale write returns `ok: false`
@@ -258,11 +270,14 @@ export function apiRulesMutate(state, body) {
258
270
  detail: 'user-rules.md changed since you loaded it — reloading' };
259
271
  }
260
272
  const [rules] = parseRules(text);
273
+ const retiredPath = path.join(state.target, RETIRED_RULES_FILE);
261
274
  let rid;
262
275
  let next;
263
276
  if (op === 'add') {
264
277
  const [title, rtext, scope, source, trial] = ruleFields(body);
265
- rid = rules.reduce((mx, r) => (r.id > mx ? r.id : mx), 0) + 1;
278
+ // A retired id is never handed out again, so an id in the user's history names one rule.
279
+ const [retired] = parseRules(readMaybe(retiredPath) ?? '');
280
+ rid = [...rules, ...retired].reduce((mx, r) => (r.id > mx ? r.id : mx), 0) + 1;
266
281
  if (!text) text = '# User rules\n';
267
282
  next = `${text.replace(/\n+$/, '')}\n\n${ruleBlock(rid, title, scope, source, trial, rtext)}`;
268
283
  } else {
@@ -270,17 +285,25 @@ export function apiRulesMutate(state, body) {
270
285
  const target = rules.find((r) => r.id === rid);
271
286
  if (target === undefined) throw new NotFound(`rule R${rid}`);
272
287
  const lines = splitLines(text);
288
+ // The block's own lines, without the blank separator after it: that separator is the seam
289
+ // with whatever follows, so it stays where it is.
290
+ let end = target.end;
291
+ while (end > target.start + 1 && isBlank(lines[end - 1])) end -= 1;
273
292
  if (op === 'update') {
274
293
  const [title, rtext, scope, source, trial] = ruleFields(body);
275
294
  const block = ruleBlock(rid, title, scope, source, trial, rtext);
276
- lines.splice(target.start, target.end - target.start,
277
- ...splitLines(block.replace(/\n+$/, '')));
295
+ lines.splice(target.start, end - target.start, ...splitLines(block.replace(/\n+$/, '')));
278
296
  } else {
279
- // delete — also swallow ONE preceding blank separator line, or repeated deletes leave
280
- // a growing run of blank lines in the user's file.
281
- let start = target.start;
282
- if (start > 0 && !stripWhitespace(lines[start - 1])) start -= 1;
283
- lines.splice(start, target.end - start);
297
+ const moved = lines.splice(target.start, end - target.start);
298
+ // Two blanks now meet at the seam; drop one, or repeated retires grow a run of them.
299
+ if (target.start > 0 && target.start < lines.length
300
+ && isBlank(lines[target.start - 1]) && isBlank(lines[target.start])) {
301
+ lines.splice(target.start, 1);
302
+ }
303
+ // THE RETIRED FILE FIRST: if the second write fails, the rule is in both files, never in
304
+ // neither.
305
+ const kept = (readMaybe(retiredPath) ?? RETIRED_HEADER).replace(/\n+$/, '');
306
+ writeText(retiredPath, `${kept}\n\n${moved.join('\n')}\n`);
284
307
  }
285
308
  next = `${lines.join('\n').replace(/\n+$/, '')}\n`;
286
309
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "Every field here is argued and gated in tests/unit/package_manifest.test.mjs. `files`, `bin` and `engines` each have a test that fails when reality drifts from this file; `version` mirrors harness.config.json and is gated too. Read that docblock before editing this one.",
3
3
  "name": "geneseed",
4
- "version": "4.23.0",
4
+ "version": "4.24.0",
5
5
  "description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
6
6
  "keywords": [
7
7
  "ai",
package/src/AGENT.md.tmpl CHANGED
@@ -262,7 +262,7 @@ the ten council seats are convened by the [council {{SKILL}}]({{DIR_SKILLS}}/cou
262
262
  | [roast-me]({{DIR_SKILLS}}/roast-me.md) | you want your own ask, plan or idea torn apart, brutally and actionably (code goes to code review) |
263
263
  | [council]({{DIR_SKILLS}}/council.md) | a decision, change, or discussion needs debating from several points of view before committing |
264
264
  | [workflow]({{DIR_SKILLS}}/workflow.md) | deterministic, code-driven orchestration of subagents (fan-out, find→verify, phased handoff) and the host exposes a workflow tool |
265
- | [pipeline]({{DIR_SKILLS}}/pipeline.md) | foreman mode triages a substantial task, or the user asks to run a crew (analyst → developer → tester) on one, isolated in its own worktree and merged on mechanical proof |
265
+ | [pipeline]({{DIR_SKILLS}}/pipeline.md) | the user asks for a crew, or foreman mode needs several specialists (analyst → developer → tester) on one, isolated in its own worktree and merged on mechanical proof |
266
266
  | [loop]({{DIR_SKILLS}}/loop.md) | the user asks to run a loop |
267
267
  | [brick-forge]({{DIR_SKILLS}}/brick-forge.md) | a new or adapted loop brick |
268
268
  | [wiki]({{DIR_SKILLS}}/wiki.md) | consulting or growing the user's machine-wide knowledge base declared in `geneseed-wiki.jsonc` (§8) |