geneseed 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/SHIPPED.md +2 -2
- package/adapters/opencode/README.md +4 -3
- package/adapters/opencode/plugins/geneseed-context.js +26 -19
- package/adapters/opencode/plugins/geneseed-guard.js +112 -7
- package/bin/geneseed-cli.mjs +3 -0
- package/docs/concepts/exclusions.md +1 -1
- package/docs/concepts/host-matrix.md +1 -1
- package/docs/guides/setup-doctrines.md +1 -1
- package/docs/understand/enforced-vs-asked.md +1 -1
- package/harness.config.json +1 -1
- package/js/README.md +7 -5
- package/js/build/args.mjs +7 -1
- package/js/build/bundle.mjs +122 -23
- package/js/build/driver.mjs +32 -12
- package/js/build/emit-claude.mjs +2 -1
- package/js/build/emit-common.mjs +2 -2
- package/js/build/emit-opencode.mjs +22 -10
- package/js/build/export.mjs +431 -0
- package/js/build/generate.mjs +3 -0
- package/js/build/source.mjs +6 -1
- package/js/cli-table.json +102 -2
- package/js/hosts/hooks-done.mjs +8 -2
- package/js/hosts/hooks.mjs +105 -4
- package/js/hosts/hosts.mjs +2 -4
- package/js/hosts/installs.mjs +28 -0
- package/js/hosts/loss.mjs +19 -2
- package/js/hosts/memory-files.mjs +3 -0
- package/js/hosts/native.mjs +30 -2
- package/js/hosts/owned.mjs +55 -1
- package/js/hosts/ownership-gate.mjs +5 -5
- package/js/hosts/settings.mjs +83 -33
- package/js/lib/managed-block.mjs +74 -0
- package/js/maintain/memory.mjs +27 -2
- package/js/maintain/uninstall.mjs +57 -14
- package/js/web/actions.mjs +3 -0
- package/js/web/api.mjs +4 -1
- package/package.json +1 -1
- package/src/agents/memory-curator.md +4 -4
- package/src/memory/README.md +1 -1
- package/src/skills/geneseed.md +1 -1
- package/src/skills/rule/consolidate.md +1 -1
- package/src/skills/rule.md +1 -1
- package/web/dist/assets/{Activity-CpkBwpu7.js → Activity-DlQ30znB.js} +1 -1
- package/web/dist/assets/{ActivityDetail-DTPziZWM.js → ActivityDetail-CG0mn5fW.js} +1 -1
- package/web/dist/assets/{Bonsai-hiG_gGNU.js → Bonsai-DSwUbavu.js} +1 -1
- package/web/dist/assets/{CopyButton-DUIUfNp6.js → CopyButton-BzRQz7k2.js} +1 -1
- package/web/dist/assets/{Dashboard-Dnw6EyX7.js → Dashboard-Ce3UOsxJ.js} +2 -2
- package/web/dist/assets/{Docs-BEET_l16.js → Docs-CisVnYqv.js} +1 -1
- package/web/dist/assets/{Factories-D6KXkfWw.js → Factories-Dq5oW4CU.js} +1 -1
- package/web/dist/assets/{GreenhouseView-BKxy5apE.js → GreenhouseView-y9WAfcc_.js} +1 -1
- package/web/dist/assets/Installs-m4GElwFW.js +3 -0
- package/web/dist/assets/{JournalView-ChFitHjo.js → JournalView-DeBLRNGc.js} +1 -1
- package/web/dist/assets/{Kits-CcR-OlwQ.js → Kits-DJYVAnyE.js} +1 -1
- package/web/dist/assets/{Laws-B1s5idOg.js → Laws-CNpc_8ZV.js} +1 -1
- package/web/dist/assets/{LibRows-BZgdbI1l.js → LibRows-RO5bvXth.js} +1 -1
- package/web/dist/assets/{Library-x6TkkEVF.js → Library-Dg0ScciC.js} +1 -1
- package/web/dist/assets/{Loops-BH93KKxn.js → Loops-CjEdo-NG.js} +1 -1
- package/web/dist/assets/{OperatorHudView-BO0aIKPL.js → OperatorHudView-2ujVMjq1.js} +1 -1
- package/web/dist/assets/{Personal-CE_0Vhh0.js → Personal-D0yS7ahT.js} +1 -1
- package/web/dist/assets/{Settings-CbpZvVN_.js → Settings-DEN0U8QI.js} +1 -1
- package/web/dist/assets/{Tabs-C2oW7oEj.js → Tabs-But5R6_r.js} +1 -1
- package/web/dist/assets/{index-BQwOmbor.js → index-Ck42AbRX.js} +2 -2
- package/web/dist/assets/{index-CuIop_pO.css → index-PG_ukkh6.css} +1 -1
- package/web/dist/index.html +2 -2
- package/adapters/claude-code/skills/geneseed/SKILL.md +0 -76
- package/web/dist/assets/Installs-CnFVlVD0.js +0 -3
package/js/hosts/settings.mjs
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
*/
|
|
36
36
|
import { existsSync, mkdirSync, renameSync, rmSync, unlinkSync } from 'node:fs';
|
|
37
37
|
import path from 'node:path';
|
|
38
|
+
import { blockDelimiters, blockSpan } from '../lib/managed-block.mjs';
|
|
38
39
|
import { readText, writeText, isOsError } from '../lib/fs.mjs';
|
|
39
40
|
import {
|
|
40
41
|
jsonDumps, jsonDumpsCompact, jsonDumpsIndent, parseJson, deepEquals, formatRepr,
|
|
@@ -272,6 +273,10 @@ function defaultPermission(doctrines = null, excluded = [], deletionGate = true)
|
|
|
272
273
|
const OWNED_BASH = ['git commit*', 'git push*',
|
|
273
274
|
...PUSH_CHAIN.flatMap(([keys]) => keys)];
|
|
274
275
|
|
|
276
|
+
/** The verdict Geneseed itself writes for each owned key — what "still reads as ours" means. */
|
|
277
|
+
const OWNED_VERDICT = new Map([['git commit*', 'ask'], ['git push*', 'ask']]);
|
|
278
|
+
for (const [keys, verdict] of PUSH_CHAIN) for (const k of /** @type {string[]} */ (keys)) OWNED_VERDICT.set(k, /** @type {string} */ (verdict));
|
|
279
|
+
|
|
275
280
|
/**
|
|
276
281
|
* Bring an ALREADY-WRITTEN `permission` block back into line with the pack selection, and
|
|
277
282
|
* touch nothing else. Returns `[changed, stranded]` — whether anything moved, and the owned
|
|
@@ -293,16 +298,27 @@ const OWNED_BASH = ['git commit*', 'git push*',
|
|
|
293
298
|
* thing to want, and the value Geneseed writes precisely because it is the obvious one — had
|
|
294
299
|
* it DELETED by a pack-off build.
|
|
295
300
|
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
301
|
+
* THE RECORD IS THE MANIFEST'S `bash_gates` (5.2.0), the `bash` twin of `skill_denies` and
|
|
302
|
+
* `edit_asks`: the keys an emit itself ADDED, because they were absent when it ran. `record` is
|
|
303
|
+
* the previous manifest's list, as a Set, updated in place. A key that was already there, at
|
|
304
|
+
* any value, is the user's and is never claimed — the value is what a user would write too, and
|
|
305
|
+
* the carrier's `Active packs:` marker cannot stand in for a record either: this same emit
|
|
306
|
+
* rewrites it BEFORE `mergeOpencodeJson` runs, so it answers with the NEW selection and would
|
|
307
|
+
* licence every removal. (This docblock once ruled the record out as "a new marker file"; the
|
|
308
|
+
* manifest has since carried two such records, so it is one more key, not one more file.)
|
|
309
|
+
*
|
|
310
|
+
* So an unwanted owned key goes only when BOTH hold: it is recorded, and it still reads
|
|
311
|
+
* Geneseed's own verdict (`OWNED_VERDICT`) — the record licenses taking back our entry, not
|
|
312
|
+
* whatever a user has since put under that key. Anything else stays and is reported as
|
|
313
|
+
* `stranded`, so the user is told rather than left to discover it.
|
|
314
|
+
*
|
|
315
|
+
* `pruneAll` (`--prune-gates`) IS THE USER SAYING "THEY ARE YOURS" for an install that predates
|
|
316
|
+
* the record: every `opencode.json` written before 5.2.0 has the gates and no `bash_gates`, so
|
|
317
|
+
* without it they would be stranded for good. For that one build it stands in for the record;
|
|
318
|
+
* the value check stays, so an entry the user re-scoped is still kept. One-shot: no marker
|
|
319
|
+
* records it and no rebuild replays it.
|
|
304
320
|
*
|
|
305
|
-
*
|
|
321
|
+
* A stranded gate is wired for a rule this build does not make binding, which is the
|
|
306
322
|
* FAIL-CLOSED direction — the boundary asks for a confirmation the constitution no longer
|
|
307
323
|
* compels, exactly as the commit skill's own consent step does with the pack off. The unsafe
|
|
308
324
|
* direction, a rule with no gate behind it, cannot occur here. A FRESH file is unaffected:
|
|
@@ -319,10 +335,11 @@ const OWNED_BASH = ['git commit*', 'git push*',
|
|
|
319
335
|
* Returns a third element, `opaque`: the shape reason wiring was impossible, or `null`. The
|
|
320
336
|
* caller warns on it. This is the one branch where the boundary can end up with NO Geneseed
|
|
321
337
|
* gate at all while the constitution states the rule — the unsafe direction — so it must not
|
|
322
|
-
* also be the silent one.
|
|
338
|
+
* also be the silent one. `removed` collects the keys taken back, for the commented-`.jsonc`
|
|
339
|
+
* branch, which cannot write and has to name them instead.
|
|
323
340
|
* @returns {[boolean, string[], string | null]}
|
|
324
341
|
*/
|
|
325
|
-
function reconcileOpencodePermission(perm, want) {
|
|
342
|
+
function reconcileOpencodePermission(perm, want, record = new Set(), pruneAll = false, removed = []) {
|
|
326
343
|
// A `permission` that is not an object, or whose `bash` is not one — OpenCode also accepts a
|
|
327
344
|
// bare `"bash": "allow"` — is a shape this function has no owned keys inside of. Leaving it
|
|
328
345
|
// exactly as found is the whole point; rewriting it into a map would DELETE a blanket policy
|
|
@@ -335,12 +352,23 @@ function reconcileOpencodePermission(perm, want) {
|
|
|
335
352
|
const bash = fresh ? {} : get(perm, 'bash');
|
|
336
353
|
let changed = false;
|
|
337
354
|
const stranded = [];
|
|
355
|
+
let addedAny = false;
|
|
338
356
|
for (const k of OWNED_BASH) {
|
|
339
357
|
if (has(want.bash, k)) {
|
|
340
|
-
if (!has(bash, k)) { bash[k] = want.bash[k]; changed = true; }
|
|
341
|
-
} else if (has(bash, k))
|
|
358
|
+
if (!has(bash, k)) { bash[k] = want.bash[k]; changed = addedAny = true; record.add(k); }
|
|
359
|
+
} else if (has(bash, k)) {
|
|
360
|
+
if ((record.has(k) || pruneAll) && bash[k] === OWNED_VERDICT.get(k)) {
|
|
361
|
+
delete bash[k];
|
|
362
|
+
removed.push(k);
|
|
363
|
+
changed = true;
|
|
364
|
+
} else stranded.push(k);
|
|
365
|
+
// Taken back, or re-scoped by the user since: either way no longer ours to remember.
|
|
366
|
+
record.delete(k);
|
|
367
|
+
} else record.delete(k);
|
|
342
368
|
}
|
|
343
|
-
if (
|
|
369
|
+
if (addedAny && fresh) perm.bash = bash;
|
|
370
|
+
// The last gate out takes the map with it, as uninstall drops an emptied `permission.skill`.
|
|
371
|
+
if (removed.length && !fresh && !Object.keys(bash).length) delete perm.bash;
|
|
344
372
|
return [changed, stranded, null];
|
|
345
373
|
}
|
|
346
374
|
|
|
@@ -619,9 +647,12 @@ export function atomicWriteJson(p, config) {
|
|
|
619
647
|
* `result.skillsAdded` is set to the `permission.skill` denies this call added ONLY when the
|
|
620
648
|
* file on disk now matches what it computed (written, or nothing to change). Left unset on
|
|
621
649
|
* every path that wrote nothing — unreadable, not an object, commented `.jsonc`, write
|
|
622
|
-
* failure — so the caller keeps its previous record rather than claiming denies never written.
|
|
650
|
+
* failure — so the caller keeps its previous record rather than claiming denies never written.
|
|
651
|
+
* `result.bashGates` (the next `bash_gates`, from `oldGates`) follows the same rule.
|
|
652
|
+
* `pruneGates` is `--prune-gates`: see `reconcileOpencodePermission`. */
|
|
623
653
|
export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [], skillNames = [],
|
|
624
|
-
staleSkillNames = [], result = {}, deletionGate = true, editAsks = [], oldEdit = null
|
|
654
|
+
staleSkillNames = [], result = {}, deletionGate = true, editAsks = [], oldEdit = null,
|
|
655
|
+
oldGates = [], pruneGates = false) {
|
|
625
656
|
const target = opencodeTarget(p);
|
|
626
657
|
let config = { $schema: OPENCODE_SCHEMA, instructions: [] };
|
|
627
658
|
const { state, data, hadComments, error } = loadJsonObject(target);
|
|
@@ -655,11 +686,16 @@ export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [],
|
|
|
655
686
|
let skillOpaque = null;
|
|
656
687
|
let permIsObject = true;
|
|
657
688
|
const added = [];
|
|
689
|
+
const gates = new Set(oldGates);
|
|
690
|
+
const gatesRemoved = [];
|
|
691
|
+
let permOther = false; // a `permission.skill` or `.edit` change, as opposed to a bash gate's
|
|
658
692
|
// The edit record is a copy, filled in place, and handed back only on the paths that wrote.
|
|
659
693
|
const edit = { asks: [...((oldEdit && oldEdit.asks) || [])], shorthand: (oldEdit && oldEdit.shorthand) || null };
|
|
660
694
|
let editNote = null;
|
|
661
695
|
if (addPerm) {
|
|
662
696
|
config.permission = defaultPermission(doctrines, excluded, deletionGate);
|
|
697
|
+
gates.clear();
|
|
698
|
+
for (const k of Object.keys(config.permission.bash)) gates.add(k);
|
|
663
699
|
if (skillNames.length) {
|
|
664
700
|
config.permission.skill = defaultSkillPermission(skillNames);
|
|
665
701
|
added.push(...skillNames);
|
|
@@ -669,7 +705,7 @@ export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [],
|
|
|
669
705
|
const perm = get(config, 'permission');
|
|
670
706
|
permIsObject = isDict(perm);
|
|
671
707
|
[permChanged, stranded, opaque] = reconcileOpencodePermission(perm,
|
|
672
|
-
defaultPermission(doctrines, excluded, deletionGate));
|
|
708
|
+
defaultPermission(doctrines, excluded, deletionGate), gates, pruneGates, gatesRemoved);
|
|
673
709
|
// Independent of the `bash` shape: a `permission.bash` the build cannot wire into must
|
|
674
710
|
// not also block the UNRELATED `permission.skill` key from being reconciled.
|
|
675
711
|
if (permIsObject) {
|
|
@@ -680,6 +716,7 @@ export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [],
|
|
|
680
716
|
let editChanged;
|
|
681
717
|
[editChanged, editNote] = reconcileOpencodeEditPermission(perm, editAsks, edit);
|
|
682
718
|
permChanged = permChanged || editChanged;
|
|
719
|
+
permOther = skillChanged || editChanged;
|
|
683
720
|
}
|
|
684
721
|
}
|
|
685
722
|
// The shape said no. This is the direction the residue warning above is NOT — a rule stated
|
|
@@ -713,8 +750,9 @@ export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [],
|
|
|
713
750
|
process.stderr.write(`[geneseed] WARN: ${path.basename(target)} keeps `
|
|
714
751
|
+ `${stranded.map((k) => jsonDumps(k)).join(', ')} under "permission".bash — the `
|
|
715
752
|
+ 'rule behind those gates (a doctrine, or the deletion gate) is off in this build, but '
|
|
716
|
-
+ 'Geneseed
|
|
717
|
-
+ '
|
|
753
|
+
+ 'Geneseed has no record that it wrote them, so it leaves them. Run this build once '
|
|
754
|
+
+ 'with --prune-gates to remove those still set as Geneseed writes them, or delete them '
|
|
755
|
+
+ 'by hand.\n');
|
|
718
756
|
}
|
|
719
757
|
if (editNote) {
|
|
720
758
|
process.stderr.write(`[geneseed] WARN: "permission"."edit" in ${path.basename(target)} `
|
|
@@ -730,9 +768,20 @@ export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [],
|
|
|
730
768
|
if (!addInstr && !permChanged && !addLsp && !addDepth) {
|
|
731
769
|
result.skillsAdded = added;
|
|
732
770
|
result.editRecord = edit;
|
|
771
|
+
result.bashGates = [...gates];
|
|
733
772
|
return target;
|
|
734
773
|
}
|
|
735
774
|
if (path.extname(target) === '.jsonc' && hadComments) {
|
|
775
|
+
// Named, since this branch cannot take them out; `bash_gates` keeps its old value (the
|
|
776
|
+
// caller's rule for a merge that wrote nothing), so they are still ours on the next emit.
|
|
777
|
+
if (gatesRemoved.length) {
|
|
778
|
+
process.stderr.write(`[geneseed] WARN: ${path.basename(target)} has comments, so it is `
|
|
779
|
+
+ 'not rewritten: remove these from its "permission".bash by hand — the rule behind '
|
|
780
|
+
+ `them is off in this build: ${gatesRemoved.map((k) => jsonDumps(k)).join(', ')}.\n`);
|
|
781
|
+
// Nothing but removals: the paste-in advice below is for what a file is MISSING.
|
|
782
|
+
const gateAdds = [...gates].some((k) => !oldGates.includes(k));
|
|
783
|
+
if (!addInstr && !addPerm && !gateAdds && !permOther && !addLsp && !addDepth) return target;
|
|
784
|
+
}
|
|
736
785
|
// ⚠ THE TWO CASES GIVE OPPOSITE ADVICE, and telling a file that HAS a `permission` key to
|
|
737
786
|
// add one is how the first cut of this got it wrong. `add` = there is no block, here is the
|
|
738
787
|
// whole one; `reconcile` = there is a block and it is missing gates this build wires, and
|
|
@@ -752,6 +801,7 @@ export function mergeOpencodeJson(p, agentPath, doctrines = null, excluded = [],
|
|
|
752
801
|
atomicWriteJson(target, config);
|
|
753
802
|
result.skillsAdded = added;
|
|
754
803
|
result.editRecord = edit;
|
|
804
|
+
result.bashGates = [...gates];
|
|
755
805
|
} catch (e) {
|
|
756
806
|
if (!isOsError(e)) throw e;
|
|
757
807
|
process.stderr.write(`[geneseed] WARN: could not write ${target} (${e.message}) — `
|
|
@@ -1350,7 +1400,8 @@ export function settingsIntegrityCheck(p, managed, expect = 'present') {
|
|
|
1350
1400
|
return flush();
|
|
1351
1401
|
}
|
|
1352
1402
|
|
|
1353
|
-
|
|
1403
|
+
// Where the block is: `blockSpan` (js/lib/managed-block.mjs), shared with the hook-side readers.
|
|
1404
|
+
const delimiters = blockDelimiters;
|
|
1354
1405
|
|
|
1355
1406
|
/**
|
|
1356
1407
|
* `_build_settings._managed_block_write` — 'created' | 'updated' | 'merged'.
|
|
@@ -1365,10 +1416,9 @@ export function managedBlockWrite(p, content, blockId = 'GENESEED') {
|
|
|
1365
1416
|
return 'created';
|
|
1366
1417
|
}
|
|
1367
1418
|
const existing = readText(p);
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
writeText(p, pre + block + lstripNewlines(post));
|
|
1419
|
+
const span = blockSpan(existing, blockId);
|
|
1420
|
+
if (span) {
|
|
1421
|
+
writeText(p, existing.slice(0, span[0]) + block + lstripNewlines(existing.slice(span[1])));
|
|
1372
1422
|
return 'updated';
|
|
1373
1423
|
}
|
|
1374
1424
|
const sep = existing.endsWith('\n') ? '' : '\n';
|
|
@@ -1383,12 +1433,11 @@ export function managedBlockRemove(p, blockId = 'GENESEED', whole = false) {
|
|
|
1383
1433
|
unlinkSync(p);
|
|
1384
1434
|
return;
|
|
1385
1435
|
}
|
|
1386
|
-
const [begin, end] = delimiters(blockId);
|
|
1387
1436
|
const existing = readText(p);
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1437
|
+
const span = blockSpan(existing, blockId);
|
|
1438
|
+
if (!span) return;
|
|
1439
|
+
const rest = stripWhitespace(`${stripTrailingNewlines(existing.slice(0, span[0]))}\n`
|
|
1440
|
+
+ `${lstripNewlines(existing.slice(span[1]))}`);
|
|
1392
1441
|
if (rest) writeText(p, `${rest}\n`);
|
|
1393
1442
|
else unlinkSync(p);
|
|
1394
1443
|
}
|
|
@@ -1414,11 +1463,12 @@ export function opencodeSentinelWrite(cfgDir) {
|
|
|
1414
1463
|
/** `_build_settings._managed_block_read` — the block's inner content, or null. */
|
|
1415
1464
|
export function managedBlockRead(p, blockId = 'GENESEED') {
|
|
1416
1465
|
if (!existsSync(p)) return null;
|
|
1417
|
-
const [begin, end] = delimiters(blockId);
|
|
1418
1466
|
const text = readText(p);
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1467
|
+
const span = blockSpan(text, blockId);
|
|
1468
|
+
if (!span) return null;
|
|
1469
|
+
// Between the two marker lines; an empty block has one newline, which is both ends.
|
|
1470
|
+
const block = text.slice(span[0], span[1]);
|
|
1471
|
+
return stripNewlines(block.slice(block.indexOf('\n') + 1, Math.max(block.lastIndexOf('\n'), 0)));
|
|
1422
1472
|
}
|
|
1423
1473
|
|
|
1424
1474
|
/** `str.lstrip("\n")`; the one copy — `native.mjs` and `opencode.mjs` import it from here. */
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The managed block: the `<!-- BEGIN GENESEED -->` … `<!-- END GENESEED -->` span Geneseed keeps
|
|
3
|
+
* inside a file the user co-owns (`CLAUDE.md`, `AGENTS.md`).
|
|
4
|
+
*
|
|
5
|
+
* ONE DEFINITION OF WHERE IT IS, for the writer (`js/hosts/settings.mjs`) and for every reader
|
|
6
|
+
* on the hook path (`js/hosts/hosts.mjs`, `js/hosts/ownership-gate.mjs`). They used to be five
|
|
7
|
+
* copies of one regex, because the hook path may not import `settings.mjs`, and when the writer
|
|
8
|
+
* learnt to read a marker only as a whole line the readers went on matching it anywhere. No
|
|
9
|
+
* imports at all, so the hook path pays nothing for it.
|
|
10
|
+
*
|
|
11
|
+
* The two OpenCode plugins cannot import this (a plugin is one self-contained file), so each
|
|
12
|
+
* carries `BLOCK_RE` below by value; `tests/unit/managed_block.test.mjs` holds the copies equal.
|
|
13
|
+
*
|
|
14
|
+
* A MARKER IS A WHOLE LINE. The block is written with each marker alone on its line, so that is
|
|
15
|
+
* the only shape read back. Matching the marker text anywhere took a user's sentence ABOUT the
|
|
16
|
+
* block ("everything below the `<!-- BEGIN GENESEED -->` line is generated") for the block's
|
|
17
|
+
* start: the next emit replaced everything from that sentence down to the real END, the user's
|
|
18
|
+
* own rules with it, and said nothing.
|
|
19
|
+
*
|
|
20
|
+
* THE PAIR IS the first END line with a BEGIN line above it, and the LAST such BEGIN. A lone
|
|
21
|
+
* BEGIN left higher up (a hand-deleted block's first line) therefore stays the user's text, with
|
|
22
|
+
* whatever they wrote under it. A file with no such pair has no block.
|
|
23
|
+
*/
|
|
24
|
+
export const blockDelimiters = (blockId = 'GENESEED') => [`<!-- BEGIN ${blockId} -->`, `<!-- END ${blockId} -->`];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* `[start, stop]`: from the first character of the BEGIN line to the last of the END line (no
|
|
28
|
+
* line ending), or null. Trailing blanks and a `\r` after a marker are allowed: a hook reads
|
|
29
|
+
* the file raw, and on Windows the line ends `\r\n`.
|
|
30
|
+
*/
|
|
31
|
+
export function blockSpan(text, blockId = 'GENESEED') {
|
|
32
|
+
const [begin, end] = blockDelimiters(blockId);
|
|
33
|
+
let at = 0;
|
|
34
|
+
let start = -1;
|
|
35
|
+
for (const line of text.split('\n')) {
|
|
36
|
+
const bare = line.replace(/[ \t\r]+$/, '');
|
|
37
|
+
if (bare === begin) start = at;
|
|
38
|
+
else if (bare === end && start >= 0) return [start, at + bare.length];
|
|
39
|
+
at += line.length + 1;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The block, markers included, or `''` when the text has none. */
|
|
45
|
+
export function blockOf(text, blockId = 'GENESEED') {
|
|
46
|
+
const span = blockSpan(text, blockId);
|
|
47
|
+
return span ? text.slice(span[0], span[1]) : '';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The text with every block removed: what is left is the user's own. */
|
|
51
|
+
export function withoutBlocks(text, blockId = 'GENESEED') {
|
|
52
|
+
let out = text;
|
|
53
|
+
for (let span = blockSpan(out, blockId); span; span = blockSpan(out, blockId)) {
|
|
54
|
+
out = out.slice(0, span[0]) + out.slice(span[1]);
|
|
55
|
+
}
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* How many whole-line markers the text holds, BEGIN and END together. The carrier gate asks when
|
|
61
|
+
* an edit changes this as well as when it changes the block: a marker line added outside the
|
|
62
|
+
* block changes nothing a reader reads today, and is still an edit to the fence itself.
|
|
63
|
+
*/
|
|
64
|
+
export function markerLines(text, blockId = 'GENESEED') {
|
|
65
|
+
const pair = blockDelimiters(blockId);
|
|
66
|
+
return text.split('\n').filter((line) => pair.includes(line.replace(/[ \t\r]+$/, ''))).length;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The same rule as one regex, for the OpenCode plugins, which cannot import this file: a BEGIN
|
|
71
|
+
* line, lazily to the first END line. It differs from `blockSpan` on one input only, a lone
|
|
72
|
+
* BEGIN line above a real block, where it starts at the lone one; a plugin only reads.
|
|
73
|
+
*/
|
|
74
|
+
export const BLOCK_RE_SOURCE = '^<!-- BEGIN GENESEED -->[ \\t]*\\r?\\n[\\s\\S]*?^<!-- END GENESEED -->[ \\t]*\\r?$';
|
package/js/maintain/memory.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* WHY THIS VERB IS NEW RATHER THAN PORTED. The reference had no `memory` subcommand: a fact
|
|
5
5
|
* could be written by the `learn` hook and deleted from the web console, and there was no
|
|
6
|
-
* third way. So the semantics
|
|
6
|
+
* third way. So the semantics of `list` and `rm` are the DELETE ENDPOINT's, deliberately and field for
|
|
7
7
|
* field — the same reserved names, the same "a bare slug, never a path" rule, the same
|
|
8
8
|
* index line dropped from MEMORY.md after the file goes — because two ways to remove a fact
|
|
9
9
|
* that disagree about what a fact is would be worse than one way.
|
|
@@ -32,11 +32,23 @@
|
|
|
32
32
|
* learn uses), so a slip of the keyboard or a click in the console is reversible; only
|
|
33
33
|
* `--purge` unlinks. `--archived` points `list` and `rm` at `archive/` itself, and a file
|
|
34
34
|
* there can only be purged — it has nowhere further to go.
|
|
35
|
+
*
|
|
36
|
+
* `consolidate` IS THE BY-HAND DOOR TO THE INDEX REBUILD, AND IT HOLDS NO REBUILD OF ITS OWN.
|
|
37
|
+
* The other door is `geneseed-hook learn --consolidate`, which the specs once told a reader
|
|
38
|
+
* to type as `geneseed learn --consolidate` — a command this binary refuses by design: `learn`
|
|
39
|
+
* spawns the model CLI, so the whole verb lives in the hook binary (ADR 0002), and hook verbs
|
|
40
|
+
* are the host's to run, never a person's. The rebuild itself is pure filesystem work, so it
|
|
41
|
+
* is legal here. Both doors call `consolidateMemory` inside `recordOwnWrites` — the
|
|
42
|
+
* `memoryDelete` precedent: one implementation, two entries. What differs is the SURFACE, in
|
|
43
|
+
* three places: the report line carries the `[memory]` prefix on stdout where the hook prints
|
|
44
|
+
* `[learn]` on stderr; with no store this exits 1 with the verb's shared refusal where the
|
|
45
|
+
* hook exits 0; and a fact name, `--archived` or `--purge` is a usage refusal (exit 2),
|
|
46
|
+
* because a rebuild takes none of them and silently ignoring `--purge` would be a lie.
|
|
35
47
|
*/
|
|
36
48
|
import { readdirSync, unlinkSync } from 'node:fs';
|
|
37
49
|
import path from 'node:path';
|
|
38
50
|
|
|
39
|
-
import { RESERVED_STEMS, archiveFact, memoryDropIndex } from '../hosts/memory-files.mjs';
|
|
51
|
+
import { RESERVED_STEMS, archiveFact, consolidateMemory, memoryDropIndex } from '../hosts/memory-files.mjs';
|
|
40
52
|
import { recordOwnWrites } from '../hosts/store-watch.mjs';
|
|
41
53
|
import { resolveMemoryDir } from '../hosts/hosts.mjs';
|
|
42
54
|
import { printOut, printErr, isFile } from '../lib/fs.mjs';
|
|
@@ -98,6 +110,19 @@ export function cmdMemory(args) {
|
|
|
98
110
|
+ 'install.\n');
|
|
99
111
|
return 1;
|
|
100
112
|
}
|
|
113
|
+
if (args.action === 'consolidate') {
|
|
114
|
+
if (args.name || args.archived || args.purge) {
|
|
115
|
+
printErr('[memory] consolidate rebuilds the whole index: it takes no fact name, '
|
|
116
|
+
+ '--archived or --purge.\n');
|
|
117
|
+
return 2;
|
|
118
|
+
}
|
|
119
|
+
const report = recordOwnWrites(path.dirname(dir), () => consolidateMemory(dir));
|
|
120
|
+
printOut(`[memory] consolidated ${dir}: +${report.added.length} indexed, `
|
|
121
|
+
+ `-${report.pruned.length} pruned, `
|
|
122
|
+
+ `${report.duplicates.length} duplicate description(s)\n`);
|
|
123
|
+
for (const [a, b] of report.duplicates) printOut(` duplicate: ${a} <-> ${b}\n`);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
101
126
|
const where = args.archived ? path.join(dir, 'archive') : dir;
|
|
102
127
|
if (args.action === 'list') {
|
|
103
128
|
const facts = memoryFacts(where);
|
|
@@ -59,7 +59,9 @@ import {
|
|
|
59
59
|
resolvePath, settingsFile,
|
|
60
60
|
} from '../hosts/hosts.mjs';
|
|
61
61
|
import { mcpCommented, mcpLoad } from '../hosts/mcp.mjs';
|
|
62
|
-
import {
|
|
62
|
+
import {
|
|
63
|
+
SRC_DIRS_MARKER, bundleFiles, hashesOf, ownedState, ownedWithin, recordedDenies, recordedEdit,
|
|
64
|
+
} from '../hosts/owned.mjs';
|
|
63
65
|
import {
|
|
64
66
|
atomicWriteJson, managedBlockRead, managedBlockRemove, managedBlockWrite,
|
|
65
67
|
loadJsonObject, mergeClaudeSettings, opencodeTarget, OPENCODE_SENTINEL, opencodeSentinelWrite,
|
|
@@ -405,11 +407,26 @@ export function installAgentEntryOf(instr) {
|
|
|
405
407
|
/**
|
|
406
408
|
* Reverse a per-repo OpenCode emit.
|
|
407
409
|
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
410
|
+
* ONLY WHAT THE EMIT RECORDED IS REMOVED, in both halves. `.opencode/` is unlinked file by file
|
|
411
|
+
* off its manifest, so a hand-added agent or plugin under it survives. The portable bundle
|
|
412
|
+
* beside it is unlinked file by file off the bundle's own list (`bundleFiles`,
|
|
413
|
+
* `js/build/bundle.mjs`), so the user's own `agents/`, `skills/`, `laws/` or `AGENT.md` at the
|
|
414
|
+
* repository root survive too. Both halves used to delete by directory, and a repository that
|
|
415
|
+
* had such folders before the install lost them.
|
|
416
|
+
*
|
|
417
|
+
* `userOnly` names the watched directories this reversal emptied of everything recorded and
|
|
418
|
+
* that still exist: what is left in them is the user's. `installUninstall` does not count them
|
|
419
|
+
* as survivors. Counting them reported INCOMPLETE and advised a retry, with the manifest already
|
|
420
|
+
* unlinked, and the retry then read `.opencode/` as a pre-manifest install and removed it whole.
|
|
421
|
+
*
|
|
422
|
+
* WITHOUT A RECORD the old shape still runs, for an install an older build made: no manifest
|
|
423
|
+
* means `.opencode/` goes whole, and no bundle list means `laws`/`agents`/`skills` and
|
|
424
|
+
* `AGENT.md` go whole. Two conditions fence it. The root must carry a bundle's own marker
|
|
425
|
+
* (`.geneseed-theme` or the version file), the test `build` uses: `installState` calls a bare
|
|
426
|
+
* `.opencode/` directory an install, and without the marker this reversal took a repository
|
|
427
|
+
* Geneseed had already left, or never entered, for a pre-manifest install. And a root that has
|
|
428
|
+
* the bundle list was made by a build that also writes the manifest, so a missing manifest
|
|
429
|
+
* there is not a pre-manifest install and `.opencode/` is left alone.
|
|
413
430
|
*
|
|
414
431
|
* The entry is read BEFORE AGENT.md is deleted. Reading it after would find the wire
|
|
415
432
|
* describing a file that no longer exists, which the fallback would then paper over with the
|
|
@@ -421,8 +438,11 @@ function opencodeProjectUninstall(root, force = false) {
|
|
|
421
438
|
let failed = [];
|
|
422
439
|
let kept = [];
|
|
423
440
|
let man = null;
|
|
441
|
+
const userOnly = [];
|
|
424
442
|
const oc = path.join(root, '.opencode');
|
|
425
443
|
const manifestPath = path.join(oc, GLOBAL_MANIFEST);
|
|
444
|
+
const listed = bundleFiles(root);
|
|
445
|
+
const legacy = isFile(path.join(root, '.geneseed-theme')) || isFile(path.join(root, VERSION_MARKER));
|
|
426
446
|
if (isFile(manifestPath)) {
|
|
427
447
|
man = claudeReadManifest(oc);
|
|
428
448
|
[removed, failed, kept] = unlinkOwned(oc, ownedOf(man), '.opencode/', hashesOf(man), force);
|
|
@@ -434,22 +454,41 @@ function opencodeProjectUninstall(root, force = false) {
|
|
|
434
454
|
if (!failed.length) {
|
|
435
455
|
unlinkQuiet(manifestPath);
|
|
436
456
|
if (isDir(oc) && isEmptyDir(oc)) rmdirQuiet(oc);
|
|
457
|
+
else if (isDir(oc)) userOnly.push(oc);
|
|
437
458
|
} else {
|
|
438
459
|
warnMarkersKept();
|
|
439
460
|
}
|
|
440
461
|
} else if (isDir(oc)) {
|
|
441
|
-
|
|
442
|
-
removed += 1;
|
|
462
|
+
if (listed || !legacy) userOnly.push(oc);
|
|
463
|
+
else { rmtreeQuiet(oc); removed += 1; }
|
|
443
464
|
}
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
|
|
465
|
+
if (listed) {
|
|
466
|
+
const [n, bundleFailed] = unlinkOwned(root, listed, '', {}, true);
|
|
467
|
+
removed += n;
|
|
468
|
+
if (bundleFailed.length) {
|
|
469
|
+
warnSurvivors(bundleFailed);
|
|
470
|
+
failed = failed.concat(bundleFailed);
|
|
471
|
+
} else {
|
|
472
|
+
unlinkQuiet(path.join(root, SRC_DIRS_MARKER));
|
|
473
|
+
for (const d of ['laws', 'agents', 'skills']) {
|
|
474
|
+
if (isDir(path.join(root, d))) userOnly.push(path.join(root, d));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
} else if (legacy) {
|
|
478
|
+
for (const d of ['laws', 'agents', 'skills']) {
|
|
479
|
+
const p = path.join(root, d);
|
|
480
|
+
if (isDir(p)) { rmtreeQuiet(p); removed += 1; }
|
|
481
|
+
}
|
|
482
|
+
const am = path.join(root, 'AGENT.md');
|
|
483
|
+
if (isFile(am)) { unlinkQuiet(am); removed += 1; }
|
|
484
|
+
} else {
|
|
485
|
+
for (const d of ['laws', 'agents', 'skills']) {
|
|
486
|
+
if (isDir(path.join(root, d))) userOnly.push(path.join(root, d));
|
|
487
|
+
}
|
|
447
488
|
}
|
|
448
|
-
const am = path.join(root, 'AGENT.md');
|
|
449
|
-
if (isFile(am)) { unlinkQuiet(am); removed += 1; }
|
|
450
489
|
const unmerged = unmergeOpencodeJson(path.join(root, 'opencode.json'), entry,
|
|
451
490
|
man ? recordedDenies(man) : [], man ? recordedEdit(man) : null);
|
|
452
|
-
const result = { removed, unmerged, archived: null };
|
|
491
|
+
const result = { removed, unmerged, archived: null, userOnly };
|
|
453
492
|
if (failed.length) result.failed = failed;
|
|
454
493
|
if (kept.length) result.kept = kept;
|
|
455
494
|
return result;
|
|
@@ -536,7 +575,11 @@ export function installUninstall(root, host = 'opencode', scope = 'global', memo
|
|
|
536
575
|
// `kept` rels are spelled relative to the reversal's own base: the cfg dir for the Claude
|
|
537
576
|
// family, the root for OpenCode (whose project reversal already prefixes `.opencode/`).
|
|
538
577
|
const keptAbs = new Set(kept.map((r) => path.join(CLAUDE_STYLE.includes(host) ? data : root, r)));
|
|
578
|
+
// `userOnly`: a reversal that removed by record names the watched dirs it left holding only
|
|
579
|
+
// the user's files (`opencodeProjectUninstall`).
|
|
580
|
+
const userOnly = new Set(summary.userOnly || []);
|
|
539
581
|
const survivors = ownedDirsFor(root, host, scope, data).filter((d) => existsSync(d)
|
|
582
|
+
&& !userOnly.has(d)
|
|
540
583
|
&& !(keptAbs.size && readdirSync(d, { recursive: true, withFileTypes: true })
|
|
541
584
|
.every((e) => e.isDirectory() || keptAbs.has(path.join(e.parentPath, e.name)))));
|
|
542
585
|
const withKept = (o) => (kept.length ? { ...o, kept } : o);
|
package/js/web/actions.mjs
CHANGED
|
@@ -786,6 +786,9 @@ export function apiInstallCmd(state, body) {
|
|
|
786
786
|
const argv = setupBuildArgs(theme || 'neutral', emit, out, out, fp, pos, mode, doctrines,
|
|
787
787
|
PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates,
|
|
788
788
|
kits ?? kitsOfDir(root, host), sharedTier);
|
|
789
|
+
// `--force` only on a literal `true`: the panel's "Replace with Geneseed's copies", which
|
|
790
|
+
// names the files first. It is this one build's instruction and is never recorded.
|
|
791
|
+
if (bget(body, 'force') === true) argv.push('--force');
|
|
789
792
|
return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
|
|
790
793
|
}
|
|
791
794
|
|
package/js/web/api.mjs
CHANGED
|
@@ -23,7 +23,7 @@ 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, modeOfDir,
|
|
26
|
+
footprintOfDir, gatesOfDir, installState, installTargets, leftoversOf, modeOfDir,
|
|
27
27
|
trustOfDir, sharedTierOfDir,
|
|
28
28
|
postureOfDir, readJsonMaybe, readMaybe, themeOfDir,
|
|
29
29
|
} from '../hosts/installs.mjs';
|
|
@@ -228,6 +228,9 @@ export function apiInstalls(state) {
|
|
|
228
228
|
trust: trustOfDir(root, host),
|
|
229
229
|
// A project install's switch for reading the machine tier (a global install owns it).
|
|
230
230
|
sharedTier: scope === 'global' ? false : sharedTierOfDir(root, host),
|
|
231
|
+
// Files here that are the user's where Geneseed ships one, and retired leftovers: what a
|
|
232
|
+
// forced rebuild would replace or remove (`leftoversOf`). Read off the emit's own record.
|
|
233
|
+
leftovers: leftoversOf(root, host, scope),
|
|
231
234
|
// The install a request naming none reads (`defaultView`): the console's pickers start on it.
|
|
232
235
|
default: !!def && samePath(viewCfg(host, scope, root), def[0]),
|
|
233
236
|
});
|
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.2.0",
|
|
5
5
|
"description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ai",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
- The {{MEMORY}} store needs tidying in bulk. The session context says so in one
|
|
7
7
|
line when a topic holds over 40 facts or a `misc` topic exists; or the user asks
|
|
8
8
|
to tidy, dedupe or re-topic their memory.
|
|
9
|
-
- `geneseed
|
|
9
|
+
- `geneseed memory consolidate` reported duplicate descriptions that need a merge.
|
|
10
10
|
|
|
11
11
|
## When NOT to dispatch
|
|
12
12
|
- A handful of facts to review — the rule {{SKILL}}'s consolidation flow does
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
scope: the whole store, or named topics only.
|
|
20
20
|
|
|
21
21
|
## Allowed tools
|
|
22
|
-
- **Read + write to the {{MEMORY}} store only.** May run `geneseed memory`
|
|
23
|
-
`
|
|
22
|
+
- **Read + write to the {{MEMORY}} store only.** May run `geneseed memory`
|
|
23
|
+
(`list`, `rm`, `consolidate`). A write into the store meets no prompt at the tool boundary
|
|
24
24
|
(memory is written freely), but bulk curation reworks facts the user already keeps, so it still
|
|
25
25
|
shows each topic's plan and applies it with the user's consent.
|
|
26
26
|
<!-- bash: allow -->
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
and run `geneseed memory rm <name> --archived --purge` only for the codes the user
|
|
52
52
|
approves. A fact holding a secret, live or archived, is proposed for `--purge` on sight
|
|
53
53
|
({{LAW:sealed-secrets}}).
|
|
54
|
-
7. Finish with `geneseed
|
|
54
|
+
7. Finish with `geneseed memory consolidate --memory <the store's path>`, so both
|
|
55
55
|
index levels match the files.
|
|
56
56
|
|
|
57
57
|
## Output contract
|
package/src/memory/README.md
CHANGED
|
@@ -111,7 +111,7 @@ facts the store holds:
|
|
|
111
111
|
|
|
112
112
|
A fact's topic is its `topic:`, else its `type:`, else `misc`, normalised to
|
|
113
113
|
lowercase `[a-z0-9-]`. Both levels are generated from the fact files:
|
|
114
|
-
`geneseed
|
|
114
|
+
`geneseed memory consolidate --memory <this dir>` rebuilds them (refreshing each
|
|
115
115
|
hook from its `description`), and the `learn` hook rebuilds them after every fact it
|
|
116
116
|
writes, updates or archives. Only top-level fact files are indexed; `archive/` and
|
|
117
117
|
`agents/` never are. A build moves a flat, one-line-per-fact `MEMORY.md` from an older install to
|
package/src/skills/geneseed.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## Procedure
|
|
9
9
|
1. **Locate.** Run `geneseed status --json` first: `installs` lists every install on this machine — host, scope, root, state, theme, footprint, posture, mode, packs, excluded rules — and `rebuild`, the command that reproduces each one exactly. `geneseed` not on PATH → ask the user before using `npx geneseed` (it downloads the package), and prefix every command below the same way. Still nothing → look for a host root file: `~/.config/opencode/AGENT.md` or `.opencode/AGENT.md` (OpenCode), `~/.claude/CLAUDE.md` or `.claude/` (Claude Code), `.openclaude/` (OpenClaude), `AGENTS.md` beside `.bob/` (Bob). None → say so; never install to "fix" it.
|
|
10
|
-
2. **Read state** with the read-only verbs, cheapest first ({{DOCTRINE:context-economy}}): `geneseed status --json`, `geneseed version`, `geneseed catalog` (optionally `agents|skills|laws|ontology|doctrines`), `geneseed doctor`, `geneseed diff`, `geneseed mcp`, `geneseed memory list`, `geneseed exclude list`.
|
|
10
|
+
2. **Read state** with the read-only verbs, cheapest first ({{DOCTRINE:context-economy}}): `geneseed status --json`, `geneseed version`, `geneseed catalog` (optionally `agents|skills|laws|ontology|doctrines`), `geneseed doctor`, `geneseed diff`, `geneseed mcp`, `geneseed memory list`, `geneseed memory consolidate` (rebuilds only the generated index, from the fact files), `geneseed exclude list`.
|
|
11
11
|
3. **Read a piece** from disk, not from recall ({{LAW:verify-before-asserting}}): `<root>/agents/<name>.md`, `<root>/skills/<name>/SKILL.md`, `<root>/memory/`, `<root>/notebook/`. The {{ONTOLOGY}}, the {{LAWS}} and the active {{DOCTRINES}} are numbered `## N. …` sections of the install's root file.
|
|
12
12
|
4. **Change an install only when the user asked for that change** ({{LAW:one-intent-one-act}}). Take that install's `rebuild` command from step 1, edit only the flag the user named (add it if the command omits it — `--posture`, `--mode` and `--trust` are left out at their defaults) — `--theme`, `--footprint lean|full`, `--posture`, `--mode direct|foreman`, `--trust prudent|balanced|aggressive`, `--doctrines craft,rigor|none`, `--exclude-rules "process 7"|none` — dry-run it first by running the same flags through `geneseed validate`, show the command, and run it once the user agrees. Never rebuild from a bare `geneseed build`: every omitted flag resets that setting to the generator default. Confirm with `geneseed status`.
|
|
13
13
|
5. **Other writes also need the user's word:** `geneseed memory rm <name>` (archives; `--purge` deletes for good), `geneseed exclude add|remove <path>`, `geneseed web start|stop`, `geneseed uninstall --target <root> --yes`. Personal rules and the profile belong to their own {{SKILLS}}; do not edit `user-rules.md` or `PROFILE.md` from here.
|
|
@@ -25,7 +25,7 @@ instead: it runs this flow topic by topic in its own context and also assigns to
|
|
|
25
25
|
archiving would keep it on disk, so propose deleting it outright, on sight
|
|
26
26
|
({{LAW:sealed-secrets}}).
|
|
27
27
|
5. **Rebuild the index** with
|
|
28
|
-
`geneseed
|
|
28
|
+
`geneseed memory consolidate --memory <the {{PATH_MEMORY}}/ dir's path>`: one pointer line per
|
|
29
29
|
surviving file in its `topics/<topic>.md`, and the `MEMORY.md` map recounted. Each
|
|
30
30
|
hook is the fact's `description`, so sharpen a weak hook there — it should say why a
|
|
31
31
|
future session would open the fact.
|
package/src/skills/rule.md
CHANGED
|
@@ -44,7 +44,7 @@ Then take exactly one branch.
|
|
|
44
44
|
3. Infer the `type` (`user` | `feedback` | `project` | `reference`) and draft the file
|
|
45
45
|
per the {{MEMORY}} convention.
|
|
46
46
|
4. Write the file, with no prompt, and rebuild the index
|
|
47
|
-
(`geneseed
|
|
47
|
+
(`geneseed memory consolidate --memory <the {{PATH_MEMORY}}/ dir's path>`) so its line
|
|
48
48
|
lands in `topics/<topic>.md` and the `MEMORY.md` map recounts. Then say in one line
|
|
49
49
|
what you wrote and where, so a wrong inference is visible at once; the web console
|
|
50
50
|
shows it to the user later too.
|