geneseed 3.3.0 → 3.5.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 (231) hide show
  1. package/CHANGELOG.md +323 -0
  2. package/DESIGN.md +11 -14
  3. package/QUICKSTART.md +3 -1
  4. package/README.md +53 -44
  5. package/SETUP.md +25 -27
  6. package/SHIPPED.md +26 -32
  7. package/adapters/bob/README.md +12 -9
  8. package/adapters/copilot/README.md +28 -26
  9. package/adapters/opencode/GLOBAL-HARNESS-SPEC.md +1 -1
  10. package/adapters/opencode/README.md +8 -4
  11. package/adapters/opencode/plugins/geneseed-context.js +5 -3
  12. package/adapters/opencode/plugins/geneseed-workflow.js +30 -3
  13. package/adapters/opencode/workflows/_runtime.js +97 -7
  14. package/bin/build-driver.mjs +5 -1248
  15. package/bin/geneseed-cli.mjs +11 -6
  16. package/bin/geneseed-hook.mjs +4 -2
  17. package/docs/candidate-hosts.md +1 -1
  18. package/docs/design-history.md +37 -37
  19. package/docs/extending.md +49 -27
  20. package/docs/token-footprint.md +52 -26
  21. package/docs/web/agents.md +1 -1
  22. package/docs/web/claude-hooks.md +3 -2
  23. package/docs/web/collaboration.md +2 -2
  24. package/docs/web/first-session.md +2 -2
  25. package/docs/web/footprint.md +2 -2
  26. package/docs/web/harnesses.md +1 -1
  27. package/docs/web/model.md +1 -1
  28. package/docs/web/plugin-workflow.md +1 -0
  29. package/docs/web/rules.md +3 -3
  30. package/docs/web/setup-choices.md +2 -2
  31. package/docs/web/skills.md +1 -1
  32. package/docs/web/themes-author.md +1 -1
  33. package/docs/web-ui.md +18 -10
  34. package/harness.config.json +1 -1
  35. package/js/README.md +6 -5
  36. package/js/build/driver.mjs +1191 -0
  37. package/js/build/emit-claude.mjs +17 -10
  38. package/js/build/emit-common.mjs +4 -4
  39. package/js/build/generate.mjs +1 -1
  40. package/js/build/render.mjs +48 -44
  41. package/js/build/stubs.mjs +1 -1
  42. package/js/build/themes.mjs +4 -4
  43. package/js/build/version.mjs +12 -0
  44. package/js/cli-table.json +21 -6
  45. package/js/hosts/hooks.mjs +89 -74
  46. package/js/hosts/hosts.mjs +19 -2
  47. package/js/hosts/mcp.mjs +14 -20
  48. package/js/hosts/native.mjs +85 -25
  49. package/js/hosts/opencode.mjs +14 -0
  50. package/js/hosts/settings.mjs +52 -104
  51. package/js/inspect/checks-authoring.mjs +117 -3
  52. package/js/inspect/diff.mjs +1 -1
  53. package/js/inspect/doctor.mjs +1 -1
  54. package/js/inspect/excludes.mjs +1 -1
  55. package/js/inspect/inventory.mjs +12 -7
  56. package/js/inspect/scan.mjs +3 -14
  57. package/js/inspect/status.mjs +2 -2
  58. package/js/inspect/validate.mjs +1 -1
  59. package/js/lib/fs.mjs +23 -8
  60. package/js/lib/json.mjs +7 -1
  61. package/js/lib/proc.mjs +6 -4
  62. package/js/maintain/migrate.mjs +1 -1
  63. package/js/maintain/setup.mjs +1 -1
  64. package/js/maintain/uninstall.mjs +17 -15
  65. package/js/ui/cli.mjs +19 -0
  66. package/js/ui/menu.mjs +1 -1
  67. package/js/web/actions.mjs +4 -4
  68. package/js/web/activity.mjs +4 -4
  69. package/js/web/api.mjs +14 -11
  70. package/js/web/daemon.mjs +1 -1
  71. package/js/web/docs.mjs +12 -12
  72. package/js/web/handler.mjs +12 -5
  73. package/js/web/jobs.mjs +1 -1
  74. package/package.json +1 -1
  75. package/registry.json +86 -79
  76. package/src/AGENT.md.tmpl +83 -48
  77. package/src/agents/architect.md +4 -1
  78. package/src/agents/developer.md +2 -2
  79. package/src/agents/explorer.md +2 -0
  80. package/src/agents/operator.md +13 -0
  81. package/src/agents/pragmatist.md +12 -0
  82. package/src/agents/researcher.md +72 -0
  83. package/src/agents/reviewer.md +5 -2
  84. package/src/agents/security.md +7 -1
  85. package/src/agents/skeptic.md +2 -1
  86. package/src/agents/tester.md +5 -1
  87. package/src/agents/user-advocate.md +13 -0
  88. package/src/doctrines/README.md +26 -3
  89. package/src/doctrines/craft.md +78 -5
  90. package/src/doctrines/ops.md +62 -0
  91. package/src/doctrines/process.md +91 -4
  92. package/src/doctrines/rigor.md +41 -1
  93. package/src/laws/universal.md +27 -21
  94. package/src/memory/README.md +4 -2
  95. package/src/modes/foreman.md +5 -5
  96. package/src/notebook/README.md +2 -1
  97. package/src/ontology/universal.md +71 -67
  98. package/src/postures/peer.md +3 -0
  99. package/src/skills/_self-improvement.md +19 -0
  100. package/src/skills/_template.md +1 -12
  101. package/src/skills/brainstorm.md +37 -19
  102. package/src/skills/bruno-collection-generator.md +2 -13
  103. package/src/skills/bruno-test-writer.md +3 -14
  104. package/src/skills/ci-fix.md +49 -0
  105. package/src/skills/codebase-design.md +1 -12
  106. package/src/skills/commit.md +1 -12
  107. package/src/skills/consolidate-memory.md +50 -0
  108. package/src/skills/council.md +1 -12
  109. package/src/skills/daydream/LICENSE +21 -0
  110. package/src/skills/daydream/VENDOR.md +3 -1
  111. package/src/skills/debug.md +1 -12
  112. package/src/skills/deps-audit.md +46 -0
  113. package/src/skills/develop.md +38 -20
  114. package/src/skills/document-project.md +1 -12
  115. package/src/skills/domain-modeling.md +1 -12
  116. package/src/skills/forge-mcp.md +1 -12
  117. package/src/skills/fresh-eyes.md +1 -12
  118. package/src/skills/frontend-design.md +1 -12
  119. package/src/skills/geneseed-code-review.md +7 -14
  120. package/src/skills/geneseed.md +1 -12
  121. package/src/skills/git-archaeology.md +1 -12
  122. package/src/skills/git-rescue.md +1 -12
  123. package/src/skills/handoff.md +1 -12
  124. package/src/skills/herdr.md +1 -12
  125. package/src/skills/ingest.md +1 -12
  126. package/src/skills/migrate.md +1 -12
  127. package/src/skills/opencode-theme.md +1 -12
  128. package/src/skills/parallel-agents.md +4 -15
  129. package/src/skills/pipeline.md +6 -17
  130. package/src/skills/plan.md +1 -12
  131. package/src/skills/ponytail.md +1 -12
  132. package/src/skills/profile.md +1 -12
  133. package/src/skills/prose.md +1 -12
  134. package/src/skills/prototype.md +1 -12
  135. package/src/skills/quiz.md +43 -0
  136. package/src/skills/react-view-transitions/VENDOR.md +7 -1
  137. package/src/skills/refactor.md +1 -12
  138. package/src/skills/release.md +1 -12
  139. package/src/skills/repo-map.md +1 -12
  140. package/src/skills/research.md +5 -13
  141. package/src/skills/review-response.md +1 -12
  142. package/src/skills/roast-me.md +1 -12
  143. package/src/skills/rule.md +1 -12
  144. package/src/skills/security-audit.md +51 -0
  145. package/src/skills/ship.md +1 -12
  146. package/src/skills/skill-forge.md +59 -0
  147. package/src/skills/teach.md +50 -0
  148. package/src/skills/tickets.md +1 -12
  149. package/src/skills/wayfinder.md +1 -12
  150. package/src/skills/wiki.md +1 -12
  151. package/src/skills/workflow.md +82 -26
  152. package/src/skills/worktree.md +52 -0
  153. package/themes/_TEMPLATE.json +15 -12
  154. package/themes/biker.json +14 -11
  155. package/themes/commentator.json +14 -11
  156. package/themes/cyberpunk.json +14 -11
  157. package/themes/gamer.json +14 -11
  158. package/themes/imperial.json +14 -11
  159. package/themes/joker.json +14 -11
  160. package/themes/marvin.json +14 -11
  161. package/themes/mean.json +14 -11
  162. package/themes/military.json +14 -11
  163. package/themes/neutral.json +15 -12
  164. package/themes/opencode/README.md +2 -2
  165. package/themes/pirate.json +14 -11
  166. package/themes/sports.json +14 -11
  167. package/themes/verstappen.json +14 -11
  168. package/themes/wizard.json +14 -11
  169. package/web/dist/assets/Activity-Flgf4kHy.js +1 -0
  170. package/web/dist/assets/ActivityDetail-DIpr85nh.js +1 -0
  171. package/web/dist/assets/CatalogRow-CjyLjaLb.js +1 -0
  172. package/web/dist/assets/Diff-Deisdha8.js +2 -0
  173. package/web/dist/assets/Docs-DGUdY4l4.js +2 -0
  174. package/web/dist/assets/Doctor-F74lJ69P.js +1 -0
  175. package/web/dist/assets/FilterInput-BakJLvaV.js +1 -0
  176. package/web/dist/assets/GreenhouseView-D072lBiD.js +2 -0
  177. package/web/dist/assets/Harness-DNRP2Va7.js +1 -0
  178. package/web/dist/assets/JournalView-DWFqZ0Iw.js +1 -0
  179. package/web/dist/assets/Laws-BN6g3HU7.js +3 -0
  180. package/web/dist/assets/Library-CDOv4emM.js +1 -0
  181. package/web/dist/assets/Markdown-BQAvN8xx.js +38 -0
  182. package/web/dist/assets/OperatorHudView-CwNIUVX8.js +2 -0
  183. package/web/dist/assets/Profile-CpP9BTne.js +1 -0
  184. package/web/dist/assets/Rules-DFXsUCB7.js +1 -0
  185. package/web/dist/assets/Settings-BqZVUtJ5.js +1 -0
  186. package/web/dist/assets/Skills-Cu6kBgfF.js +1 -0
  187. package/web/dist/assets/StatusBadge-Cg6j-NJL.js +1 -0
  188. package/web/dist/assets/activity-iWaWVtsR.js +1 -0
  189. package/web/dist/assets/drawable-BgfrEBer.js +1 -0
  190. package/web/dist/assets/index-CAqrWhKl.js +2 -0
  191. package/web/dist/assets/index-Ruh93A3A.css +1 -0
  192. package/web/dist/assets/jobBuckets-Dbq8ZlWW.js +1 -0
  193. package/web/dist/assets/lawCats-BLgxl151.js +1 -0
  194. package/web/dist/assets/react-DbkvxWG5.js +8 -0
  195. package/web/dist/assets/rolldown-runtime-CbXtAM7H.js +1 -0
  196. package/web/dist/index.html +4 -3
  197. package/web/src/pages/Laws.jsx +22 -8
  198. package/src/skills/clarify.md +0 -28
  199. package/src/skills/crash-course.md +0 -29
  200. package/src/skills/decode.md +0 -29
  201. package/src/skills/drill.md +0 -29
  202. package/src/skills/feynman.md +0 -27
  203. package/src/skills/gap-detector.md +0 -27
  204. package/src/skills/learning-path.md +0 -27
  205. package/src/skills/react-view-transitions/README.md +0 -42
  206. package/src/skills/tdd.md +0 -31
  207. package/web/dist/assets/Activity-BfVcLrda.js +0 -1
  208. package/web/dist/assets/ActivityDetail-CQXccGPl.js +0 -1
  209. package/web/dist/assets/CatalogRow-DALEQImZ.js +0 -1
  210. package/web/dist/assets/Diff-BIjxXx46.js +0 -5
  211. package/web/dist/assets/Doctor-CJLbgsrw.js +0 -1
  212. package/web/dist/assets/FilterInput-CkUCk_lY.js +0 -1
  213. package/web/dist/assets/GreenhouseView-DfC5IILJ.js +0 -2
  214. package/web/dist/assets/Harness-Dm5CCU-v.js +0 -1
  215. package/web/dist/assets/JournalView-Cpu2eI4s.js +0 -1
  216. package/web/dist/assets/Laws-DDDVFuQz.js +0 -3
  217. package/web/dist/assets/Library-Dao3T9na.js +0 -1
  218. package/web/dist/assets/Markdown-C__nuWX5.js +0 -46
  219. package/web/dist/assets/OperatorHudView-DEpCtAjP.js +0 -2
  220. package/web/dist/assets/Profile-BlXtUlh2.js +0 -1
  221. package/web/dist/assets/Rules-DIre6gxR.js +0 -1
  222. package/web/dist/assets/Skills-rY13ZPhM.js +0 -1
  223. package/web/dist/assets/StatusBadge-wW_RS_my.js +0 -1
  224. package/web/dist/assets/activity-DpYPKNrA.js +0 -1
  225. package/web/dist/assets/index-BEZvPvpF.js +0 -1
  226. package/web/dist/assets/index-DNQE5ydy.js +0 -10
  227. package/web/dist/assets/index-DzdQjvM1.css +0 -1
  228. package/web/dist/assets/index-PmQGRS1X.js +0 -2
  229. package/web/dist/assets/jobBuckets-DfTUJUxR.js +0 -1
  230. package/web/dist/assets/lawCats-DUS9UTH4.js +0 -1
  231. package/web/dist/assets/react-DOpiTn5v.js +0 -32
@@ -47,7 +47,7 @@ import {
47
47
  } from 'node:fs';
48
48
  import path from 'node:path';
49
49
 
50
- import { hookRunnerEntry } from '../../bin/build-driver.mjs';
50
+ import { hookRunnerEntry } from '../build/driver.mjs';
51
51
  import { confirm } from './setup.mjs';
52
52
  import {
53
53
  claudeCfg, claudeReadManifest, doctrinesOfDir, emitHostScopeOf, excludedRulesOfDir, installKind,
@@ -60,7 +60,7 @@ import {
60
60
  import { mcpCommented } from '../hosts/mcp.mjs';
61
61
  import {
62
62
  copilotIntegrityCheck, managedBlockRead, managedBlockRemove, managedBlockWrite,
63
- mergeClaudeSettings, mergeCopilotSettings, opencodeTarget, readJsonc,
63
+ mergeClaudeSettings, opencodeTarget, readJsonc,
64
64
  settingsIntegrityCheck, wireClaudeExcludes, unwireClaudeExcludes, unwireClaudeSettings,
65
65
  unwireCopilotSettings,
66
66
  } from '../hosts/settings.mjs';
@@ -347,9 +347,8 @@ export function uninstallGlobal(target, archiveMemory, host = 'opencode') {
347
347
  /**
348
348
  * `_harness_mcp._mcp_load`, reduced to the OpenCode arm.
349
349
  *
350
- * The Claude arm (`.mcp.json`, `~/.claude.json`, parsed with STRICT `json.loads` because the
351
- * comment stripper's trailing-comma pass is not string-aware) belongs to the MCP catalog and
352
- * the TUI, and neither has crossed. `installAgentEntry` is this port's only caller and passes
350
+ * The Claude arm (`.mcp.json`, `~/.claude.json`, parsed STRICTLY — see `mcpLoad` in
351
+ * js/hosts/mcp.mjs for why) lives with the MCP catalog. `installAgentEntry` is this port's only caller and passes
353
352
  * no host, so porting the branch would ship an unreachable arm with no cell and no partition
354
353
  * to be part of — the criterion this port decides keep-vs-delete by.
355
354
  */
@@ -645,7 +644,7 @@ function printSurvivingProjectInventory(removedRoot) {
645
644
  function printOtherHostHits(root, removedHost) {
646
645
  for (const spec of HOSTS) {
647
646
  if (spec.host !== removedHost && projectQualifies(root, spec.host)) {
648
- printOut(`[uninstall] also found ${spec.host}:project here — run \`harness `
647
+ printOut(`[uninstall] also found ${spec.host}:project here — run \`geneseed `
649
648
  + 'uninstall` again to remove it.\n');
650
649
  }
651
650
  }
@@ -1058,15 +1057,18 @@ function cleanHostStash(cfg, host = 'claude') {
1058
1057
  function remergeClaudeHooks(cfg, root = cfg, host = 'claude') {
1059
1058
  const data = claudeReadManifest(cfg);
1060
1059
  const managed = managedOf(data);
1061
- // A Copilot install: its own merge, its own claim key, and none of the pack/exclude axes
1062
- // below — the Copilot gate is not pack-conditional (see `copilotHooks`). Without this
1063
- // branch a Copilot reactivate would write CLAUDE-shaped hook groups into
1064
- // ~/.copilot/settings.json, which Copilot cannot read.
1060
+ // A LEGACY Copilot install (single-slot `copilot_hooks`, the dead `toolCall` event):
1061
+ // reactivating it re-wires the CURRENT Copilot shape — event → array, recorded under
1062
+ // `settings_hooks` — rather than restoring hooks Copilot no longer reads. None of the
1063
+ // pack/exclude axes below apply: the Copilot gate is not pack-conditional.
1065
1064
  if (Array.isArray(managed.copilot_hooks)) {
1066
- const [, claims] = mergeCopilotSettings(settingsFile(cfg, managed), managed.copilot_hooks,
1067
- hookRunnerEntry());
1068
- if (!deepEquals(claims, managed.copilot_hooks) && Object.keys(data).length > 0) {
1069
- managed.copilot_hooks = claims;
1065
+ const sf = settingsFile(cfg, managed);
1066
+ unwireCopilotSettings(sf, managed.copilot_hooks);
1067
+ const [, claims] = mergeClaudeSettings(sf, 'global', null, hookRunnerEntry(), null, [],
1068
+ 'copilot', cfg);
1069
+ if (Object.keys(data).length > 0) {
1070
+ delete managed.copilot_hooks;
1071
+ managed.settings_hooks = claims;
1070
1072
  data.managed = managed;
1071
1073
  const tmp = path.join(cfg, `${GLOBAL_MANIFEST}.tmp`);
1072
1074
  try {
@@ -1098,7 +1100,7 @@ function remergeClaudeHooks(cfg, root = cfg, host = 'claude') {
1098
1100
  : excludedRulesOfDir(cfg);
1099
1101
  // `host` reaches the group builder: a Bob reactivate must re-wire Gemini-named groups.
1100
1102
  const [, claims] = mergeClaudeSettings(settingsFile(cfg, managed), 'global',
1101
- managed.settings_hooks ?? null, hookRunnerEntry(), doctrines, excluded, host);
1103
+ managed.settings_hooks ?? null, hookRunnerEntry(), doctrines, excluded, host, cfg);
1102
1104
  // `and data` — a manifest that did not parse is not one to write back.
1103
1105
  if (!deepEquals(claims, managed.settings_hooks ?? null) && Object.keys(data).length > 0) {
1104
1106
  managed.settings_hooks = claims;
package/js/ui/cli.mjs CHANGED
@@ -441,6 +441,25 @@ export function cliCommand(verb) {
441
441
  * CRLF ON WINDOWS for `die`'s reason: argparse writes through a Python text stream, which
442
442
  * translates, and this text lands in the same terminals and the same pipes as that one.
443
443
  */
444
+ /**
445
+ * `geneseed --help` — every verb with its one-line help, from the same table the per-verb help
446
+ * reads. `verbs` is the entry's own dispatch list, so the listing can name nothing the entry
447
+ * would refuse; a verb the table does not describe still appears, with no help line.
448
+ */
449
+ export function printVerbList(prog, verbs, extra = {}) {
450
+ const helpOf = new Map([...Object.entries(extra),
451
+ ...cliReference().commands.filter((c) => c.help).map((c) => [c.name, c.help])]);
452
+ const names = [...verbs].sort();
453
+ const pad = Math.max(...names.map((n) => n.length)) + 2;
454
+ const lines = [`usage: ${prog} <command> [options]`, '',
455
+ `A bare \`${prog}\` runs \`home\`. \`${prog} <command> --help\` describes one command.`, '',
456
+ 'commands:'];
457
+ for (const n of names) lines.push(` ${n.padEnd(pad)}${helpOf.get(n) || ''}`.trimEnd());
458
+ const text = `${lines.join('\n')}\n`;
459
+ process.stdout.write(process.platform === 'win32' ? text.replaceAll('\n', '\r\n') : text);
460
+ return 0;
461
+ }
462
+
444
463
  export function printHelp(prog, verb) {
445
464
  const cmd = cliCommand(verb);
446
465
  if (cmd === null) return null;
package/js/ui/menu.mjs CHANGED
@@ -45,7 +45,7 @@ import { startDaemon } from '../web/daemon.mjs';
45
45
  function menuHelp() {
46
46
  printOut('Geneseed — no interactive menu here. Get started with: geneseed setup\n');
47
47
  printOut('Other commands: bootstrap · update · build · doctor · diff · tui · web\n');
48
- printOut('On a VT-capable terminal, a bare `./geneseed` opens the interactive menu of these.\n');
48
+ printOut('`geneseed --help` lists every command.\n');
49
49
  return 0;
50
50
  }
51
51
 
@@ -32,7 +32,7 @@ import {
32
32
  import os from 'node:os';
33
33
  import path from 'node:path';
34
34
 
35
- import { emitGlobalInto } from '../../bin/build-driver.mjs';
35
+ import { emitGlobalInto } from '../build/driver.mjs';
36
36
  import {
37
37
  ROOT, discoverNames, knownRuleIds, PACK_ORDER,
38
38
  } from '../build/source.mjs';
@@ -127,7 +127,7 @@ function bodyExcludeRules(body) {
127
127
  const splitWords = (s) => s.split(new RegExp(`[${WHITESPACE}]+`)).filter(Boolean);
128
128
 
129
129
  /** Today's date, LOCAL (not UTC) — this is a user-facing date, not a wire timestamp. */
130
- export function todayIso(d = new Date()) {
130
+ function todayIso(d = new Date()) {
131
131
  const p2 = (n) => String(n).padStart(2, '0');
132
132
  return `${d.getFullYear()}-${p2(d.getMonth() + 1)}-${p2(d.getDate())}`;
133
133
  }
@@ -278,13 +278,13 @@ const rulesPath = (state) => path.join(state.target, RULES_FILE);
278
278
  * `max(ids) + 1`. Widening this to match would only move the gap one line down, to whatever
279
279
  * parses the captured digits back into a number.
280
280
  */
281
- export const RULE_HEAD_RE = new RegExp(
281
+ const RULE_HEAD_RE = new RegExp(
282
282
  `^##[${WHITESPACE}]+R(\\d+)[${WHITESPACE}]*[—–-]+[${WHITESPACE}]*`
283
283
  + `([^${WHITESPACE}].*?)[${WHITESPACE}]*$`,
284
284
  );
285
285
 
286
286
  /** Advisory only; nothing blocks past it. */
287
- export const RULES_BUDGET = { max_rules: 15, max_tokens: 1500 };
287
+ const RULES_BUDGET = { max_rules: 15, max_tokens: 1500 };
288
288
 
289
289
  const META_RE = new RegExp(`^\\((.+)\\)[${WHITESPACE}]*$`);
290
290
 
@@ -48,7 +48,7 @@ import { NotFound, stemOf } from './api.mjs';
48
48
  * platform where the probe cannot tell. Generous on purpose: streaming bumps `updated_at`
49
49
  * constantly, so only a genuinely abandoned (process-still-alive) session ages out.
50
50
  */
51
- export const ACTIVITY_STALE_SECONDS = 1800;
51
+ const ACTIVITY_STALE_SECONDS = 1800;
52
52
 
53
53
  const nowSeconds = () => Date.now() / 1000;
54
54
 
@@ -66,7 +66,7 @@ const activityFlag = (state) => path.join(state.target, '.geneseed-activity');
66
66
  * default every user who has never toggled is in. An undecodable flag file is not treated
67
67
  * specially: Node substitutes U+FFFD and reads on rather than raising.
68
68
  */
69
- export function activityEnabled(state) {
69
+ function activityEnabled(state) {
70
70
  let raw;
71
71
  try {
72
72
  raw = readText(activityFlag(state));
@@ -97,7 +97,7 @@ function toIntOr(raw) {
97
97
  }
98
98
 
99
99
  /** Best-effort liveness for the writer process. See this file's header. */
100
- export function pidAlive(raw) {
100
+ function pidAlive(raw) {
101
101
  const pid = toIntOr(raw);
102
102
  if (pid === null || pid <= 0) return false;
103
103
  try {
@@ -161,7 +161,7 @@ function isLive(entry, now) {
161
161
  * missing dir is `[]`, a garbage file is skipped (and kept — only a snapshot that PARSED and
162
162
  * failed the liveness test is unlinked), newest first.
163
163
  */
164
- export function activityEntries(state) {
164
+ function activityEntries(state) {
165
165
  const d = activityDir(state);
166
166
  if (!isDir(d)) return [];
167
167
  const now = nowSeconds();
package/js/web/api.mjs CHANGED
@@ -201,7 +201,7 @@ export function specDesc(fm, body) {
201
201
  * plumbing rather than prose, which is what makes a deployed entry the same shape as a
202
202
  * source-rendered one and every consumer indifferent to the origin.
203
203
  */
204
- export function specEntries(root, nested) {
204
+ function specEntries(root, nested) {
205
205
  const out = [];
206
206
  if (!isDir(root)) return out;
207
207
  let names;
@@ -238,7 +238,7 @@ export function specEntries(root, nested) {
238
238
  * the walk. So the catalogue is always whole, and which packs this INSTALL built in comes from
239
239
  * its own carrier via `doctrinesForBuild`, which resolves "no marker" to every pack.
240
240
  */
241
- export function deployedInventory(state) {
241
+ function deployedInventory(state) {
242
242
  const render = tuiInventory(state.theme, doctrinesForBuild(state.target),
243
243
  excludedRulesOfDir(state.target));
244
244
  const registry = loadRegistry();
@@ -259,7 +259,7 @@ export function deployedInventory(state) {
259
259
  }
260
260
 
261
261
  /** The deployed record when there is one, else the source render. */
262
- export function inventoryFor(state) {
262
+ function inventoryFor(state) {
263
263
  return deployed(state) ? deployedInventory(state) : tuiInventory(state.theme);
264
264
  }
265
265
 
@@ -305,7 +305,7 @@ export function memoryItems(state) {
305
305
  });
306
306
  }
307
307
 
308
- export function notebookItems(state) {
308
+ function notebookItems(state) {
309
309
  const d = notebookDir(state);
310
310
  if (!isDir(d)) return [];
311
311
  return globMd(d).map((n) => ({
@@ -319,7 +319,7 @@ const CONFIG_META = {
319
319
  'wiki.jsonc': ['Wiki manifest', 'your machine-wide knowledge base(s)'],
320
320
  };
321
321
 
322
- export function configItems(state) {
322
+ function configItems(state) {
323
323
  const out = [];
324
324
  for (const fname of ['context.json', 'wiki.jsonc']) {
325
325
  const p = path.join(state.target, fname);
@@ -331,7 +331,7 @@ export function configItems(state) {
331
331
  return out;
332
332
  }
333
333
 
334
- export const WIKI_FILE_CAP = 5000;
334
+ const WIKI_FILE_CAP = 5000;
335
335
 
336
336
  /**
337
337
  * `resolvePath` for a path that came out of a HAND-MAINTAINED manifest — `null`, never a throw.
@@ -419,7 +419,10 @@ export function wikiItems(state) {
419
419
  // blank every OTHER vault in it.
420
420
  const root = wikiPath(String(dget(w, 'path', null) || ''));
421
421
  if (!root || !isDir(root)) continue;
422
- const entries = (dget(w, 'entries', null) || [])
422
+ // A hand-edited `entries` that is not a list (`{}`, a string) is a malformed vault, not a
423
+ // crash: `/api/status` counts these, and one bad manifest must not fail the dashboard.
424
+ const rawEntries = dget(w, 'entries', null);
425
+ const entries = (Array.isArray(rawEntries) ? rawEntries : [])
423
426
  .filter((e) => e && typeof e === 'object' && !Array.isArray(e));
424
427
  const excludes = entries.filter((e) => dget(e, 'load', null) === 'exclude')
425
428
  .map((e) => String(dget(e, 'path', null) || '').replace(/^\/+|\/+$/g, '').replace(/\\/g, '/'));
@@ -450,7 +453,7 @@ export function wikiItems(state) {
450
453
  }
451
454
 
452
455
  /** One page by `<wiki>:<relpath>`, never outside the vault. */
453
- export function apiWikiItem(state, name) {
456
+ function apiWikiItem(state, name) {
454
457
  const at = name.indexOf(':');
455
458
  const wname = at < 0 ? name : name.slice(0, at);
456
459
  const rel = (at < 0 ? '' : name.slice(at + 1))
@@ -497,7 +500,7 @@ function flatName(name) {
497
500
  }
498
501
  }
499
502
 
500
- export const WIKILINK_RE = /\[\[([^\]]+)\]\]/g;
503
+ const WIKILINK_RE = /\[\[([^\]]+)\]\]/g;
501
504
 
502
505
  /**
503
506
  * `[[name]]` matched against known agent and skill names.
@@ -746,9 +749,9 @@ export function apiInstalls(state) {
746
749
 
747
750
  /** Beside the deployed AGENT.md. */
748
751
  export const PROFILE_FILE = 'PROFILE.md';
749
- export const profilePath = (state) => path.join(state.target, PROFILE_FILE);
752
+ const profilePath = (state) => path.join(state.target, PROFILE_FILE);
750
753
 
751
- export function apiProfile(state) {
754
+ function apiProfile(state) {
752
755
  const p = profilePath(state);
753
756
  if (!isFile(p)) return { exists: false, path: p, text: '', fingerprint: '' };
754
757
  const text = readMaybe(p) ?? '';
package/js/web/daemon.mjs CHANGED
@@ -83,7 +83,7 @@ export async function probe(url, timeout = 1.5) {
83
83
  }
84
84
 
85
85
  /** The token-carrying POST `geneseed web stop` and the in-page Stop button both send. */
86
- export async function postShutdown(url, token, timeout = 3.0) {
86
+ async function postShutdown(url, token, timeout = 3.0) {
87
87
  try {
88
88
  const res = await fetch(`${url}/api/shutdown`, {
89
89
  method: 'POST',
package/js/web/docs.mjs CHANGED
@@ -24,7 +24,7 @@ import { readJsonMaybe, readMaybe } from '../hosts/installs.mjs';
24
24
  import { resolvePath } from '../hosts/hosts.mjs';
25
25
  import { parseJson } from '../lib/json.mjs';
26
26
  import { isFile } from '../lib/fs.mjs';
27
- import { normcase } from '../lib/paths.mjs';
27
+ import { normcase, within } from '../lib/paths.mjs';
28
28
  import { WHITESPACE, stripWhitespace } from '../lib/text.mjs';
29
29
  import { statusData } from '../inspect/status.mjs';
30
30
  import { originDisplay } from '../maintain/update.mjs';
@@ -39,7 +39,7 @@ const DOC_DIR = path.join(ROOT, 'docs', 'web');
39
39
  * covers every key these pages use and parses with the standard library. A value that is
40
40
  * not valid JSON is kept as the raw string, which is how `title: Something` works.
41
41
  */
42
- export function docFrontmatter(text) {
42
+ function docFrontmatter(text) {
43
43
  const marker = '---\n';
44
44
  if (!text.startsWith(marker)) return [{}, text];
45
45
  const rest = text.slice(marker.length);
@@ -109,8 +109,13 @@ export function docGroups() {
109
109
  */
110
110
  const GLOSSARY_KEYS = [
111
111
  // The three tiers, in constitutional order and before the entities — a reader who does not
112
- // know what an Ontology is here cannot read the rest of the glossary's first rows.
113
- ['Ontology', 'ONTOLOGY', 'the always-on worldview under the rules — telos, evidence, '
112
+ // know what an Ethos is here cannot read the rest of the glossary's first rows.
113
+ //
114
+ // `Ethos (Ontology)` for the same reason as `Rule (Law)` below: the neutral theme renamed
115
+ // what a reader SEES, while the address the reader will meet in `src/ontology/`, in the
116
+ // `ONTOLOGY` theme key and in every identifier did not move. The parenthesis is the bridge
117
+ // between the two, and the glossary is the one page that owes a reader that bridge.
118
+ ['Ethos (Ontology)', 'ONTOLOGY', 'the always-on worldview under the rules — telos, evidence, '
114
119
  + 'decisions, conduct; it holds the Pact'],
115
120
  ['Rule (Law)', 'LAW', 'one of the nine always-on invariants: what is never done'],
116
121
  ['Rules (Laws)', 'LAWS', 'the body of always-on invariants'],
@@ -126,8 +131,9 @@ const GLOSSARY_KEYS = [
126
131
  ['Wiki', 'WIKI', 'the machine-wide knowledge base'],
127
132
  // Still a token, still themed, but it names a CONCEPT INSIDE the ontology's Telos now
128
133
  // rather than a peer of the Rules — `src/postures/peer.md` cites it and the section that
129
- // used to carry it is the Ontology.
130
- ['Pact', 'PACT', "the two-way collaboration contract, stated in the Ontology's Telos"],
134
+ // used to carry it is the Ethos.
135
+ ['Pact', 'PACT', 'the two-way collaboration contract, stated in Telos, the first Ethos '
136
+ + 'section'],
131
137
  ['Posture', null, 'the relationship register the agent works in '
132
138
  + '(peer, mentor, expert, assistant, artisan)'],
133
139
  ['Mode', null, 'how work gets executed — direct (the agent works every '
@@ -357,12 +363,6 @@ function readDocSource(rel) {
357
363
  return readMaybe(target) ?? '';
358
364
  }
359
365
 
360
- function within(child, parent) {
361
- const c = normcase(child).split(/[\\/]/);
362
- const p = normcase(parent).split(/[\\/]/);
363
- return p.length <= c.length && p.every((seg, i) => c[i] === seg);
364
- }
365
-
366
366
  /** The deployed theme's words beside the neutral ones. */
367
367
  function glossary(state) {
368
368
  const load = (theme) => {
@@ -62,6 +62,13 @@ export function makeHandler(state, jm, token, dist, holder = null) {
62
62
  // syscall against the readFileSync + gzipSync it saves. `gz` is the gzipped body,
63
63
  // computed once on the first gzip-accepting request instead of per request.
64
64
  const staticCache = new Map();
65
+ // `dist` RESOLVED ONCE, because every path compared against it below is resolved too.
66
+ // `resolvePath` is `realpathSync.native`, so a checkout reached by any path that is not its
67
+ // canonical one — a symlink, a Windows junction, a `subst` or mapped drive, an 8.3 short name,
68
+ // a lowercase drive letter — made `fp.startsWith(dist + sep)` false for EVERY asset. Each one
69
+ // then fell back to index.html at `text/html`, the browser refused the module script, and the
70
+ // page stayed blank with nothing logged on either side.
71
+ const distReal = resolvePath(dist);
65
72
 
66
73
  function sendBytes(res, body, ctype, code = 200, extra = null, acceptEncoding = '', gzStore = null) {
67
74
  const headers = { ...(extra || {}) };
@@ -86,12 +93,12 @@ export function makeHandler(state, jm, token, dist, holder = null) {
86
93
 
87
94
  function serveStatic(res, path, acceptEncoding) {
88
95
  const rel = (path === '/' || path === '') ? 'index.html' : path.replace(/^\/+/, '');
89
- const index = resolvePath(join(dist, 'index.html'));
90
- let fp = resolvePath(join(dist, rel));
96
+ const index = join(distReal, 'index.html');
97
+ let fp = resolvePath(join(distReal, rel));
91
98
  // STRICTLY under `dist`: `fp === dist` itself must also take the fallback below, which
92
- // is why this checks `fp !== dist` and not just the prefix.
93
- if (!(fp.startsWith(dist + sep) && fp !== dist) && fp !== index) fp = join(dist, 'index.html');
94
- if (!isFile(fp)) fp = join(dist, 'index.html');
99
+ // is why this checks `fp !== distReal` and not just the prefix.
100
+ if (!(fp.startsWith(distReal + sep) && fp !== distReal) && fp !== index) fp = index;
101
+ if (!isFile(fp)) fp = index;
95
102
  if (!isFile(fp)) {
96
103
  return sendJson(res, { error: 'web/dist missing — run the UI build' }, 500, acceptEncoding);
97
104
  }
package/js/web/jobs.mjs CHANGED
@@ -98,7 +98,7 @@ import { jsonDumpsCompact, parseJson, isTruthy } from '../lib/json.mjs';
98
98
  * NEVER THROWS: it runs from `cancel()` and from the crash path in `_run`'s `catch`, and an
99
99
  * exception in either would leave the child alive with the manager believing it dead.
100
100
  */
101
- export function killJobTree(child) {
101
+ function killJobTree(child) {
102
102
  try {
103
103
  if (process.platform === 'win32') {
104
104
  // The one machine primitive with no Node equivalent — see this module's header.
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": "3.3.0",
4
+ "version": "3.5.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",