geneseed 5.4.0 → 5.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 (162) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +30 -0
  3. package/SHIPPED.md +1 -1
  4. package/adapters/bob/README.md +12 -1
  5. package/adapters/opencode/README.md +2 -1
  6. package/adapters/opencode/plugins/geneseed-context.js +71 -10
  7. package/adapters/opencode/plugins/geneseed-guard.js +101 -19
  8. package/adapters/opencode/plugins/geneseed-learn.js +641 -6
  9. package/bin/geneseed-cli.mjs +3 -0
  10. package/bin/geneseed-hook.mjs +2 -1
  11. package/docs/concepts/agents.md +13 -1
  12. package/docs/concepts/enforcement-table.md +1 -1
  13. package/docs/concepts/foreman-mode.md +22 -3
  14. package/docs/concepts/hook-gates.md +1 -1
  15. package/docs/concepts/hooks.md +22 -5
  16. package/docs/concepts/host-matrix.md +2 -2
  17. package/docs/concepts/hosts.md +1 -1
  18. package/docs/concepts/shared-tier.md +1 -1
  19. package/docs/concepts/skills.md +21 -1
  20. package/docs/concepts/themes.md +1 -1
  21. package/docs/extending.md +10 -1
  22. package/docs/guides/install-clone.md +18 -0
  23. package/docs/guides/install-scripted.md +8 -2
  24. package/docs/guides/install.md +19 -1
  25. package/docs/guides/upgrade.md +1 -1
  26. package/docs/reference/env-context.md +1 -1
  27. package/docs/reference/environment.md +1 -1
  28. package/docs/reference/plugin-learn.md +4 -0
  29. package/docs/reference/profiles.md +142 -0
  30. package/docs/token-footprint.md +9 -4
  31. package/docs/understand/design-choices-engineering.md +1 -1
  32. package/docs/web-ui.md +3 -1
  33. package/harness.config.json +1 -1
  34. package/js/README.md +9 -2
  35. package/js/build/args.mjs +4 -3
  36. package/js/build/catalog.mjs +11 -1
  37. package/js/build/driver.mjs +42 -11
  38. package/js/build/emit-claude.mjs +24 -1
  39. package/js/build/emit-opencode.mjs +3 -0
  40. package/js/build/export.mjs +1 -1
  41. package/js/build/generate.mjs +2 -1
  42. package/js/build/notes-migrate.mjs +99 -0
  43. package/js/build/profile.mjs +14 -6
  44. package/js/build/render.mjs +34 -10
  45. package/js/build/source.mjs +85 -2
  46. package/js/cli-table.json +164 -4
  47. package/js/hosts/agent-runs.mjs +205 -0
  48. package/js/hosts/done-checks.mjs +3 -1
  49. package/js/hosts/hooks-done.mjs +91 -16
  50. package/js/hosts/hooks-learn.mjs +85 -0
  51. package/js/hosts/hooks-prims.mjs +39 -1
  52. package/js/hosts/hooks.mjs +6 -3
  53. package/js/hosts/hosts.mjs +10 -0
  54. package/js/hosts/installs.mjs +25 -1
  55. package/js/hosts/link.mjs +45 -10
  56. package/js/hosts/native.mjs +42 -5
  57. package/js/hosts/opencode.mjs +1 -1
  58. package/js/hosts/settings.mjs +72 -0
  59. package/js/hosts/spec-feedback.mjs +538 -0
  60. package/js/hosts/usage.mjs +67 -8
  61. package/js/inspect/agent-scores.mjs +118 -0
  62. package/js/inspect/checks-authoring.mjs +2 -1
  63. package/js/inspect/checks-build.mjs +20 -4
  64. package/js/inspect/checks-repo.mjs +27 -2
  65. package/js/inspect/cost.mjs +6 -5
  66. package/js/inspect/diff.mjs +25 -5
  67. package/js/inspect/doctor.mjs +4 -0
  68. package/js/inspect/status.mjs +3 -1
  69. package/js/inspect/validate.mjs +1 -0
  70. package/js/lib/machine-dir.mjs +8 -0
  71. package/js/lib/paths.mjs +4 -1
  72. package/js/maintain/profile-scope.mjs +145 -0
  73. package/js/maintain/profiles.mjs +486 -0
  74. package/js/maintain/setup.mjs +409 -15
  75. package/js/maintain/uninstall.mjs +4 -1
  76. package/js/maintain/update.mjs +1 -1
  77. package/js/web/actions.mjs +28 -38
  78. package/js/web/api.mjs +7 -2
  79. package/js/web/handler.mjs +8 -0
  80. package/js/web/jobs.mjs +5 -4
  81. package/js/web/profiles-api.mjs +201 -0
  82. package/js/web/routes.mjs +5 -0
  83. package/package.json +2 -1
  84. package/profiles/guillaume-claude-global.json +16 -0
  85. package/profiles/starter.json +14 -0
  86. package/src/AGENT.md.tmpl +1 -1
  87. package/src/agents/_self-improvement.md +15 -7
  88. package/src/agents/_template.md +4 -2
  89. package/src/agents/advocate.md +1 -1
  90. package/src/agents/architect.md +1 -1
  91. package/src/agents/developer.md +10 -3
  92. package/src/agents/devops-engineer.md +1 -1
  93. package/src/agents/docker-expert.md +1 -1
  94. package/src/agents/docs.md +1 -1
  95. package/src/agents/empiricist.md +1 -1
  96. package/src/agents/explorer.md +4 -2
  97. package/src/agents/framer.md +1 -1
  98. package/src/agents/historian.md +1 -1
  99. package/src/agents/kubernetes-specialist.md +1 -1
  100. package/src/agents/memory-curator.md +1 -1
  101. package/src/agents/operator.md +1 -1
  102. package/src/agents/performance.md +1 -1
  103. package/src/agents/pragmatist.md +1 -1
  104. package/src/agents/react-engineer.md +1 -1
  105. package/src/agents/react-reviewer.md +1 -1
  106. package/src/agents/researcher.md +1 -1
  107. package/src/agents/reviewer.md +10 -3
  108. package/src/agents/security.md +1 -1
  109. package/src/agents/skeptic.md +1 -1
  110. package/src/agents/spring-boot-engineer.md +1 -1
  111. package/src/agents/spring-reviewer.md +1 -1
  112. package/src/agents/spring-security.md +1 -1
  113. package/src/agents/steward.md +1 -1
  114. package/src/agents/tester.md +4 -2
  115. package/src/agents/user-advocate.md +1 -1
  116. package/src/agents/visionary.md +1 -1
  117. package/src/memory/README.md +12 -2
  118. package/src/modes/foreman.md +23 -10
  119. package/src/skill-descriptions.json +63 -0
  120. package/src/skills/_self-improvement.md +42 -26
  121. package/src/skills/_template.md +3 -1
  122. package/src/skills/brainstorm.md +35 -22
  123. package/src/skills/daydream/VENDOR.md +6 -0
  124. package/src/skills/diagram-design/VENDOR.md +4 -0
  125. package/src/skills/explain-changes/VENDOR.md +5 -1
  126. package/src/skills/parallel-agents.md +11 -0
  127. package/src/skills/pipeline.md +3 -3
  128. package/src/skills/plan.md +5 -4
  129. package/src/skills/react-view-transitions/VENDOR.md +7 -1
  130. package/src/skills/release.md +7 -2
  131. package/src/skills/rule/approve.md +2 -1
  132. package/src/skills/skill-forge.md +5 -3
  133. package/src/skills/token-report/VENDOR.md +5 -1
  134. package/src/upstreams.json +2 -2
  135. package/themes/README.md +3 -1
  136. package/web/dist/assets/{ActiveLoops-BJJN3P-V.js → ActiveLoops-DOJCPPPc.js} +1 -1
  137. package/web/dist/assets/{Activity-D2kOc3yi.js → Activity-LKsDzsnK.js} +1 -1
  138. package/web/dist/assets/{ActivityDetail-By3xOr21.js → ActivityDetail-DhwTfPm6.js} +1 -1
  139. package/web/dist/assets/{Bonsai-CBWDTBA4.js → Bonsai-CePMLrpr.js} +1 -1
  140. package/web/dist/assets/{CopyButton-BVbpriMB.js → CopyButton-CuoaJ6k7.js} +1 -1
  141. package/web/dist/assets/{Dashboard-CIJLPHM9.js → Dashboard-D1VKuvLe.js} +2 -2
  142. package/web/dist/assets/{Docs-CiRRIELs.js → Docs-CUrHJKaU.js} +1 -1
  143. package/web/dist/assets/{Factories-DhyK0O8d.js → Factories-Ci1XfmSy.js} +1 -1
  144. package/web/dist/assets/{GreenhouseView-DW3PgTPy.js → GreenhouseView-CNfH2lPK.js} +1 -1
  145. package/web/dist/assets/Installs-ZHQZM1iS.js +3 -0
  146. package/web/dist/assets/{JournalView-O65qEWfp.js → JournalView-CMsWahkS.js} +1 -1
  147. package/web/dist/assets/{Kits-C5U-yT6Z.js → Kits-CkliyK0n.js} +1 -1
  148. package/web/dist/assets/{Laws-CuTw_XNf.js → Laws-hh4O3HZ4.js} +1 -1
  149. package/web/dist/assets/{LibRows-D6-CVa3K.js → LibRows-Brv0Hmkr.js} +1 -1
  150. package/web/dist/assets/{Library-CzPlerd6.js → Library-BYmiLjJr.js} +1 -1
  151. package/web/dist/assets/{Loops-CqNF_-nS.js → Loops-ytm-xJ68.js} +1 -1
  152. package/web/dist/assets/{OperatorHudView-BNr8K5qj.js → OperatorHudView-KaqCx_HP.js} +1 -1
  153. package/web/dist/assets/{Personal-DeDb9e8O.js → Personal-CmcnRKYE.js} +1 -1
  154. package/web/dist/assets/{Settings-B8MPN_AD.js → Settings-tUrpdOfq.js} +1 -1
  155. package/web/dist/assets/{Tabs-DJzAez4h.js → Tabs-CD7etcGD.js} +1 -1
  156. package/web/dist/assets/api-CZ-x0iWG.js +1 -0
  157. package/web/dist/assets/{controls-D4wmg_pl.js → controls-CK7qHA8H.js} +1 -1
  158. package/web/dist/assets/{index-CRWqKxfY.css → index-Ba_Kg3Af.css} +1 -1
  159. package/web/dist/assets/{index-BL3P-9Rg.js → index-COKbhFNo.js} +3 -3
  160. package/web/dist/index.html +3 -3
  161. package/web/dist/assets/Installs-B6nlo-Ly.js +0 -3
  162. package/web/dist/assets/api-DLDVY3K-.js +0 -1
@@ -27,15 +27,14 @@
27
27
  */
28
28
  import { spawn } from 'node:child_process';
29
29
  import {
30
- accessSync, constants, copyFileSync, existsSync, mkdirSync, mkdtempSync, realpathSync,
31
- renameSync, rmSync,
30
+ copyFileSync, existsSync, mkdirSync, mkdtempSync, realpathSync, renameSync, rmSync,
32
31
  } from 'node:fs';
33
32
  import os from 'node:os';
34
33
  import path from 'node:path';
35
34
 
36
35
  import { emitGlobalInto } from '../build/driver.mjs';
37
36
  import {
38
- ROOT, discoverNames, knownRuleIds, loadKits, PACK_ORDER,
37
+ CONTEXT_WINDOWS, ROOT, discoverNames, knownRuleIds, loadKits, PACK_ORDER,
39
38
  } from '../build/source.mjs';
40
39
  import { diffCollect, drifted, renderMemo, withStdoutSwallowed } from '../inspect/diff.mjs';
41
40
  import { SESSION_FILES } from '../hosts/hooks-context.mjs';
@@ -43,14 +42,11 @@ import { excludeAdd, excludeRemove } from '../inspect/excludes.mjs';
43
42
  import { installProfile, setupBuildArgs } from '../build/generate.mjs';
44
43
  import { DEFAULT_PRESET, PRESETS } from '../loop/score.mjs';
45
44
  import { activeLoops, setLoopPreset } from '../loop/registry.mjs';
45
+ import { HOSTS, resolvePath } from '../hosts/hosts.mjs';
46
46
  import {
47
- HOSTS, bobConfigDir, claudeConfigDir, expanduser, openclaudeConfigDir,
48
- opencodeConfigDir, resolvePath,
49
- } from '../hosts/hosts.mjs';
50
- import {
51
- EMIT_FOR, EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, kitsOfDir, sharedTierOfDir, renderedTier,
47
+ EMIT_FOR, EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, kitsOfDir, sharedTierOfDir, contextWindowOfDir, renderedTier,
52
48
  footprintOfDir, gatesOfDir,
53
- installState, installTargets, modeOfDir, postureOfDir, themeOfDir,
49
+ installedDefaults, installState, installTargets, modeOfDir, postureOfDir, themeOfDir,
54
50
  trustOfDir,
55
51
  } from '../hosts/installs.mjs';
56
52
  import {
@@ -64,6 +60,7 @@ import { stripWhitespace } from '../lib/text.mjs';
64
60
  import { memoryDelete } from '../maintain/memory.mjs';
65
61
  import { autostartInstall, autostartRemove } from '../hosts/shim.mjs';
66
62
  import { installDeactivate, installReactivate, installUninstall } from '../maintain/uninstall.mjs';
63
+ import { checkProjectFolder } from '../maintain/profile-scope.mjs';
67
64
  import { emitChoices, themeChoices, viewCfg } from './api.mjs';
68
65
  import { actionCommands } from './jobs.mjs';
69
66
  import { emitOf } from '../inspect/status.mjs';
@@ -155,6 +152,17 @@ function bodySharedTier(body, root, host) {
155
152
  return typeof said === 'boolean' ? said : sharedTierOfDir(root, host);
156
153
  }
157
154
 
155
+ /**
156
+ * A request body's `contextWindow` (`--context-window`): only a value `CONTEXT_WINDOWS` names
157
+ * counts; anything else keeps the install's own answer, so a malformed body changes nothing. An
158
+ * install not there yet takes the machine's (`installedDefaults`), as the CLI's new project does.
159
+ */
160
+ function bodyContextWindow(body, root, host, scope) {
161
+ const said = bget(body, 'contextWindow');
162
+ if (typeof said === 'string' && Object.hasOwn(CONTEXT_WINDOWS, said)) return said;
163
+ return installState(root, host, scope) === 'absent' ? installedDefaults().contextWindow : contextWindowOfDir(root, host);
164
+ }
165
+
158
166
  /**
159
167
  * The gate switches across the trust boundary (`deletionGate`, `secretsGate`, `doneGate`,
160
168
  * `ownershipGate`, `externalGate`, `testNote`, `ownBranchPass`), each on its own: only a real JSON boolean counts. Anything else — a string
@@ -669,6 +677,7 @@ export function apiRestore(state, files) {
669
677
  // The kits: a restored AGENT.md keeps its Kits block and `Active kits:` line.
670
678
  kits: kitsOfDir(target),
671
679
  sharedTier: sharedTierOfDir(target),
680
+ contextWindow: contextWindowOfDir(target),
672
681
  // The gate switches: a restored AGENT.md must keep the install's `<gate>: off` lines.
673
682
  ...gatesOfDir(target),
674
683
  }));
@@ -783,7 +792,7 @@ export function apiInstallCmd(state, body) {
783
792
  const out = scope === 'global' ? null : String(root);
784
793
  const argv = setupBuildArgs(theme || 'neutral', emit, out, out, fp, pos, mode, doctrines,
785
794
  PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates,
786
- kits ?? kitsOfDir(root, host), sharedTier);
795
+ kits ?? kitsOfDir(root, host), sharedTier, bodyContextWindow(body, root, host, scope));
787
796
  // `--reset`: this argv is a WHOLE selection — every axis is the body's or the install's own —
788
797
  // and `setupBuildArgs` elides an axis at its default, so returning one to it (a mode back to
789
798
  // direct, a gate re-armed) would otherwise trip the preserve guard (js/build/profile.mjs).
@@ -874,39 +883,20 @@ export function apiInstallToggle(state, body) {
874
883
  * The open-ended sibling of `apiInstallCmd`, which only rebuilds a pre-detected target from
875
884
  * a tight allowlist. Scope is always `project`: a global lands in the host's config dir,
876
885
  * never a chosen folder. THIS ENDPOINT TAKES A RAW PATH, so it is the trust boundary — the
877
- * path is validated here as an existing, writable directory that is not a host's own global
878
- * config dir (deploying a `project` emit there would mislabel as the global row and collide
879
- * on dedup).
886
+ * path is validated (`checkProjectFolder`) as an existing, writable directory that is not a
887
+ * host's own global config dir (deploying a `project` emit there would mislabel as the global
888
+ * row and collide on dedup).
880
889
  */
881
890
  export function apiDeployCmd(state, body) {
882
891
  const host = stripWhitespace(strOr(bget(body, 'host')));
883
892
  if (!HOSTS.some((h) => h.host === host)) {
884
893
  return { error: `unknown host: ${host || '(none)'}` };
885
894
  }
886
- const raw = stripWhitespace(strOr(bget(body, 'path')));
887
- if (!raw) return { error: 'no folder given' };
888
- let root;
889
- try {
890
- root = resolvePath(expanduser(raw));
891
- } catch {
892
- return { error: `bad path: ${raw}` };
893
- }
894
- if (!isDir(root)) return { error: `not a folder: ${root}` };
895
- try {
896
- accessSync(root, constants.W_OK);
897
- } catch {
898
- return { error: `folder not writable: ${root}` };
899
- }
900
- const cfgdirs = new Set();
901
- for (const fn of [opencodeConfigDir, claudeConfigDir, bobConfigDir,
902
- openclaudeConfigDir]) {
903
- try {
904
- cfgdirs.add(resolvePath(fn()));
905
- } catch { /* not every host has a resolvable config dir; skip it */ }
906
- }
907
- if (cfgdirs.has(root)) {
908
- return { error: "that's a host global config dir — use its existing row to build a global install" };
909
- }
895
+ // The folder check is `checkProjectFolder`'s (js/maintain/profile-scope.mjs), shared with
896
+ // `geneseed profile apply --project` and the Profiles tab's apply.
897
+ const folder = checkProjectFolder(strOr(bget(body, 'path')), [host]);
898
+ if (folder.error) return { error: folder.error };
899
+ const { root } = folder;
910
900
  // A fresh deploy is LEAN, at the default register, mode and trust: the same default as the
911
901
  // CLI's `--footprint`, which the user chose (2026-10-24) over the console's old `full` — a
912
902
  // console install and a CLI install of the same folder must not differ in always-on text for
@@ -926,7 +916,7 @@ export function apiDeployCmd(state, body) {
926
916
  // project-scope emit name == host name (opencode / claude / bob / openclaude)
927
917
  const argv = setupBuildArgs(theme || 'neutral', host, root, root, fp, pos, mode, doctrines,
928
918
  PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates, kitsOfDir(root, host),
929
- bodySharedTier(body, root, host));
919
+ bodySharedTier(body, root, host), bodyContextWindow(body, root, host, 'project'));
930
920
  // `--reset`, as in `apiInstallCmd`: the form's answers plus the folder's own are a whole selection.
931
921
  argv.push('--reset');
932
922
  return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
package/js/web/api.mjs CHANGED
@@ -23,8 +23,8 @@ import { CLAUDE_STYLE, VERSION_MARKER } from '../hosts/hosts.mjs';
23
23
  import { factCount } from '../hosts/memory-files.mjs';
24
24
  import { autostartState } from '../hosts/shim.mjs';
25
25
  import {
26
- footprintOfDir, gatesOfDir, installState, installTargets, leftoversOf, modeOfDir,
27
- trustOfDir, sharedTierOfDir, strandedGatesOf,
26
+ footprintOfDir, gatesOfDir, installedDefaults, installState, installTargets, leftoversOf, modeOfDir,
27
+ trustOfDir, sharedTierOfDir, contextWindowOfDir, strandedGatesOf,
28
28
  postureOfDir, readJsonMaybe, readMaybe, themeOfDir,
29
29
  } from '../hosts/installs.mjs';
30
30
  import { PRESETS } from '../loop/score.mjs';
@@ -234,6 +234,8 @@ export function apiInstalls(state) {
234
234
  // The row marked `default` must be the install an unnamed request reads, so the daemon state
235
235
  // follows the marker here, where the console reads it, rather than only on a full refresh.
236
236
  followDefault(state, def);
237
+ let machineCw = null;
238
+ const machineWindow = () => (machineCw ??= installedDefaults().contextWindow);
237
239
  for (const [host, scope, root] of targets) {
238
240
  out.push({
239
241
  ...installRowBase(host, scope, root, installState(root, host, scope)),
@@ -242,6 +244,9 @@ export function apiInstalls(state) {
242
244
  trust: trustOfDir(root, host),
243
245
  // A project install's switch for reading the machine tier (a global install owns it).
244
246
  sharedTier: scope === 'global' ? false : sharedTierOfDir(root, host),
247
+ // The context window the install is built for (`--context-window`); it writes settings on
248
+ // Claude Code only. A row not installed yet offers the machine's, as a new install takes it.
249
+ contextWindow: installState(root, host, scope) === 'absent' ? machineWindow() : contextWindowOfDir(root, host),
245
250
  // Files here that are the user's where Geneseed ships one, and retired leftovers: what a
246
251
  // forced rebuild would replace or remove (`leftoversOf`). Read off the emit's own record.
247
252
  leftovers: leftoversOf(root, host, scope),
@@ -22,6 +22,7 @@ import { BadRequest, NotFound } from './catalog.mjs';
22
22
  import { nonceBook, openFolder, requestRestart, restartRefusal, rootId, secretProof } from './daemon.mjs';
23
23
  import { apiDocs, apiDocsPage } from './docs.mjs';
24
24
  import { actionCommands, updatePlan } from './jobs.mjs';
25
+ import { profileApplyCmd, profileSaveCmd } from './profiles-api.mjs';
25
26
  import {
26
27
  MACHINE_GETS, POST_ROUTES, PREFIX_ROUTES, STATE_ROUTES, VIEW_POSTS, readJsonBody,
27
28
  } from './routes.mjs';
@@ -396,6 +397,13 @@ export function makeHandler(state, jm, token, dist, holder = null) {
396
397
  if (Object.hasOwn(plan, 'error')) return sendJson(res, plan, 400, ae);
397
398
  return startJob(res, 'deploy', [plan.cmd], ae);
398
399
  }
400
+ // The Profiles tab's two jobs run the CLI's own `profile apply|save` (js/web/profiles-api.mjs).
401
+ // The body names a profile, hosts, a folder or an install, so a refusal is the body's: 400.
402
+ if (action === 'profile-apply' || action === 'profile-save') {
403
+ const plan = action === 'profile-apply' ? profileApplyCmd(body) : profileSaveCmd(body);
404
+ if (Object.hasOwn(plan, 'error')) return sendJson(res, plan, 400, ae);
405
+ return startJob(res, action, [plan.cmd], ae);
406
+ }
399
407
  if (action === 'rebuild') {
400
408
  const plan = rebuildCmds(body);
401
409
  if (Object.hasOwn(plan, 'error')) return sendJson(res, plan, 409, ae);
package/js/web/jobs.mjs CHANGED
@@ -413,12 +413,13 @@ const CLI = () => path.join(ROOT, 'bin', 'geneseed-cli.mjs');
413
413
  const GEN = () => path.join(ROOT, 'bin', 'build-driver.mjs');
414
414
 
415
415
  /**
416
- * The four actions the dispatcher answers INLINE, without consulting the table above:
417
- * `restore` is synchronous and returns a result rather than a job id, and `install`/`deploy`/
418
- * `rebuild` resolve their argv from the request body first. Declared so the surface check
416
+ * The actions the dispatcher answers INLINE, without consulting the table above: `restore` is
417
+ * synchronous and returns a result rather than a job id, and `install`/`deploy`/`rebuild` and the
418
+ * two profile jobs (`profile-apply`, `profile-save`, js/web/profiles-api.mjs) resolve their argv
419
+ * from the request body first. Declared so the surface check
419
420
  * covers every action the dispatcher answers, not only the table's keys.
420
421
  */
421
- export const INLINE_ACTIONS = ['restore', 'install', 'deploy', 'rebuild'];
422
+ export const INLINE_ACTIONS = ['restore', 'install', 'deploy', 'rebuild', 'profile-apply', 'profile-save'];
422
423
 
423
424
  /**
424
425
  * ⚠ `doctrines` DEFAULTS TO THE FULL SET, and it is the one axis here whose default is not the
@@ -0,0 +1,201 @@
1
+ /**
2
+ * The console's Profiles tab (spec D38, D39): the read-only list of install profiles, what
3
+ * applying one would change, and the two jobs that apply or save one.
4
+ *
5
+ * NOTHING HERE BUILDS. The list and the preview read profile files and install markers; the two
6
+ * writes are a `{ cmd }` the job runner spawns, `geneseed profile apply|save …` — the same CLI path
7
+ * a terminal takes, so the console cannot apply a profile any other way than the CLI does. Each
8
+ * body is checked here first, so a bad one is a 400 and never a job that fails.
9
+ *
10
+ * `src` (the profile sources) and `tools` (the host detection) are the tests' seams: no test may
11
+ * read the real machine tier's `profiles/`.
12
+ */
13
+ import path from 'node:path';
14
+
15
+ import { ROOT } from '../build/source.mjs';
16
+ import { installProfile } from '../build/profile.mjs';
17
+ import { HOSTS, expanduser } from '../hosts/hosts.mjs';
18
+ import { installState, installTargets } from '../hosts/installs.mjs';
19
+ import {
20
+ BASE_PROFILE, isGitClone, listProfiles, loadProfile, profileBuildArgs, profileDiff, profileDirs,
21
+ profileFromInstall, profileHosts,
22
+ } from '../maintain/profiles.mjs';
23
+ import { checkProjectFolder, globalLayering, markerCollision } from '../maintain/profile-scope.mjs';
24
+ import { hostTools, profileChanges } from '../maintain/setup.mjs';
25
+
26
+ /**
27
+ * The console's folder check: absolute (after `~` expansion) first, then `checkProjectFolder`.
28
+ * A RELATIVE PATH IS REFUSED HERE: it would resolve against the daemon's working directory,
29
+ * which the user never sees, so `api` typed in the panel could build into a folder nobody named.
30
+ */
31
+ function consoleFolder(raw, hosts = []) {
32
+ const typed = typeof raw === 'string' ? raw.trim() : '';
33
+ if (typed && !path.isAbsolute(expanduser(typed))) {
34
+ return { error: `not an absolute path: ${typed} — give the whole folder path (or start it with ~)` };
35
+ }
36
+ return checkProjectFolder(typed, hosts);
37
+ }
38
+
39
+ /** A profile name, as `saveProfile` takes one: a file stem, never a path. */
40
+ const NAME_RE = /^[a-z0-9][a-z0-9._-]*$/i;
41
+
42
+ /** `[host, scope, root]` of every active install, in `installTargets` order. */
43
+ function activeTargets() {
44
+ return installTargets().filter(([h, s, r]) => installState(r, h, s) === 'active');
45
+ }
46
+
47
+ /**
48
+ * Whether an install FOLLOWS a profile: its read-back equals the profile on every build setting.
49
+ * `hosts`, `login` and `description` are no install setting, so they are never compared (else
50
+ * `starter`, which lists four hosts, could match no install). `sharedTier` counts only on a
51
+ * project install: a global apply ignores it (D37), so a global install cannot differ on it.
52
+ */
53
+ export function followsProfile(installP, scope, p) {
54
+ const skip = new Set(['hosts', 'login', ...(scope === 'global' ? ['sharedTier'] : [])]);
55
+ return profileDiff(installP, p).every((d) => skip.has(d.key));
56
+ }
57
+
58
+ /** The hosts row of the tab: `{ host, label, present }` in HOSTS order. */
59
+ function hostRows(tools) {
60
+ const labels = { opencode: 'OpenCode', claude: 'Claude Code', bob: 'IBM Bob', openclaude: 'OpenClaude' };
61
+ const rows = tools();
62
+ return profileHosts().map((host, i) => ({ host, label: labels[host] ?? host, present: Boolean(rows[i]?.[1]) }));
63
+ }
64
+
65
+ /**
66
+ * What applying `p` would do per host, in one scope: `project` null is global. Each row names
67
+ * the install there now (`state`), whether this machine has the tool, the settings its build
68
+ * would change back (the preserve guard's own list, `profileChanges`), and in project scope the
69
+ * global install that keeps running beside it (D39, `globalLayering`).
70
+ */
71
+ function previewRows(p, project, hosts) {
72
+ return hosts.filter((h) => p.hosts.includes(h.host)).map((h) => {
73
+ let root = project;
74
+ if (!project) {
75
+ try { root = HOSTS.find((x) => x.host === h.host).configDir(); } catch { root = null; }
76
+ }
77
+ const state = root ? installState(root, h.host, project ? 'project' : 'global') : 'absent';
78
+ // A project folder whose marker dir IS this host's global install is refused for this host
79
+ // (`markerCollision`): the row says so and the panel does not offer it.
80
+ const refused = project ? markerCollision(project, h.host) : null;
81
+ const changes = h.present && !refused && state === 'active'
82
+ ? profileChanges(profileBuildArgs(p, h.host, project)) : [];
83
+ return {
84
+ host: h.host, label: h.label, present: h.present, state, root: root ? String(root) : null,
85
+ changes, layering: project && !refused ? globalLayering(h.host) : null, refused,
86
+ };
87
+ });
88
+ }
89
+
90
+ /**
91
+ * `GET /api/profiles[?profile=<name>[&project=<dir>]]` — machine-wide (`MACHINE_GETS`).
92
+ *
93
+ * `profiles`: every file of both sources, each with its source, file, validity, settings, the
94
+ * gates it turns off, how it differs from `starter` and the active installs that follow it.
95
+ * `installs`: every active install with the profiles it follows and its own difference from
96
+ * `starter` (the Selected install panel's tag, the Save panel's preview). With `?profile=`, a
97
+ * `preview` of applying it globally, or into `?project=` (a folder the Apply panel names).
98
+ */
99
+ export function apiProfiles(state, url, { src = {}, tools = hostTools } = {}) {
100
+ const q = new URL(url || '', 'http://x').searchParams;
101
+ const dirs = profileDirs(src);
102
+ const base = loadProfile(BASE_PROFILE, dirs);
103
+ const readBacks = activeTargets().map(([host, scope, root]) => ({
104
+ host, scope, path: String(root), profile: profileFromInstall(installProfile(host, scope, root)),
105
+ }));
106
+ /** @type {any[]} one row per file: a loaded profile carries `profile`, a refused one `error` */
107
+ const profiles = listProfiles(dirs).map((e) => {
108
+ const head = { name: e.name, source: e.source, file: e.file, shadowed: e.shadowed };
109
+ if (e.shadowed) return { ...head, error: 'a shipped profile has this name, so this file is never loaded — rename it' };
110
+ const r = loadProfile(e.name, dirs);
111
+ if (!r.ok) return { ...head, error: r.error };
112
+ const p = r.profile;
113
+ return {
114
+ ...head, description: p.description ?? '', profile: p,
115
+ gatesOff: Object.keys(p.gates ?? {}),
116
+ diff: base.ok ? profileDiff(p, base.profile) : [],
117
+ matches: readBacks.filter((rb) => followsProfile(rb.profile, rb.scope, p))
118
+ .map(({ host, scope, path: at }) => ({ host, scope, path: at })),
119
+ };
120
+ });
121
+ const loaded = profiles.filter((x) => x.profile);
122
+ const installs = readBacks.map((rb) => ({
123
+ host: rb.host, scope: rb.scope, path: rb.path,
124
+ matches: loaded.filter((x) => followsProfile(rb.profile, rb.scope, x.profile)).map((x) => x.name),
125
+ diff: base.ok ? profileDiff(rb.profile, base.profile) : [],
126
+ }));
127
+ const hosts = hostRows(tools);
128
+ const out = {
129
+ profiles, installs, hosts, base: BASE_PROFILE, personalDir: dirs.personalDir,
130
+ shippedDir: dirs.shippedDir, shippedWritable: isGitClone(),
131
+ };
132
+ const name = q.get('profile');
133
+ if (name) {
134
+ const r = loadProfile(name, dirs);
135
+ if (!r.ok) return { ...out, preview: { error: r.error } };
136
+ let project = null;
137
+ const raw = q.get('project');
138
+ if (raw !== null) {
139
+ const f = consoleFolder(raw);
140
+ if (f.error) return { ...out, preview: { name, scope: 'project', error: f.error } };
141
+ project = f.root;
142
+ }
143
+ out.preview = { name, scope: project ? 'project' : 'global', project, rows: previewRows(r.profile, project, hosts) };
144
+ }
145
+ return out;
146
+ }
147
+
148
+ const CLI = () => path.join(ROOT, 'bin', 'geneseed-cli.mjs');
149
+
150
+ /**
151
+ * The job for `POST /api/actions/profile-apply`, body `{ name, hosts: [..], project? }`:
152
+ * `{ cmd }` or `{ error }` (400). `hosts` must be a non-empty subset of the profile's own (D41);
153
+ * `project`, when given, passes the deploy form's folder check.
154
+ */
155
+ export function profileApplyCmd(body, { src = {} } = {}) {
156
+ const name = typeof body?.name === 'string' ? body.name : '';
157
+ const r = loadProfile(name, profileDirs(src));
158
+ if (!r.ok) return { error: r.error };
159
+ const hosts = body?.hosts;
160
+ if (!Array.isArray(hosts) || !hosts.length || !hosts.every((h) => typeof h === 'string')) {
161
+ return { error: 'hosts must be a non-empty list of host ids' };
162
+ }
163
+ const bad = hosts.filter((h) => !r.profile.hosts.includes(h));
164
+ if (bad.length) return { error: `not in profile '${name}': ${bad.join(', ')} (it lists ${r.profile.hosts.join(', ')})` };
165
+ const argv = ['profile', 'apply', name, '--hosts', [...new Set(hosts)].join(',')];
166
+ if (body.project !== undefined && body.project !== null) {
167
+ const f = consoleFolder(body.project, [...new Set(hosts)]);
168
+ if (f.error) return { error: f.error };
169
+ argv.push('--project', f.root);
170
+ }
171
+ return { cmd: [process.execPath, CLI(), ...argv] };
172
+ }
173
+
174
+ /**
175
+ * The job for `POST /api/actions/profile-save`, body `{ name, from: { host, path }, shipped?,
176
+ * force? }`: `{ cmd }` or `{ error }` (400). `from` must be an ACTIVE detected install, matched on
177
+ * its raw path as `/api/profiles` gave it, so the argv is built from the registry, never from body
178
+ * strings. The refusals the CLI would print are answered here first: a Shipped destination outside
179
+ * a git clone (D35), a name the other source holds (D36), an existing file without `force`.
180
+ */
181
+ export function profileSaveCmd(body, { src = {}, root = ROOT } = {}) {
182
+ const name = typeof body?.name === 'string' ? body.name : '';
183
+ if (!NAME_RE.test(name)) return { error: `'${name}' is not a profile name: letters, digits, '.', '_' and '-' only` };
184
+ const from = body?.from;
185
+ const want = JSON.stringify([String(from?.host ?? ''), String(from?.path ?? '')]);
186
+ const hit = activeTargets().findLast(([h, , r]) => JSON.stringify([h, String(r)]) === want);
187
+ if (!hit) return { error: 'from must name an active install ({host, path})' };
188
+ const [host, scope, installRoot] = hit;
189
+ const shipped = body.shipped === true;
190
+ if (shipped && !isGitClone(root)) return { error: 'a shipped profile can only be saved from a git clone of Geneseed' };
191
+ const entries = listProfiles(profileDirs(src));
192
+ const other = entries.find((e) => e.name === name && e.source === (shipped ? 'personal' : 'shipped'));
193
+ if (other) return { error: `'${name}' is already a ${other.source} profile — a personal profile may not reuse a shipped name` };
194
+ const same = entries.find((e) => e.name === name && e.source === (shipped ? 'shipped' : 'personal'));
195
+ if (same && body.force !== true) return { error: `'${name}' already exists (${same.file}) — pick another name, or replace it` };
196
+ const argv = ['profile', 'save', name, '--from', scope === 'global' ? `${host}-global` : host];
197
+ if (scope !== 'global') argv.push('--project', String(installRoot));
198
+ if (shipped) argv.push('--shipped');
199
+ if (body.force === true) argv.push('--force');
200
+ return { cmd: [process.execPath, CLI(), ...argv] };
201
+ }
package/js/web/routes.mjs CHANGED
@@ -25,6 +25,7 @@ import {
25
25
  } from './api.mjs';
26
26
  import { FLEET_SECTIONS, NotFound, apiCatalog, apiItem, apiLoadout } from './catalog.mjs';
27
27
  import { apiUsage } from './usage-api.mjs';
28
+ import { apiProfiles } from './profiles-api.mjs';
28
29
  import { fleetSort } from './state.mjs';
29
30
  import { apiGates } from './gates-api.mjs';
30
31
  import { migratePreview } from '../maintain/migrate.mjs';
@@ -90,6 +91,7 @@ export const VIEW_POSTS = new Set(['/api/activity', '/api/memory/delete', '/api/
90
91
  * section, and `/api/item/`, stay install-scoped (`PREFIX_ROUTES`).
91
92
  */
92
93
  export const MACHINE_GETS = new Set(['/api/update', '/api/installs', '/api/fleet', '/api/migrate/preview', '/api/kits',
94
+ '/api/profiles',
93
95
  '/api/usage', '/api/gates', '/api/excludes', '/api/mcp', '/api/loops/active', '/api/factories/active', '/api/activity',
94
96
  '/api/catalog/skills', '/api/catalog/agents', '/api/catalog/memory', '/api/catalog/notebook',
95
97
  '/api/catalog/wiki', '/api/catalog/config']);
@@ -212,6 +214,9 @@ export const STATE_ROUTES = {
212
214
  // Reads every global install, and writes nothing: the console's view of `migrate --dry-run`.
213
215
  '/api/migrate/preview': () => migratePreview(),
214
216
  '/api/kits': apiKits,
217
+ // The Profiles tab: both profile sources, the installs that follow each, and with `?profile=`
218
+ // (and `?project=`) what applying one would change. Machine-wide; it reads its own query.
219
+ '/api/profiles': (state, url) => apiProfiles(state, url),
215
220
  '/api/update': apiUpdate,
216
221
  '/api/usage': apiUsage,
217
222
  '/api/gates': apiGates,
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`, `exports` 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": "5.4.0",
4
+ "version": "5.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",
@@ -39,6 +39,7 @@
39
39
  "js/",
40
40
  "src/",
41
41
  "themes/",
42
+ "profiles/",
42
43
  "adapters/",
43
44
  "docs/*.md",
44
45
  "docs/_groups.json",
@@ -0,0 +1,16 @@
1
+ {
2
+ "description": "Guillaume's recommended Claude Code setup: imperial voice, expert posture, foreman mode. Claude Code only.",
3
+ "hosts": ["claude"],
4
+ "theme": "imperial",
5
+ "footprint": "lean",
6
+ "posture": "expert",
7
+ "mode": "foreman",
8
+ "trust": "balanced",
9
+ "doctrines": ["craft", "rigor", "ops", "process", "comms"],
10
+ "excludeRules": ["craft.4", "ops.1", "process.3", "process.4", "process.5", "rigor.5"],
11
+ "excludeSkills": [],
12
+ "kits": [],
13
+ "contextWindow": "1m",
14
+ "gates": { "deletionGate": false, "ownershipGate": false, "externalGate": false },
15
+ "login": true
16
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "description": "For a first install: neutral voice, every guardrail except the ownership gate.",
3
+ "hosts": ["opencode", "bob", "claude", "openclaude"],
4
+ "theme": "neutral",
5
+ "footprint": "lean",
6
+ "posture": "peer",
7
+ "mode": "direct",
8
+ "trust": "balanced",
9
+ "doctrines": "all",
10
+ "kits": [],
11
+ "contextWindow": "200k",
12
+ "gates": { "ownershipGate": false },
13
+ "login": true
14
+ }
package/src/AGENT.md.tmpl CHANGED
@@ -298,7 +298,7 @@ inventory — that list is the catalogue and it is authoritative, as is its
298
298
  procedure is in [`{{DIR_SKILLS}}/`]({{DIR_SKILLS}}/) and the host loads it on
299
299
  demand.
300
300
  <!-- CATALOG:end -->
301
- {{EXCLUDED_SKILLS_LINE}}{{KITS_LINE}}{{SHARED_TIER_LINE}}
301
+ {{EXCLUDED_SKILLS_LINE}}{{KITS_LINE}}{{SHARED_TIER_LINE}}{{CONTEXT_WINDOW_LINE}}
302
302
  When a task repeats and no {{SKILL}} covers it, forge one through the
303
303
  [skill-forge]({{DIR_SKILLS}}/skill-forge.md) {{SKILL}}: copy
304
304
  [`{{DIR_SKILLS}}/_template.md`]({{DIR_SKILLS}}/_template.md), keep it to one coherent
@@ -3,10 +3,18 @@
3
3
  If this spec misled you — an input you needed but were not given, a boundary
4
4
  that proved wrong, a step you could not execute — end your report with one line:
5
5
  `spec-feedback: [agent|general] <the one-line fix> [— situation: <when it applies>] — seen:
6
- <what happened, against what this spec led you to expect>`. `general` marks a fix other
7
- {{AGENTS}} need too. Omit the line when there is no friction. The caller weighs the
8
- feedback and writes a real flaw, dated, into `{{PATH_NOTES}}/agent-notes/<name>.md` on
9
- its own, with no prompt — never into this rendered file, which a rebuild overwrites —
10
- and hands those notes to every later dispatch of this {{AGENT}}. Folding a note into the
11
- source is the user's call, after the skill-forge {{SKILL}}'s probe. It records the feedback to {{MEMORY}} only if it clears
12
- {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
6
+ <what happened, against what this spec led you to expect>`. Ask one question first: is it true
7
+ in any repo, or only here? Any repo: `[agent]`, or `[general]` for a fix other {{AGENTS}} need
8
+ too. Only here: `[agent:project]`, or `[general:project]`. Omit the line when there is no
9
+ friction. When the run ends, the harness hook copies each line, dated, into the machine notes
10
+ `{{PATH_NOTES}}/agent-notes/<name>.md` (a `general` line into `agent-notes/_general.md` there),
11
+ or a `project` line into `{{PATH_PROJECT_NOTES}}/agent-notes/` at the project root, the same two
12
+ files (in a linked worktree, the main checkout's) — no model call, and never into this rendered file, which
13
+ a rebuild overwrites. Step 0 reads those notes at every later dispatch of this {{AGENT}}, machine
14
+ first; the project notes win where they disagree. When a step-0 read is refused, or the brief
15
+ forbids that path, skip it, say so in one line of the report, and go on. The caller writes no
16
+ note itself, except on a host with no subagent-finished hook (Bob), where it copies the line
17
+ into the machine or the project file, in the same form. The caller
18
+ weighs the line, and folding a note into the source is the user's call, after the
19
+ skill-forge {{SKILL}}'s probe. The caller records the feedback to {{MEMORY}} only if it
20
+ clears {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -42,8 +42,10 @@
42
42
  write-capable {{AGENT}}'s spec must not contain it, or its emit is locked down.
43
43
 
44
44
  ## Procedure
45
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists in the harness, read it first —
46
- it holds your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
45
+ 0. Read first, each if it exists — your durable lessons from prior dispatches
46
+ ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback
47
+ notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`,
48
+ then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
47
49
  1. Step-by-step method this {{AGENT}} follows.
48
50
 
49
51
  ## Output contract
@@ -17,7 +17,7 @@
17
17
  - **Read-only.** Search and read, to ground the case in the real artifact. Never edits, never runs commands, never casts the verdict.
18
18
 
19
19
  ## Procedure
20
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
20
+ 0. Read first, each if it exists — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`, then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
21
21
  1. Read the motion and the artifact so the case is concrete, not abstract ({{DOCTRINE:read-the-docs-first}}).
22
22
  2. Steelman the proposal: make its strongest case — the upside, the opportunity, the cost of *not* acting ({{ONTOLOGY}}: {{ONT_CONDUCT}}).
23
23
  3. Name the single objection the proposal must survive, and answer it; concede only what is genuinely indefensible.
@@ -22,7 +22,7 @@
22
22
  <!-- bash: allow -->
23
23
 
24
24
  ## Procedure
25
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
25
+ 0. Read first, each if it exists — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`, then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
26
26
  1. Establish the current state: data shapes, module boundaries, existing patterns.
27
27
  2. Propose 2–3 approaches with trade-offs; recommend one with reasoning.
28
28
  3. Break the chosen approach into isolated units, each with one purpose and a
@@ -22,16 +22,20 @@
22
22
  decisions the developer approved, carried in the brief.
23
23
 
24
24
  ## Allowed tools
25
- - **Read + write to the assigned worktree.** May run the project's own build/lint
26
- commands to self-check before handing off.
25
+ - **Read + write to the assigned worktree.** May run the project's own build, lint and
26
+ test commands to self-check before handing off; installs dependencies (`npm ci` and
27
+ alike) only when the brief allows it.
27
28
  <!-- bash: allow -->
29
+ - In an isolated worktree, run one plain command per call: `git -C <worktree>`, never
30
+ `cd <worktree> &&`, no heredocs. Change files with the edit and write tools; a `\u`
31
+ escape in source stays an escape — check it in the diff.
28
32
  - Commits only in its own worktree, never pushes, and never merges outside its own branch
29
33
  ({{DOCTRINE:consent-before-push}}); into that branch it merges only the branches of
30
34
  sub-workers it started. The parent re-runs the proof and merges beyond it once the user
31
35
  accepts.
32
36
 
33
37
  ## Procedure
34
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
38
+ 0. Read first, each if it exists — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`, then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
35
39
  1. Implement the smallest change that satisfies the scoped task ({{DOCTRINE:smallest-viable-diff}}) —
36
40
  in the assigned worktree only, never touching the parent's own tree. In ownership mode,
37
41
  write only what the approved decisions cover; on a choice none of them covers, stop and
@@ -61,6 +65,9 @@ in your own context, and after two repair rounds on your own red tests return re
61
65
  findings ({{DOCTRINE:bound-the-loop}}). As a lead, hold every member's result before you end. Report `T<n> · <task> · files: <write set> · <state>`
62
66
  at start and on each change, as the mode says. Return the branch, its commit list, any
63
67
  uncommitted work, and the raw test + lint output — the parent re-runs it before any merge.
68
+ That output is a full run to completion, with the runner's own count line, never a
69
+ partial run. Call a failure pre-existing only after you reproduce it on a clean checkout
70
+ of BASE, and cite that run.
64
71
 
65
72
  ## Pipeline role
66
73
 
@@ -21,7 +21,7 @@ Builds CI/CD pipelines and delivery automation for Spring Boot applications.
21
21
  - Never commits, pushes or triggers a deployment ({{DOCTRINE:consent-before-push}}).
22
22
 
23
23
  ## Procedure
24
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
24
+ 0. Read first, each if it exists — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`, then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
25
25
  1. Detect the CI the project already uses (GitHub Actions, GitLab CI, Jenkins, other) and extend it; do not switch providers. With none present, ask the user which to use.
26
26
  2. Pipeline order: checkout, restore build cache, `./mvnw verify` (or `./gradlew build`), publish test results, build image, scan, push, deploy.
27
27
  3. Cache the Maven or Gradle repository keyed on the build files.
@@ -22,7 +22,7 @@ Builds small, safe container images for Spring Boot 4 applications.
22
22
  - Never pushes images or commits ({{DOCTRINE:consent-before-push}}).
23
23
 
24
24
  ## Procedure
25
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
25
+ 0. Read first, each if it exists — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`, then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
26
26
  1. Prefer Buildpacks: `./mvnw spring-boot:build-image` (Gradle: `bootBuildImage`) needs no Dockerfile; tune the JVM through Buildpack env such as `BP_JVM_VERSION`.
27
27
  2. Use a Dockerfile only when Buildpacks do not fit. Build multi-stage and extract layers with `java -Djarmode=tools -jar app.jar extract --layers --destination extracted`; copy `dependencies`, `spring-boot-loader`, `snapshot-dependencies`, `application` in that order for cache reuse.
28
28
  3. Run as a non-root user; pin base image tags or digests, never `latest`.
@@ -19,7 +19,7 @@
19
19
  may run documented examples and commands to confirm they work as written.
20
20
 
21
21
  ## Procedure
22
- 0. If `{{PATH_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
22
+ 0. Read first, each if it exists — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}): `{{PATH_MEMORY}}/agents/<your-name>.md`, then the feedback notes `{{PATH_NOTES}}/agent-notes/<your-name>.md` and `{{PATH_NOTES}}/agent-notes/_general.md`, then this repo's `{{PATH_PROJECT_NOTES}}/agent-notes/<your-name>.md` and `_general.md` there, which win where they disagree.
23
23
  1. Read the actual code/behaviour before describing it — never document intent
24
24
  that the code does not implement ({{LAW:verify-before-asserting}}).
25
25
  2. Write for the stated audience; lead with what the reader needs to do.