geneseed 6.0.2 → 6.0.4
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 +28 -0
- package/DESIGN.md +1 -1
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +11 -10
- package/adapters/opencode/plugins/geneseed-learn.js +24 -8
- package/bin/geneseed-hook.mjs +5 -0
- package/docs/concepts/hooks.md +6 -6
- package/docs/guides/install-scripted.md +1 -1
- package/docs/reference/env-context.md +2 -1
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/reference/profiles.md +1 -0
- package/docs/understand/a-day.md +1 -1
- package/docs/understand/machine-claude.md +1 -1
- package/docs/web-ui.md +27 -2
- package/harness.config.json +1 -1
- package/js/build/args.mjs +4 -3
- package/js/build/bundle.mjs +2 -11
- package/js/build/driver.mjs +8 -8
- package/js/build/emit-claude.mjs +59 -4
- package/js/build/fold.mjs +3 -20
- package/js/build/generate.mjs +11 -2
- package/js/build/profile.mjs +10 -5
- package/js/build/render.mjs +3 -1
- package/js/build/source.mjs +12 -1
- package/js/build/stubs.mjs +42 -5
- package/js/cli-table.json +37 -0
- package/js/hosts/hooks-context.mjs +9 -8
- package/js/hosts/hooks-learn.mjs +435 -55
- package/js/hosts/installs.mjs +22 -2
- package/js/hosts/memory-files.mjs +249 -13
- package/js/hosts/native.mjs +23 -1
- package/js/hosts/settings.mjs +77 -4
- package/js/inspect/diff.mjs +3 -1
- package/js/inspect/doctor.mjs +37 -1
- package/js/inspect/status.mjs +40 -4
- package/js/inspect/validate.mjs +1 -1
- package/js/lib/proc.mjs +36 -0
- package/js/maintain/memory.mjs +2 -2
- package/js/maintain/profiles.mjs +15 -4
- package/js/maintain/setup.mjs +31 -7
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +5 -3
- package/js/web/api.mjs +2 -2
- package/js/web/catalog.mjs +5 -3
- package/js/web/profiles-api.mjs +2 -2
- package/js/web/state.mjs +13 -2
- package/package.json +1 -1
- package/src/AGENT.md.tmpl +1 -1
- package/src/agents/memory-curator.md +4 -1
- package/src/doctrines/process.md +2 -2
- package/src/memory/README.md +45 -6
- package/src/skills/rule/approve.md +3 -1
- package/src/skills/rule/consolidate.md +1 -1
- package/src/skills/rule.md +9 -5
- package/web/dist/assets/ActiveLoops-paFbiZyt.js +1 -0
- package/web/dist/assets/Activity-BsMFA5Aa.js +1 -0
- package/web/dist/assets/ActivityDetail-C66n3oul.js +1 -0
- package/web/dist/assets/{Bonsai-Bry-kOFb.js → Bonsai-BCd-qt7W.js} +1 -1
- package/web/dist/assets/{CopyButton-Cnnvjgkg.js → CopyButton-Dpl0PFja.js} +1 -1
- package/web/dist/assets/Dashboard-CQxdiv7F.js +2 -0
- package/web/dist/assets/{Docs-BJ23-fIx.js → Docs-D0XlXuiA.js} +2 -2
- package/web/dist/assets/Factories-CPVBoWoA.js +1 -0
- package/web/dist/assets/{GreenhouseView-VL_ZKJUR.js → GreenhouseView-C_2auUA8.js} +1 -1
- package/web/dist/assets/Installs-CXqjmqms.js +3 -0
- package/web/dist/assets/JournalView-S-igd-Nv.js +1 -0
- package/web/dist/assets/{Kits-DDSerkJk.js → Kits-K6mu91rm.js} +1 -1
- package/web/dist/assets/Laws-j5vKNwLT.js +4 -0
- package/web/dist/assets/{LibRows-QsUBjOF7.js → LibRows-1yTY0Kwn.js} +1 -1
- package/web/dist/assets/Library-BQZnFdWs.js +3 -0
- package/web/dist/assets/Loops-B5DgxpLm.js +2 -0
- package/web/dist/assets/Models-C-4Y4jvx.js +1 -0
- package/web/dist/assets/{OperatorHudView-Bdupodlc.js → OperatorHudView-_8NBAvkd.js} +1 -1
- package/web/dist/assets/Personal-Bf7zHDc6.js +2 -0
- package/web/dist/assets/Settings-BTrA6MXv.js +1 -0
- package/web/dist/assets/Tabs-BDhZImxa.js +1 -0
- package/web/dist/assets/controls-CREglcUF.js +1 -0
- package/web/dist/assets/index-9iBqq7i2.css +1 -0
- package/web/dist/assets/index-BiKWWv7Z.js +6 -0
- package/web/dist/assets/router-1EhRJy1C.js +1 -0
- package/web/dist/assets/useLocalStorage-54tkqXN7.js +1 -0
- package/web/dist/index.html +4 -2
- package/web/dist/assets/ActiveLoops-BWkImeYa.js +0 -1
- package/web/dist/assets/Activity-DJlPhk8q.js +0 -1
- package/web/dist/assets/ActivityDetail-Dk7UPnE_.js +0 -1
- package/web/dist/assets/Dashboard-CWhh_GSc.js +0 -2
- package/web/dist/assets/Factories-CjsIACyi.js +0 -1
- package/web/dist/assets/Installs-qcfOZNzF.js +0 -3
- package/web/dist/assets/JournalView-KrmFUC-X.js +0 -1
- package/web/dist/assets/Laws-DDffPs6O.js +0 -4
- package/web/dist/assets/Library-DzT3Mebh.js +0 -3
- package/web/dist/assets/Loops-CjsX3brz.js +0 -2
- package/web/dist/assets/Models-DPrAv3FG.js +0 -1
- package/web/dist/assets/Personal-D-dpCUU5.js +0 -2
- package/web/dist/assets/Settings-Dz33_Sys.js +0 -1
- package/web/dist/assets/Tabs-qY40S34V.js +0 -1
- package/web/dist/assets/controls-CK7qHA8H.js +0 -1
- package/web/dist/assets/index-BhT94v2q.js +0 -6
- package/web/dist/assets/index-DcusoHzF.css +0 -1
- package/web/dist/assets/usePoll-D5c_qIFZ.js +0 -1
package/js/inspect/status.mjs
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
37
37
|
import path from 'node:path';
|
|
38
38
|
|
|
39
|
-
import { DEFAULT_CONTEXT_WINDOW, GATE_SWITCHES, THEMES, ROOT, loadKits, makeCfg } from '../build/source.mjs';
|
|
39
|
+
import { DEFAULT_CONTEXT_WINDOW, DEFAULT_LEARN, GATE_SWITCHES, THEMES, ROOT, loadKits, makeCfg } from '../build/source.mjs';
|
|
40
40
|
import { tuiInventory } from './inventory.mjs';
|
|
41
41
|
import { sourceGeneration } from '../build/render.mjs';
|
|
42
42
|
import { readVersion, sourceFingerprint } from '../build/version.mjs';
|
|
@@ -48,14 +48,14 @@ import {
|
|
|
48
48
|
// the deployed theme and footprint, and `rebuild-all` re-emits in the deployed everything, so
|
|
49
49
|
// three verbs read them.
|
|
50
50
|
import {
|
|
51
|
-
claudeCfg, defaultTheme, hookShellProblems, installedDefaults, installState, installTargets,
|
|
52
|
-
installsReferencingShim, openclaudeDualHarnessRoots, themeOfDir, readJsonMaybe, readMaybe,
|
|
51
|
+
claudeCfg, claudeReadManifest, defaultTheme, hookShellProblems, installedDefaults, installState, installTargets,
|
|
52
|
+
installsReferencingShim, learnOfDir, openclaudeDualHarnessRoots, themeOfDir, readJsonMaybe, readMaybe,
|
|
53
53
|
} from '../hosts/installs.mjs';
|
|
54
54
|
import { installProfile, rebuildCommand } from '../build/generate.mjs';
|
|
55
55
|
import { providerWarning } from '../maintain/kit-migration.mjs';
|
|
56
56
|
import { isDoctorNote } from './scan.mjs';
|
|
57
57
|
import { pendingDrafts } from '../hosts/hooks-context.mjs';
|
|
58
|
-
import { factCount } from '../hosts/memory-files.mjs';
|
|
58
|
+
import { factCount, learnState, readLearnLast } from '../hosts/memory-files.mjs';
|
|
59
59
|
import { lastStoreReport } from '../hosts/store-watch.mjs';
|
|
60
60
|
import { hookShimPath, shimDead } from '../hosts/shim.mjs';
|
|
61
61
|
import { printErr, printOut } from '../lib/fs.mjs';
|
|
@@ -272,6 +272,37 @@ export function keptKitFiles(host, scope, root, active) {
|
|
|
272
272
|
return Object.keys(kept).length ? kept : null;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
+
/**
|
|
276
|
+
* The installs present, each with the settings `"env"` objects its hook runs under, for
|
|
277
|
+
* `learnState` (D12). A Claude-shaped hook gets its env from the shell and from the settings
|
|
278
|
+
* files: the host's user settings always, plus the project's two for a project install. Not on
|
|
279
|
+
* the hook path; an unreadable file is simply no env.
|
|
280
|
+
*/
|
|
281
|
+
export function learnInstalls(targets = installTargets()) {
|
|
282
|
+
const envOf = (file) => readJsonMaybe(file)?.env ?? null;
|
|
283
|
+
const out = [];
|
|
284
|
+
for (const [host, scope, root] of targets) {
|
|
285
|
+
let state;
|
|
286
|
+
try { state = installState(root, host, scope); } catch { continue; }
|
|
287
|
+
if (state !== 'active') continue;
|
|
288
|
+
if (!CLAUDE_STYLE.includes(host) || host === 'bob') { out.push({ host }); continue; }
|
|
289
|
+
const spec = HOSTS.find((h) => h.host === host);
|
|
290
|
+
const files = [];
|
|
291
|
+
try { files.push(path.join(spec.configDir(), 'settings.json')); } catch { /* no host dir */ }
|
|
292
|
+
if (scope !== 'global') {
|
|
293
|
+
const dir = path.join(root, spec.projectMarker);
|
|
294
|
+
files.push(path.join(dir, 'settings.json'), path.join(dir, 'settings.local.json'));
|
|
295
|
+
}
|
|
296
|
+
// What the manifest recorded Geneseed wrote (D5): a value equal to it is Geneseed's, any other is the user's.
|
|
297
|
+
const cfg = claudeCfg(root, scope, host);
|
|
298
|
+
const recorded = claudeReadManifest(cfg).managed?.settings_env?.GENESEED_LLM;
|
|
299
|
+
let learn = null;
|
|
300
|
+
try { learn = learnOfDir(cfg, host); } catch { /* no carrier: the default */ }
|
|
301
|
+
out.push({ host, settingsEnv: files.map(envOf), recorded: typeof recorded === 'string' ? recorded : null, learn });
|
|
302
|
+
}
|
|
303
|
+
return out;
|
|
304
|
+
}
|
|
305
|
+
|
|
275
306
|
/**
|
|
276
307
|
* The `[host, scope, root]` of `targets` the user chose as the default, or null: no pick, or a pick
|
|
277
308
|
* that no longer names an ACTIVE install (removed, disabled, or not seen from here). A stale pick
|
|
@@ -365,6 +396,7 @@ export function statusData() {
|
|
|
365
396
|
agent_md_present: Boolean(agentMd && existsSync(agentMd)),
|
|
366
397
|
gates: gateSummary([...(cfgDir ? [cfgDir] : []), ...otherCfg]),
|
|
367
398
|
drafts_pending: pendingDrafts(),
|
|
399
|
+
learn: learnState(process.env, learnInstalls(), readLearnLast()),
|
|
368
400
|
store_report: lastStoreReport(),
|
|
369
401
|
opencode_shadow: opencodeShadowedInstall(),
|
|
370
402
|
openclaude_dual_harness: openclaudeDualHarnessRoots(),
|
|
@@ -477,6 +509,8 @@ export function statusLines(d, color = false, boxed = true) {
|
|
|
477
509
|
rows.push(['gates', `${armed} ${DOT} ${g.total} ask${g.total === 1 ? '' : 's'}`
|
|
478
510
|
+ (byRule ? ` (${byRule})` : '')]);
|
|
479
511
|
}
|
|
512
|
+
// Conditional for the recording reason again; says why no fact is ever distilled on a machine without a model (D12).
|
|
513
|
+
if (d.learn) rows.push(['learn', d.learn]);
|
|
480
514
|
if (d.drafts_pending) {
|
|
481
515
|
rows.push(['drafts', `${d.drafts_pending} in user-rules.draft.md wait${d.drafts_pending === 1 ? 's' : ''} for your decision`]);
|
|
482
516
|
}
|
|
@@ -513,6 +547,8 @@ export function statusLines(d, color = false, boxed = true) {
|
|
|
513
547
|
// Elided at the default, like the shared tier, so a default row prints what it did.
|
|
514
548
|
...(p.contextWindow && p.contextWindow !== DEFAULT_CONTEXT_WINDOW ? [`context window: ${p.contextWindow}`] : []),
|
|
515
549
|
...(p.tiers && p.tiers !== 'off' ? [`model tiers: ${p.tiers}`] : []),
|
|
550
|
+
// The learn model, elided at its default (`light`) like the tiers: a default row prints what it did.
|
|
551
|
+
...(p.learn && p.learn !== DEFAULT_LEARN ? [`learn model: ${p.learn}`] : []),
|
|
516
552
|
// Each elided when armed. The law's text still binds; only its tool-boundary gate is off.
|
|
517
553
|
...GATE_SWITCHES.filter((g) => p[g.key] === false)
|
|
518
554
|
.map((g) => `${g.marker.toLowerCase()}: off${g.law ? ` (Law ${g.law} text still binds)` : ''}`)]
|
package/js/inspect/validate.mjs
CHANGED
|
@@ -155,7 +155,7 @@ export function cmdValidate(args) {
|
|
|
155
155
|
theme: args.theme, footprint: args.footprint, posture: args.posture, mode: args.mode,
|
|
156
156
|
trust: args.trust, doctrines: args.doctrines, excludeRules: args.excludeRules,
|
|
157
157
|
excludeSkills: args.excludeSkills, kits: args.kits, sharedTier: args.sharedTier === 'on',
|
|
158
|
-
contextWindow: args.contextWindow, tiers: args.tiers,
|
|
158
|
+
contextWindow: args.contextWindow, tiers: args.tiers, learn: args.learn,
|
|
159
159
|
...Object.fromEntries(GATE_SWITCHES.map((g) => [g.key, args[g.arg] ? false : null])),
|
|
160
160
|
};
|
|
161
161
|
let scanDirs;
|
package/js/lib/proc.mjs
CHANGED
|
@@ -27,4 +27,40 @@
|
|
|
27
27
|
* `js/maintain/update.mjs`) and are correct — `tests/unit/spawn_hygiene.test.mjs` explains why
|
|
28
28
|
* it asserts no inverse rule.
|
|
29
29
|
*/
|
|
30
|
+
import { existsSync } from 'node:fs';
|
|
31
|
+
import path from 'node:path';
|
|
32
|
+
|
|
30
33
|
export const NO_WINDOW = { windowsHide: process.platform === 'win32' };
|
|
34
|
+
|
|
35
|
+
/** The extensions the model spawn can run on Windows: an executable, or a `cmd.exe` batch shim. */
|
|
36
|
+
const WIN_RUNNABLE = ['.exe', '.com', '.cmd', '.bat'];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The file `word` names as a command, or null: what a spawn of it can actually run, and the one answer
|
|
40
|
+
* `learn`'s spawn and `doctor`'s PATH note share (spec 2026-11-18-learn-model-row, F5).
|
|
41
|
+
*
|
|
42
|
+
* On Windows `CreateProcess` finds only `.exe` on PATH, so an npm-installed CLI (`claude.cmd`,
|
|
43
|
+
* `openclaude.cmd`) is "not found" to a plain `spawn`: the word is resolved here against `PATH` and
|
|
44
|
+
* `PATHEXT`, and only `.exe`, `.com`, `.cmd` and `.bat` count (a `.ps1` or `.vbs` in PATHEXT cannot be
|
|
45
|
+
* run by this spawn). Elsewhere the OS resolves the word at spawn time, so this only reports whether a
|
|
46
|
+
* file of that name sits on `PATH`. `exists` and `platform` are parameters so a table can state every row.
|
|
47
|
+
*/
|
|
48
|
+
export function resolveCommand(word, env = process.env, exists = existsSync, platform = process.platform) {
|
|
49
|
+
if (!word) return null;
|
|
50
|
+
const win = platform === 'win32';
|
|
51
|
+
const sep = win ? /[\\/]/ : /\//;
|
|
52
|
+
const dirs = sep.test(word) ? [''] : String(env.PATH ?? env.Path ?? '').split(win ? ';' : ':').filter(Boolean);
|
|
53
|
+
let exts = [''];
|
|
54
|
+
if (win) {
|
|
55
|
+
const listed = String(env.PATHEXT || '.COM;.EXE;.BAT;.CMD').split(';').map((e) => e.toLowerCase());
|
|
56
|
+
const has = WIN_RUNNABLE.find((e) => word.toLowerCase().endsWith(e));
|
|
57
|
+
exts = has ? [''] : listed.filter((e) => WIN_RUNNABLE.includes(e));
|
|
58
|
+
}
|
|
59
|
+
for (const dir of dirs) {
|
|
60
|
+
for (const ext of exts) {
|
|
61
|
+
const file = dir ? path.join(dir, word + ext) : word + ext;
|
|
62
|
+
if (exists(file)) return file;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
package/js/maintain/memory.mjs
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
import { readdirSync, unlinkSync } from 'node:fs';
|
|
49
49
|
import path from 'node:path';
|
|
50
50
|
|
|
51
|
-
import {
|
|
51
|
+
import { archiveFact, consolidateMemory, isReservedStem, memoryDropIndex } from '../hosts/memory-files.mjs';
|
|
52
52
|
import { recordOwnWrites } from '../hosts/store-watch.mjs';
|
|
53
53
|
import { resolveMemoryDir } from '../hosts/hosts.mjs';
|
|
54
54
|
import { printOut, printErr, isFile } from '../lib/fs.mjs';
|
|
@@ -57,7 +57,7 @@ import { printOut, printErr, isFile } from '../lib/fs.mjs';
|
|
|
57
57
|
export function isFactName(name) {
|
|
58
58
|
return Boolean(name) && !name.includes('/') && !name.includes('\\')
|
|
59
59
|
&& ![...name].some((c) => c.charCodeAt(0) < 0x20 || c.charCodeAt(0) === 0x7f)
|
|
60
|
-
&& !
|
|
60
|
+
&& !isReservedStem(name);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
package/js/maintain/profiles.mjs
CHANGED
|
@@ -27,7 +27,7 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from
|
|
|
27
27
|
import path from 'node:path';
|
|
28
28
|
|
|
29
29
|
import {
|
|
30
|
-
CONTEXT_WINDOWS, DEFAULT_CONTEXT_WINDOW, DEFAULT_TIERS, TIERS_CHOICES, discoverNames, GATE_SWITCHES, knownRuleIds, knownSkillIds, linkedSkillIds, loadKits, PACK_ORDER, ROOT,
|
|
30
|
+
CONTEXT_WINDOWS, DEFAULT_CONTEXT_WINDOW, DEFAULT_LEARN, DEFAULT_TIERS, LEARN_CHOICES, TIERS_CHOICES, discoverNames, GATE_SWITCHES, knownRuleIds, knownSkillIds, linkedSkillIds, loadKits, PACK_ORDER, ROOT,
|
|
31
31
|
} from '../build/source.mjs';
|
|
32
32
|
import { installProfile, setupBuildArgs } from '../build/profile.mjs';
|
|
33
33
|
import { PRESETS } from '../loop/score.mjs';
|
|
@@ -70,9 +70,11 @@ export const BASE_PROFILE = 'starter';
|
|
|
70
70
|
* `tiers` (`--tiers`) is optional and means "the profile sets it" only when present: absent keeps the
|
|
71
71
|
* install's own recorded value (`profileBuildArgs`' `current`), `off` on a fresh install. No shipped
|
|
72
72
|
* profile turns it on.
|
|
73
|
+
* `learn` (`--learn`) is optional the same way: absent keeps the install's own recorded value
|
|
74
|
+
* (`profileBuildArgs`' `currentLearn`), `light` on a fresh install.
|
|
73
75
|
*/
|
|
74
76
|
export const PROFILE_KEYS = ['description', 'hosts', 'theme', 'footprint', 'posture', 'mode', 'trust',
|
|
75
|
-
'doctrines', 'excludeRules', 'excludeSkills', 'kits', 'kitsByDetection', 'sharedTier', 'contextWindow', 'tiers', 'gates', 'login'];
|
|
77
|
+
'doctrines', 'excludeRules', 'excludeSkills', 'kits', 'kitsByDetection', 'sharedTier', 'contextWindow', 'tiers', 'learn', 'gates', 'login'];
|
|
76
78
|
|
|
77
79
|
/** A profile name: a file stem, never a path. */
|
|
78
80
|
const NAME_RE = /^[a-z0-9][a-z0-9._-]*$/i;
|
|
@@ -144,6 +146,7 @@ export function profileProblems(p) {
|
|
|
144
146
|
choice('trust', Object.keys(PRESETS));
|
|
145
147
|
choice('contextWindow', Object.keys(CONTEXT_WINDOWS));
|
|
146
148
|
choice('tiers', [...TIERS_CHOICES]);
|
|
149
|
+
choice('learn', [...LEARN_CHOICES]);
|
|
147
150
|
const packs = discoverNames('doctrines', PACK_ORDER[0]);
|
|
148
151
|
if (p.doctrines !== undefined && p.doctrines !== 'all') {
|
|
149
152
|
if (!stringList(p.doctrines)) errs.push(`'doctrines' must be 'all' or a list of: ${list(packs)}`);
|
|
@@ -258,7 +261,7 @@ export function profileKits(p, host, project = null, detectRoots = {}) {
|
|
|
258
261
|
* here; posture and mode elide only at the value the driver would take anyway. `--reset` last,
|
|
259
262
|
* as the wizard does: a profile is a whole selection and wins over the install it lands on (D14).
|
|
260
263
|
*/
|
|
261
|
-
export function profileBuildArgs(p, host, project = null, current = null, detectRoots = {}) {
|
|
264
|
+
export function profileBuildArgs(p, host, project = null, current = null, detectRoots = {}, currentLearn = null) {
|
|
262
265
|
// A stated selection, never null: `'all'` resolves to the packs, a list is the list.
|
|
263
266
|
const doctrines = PACK_ORDER.filter((d) => profileDoctrines(p).includes(d));
|
|
264
267
|
// PROJECT SCOPE (spec D32, D37): `--emit <host> --out <dir> --root <dir>`, and only here the
|
|
@@ -269,7 +272,9 @@ export function profileBuildArgs(p, host, project = null, current = null, detect
|
|
|
269
272
|
p.contextWindow ?? DEFAULT_CONTEXT_WINDOW,
|
|
270
273
|
// The profile's own value, else the install's recorded one (`current`), else off: a profile
|
|
271
274
|
// without the key never turns a routed install back off by being applied over it.
|
|
272
|
-
p.tiers ?? current ?? DEFAULT_TIERS
|
|
275
|
+
p.tiers ?? current ?? DEFAULT_TIERS,
|
|
276
|
+
// The same for the learn model: a profile without the key never resets a recorded choice.
|
|
277
|
+
p.learn ?? currentLearn ?? DEFAULT_LEARN);
|
|
273
278
|
if (!p.excludeSkills?.length) argv.push('--exclude-skills', 'none');
|
|
274
279
|
argv.push('--reset');
|
|
275
280
|
return argv;
|
|
@@ -303,6 +308,7 @@ export function profileFromInstall(info, description = '') {
|
|
|
303
308
|
contextWindow: info.contextWindow ?? DEFAULT_CONTEXT_WINDOW,
|
|
304
309
|
// Written only when on, so a saved profile of a default install is what it always was.
|
|
305
310
|
...(info.tiers && info.tiers !== DEFAULT_TIERS ? { tiers: info.tiers } : {}),
|
|
311
|
+
...(info.learn && info.learn !== DEFAULT_LEARN ? { learn: info.learn } : {}),
|
|
306
312
|
gates,
|
|
307
313
|
login: true,
|
|
308
314
|
};
|
|
@@ -343,6 +349,11 @@ export function profileDiff(p, base) {
|
|
|
343
349
|
if (w(p) !== w(base)) out.push({ key, base: w(base), now: w(p) });
|
|
344
350
|
continue;
|
|
345
351
|
}
|
|
352
|
+
if (key === 'learn') {
|
|
353
|
+
const w = (prof) => prof.learn ?? DEFAULT_LEARN;
|
|
354
|
+
if (w(p) !== w(base)) out.push({ key, base: w(base), now: w(p) });
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
346
357
|
if (key === 'contextWindow') {
|
|
347
358
|
const w = (prof) => prof.contextWindow ?? DEFAULT_CONTEXT_WINDOW;
|
|
348
359
|
if (w(p) !== w(base)) out.push({ key, base: w(base), now: w(p) });
|
package/js/maintain/setup.mjs
CHANGED
|
@@ -53,7 +53,7 @@ import { loadProfile, profileBuildArgs, profileHosts } from './profiles.mjs';
|
|
|
53
53
|
import { superpowersKitDefault } from './plugin-detect.mjs';
|
|
54
54
|
import { checkProjectFolder, globalLayering, layeringText } from './profile-scope.mjs';
|
|
55
55
|
import { playLine } from '../ui/anim.mjs';
|
|
56
|
-
import { DEFAULT_CONTEXT_WINDOW, DEFAULT_TIERS, discoverNames, GATE_SWITCHES, PACK_ORDER, ROOT, loadKits } from '../build/source.mjs';
|
|
56
|
+
import { DEFAULT_CONTEXT_WINDOW, DEFAULT_LEARN, DEFAULT_TIERS, discoverNames, GATE_SWITCHES, PACK_ORDER, ROOT, loadKits } from '../build/source.mjs';
|
|
57
57
|
import { exportImprovements } from '../inspect/diff.mjs';
|
|
58
58
|
import { cmdDoctor } from '../inspect/doctor.mjs';
|
|
59
59
|
import { setupBuildArgs } from '../build/generate.mjs';
|
|
@@ -61,7 +61,7 @@ import { SHARED_TIER_BENEFIT, sharedTierCost, sharedTierFigure } from '../inspec
|
|
|
61
61
|
import { GLOBAL_MANIFEST, HOSTS, opencodeConfigDir } from '../hosts/hosts.mjs';
|
|
62
62
|
import {
|
|
63
63
|
claudeCfg, defaultMode, defaultPosture, defaultTheme, EMIT_HOST_SCOPE, gatesOfDir, installedDefaults, installState,
|
|
64
|
-
contextWindowOfDir, readJsonMaybe, sharedTierOfDir, themeFiles, tiersOfDir,
|
|
64
|
+
contextWindowOfDir, readJsonMaybe, sharedTierOfDir, themeFiles, tiersOfDir, learnOfDir,
|
|
65
65
|
} from '../hosts/installs.mjs';
|
|
66
66
|
import { printOut, printErr } from '../lib/fs.mjs';
|
|
67
67
|
import { inNpxCache, which } from '../lib/paths.mjs';
|
|
@@ -340,6 +340,23 @@ export function targetTiers(emit, out) {
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
+
/**
|
|
344
|
+
* The learn model of the one install a setup answer re-runs, read off it: PRESERVED, NOT ASKED (the
|
|
345
|
+
* Models page owns the question), as `targetTiers` does, so the wizard's `--reset` cannot reset a
|
|
346
|
+
* recorded choice to the default. No install, or unreadable: the default.
|
|
347
|
+
*/
|
|
348
|
+
export function targetLearn(emit, out) {
|
|
349
|
+
const [host, scope] = EMIT_HOST_SCOPE.get(emit) ?? [];
|
|
350
|
+
try {
|
|
351
|
+
if (!host) return DEFAULT_LEARN;
|
|
352
|
+
const dir = scope === 'global'
|
|
353
|
+
? HOSTS.find((h) => h.host === host).configDir() : resolveOut(out || '.');
|
|
354
|
+
return installState(dir, host, scope) === 'absent' ? DEFAULT_LEARN : learnOfDir(dir, host);
|
|
355
|
+
} catch {
|
|
356
|
+
return DEFAULT_LEARN;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
343
360
|
export function collectSetupLines(kitMap = null) {
|
|
344
361
|
printOut('Geneseed setup — answer a few questions; nothing is written until you confirm.\n');
|
|
345
362
|
const inst = installedDefaults();
|
|
@@ -389,9 +406,10 @@ export function collectSetupLines(kitMap = null) {
|
|
|
389
406
|
const gated = Object.values(gates).some((on) => on === false);
|
|
390
407
|
const contextWindow = targetContextWindow(emit, out, inst.contextWindow);
|
|
391
408
|
const tiers = targetTiers(emit, out);
|
|
409
|
+
const learn = targetLearn(emit, out);
|
|
392
410
|
printOut(`\nAbout to run: geneseed build ${
|
|
393
411
|
setupBuildArgs(theme, emit, out, root, footprint, posture, mode, doctrines, allPacks,
|
|
394
|
-
excludeRules, undefined, excludeSkills, gates, kits, sharedTier, contextWindow, tiers).join(' ')} --reset\n`);
|
|
412
|
+
excludeRules, undefined, excludeSkills, gates, kits, sharedTier, contextWindow, tiers, learn).join(' ')} --reset\n`);
|
|
395
413
|
if (!confirm('Proceed?', true)) return null;
|
|
396
414
|
// The key only when there is something to carry, so a selection that excludes no skill and
|
|
397
415
|
// switches off no gate is the same object it was before either existed.
|
|
@@ -400,6 +418,7 @@ export function collectSetupLines(kitMap = null) {
|
|
|
400
418
|
...(gated ? { gates } : {}), ...(kits ? { kits } : {}), ...(sharedTier ? { sharedTier } : {}),
|
|
401
419
|
...(contextWindow !== DEFAULT_CONTEXT_WINDOW ? { contextWindow } : {}),
|
|
402
420
|
...(tiers !== DEFAULT_TIERS ? { tiers } : {}),
|
|
421
|
+
...(learn !== DEFAULT_LEARN ? { learn } : {}),
|
|
403
422
|
emit, out, root, footprint,
|
|
404
423
|
};
|
|
405
424
|
}
|
|
@@ -595,7 +614,7 @@ export function setupLines() {
|
|
|
595
614
|
const {
|
|
596
615
|
theme, emit, out, root, footprint = 'lean', posture = 'peer', mode = 'direct',
|
|
597
616
|
doctrines = null, excludeRules = null, excludeSkills = null, gates = {}, kits = null,
|
|
598
|
-
sharedTier = false, contextWindow = DEFAULT_CONTEXT_WINDOW, tiers = DEFAULT_TIERS,
|
|
617
|
+
sharedTier = false, contextWindow = DEFAULT_CONTEXT_WINDOW, tiers = DEFAULT_TIERS, learn = DEFAULT_LEARN,
|
|
599
618
|
} = sel;
|
|
600
619
|
if (emit === 'opencode-global') {
|
|
601
620
|
// The build below overwrites the deployed global harness, which may carry hand edits (or
|
|
@@ -615,7 +634,7 @@ export function setupLines() {
|
|
|
615
634
|
// one command and run another.
|
|
616
635
|
const argv = setupBuildArgs(theme, emit, out, root, footprint, posture, mode, doctrines,
|
|
617
636
|
doctrineOptions().map(([n]) => n), excludeRules, undefined, excludeSkills, gates, kits, sharedTier,
|
|
618
|
-
contextWindow, tiers);
|
|
637
|
+
contextWindow, tiers, learn);
|
|
619
638
|
// `--reset`: the wizard's answers are a WHOLE selection, and `setupBuildArgs` elides an axis at
|
|
620
639
|
// its default, so answering one back to it (mode direct, posture peer) over an install would
|
|
621
640
|
// otherwise trip the preserve guard (js/build/profile.mjs). The plan line above says the same.
|
|
@@ -852,8 +871,13 @@ export function profileBuilds(p, targets, { project = null, build, exportDrift,
|
|
|
852
871
|
for (const t of targets) {
|
|
853
872
|
// The install's own tier routing rides along unless the profile names one (`profileBuildArgs`).
|
|
854
873
|
let current = null;
|
|
855
|
-
|
|
856
|
-
|
|
874
|
+
let currentLearn = null;
|
|
875
|
+
try {
|
|
876
|
+
const dir = project ? resolveOut(project) : configDir(t.host);
|
|
877
|
+
current = tiersOfDir(dir, t.host);
|
|
878
|
+
currentLearn = learnOfDir(dir, t.host);
|
|
879
|
+
} catch { /* unreadable: the default */ }
|
|
880
|
+
const argv = profileBuildArgs(p, t.host, project, current, {}, currentLearn);
|
|
857
881
|
const moved = changes(argv);
|
|
858
882
|
let saved = null;
|
|
859
883
|
if (!project) {
|
package/js/maintain/update.mjs
CHANGED
|
@@ -772,7 +772,7 @@ export async function installAxes(dir, { installProfile, setupBuildArgs }, notif
|
|
|
772
772
|
if (!existsSync(path.join(String(dir), '.geneseed-emit'))) return [];
|
|
773
773
|
const p = installProfile('opencode', 'global', String(dir), notify);
|
|
774
774
|
return setupBuildArgs('', 'files', null, null, p.footprint, p.posture, p.mode, p.doctrines,
|
|
775
|
-
undefined, p.excludeRules, p.trust, p.excludeSkills, p, p.kits, p.sharedTier, p.contextWindow, p.tiers).slice(4);
|
|
775
|
+
undefined, p.excludeRules, p.trust, p.excludeSkills, p, p.kits, p.sharedTier, p.contextWindow, p.tiers, p.learn).slice(4);
|
|
776
776
|
}
|
|
777
777
|
|
|
778
778
|
/**
|
package/js/web/actions.mjs
CHANGED
|
@@ -44,7 +44,7 @@ import { DEFAULT_PRESET, PRESETS } from '../loop/score.mjs';
|
|
|
44
44
|
import { activeLoops, setLoopPreset } from '../loop/registry.mjs';
|
|
45
45
|
import { HOSTS, resolvePath } from '../hosts/hosts.mjs';
|
|
46
46
|
import {
|
|
47
|
-
EMIT_FOR, EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, sharedTierOfDir, contextWindowOfDir, tiersOfDir, renderedTier,
|
|
47
|
+
EMIT_FOR, EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, sharedTierOfDir, contextWindowOfDir, tiersOfDir, learnOfDir, renderedTier,
|
|
48
48
|
footprintOfDir, gatesOfDir,
|
|
49
49
|
installedDefaults, installState, installTargets, modeOfDir, postureOfDir, themeOfDir,
|
|
50
50
|
trustOfDir,
|
|
@@ -697,6 +697,8 @@ export function apiRestore(state, files) {
|
|
|
697
697
|
contextWindow: contextWindowOfDir(target),
|
|
698
698
|
// The tier routing, or a restored AGENT.md drops its `Model tiers: auto` line and the agents their model lines.
|
|
699
699
|
tiers: tiersOfDir(target),
|
|
700
|
+
// The learn model, or a restored AGENT.md drops its `Learn model:` line.
|
|
701
|
+
learn: learnOfDir(target),
|
|
700
702
|
// The gate switches: a restored AGENT.md must keep the install's `<gate>: off` lines.
|
|
701
703
|
...gatesOfDir(target),
|
|
702
704
|
}));
|
|
@@ -812,7 +814,7 @@ export function apiInstallCmd(state, body) {
|
|
|
812
814
|
const argv = setupBuildArgs(theme || 'neutral', emit, out, out, fp, pos, mode, doctrines,
|
|
813
815
|
PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates,
|
|
814
816
|
kits ?? migratedKitsOfDir(root, host), sharedTier, bodyContextWindow(body, root, host, scope),
|
|
815
|
-
bodyTiers(body, root, host));
|
|
817
|
+
bodyTiers(body, root, host), learnOfDir(root, host));
|
|
816
818
|
// `--reset`: this argv is a WHOLE selection — every axis is the body's or the install's own —
|
|
817
819
|
// and `setupBuildArgs` elides an axis at its default, so returning one to it (a mode back to
|
|
818
820
|
// direct, a gate re-armed) would otherwise trip the preserve guard (js/build/profile.mjs).
|
|
@@ -937,7 +939,7 @@ export function apiDeployCmd(state, body) {
|
|
|
937
939
|
const argv = setupBuildArgs(theme || 'neutral', host, root, root, fp, pos, mode, doctrines,
|
|
938
940
|
PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates, migratedKitsOfDir(root, host),
|
|
939
941
|
bodySharedTier(body, root, host), bodyContextWindow(body, root, host, 'project'),
|
|
940
|
-
bodyTiers(body, root, host));
|
|
942
|
+
bodyTiers(body, root, host), learnOfDir(root, host));
|
|
941
943
|
// `--reset`, as in `apiInstallCmd`: the form's answers plus the folder's own are a whole selection.
|
|
942
944
|
argv.push('--reset');
|
|
943
945
|
return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
|
package/js/web/api.mjs
CHANGED
|
@@ -116,8 +116,8 @@ export function apiDoctor(state, fresh = false) {
|
|
|
116
116
|
const answer = () => {
|
|
117
117
|
if (state._doctor === null && state._doctorJob !== null) return state._doctorJob.then(answer);
|
|
118
118
|
if (state._doctor === null) state.runDoctor();
|
|
119
|
-
const { ok, problems, checked_at } = state._doctor;
|
|
120
|
-
return { ...state._doctorRun, ok, problems, checked_at };
|
|
119
|
+
const { ok, problems, notes, checked_at } = state._doctor;
|
|
120
|
+
return { ...state._doctorRun, ok, problems, notes, checked_at };
|
|
121
121
|
};
|
|
122
122
|
// A cold cache on a daemon (a view switch dropped it) is filled on the thread, as the overview's is.
|
|
123
123
|
if (state.warm && state._doctor === null) warmDoctor(state);
|
package/js/web/catalog.mjs
CHANGED
|
@@ -30,7 +30,7 @@ import { comparePaths, normcase, within } from '../lib/paths.mjs';
|
|
|
30
30
|
import { stripWhitespace } from '../lib/text.mjs';
|
|
31
31
|
import { readJsonc } from '../hosts/settings.mjs';
|
|
32
32
|
import { SRC, loadKits, makeCfg, ruleCanon, ruleSummaries } from '../build/source.mjs';
|
|
33
|
-
import { RESERVED_STEMS } from '../hosts/memory-files.mjs';
|
|
33
|
+
import { RESERVED_STEMS, isReservedStem } from '../hosts/memory-files.mjs';
|
|
34
34
|
import { loadTheme } from '../build/render.mjs';
|
|
35
35
|
|
|
36
36
|
/** A requested catalog section or item that does not exist. */
|
|
@@ -213,8 +213,10 @@ export const stemOf = (name) => name.slice(0, name.length - path.extname(name).l
|
|
|
213
213
|
* map) but no list holds them, so a list and its count cannot disagree.
|
|
214
214
|
*/
|
|
215
215
|
export const isFurniture = (file, index) => {
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const raw = stemOf(file);
|
|
217
|
+
const stem = raw.toLowerCase();
|
|
218
|
+
// The memory store also treats a stem in capitals alone as a document (`ARCHIVE-INDEX`, D2).
|
|
219
|
+
return stem === index || (index === 'memory' ? isReservedStem(raw) : stem !== 'memory' && RESERVED_STEMS.has(stem));
|
|
218
220
|
};
|
|
219
221
|
|
|
220
222
|
/**
|
package/js/web/profiles-api.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import path from 'node:path';
|
|
|
15
15
|
import { ROOT } from '../build/source.mjs';
|
|
16
16
|
import { installProfile } from '../build/profile.mjs';
|
|
17
17
|
import { HOSTS, expanduser } from '../hosts/hosts.mjs';
|
|
18
|
-
import { installState, installTargets, tiersOfDir } from '../hosts/installs.mjs';
|
|
18
|
+
import { installState, installTargets, learnOfDir, tiersOfDir } from '../hosts/installs.mjs';
|
|
19
19
|
import {
|
|
20
20
|
BASE_PROFILE, isGitClone, listProfiles, loadProfile, profileBuildArgs, profileDiff, profileDirs,
|
|
21
21
|
profileFromInstall, profileHosts, profileKits,
|
|
@@ -83,7 +83,7 @@ function previewRows(p, project, hosts) {
|
|
|
83
83
|
// (`markerCollision`): the row says so and the panel does not offer it.
|
|
84
84
|
const refused = project ? markerCollision(project, h.host) : null;
|
|
85
85
|
const changes = h.present && !refused && state === 'active'
|
|
86
|
-
? profileChanges(profileBuildArgs(p, h.host, project, root ? tiersOfDir(root, h.host) : null)) : [];
|
|
86
|
+
? profileChanges(profileBuildArgs(p, h.host, project, root ? tiersOfDir(root, h.host) : null, {}, root ? learnOfDir(root, h.host) : null)) : [];
|
|
87
87
|
return {
|
|
88
88
|
host: h.host, label: h.label, present: h.present, state, root: root ? String(root) : null,
|
|
89
89
|
changes, layering: project && !refused ? globalLayering(h.host) : null, refused,
|
package/js/web/state.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
postureOfDir, themeOfDir, trustOfDir,
|
|
17
17
|
} from '../hosts/installs.mjs';
|
|
18
18
|
import { doctorCollect } from '../inspect/doctor.mjs';
|
|
19
|
+
import { isDoctorNote } from '../inspect/scan.mjs';
|
|
19
20
|
import { emitOf, pickedInstall } from '../inspect/status.mjs';
|
|
20
21
|
import { DEFAULT_PRESET } from '../loop/score.mjs';
|
|
21
22
|
import { readText, isFile } from '../lib/fs.mjs';
|
|
@@ -191,8 +192,18 @@ export function webState(theme = null, target = null) {
|
|
|
191
192
|
};
|
|
192
193
|
st.stampDoctor = (problems, themes = [], groups = []) => {
|
|
193
194
|
st._doctorJob = null; // a run still in flight started earlier: this verdict is the newer one
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
// `doctorCollect` hands back `[note] …` lines among the problems; the CLI keeps them apart
|
|
196
|
+
// and so does the console (a healthy machine is not "1 problem"). The ONE split, shared by
|
|
197
|
+
// the in-process run and the worker's message, since both end here.
|
|
198
|
+
const notes = problems.filter(isDoctorNote);
|
|
199
|
+
const real = problems.filter((p) => !isDoctorNote(p));
|
|
200
|
+
const split = groups.map((g) => ({
|
|
201
|
+
...g,
|
|
202
|
+
problems: g.problems.filter((p) => !isDoctorNote(p)),
|
|
203
|
+
notes: [...(g.notes ?? []), ...g.problems.filter(isDoctorNote)],
|
|
204
|
+
}));
|
|
205
|
+
st._doctor = { ok: !real.length, problems: real, notes, checked_at: stampMinute(Date.now()) };
|
|
206
|
+
st._doctorRun = { themes, groups: split };
|
|
196
207
|
};
|
|
197
208
|
/**
|
|
198
209
|
* The CURRENT install's mode, from its `.geneseed-emit` marker: the ROOT first (where
|
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": "6.0.
|
|
4
|
+
"version": "6.0.4",
|
|
5
5
|
"description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ai",
|
package/src/AGENT.md.tmpl
CHANGED
|
@@ -293,7 +293,7 @@ inventory — that list is the catalogue and it is authoritative, as is its
|
|
|
293
293
|
procedure is in [`{{DIR_SKILLS}}/`]({{DIR_SKILLS}}/) and the host loads it on
|
|
294
294
|
demand.
|
|
295
295
|
<!-- CATALOG:end -->
|
|
296
|
-
{{EXCLUDED_SKILLS_LINE}}{{KITS_LINE}}{{SHARED_TIER_LINE}}{{CONTEXT_WINDOW_LINE}}{{TIERS_LINE}}
|
|
296
|
+
{{EXCLUDED_SKILLS_LINE}}{{KITS_LINE}}{{SHARED_TIER_LINE}}{{CONTEXT_WINDOW_LINE}}{{TIERS_LINE}}{{LEARN_LINE}}
|
|
297
297
|
When a task repeats and no {{SKILL}} covers it, forge one through the
|
|
298
298
|
[skill-forge]({{DIR_SKILLS}}/skill-forge.md) {{SKILL}}: copy
|
|
299
299
|
[`{{DIR_SKILLS}}/_template.md`]({{DIR_SKILLS}}/_template.md), keep it to one coherent
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## When to dispatch
|
|
6
6
|
- The {{MEMORY}} store needs tidying in bulk. The session context says so in one
|
|
7
|
-
line when a
|
|
7
|
+
line when a `misc` topic exists; or the user asks
|
|
8
8
|
to tidy, dedupe or re-topic their memory.
|
|
9
9
|
- `geneseed memory consolidate` reported duplicate descriptions that need a merge.
|
|
10
10
|
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
2. For each topic, verify and classify its facts as the
|
|
37
37
|
rule {{SKILL}}'s consolidation flow does (verify, classify, apply with consent):
|
|
38
38
|
keep, merge, rewrite, promote or retire. Show the topic's plan, then apply it.
|
|
39
|
+
When you rewrite a fact, bring it to the convention's *Writing a fact* bar: durable,
|
|
40
|
+
general, lean. A fact that is only task residue is archived, not rewritten. Move the
|
|
41
|
+
old version into `archive/` before you overwrite it, so every rewrite can be undone.
|
|
39
42
|
3. **Merge** overlapping facts into one survivor that keeps both `**Why:**` /
|
|
40
43
|
`**How to apply:**` lines and both sets of `[[links]]`; archive the merged-away
|
|
41
44
|
file with `geneseed memory rm`.
|
package/src/doctrines/process.md
CHANGED
|
@@ -8,13 +8,13 @@ architectural stance, record it before the session ends. A durable fact goes int
|
|
|
8
8
|
{{MEMORY}} on your own, with no prompt: the user sees every memory later in the web
|
|
9
9
|
console. A standing rule binds every later session, so it is the user's call: take it to
|
|
10
10
|
them through the rule {{SKILL}}. A memory phrased as an instruction to later sessions
|
|
11
|
-
("always…", "never…", `force: constraint`) is a standing rule.
|
|
11
|
+
("always…", "never…", `force: constraint`) is a standing rule. Store only what stays true past this task, in the fewest words that keep it exact.
|
|
12
12
|
<!-- LEAN:else -->
|
|
13
13
|
When a session yields a durable decision, correction, non-obvious discovery, or
|
|
14
14
|
architectural stance, record it before it ends: a durable fact into {{MEMORY}} on your
|
|
15
15
|
own (the user sees it in the web console); a standing rule, which includes
|
|
16
16
|
any instruction to later sessions ("always…", "never…", `force: constraint`), only through
|
|
17
|
-
the rule {{SKILL}}, with the user's consent.
|
|
17
|
+
the rule {{SKILL}}, with the user's consent. Store only what stays true past this task, in the fewest words that keep it exact.
|
|
18
18
|
<!-- LEAN:end -->
|
|
19
19
|
|
|
20
20
|
### {{DOCTRINE:plan-before-acting}} Plan Before Acting
|
package/src/memory/README.md
CHANGED
|
@@ -31,7 +31,7 @@ topic: <kebab-case-slug> # optional; index group,
|
|
|
31
31
|
force: constraint | choice | conviction | tempered # optional
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
-
The fact
|
|
34
|
+
The fact in one or two sentences (see *Writing a fact*). For `feedback` and `project`, follow with
|
|
35
35
|
**Why:** and **How to apply:** lines. Link related memories with [[their-name]].
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -39,6 +39,26 @@ The fact, stated plainly. For `feedback` and `project`, follow with
|
|
|
39
39
|
binds* — the two are independent axes. Leave `force` off for a plain fact; add it
|
|
40
40
|
when a memory is a decision or stance the agent must weigh before overriding.
|
|
41
41
|
|
|
42
|
+
## Writing a fact
|
|
43
|
+
|
|
44
|
+
Every fact is read again in later sessions, and its `description` loads with its topic
|
|
45
|
+
file, so each word costs on every recall.
|
|
46
|
+
|
|
47
|
+
- **Durable only.** Store what stays true and useful at the start of an unrelated later
|
|
48
|
+
task: a preference, a convention, a decision and its reason, a trap and its fix. Never
|
|
49
|
+
store task residue: what this session did, fixed, merged or released, a PR or ticket
|
|
50
|
+
number, a session-specific count or status such as "pending" or "next is…". The git history holds those.
|
|
51
|
+
- **General, not the incident.** State the principle the incident taught. Name a file,
|
|
52
|
+
function or command only when the fact is about it.
|
|
53
|
+
- **Lean.** `description` is one line that states the claim itself, specific enough to
|
|
54
|
+
tell it from its neighbours: it is the index hook, and the only field `learn` reads to
|
|
55
|
+
choose between update and create. A bare label ("Plugin panels") is too vague. The body
|
|
56
|
+
holds the fact in one or two sentences; **Why:** and **How to apply:** take one line
|
|
57
|
+
each. No narrative, no story of how it was found, no repeat of the description. Keep a
|
|
58
|
+
date only when the fact depends on it, and write it absolute.
|
|
59
|
+
- **Too long for this is documentation.** Put it in the project's docs and store a
|
|
60
|
+
one-line `reference` pointer to it.
|
|
61
|
+
|
|
42
62
|
## Types
|
|
43
63
|
|
|
44
64
|
- **user** — who the user is: role, expertise, stable preferences.
|
|
@@ -87,9 +107,10 @@ memory that carries a `force`; revising one stays with the agent and the user.
|
|
|
87
107
|
`archive/` needs the user's consent ({{LAW:deletion-is-deliberate}}):
|
|
88
108
|
`geneseed memory list --archived`, then `geneseed memory rm <name> --archived --purge`.
|
|
89
109
|
`archive/` is part of this git-ignored store.
|
|
90
|
-
- When
|
|
91
|
-
|
|
92
|
-
|
|
110
|
+
- When facts sit in `misc` (no `topic:` and no `type:`), the session context says so in
|
|
111
|
+
one line; the memory-curator {{AGENT}} then assigns topics, merges and archives in
|
|
112
|
+
bulk, and proposes deletions for approval. The size of a topic never raises it: a large
|
|
113
|
+
store is read through its topic files, not curated for its size.
|
|
93
114
|
- Don't store what the repo already records (code structure, git history, the
|
|
94
115
|
{{LAWS}}, `user-rules.md`). Store what was *non-obvious*.
|
|
95
116
|
- When the same `feedback` lesson keeps recurring, propose promoting it into a
|
|
@@ -114,8 +135,26 @@ lowercase `[a-z0-9-]`. Both levels are generated from the fact files:
|
|
|
114
135
|
`geneseed memory consolidate --memory <this dir>` rebuilds them (refreshing each
|
|
115
136
|
hook from its `description`), and the `learn` hook rebuilds them after every fact it
|
|
116
137
|
writes, updates or archives. Only top-level fact files are indexed; `archive/` and
|
|
117
|
-
`agents/` never are.
|
|
118
|
-
|
|
138
|
+
`agents/` never are.
|
|
139
|
+
|
|
140
|
+
**A top-level file whose name is all capitals is a store document, not a fact:** `MEMORY.md`,
|
|
141
|
+
`README.md`, `ARCHIVE-INDEX.md`. It is never indexed, never filed under `misc`, never shown to
|
|
142
|
+
`learn`, and `geneseed memory rm` refuses it. Name a fact in lower case.
|
|
143
|
+
|
|
144
|
+
**A build moves a flat index to this layout, once, in every store it manages** — each install's
|
|
145
|
+
and the machine tier's. It keeps each pointer's own title and hook and
|
|
146
|
+
every other line of the old `MEMORY.md` (headings, prose, a pointer to a store document), and it
|
|
147
|
+
never touches a fact file. The hand-written headings that grouped the old fact lines now sit above
|
|
148
|
+
nothing; delete them once if they bother you.
|
|
149
|
+
|
|
150
|
+
**Rules the old index loaded every session become drafts.** A flat index was cut by position at
|
|
151
|
+
session start, so what sat in its first 3 072 characters loaded by accident. At the move, a
|
|
152
|
+
`feedback` fact whose line sat there, any fact with `force: constraint`, and a `feedback` fact whose
|
|
153
|
+
description says *always* or *never* (*toujours*, *jamais*) are written to `user-rules.draft.md`
|
|
154
|
+
(at most 30), exactly as the fold drafts a rule; `user-rules.md` is never written without your
|
|
155
|
+
decision. A draft does not load until you approve it, in the console or with the rule {{SKILL}}:
|
|
156
|
+
an approved draft moves into `user-rules.md`, which loads; a rejected one is dropped. Until then
|
|
157
|
+
a one-line reminder at session start says how many wait. A second build drafts nothing new.
|
|
119
158
|
|
|
120
159
|
## Per-{{AGENT}} memory (`agents/` subdirectory)
|
|
121
160
|
|
|
@@ -52,7 +52,9 @@ The lines under the pointer are the rule as it stands, with its own metadata lin
|
|
|
52
52
|
blocks after it. This line is a record: leave every `R<n>` citation in the facts as it is.
|
|
53
53
|
6. Delete the block.
|
|
54
54
|
|
|
55
|
-
Leave the host file alone. The next fold of that host removes the rule from it.
|
|
55
|
+
Leave the host file alone. The next fold of that host removes the rule from it. A block from host
|
|
56
|
+
`memory` is a fact of the store the build migrated: its `source` is the fact file, and nothing
|
|
57
|
+
removes the fact. Either decision ends the fact's loading under the memory map at session start.
|
|
56
58
|
- **Reject** means "keep it on this host only". Set the row's `state` to `rejected`, and delete
|
|
57
59
|
the block. The rule stays in the host file, and the fold never drafts it again.
|
|
58
60
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# {{SKILL}}: rule — consolidation flow
|
|
2
2
|
|
|
3
3
|
Tends the {{MEMORY}} set as a whole. A store too large for one careful read (a
|
|
4
|
-
topic over 40 facts, or a `misc` topic)
|
|
4
|
+
topic over 40 facts, or a `misc` topic) may go to the memory-curator {{AGENT}}
|
|
5
5
|
instead: it runs this flow topic by topic in its own context and also assigns topics.
|
|
6
6
|
|
|
7
7
|
1. **Read the whole set once**: `MEMORY.md`, its `topics/` files, every fact they
|