geneseed 5.4.0 → 5.5.1
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.
- package/CHANGELOG.md +51 -0
- package/README.md +31 -1
- package/SHIPPED.md +1 -1
- package/adapters/bob/README.md +12 -1
- package/adapters/opencode/README.md +2 -1
- package/adapters/opencode/plugins/geneseed-context.js +71 -10
- package/adapters/opencode/plugins/geneseed-guard.js +101 -19
- package/adapters/opencode/plugins/geneseed-learn.js +641 -6
- package/bin/geneseed-cli.mjs +3 -0
- package/bin/geneseed-hook.mjs +2 -1
- package/docs/concepts/agents.md +13 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/foreman-mode.md +22 -3
- package/docs/concepts/hook-gates.md +1 -1
- package/docs/concepts/hooks.md +22 -5
- package/docs/concepts/host-matrix.md +2 -2
- package/docs/concepts/hosts.md +1 -1
- package/docs/concepts/shared-tier.md +1 -1
- package/docs/concepts/skills.md +21 -1
- package/docs/concepts/themes.md +1 -1
- package/docs/extending.md +11 -2
- package/docs/guides/install-clone.md +18 -0
- package/docs/guides/install-scripted.md +8 -2
- package/docs/guides/install.md +19 -1
- package/docs/guides/upgrade.md +1 -1
- package/docs/reference/env-context.md +1 -1
- package/docs/reference/environment.md +1 -1
- package/docs/reference/plugin-learn.md +4 -0
- package/docs/reference/profiles.md +226 -0
- package/docs/token-footprint.md +9 -4
- package/docs/understand/design-choices-engineering.md +1 -1
- package/docs/web-ui.md +3 -1
- package/harness.config.json +1 -1
- package/js/README.md +9 -2
- package/js/build/args.mjs +4 -3
- package/js/build/catalog.mjs +11 -1
- package/js/build/driver.mjs +42 -11
- package/js/build/emit-claude.mjs +24 -1
- package/js/build/emit-opencode.mjs +3 -0
- package/js/build/export.mjs +12 -17
- package/js/build/generate.mjs +2 -1
- package/js/build/notes-migrate.mjs +99 -0
- package/js/build/profile.mjs +14 -6
- package/js/build/render.mjs +34 -10
- package/js/build/source.mjs +85 -2
- package/js/cli-table.json +164 -4
- package/js/hosts/agent-runs.mjs +205 -0
- package/js/hosts/done-checks.mjs +3 -1
- package/js/hosts/hooks-done.mjs +91 -16
- package/js/hosts/hooks-learn.mjs +85 -0
- package/js/hosts/hooks-prims.mjs +39 -1
- package/js/hosts/hooks.mjs +10 -4
- package/js/hosts/hosts.mjs +10 -0
- package/js/hosts/installs.mjs +25 -1
- package/js/hosts/link.mjs +45 -10
- package/js/hosts/native.mjs +42 -5
- package/js/hosts/opencode.mjs +1 -1
- package/js/hosts/settings.mjs +72 -0
- package/js/hosts/spec-feedback.mjs +538 -0
- package/js/hosts/usage.mjs +67 -8
- package/js/inspect/agent-scores.mjs +118 -0
- package/js/inspect/checks-authoring.mjs +2 -1
- package/js/inspect/checks-build.mjs +20 -4
- package/js/inspect/checks-repo.mjs +27 -2
- package/js/inspect/cost.mjs +6 -5
- package/js/inspect/diff.mjs +25 -5
- package/js/inspect/doctor.mjs +4 -0
- package/js/inspect/status.mjs +3 -1
- package/js/inspect/validate.mjs +1 -0
- package/js/lib/machine-dir.mjs +8 -0
- package/js/lib/paths.mjs +4 -1
- package/js/maintain/profile-scope.mjs +145 -0
- package/js/maintain/profiles.mjs +486 -0
- package/js/maintain/setup.mjs +409 -15
- package/js/maintain/uninstall.mjs +4 -1
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +28 -38
- package/js/web/api.mjs +7 -2
- package/js/web/handler.mjs +8 -0
- package/js/web/jobs.mjs +5 -4
- package/js/web/profiles-api.mjs +201 -0
- package/js/web/routes.mjs +5 -0
- package/package.json +2 -1
- package/profiles/autonomous.json +14 -0
- package/profiles/corporate.json +14 -0
- package/profiles/guillaume-claude-global.json +16 -0
- package/profiles/mentor.json +13 -0
- package/profiles/minimal.json +15 -0
- package/profiles/starter.json +14 -0
- package/src/AGENT.md.tmpl +1 -1
- package/src/agents/_self-improvement.md +15 -7
- package/src/agents/_template.md +4 -2
- package/src/agents/advocate.md +1 -1
- package/src/agents/architect.md +1 -1
- package/src/agents/developer.md +10 -3
- package/src/agents/devops-engineer.md +7 -6
- package/src/agents/docker-expert.md +1 -1
- package/src/agents/docs.md +1 -1
- package/src/agents/empiricist.md +1 -1
- package/src/agents/explorer.md +4 -2
- package/src/agents/framer.md +1 -1
- package/src/agents/historian.md +1 -1
- package/src/agents/kubernetes-specialist.md +4 -2
- package/src/agents/memory-curator.md +1 -1
- package/src/agents/operator.md +1 -1
- package/src/agents/performance.md +1 -1
- package/src/agents/pragmatist.md +1 -1
- package/src/agents/react-engineer.md +1 -1
- package/src/agents/react-reviewer.md +1 -1
- package/src/agents/researcher.md +1 -1
- package/src/agents/reviewer.md +10 -3
- package/src/agents/security.md +1 -1
- package/src/agents/skeptic.md +1 -1
- package/src/agents/spring-boot-engineer.md +4 -4
- package/src/agents/spring-reviewer.md +5 -3
- package/src/agents/spring-security.md +1 -1
- package/src/agents/steward.md +1 -1
- package/src/agents/tester.md +4 -2
- package/src/agents/user-advocate.md +1 -1
- package/src/agents/visionary.md +1 -1
- package/src/memory/README.md +12 -2
- package/src/modes/foreman.md +23 -10
- package/src/skill-descriptions.json +63 -0
- package/src/skills/_self-improvement.md +42 -26
- package/src/skills/_template.md +3 -1
- package/src/skills/brainstorm.md +35 -22
- package/src/skills/codebase-design.md +2 -2
- package/src/skills/daydream/VENDOR.md +6 -0
- package/src/skills/diagram-design/SKILL.md +12 -7
- package/src/skills/diagram-design/VENDOR.md +23 -14
- package/src/skills/diagram-design/references/layout-budget.md +7 -1
- package/src/skills/diagram-design/references/onboarding.md +1 -1
- package/src/skills/diagram-design/references/primitives-core.md +1 -1
- package/src/skills/diagram-design/references/semantic-patterns.md +1 -1
- package/src/skills/diagram-design/references/style-guide.md +1 -1
- package/src/skills/diagram-design/references/type-dependency.md +69 -0
- package/src/skills/diagram-design/references/type-event-modeling.md +36 -0
- package/src/skills/diagram-design/references/type-requirement-traceability.md +45 -0
- package/src/skills/diagram-design/references/type-sbgn.md +80 -0
- package/src/skills/diagram-design/references/type-scatter.md +1 -1
- package/src/skills/diagram-design/references/type-steps.md +180 -0
- package/src/skills/diagram-design/references/type-unit-grid.md +63 -0
- package/src/skills/explain-changes/VENDOR.md +5 -1
- package/src/skills/geneseed-code-review.md +2 -1
- package/src/skills/parallel-agents.md +12 -1
- package/src/skills/pipeline.md +3 -3
- package/src/skills/plan.md +5 -4
- package/src/skills/react-view-transitions/AGENTS.md +26 -26
- package/src/skills/react-view-transitions/SKILL.md +1 -1
- package/src/skills/react-view-transitions/VENDOR.md +19 -4
- package/src/skills/release.md +7 -2
- package/src/skills/rule/approve.md +2 -1
- package/src/skills/skill-forge.md +5 -3
- package/src/skills/spring-boot/cloud.md +19 -1
- package/src/skills/spring-boot/logging.md +5 -3
- package/src/skills/spring-boot/web.md +27 -2
- package/src/skills/spring-boot.md +4 -2
- package/src/skills/spring-data-jpa.md +18 -4
- package/src/skills/spring-testing.md +4 -0
- package/src/skills/token-report/VENDOR.md +5 -1
- package/src/upstreams.json +6 -6
- package/themes/README.md +3 -1
- package/web/dist/assets/{ActiveLoops-BJJN3P-V.js → ActiveLoops-DOJCPPPc.js} +1 -1
- package/web/dist/assets/{Activity-D2kOc3yi.js → Activity-bUSPM3Dl.js} +1 -1
- package/web/dist/assets/{ActivityDetail-By3xOr21.js → ActivityDetail-AHRoXeFN.js} +1 -1
- package/web/dist/assets/{Bonsai-CBWDTBA4.js → Bonsai-B5XY9pid.js} +1 -1
- package/web/dist/assets/{CopyButton-BVbpriMB.js → CopyButton-C0wwRR9H.js} +1 -1
- package/web/dist/assets/{Dashboard-CIJLPHM9.js → Dashboard-DPAA96EI.js} +2 -2
- package/web/dist/assets/{Docs-CiRRIELs.js → Docs-CpGDq165.js} +1 -1
- package/web/dist/assets/{Factories-DhyK0O8d.js → Factories-cNhETa5Q.js} +1 -1
- package/web/dist/assets/{GreenhouseView-DW3PgTPy.js → GreenhouseView-DO3ADmT9.js} +1 -1
- package/web/dist/assets/Installs-D3dDyq10.js +3 -0
- package/web/dist/assets/{JournalView-O65qEWfp.js → JournalView--W-Lw_V9.js} +1 -1
- package/web/dist/assets/{Kits-C5U-yT6Z.js → Kits-ChfehxY6.js} +1 -1
- package/web/dist/assets/Laws-CNxYmV36.js +4 -0
- package/web/dist/assets/{LibRows-D6-CVa3K.js → LibRows-CiPvsRYB.js} +1 -1
- package/web/dist/assets/{Library-CzPlerd6.js → Library-BxQvbwVU.js} +1 -1
- package/web/dist/assets/{Loops-CqNF_-nS.js → Loops-DAblKkyq.js} +1 -1
- package/web/dist/assets/{OperatorHudView-BNr8K5qj.js → OperatorHudView-QtSaSyYm.js} +1 -1
- package/web/dist/assets/{Personal-DeDb9e8O.js → Personal-DxSGv638.js} +1 -1
- package/web/dist/assets/{Settings-B8MPN_AD.js → Settings-CgTbhvRv.js} +1 -1
- package/web/dist/assets/{Tabs-DJzAez4h.js → Tabs-Cf4X1hdz.js} +1 -1
- package/web/dist/assets/api-CZ-x0iWG.js +1 -0
- package/web/dist/assets/{controls-D4wmg_pl.js → controls-CK7qHA8H.js} +1 -1
- package/web/dist/assets/{index-BL3P-9Rg.js → index-B_pTwZra.js} +4 -4
- package/web/dist/assets/index-CzfImiYb.css +1 -0
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Installs-B6nlo-Ly.js +0 -3
- package/web/dist/assets/Laws-CuTw_XNf.js +0 -4
- package/web/dist/assets/api-DLDVY3K-.js +0 -1
- package/web/dist/assets/index-CRWqKxfY.css +0 -1
package/js/web/actions.mjs
CHANGED
|
@@ -27,15 +27,14 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { spawn } from 'node:child_process';
|
|
29
29
|
import {
|
|
30
|
-
|
|
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
|
-
|
|
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
|
|
878
|
-
* config dir (deploying a `project` emit there would mislabel as the global
|
|
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
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
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),
|
package/js/web/handler.mjs
CHANGED
|
@@ -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
|
|
417
|
-
*
|
|
418
|
-
*
|
|
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
|
+
"version": "5.5.1",
|
|
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,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "For a fluent user who delegates: expert posture, foreman mode, aggressive loops, every guardrail except the ownership gate.",
|
|
3
|
+
"hosts": ["opencode", "bob", "claude", "openclaude"],
|
|
4
|
+
"theme": "neutral",
|
|
5
|
+
"footprint": "lean",
|
|
6
|
+
"posture": "expert",
|
|
7
|
+
"mode": "foreman",
|
|
8
|
+
"trust": "aggressive",
|
|
9
|
+
"doctrines": "all",
|
|
10
|
+
"kits": [],
|
|
11
|
+
"contextWindow": "1m",
|
|
12
|
+
"gates": { "ownershipGate": false },
|
|
13
|
+
"login": true
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "For a locked-down work PC: neutral voice, every guardrail except the ownership gate, strict consent, no login item.",
|
|
3
|
+
"hosts": ["opencode", "bob", "claude", "openclaude"],
|
|
4
|
+
"theme": "neutral",
|
|
5
|
+
"footprint": "lean",
|
|
6
|
+
"posture": "peer",
|
|
7
|
+
"mode": "direct",
|
|
8
|
+
"trust": "prudent",
|
|
9
|
+
"doctrines": "all",
|
|
10
|
+
"kits": [],
|
|
11
|
+
"contextWindow": "200k",
|
|
12
|
+
"gates": { "ownershipGate": false, "ownBranchPass": false },
|
|
13
|
+
"login": false
|
|
14
|
+
}
|
|
@@ -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,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "For a learner (a junior, a student): neutral voice, mentor posture, every guardrail, the ownership gate included.",
|
|
3
|
+
"hosts": ["opencode", "bob", "claude", "openclaude"],
|
|
4
|
+
"theme": "neutral",
|
|
5
|
+
"footprint": "lean",
|
|
6
|
+
"posture": "mentor",
|
|
7
|
+
"mode": "direct",
|
|
8
|
+
"trust": "prudent",
|
|
9
|
+
"doctrines": "all",
|
|
10
|
+
"kits": [],
|
|
11
|
+
"contextWindow": "200k",
|
|
12
|
+
"login": true
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "For a small model or a tight token budget: the smallest always-on context, two doctrine packs, niche skills left out.",
|
|
3
|
+
"hosts": ["opencode", "bob", "claude", "openclaude"],
|
|
4
|
+
"theme": "neutral",
|
|
5
|
+
"footprint": "lean",
|
|
6
|
+
"posture": "assistant",
|
|
7
|
+
"mode": "direct",
|
|
8
|
+
"trust": "balanced",
|
|
9
|
+
"doctrines": ["craft", "rigor"],
|
|
10
|
+
"excludeSkills": ["brick-forge", "bruno", "daydream", "factory", "factory-forge", "forge-mcp", "prototype", "react-view-transitions"],
|
|
11
|
+
"kits": [],
|
|
12
|
+
"contextWindow": "200k",
|
|
13
|
+
"gates": { "ownershipGate": false },
|
|
14
|
+
"login": true
|
|
15
|
+
}
|
|
@@ -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>`.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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.
|
package/src/agents/_template.md
CHANGED
|
@@ -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.
|
|
46
|
-
|
|
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
|
package/src/agents/advocate.md
CHANGED
|
@@ -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.
|
|
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.
|
package/src/agents/architect.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<!-- bash: allow -->
|
|
23
23
|
|
|
24
24
|
## Procedure
|
|
25
|
-
0.
|
|
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
|