geneseed 5.3.0 → 5.3.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 +27 -0
- package/README.md +2 -2
- package/SHIPPED.md +1 -1
- package/adapters/bob/README.md +31 -18
- package/adapters/claude-code/README.md +27 -22
- package/adapters/openclaude/README.md +18 -8
- package/adapters/opencode/HOW-OPENCODE-LOADS.md +8 -3
- package/adapters/opencode/plugins/geneseed-activity.js +20 -21
- package/adapters/opencode/plugins/geneseed-context.js +169 -62
- package/adapters/opencode/plugins/geneseed-guard.js +414 -202
- package/adapters/opencode/plugins/geneseed-workflow.js +3 -2
- package/adapters/opencode/workflows/_runtime.js +3 -2
- package/bin/geneseed-hook.mjs +57 -9
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/exclusions.md +2 -2
- package/docs/concepts/footprint.md +10 -0
- package/docs/concepts/hook-gates.md +3 -3
- package/docs/concepts/host-matrix.md +22 -4
- package/docs/design-history.md +8 -0
- package/docs/extending.md +49 -7
- package/docs/guides/install-bob.md +2 -2
- package/docs/guides/install-openclaude.md +1 -1
- package/docs/guides/verify.md +12 -0
- package/docs/reference/environment.md +1 -0
- package/docs/reference/troubleshoot-doctor.md +1 -1
- package/docs/token-footprint.md +66 -2
- package/docs/understand/design-choices-hosts.md +1 -1
- package/docs/understand/design-choices-shape.md +1 -0
- package/docs/understand/enforced-vs-asked.md +1 -1
- package/docs/understand/machine-bob.md +1 -1
- package/docs/web-ui.md +5 -0
- package/harness.config.json +1 -1
- package/js/README.md +3 -2
- package/js/build/args.mjs +1 -1
- package/js/build/driver.mjs +1 -1
- package/js/build/emit-claude.mjs +1 -1
- package/js/build/generate.mjs +5 -14
- package/js/hosts/done-checks.mjs +6 -0
- package/js/hosts/geneseed-dir.mjs +3 -2
- package/js/hosts/gitref.mjs +5 -3
- package/js/hosts/hook-tap.mjs +104 -0
- package/js/hosts/hooks-context.mjs +4 -2
- package/js/hosts/hooks-learn.mjs +47 -16
- package/js/hosts/hooks.mjs +19 -13
- package/js/hosts/hosts.mjs +80 -12
- package/js/hosts/installs.mjs +7 -0
- package/js/hosts/native.mjs +14 -5
- package/js/hosts/owned.mjs +7 -6
- package/js/hosts/ownership-gate.mjs +14 -1
- package/js/hosts/settings.mjs +245 -103
- package/js/hosts/shim.mjs +4 -4
- package/js/hosts/usage.mjs +9 -3
- package/js/inspect/checks-probe.mjs +66 -5
- package/js/inspect/checks-repo.mjs +196 -2
- package/js/inspect/cost.mjs +34 -2
- package/js/inspect/doctor.mjs +6 -1
- package/js/lib/machine-dir.mjs +1 -1
- package/js/lib/node-floor.mjs +46 -6
- package/js/maintain/uninstall.mjs +42 -16
- package/js/web/actions.mjs +1 -9
- package/package.json +1 -1
- package/web/dist/assets/Activity-WQ3ykgxU.js +1 -0
- package/web/dist/assets/{ActivityDetail-BSzevynX.js → ActivityDetail-7rt04SkS.js} +1 -1
- package/web/dist/assets/{Bonsai-Bfpb6W-1.js → Bonsai-BBl4XXqs.js} +1 -1
- package/web/dist/assets/{CopyButton-ByIntFtB.js → CopyButton-Beven8yn.js} +1 -1
- package/web/dist/assets/Dashboard-BgLArtgu.js +2 -0
- package/web/dist/assets/{Docs-DvlMJhpu.js → Docs-B5aHp86J.js} +3 -3
- package/web/dist/assets/Factories-BjqzXAw8.js +1 -0
- package/web/dist/assets/GreenhouseView-Bce212qd.js +1 -0
- package/web/dist/assets/{Installs-BlGmVrFK.js → Installs-B1OsrHXF.js} +3 -3
- package/web/dist/assets/JournalView-CV4omyww.js +1 -0
- package/web/dist/assets/{Kits-DRwpxC-J.js → Kits-CW1e7xNa.js} +1 -1
- package/web/dist/assets/{Laws-CZkiNOWQ.js → Laws-1Ckf1lbs.js} +2 -2
- package/web/dist/assets/{LibRows-DEHjIoD-.js → LibRows-Dag1s0ZX.js} +1 -1
- package/web/dist/assets/Library-B3FuFLel.js +3 -0
- package/web/dist/assets/Loops-CwqgnLNw.js +2 -0
- package/web/dist/assets/Markdown-CxkA7940.js +71 -0
- package/web/dist/assets/OperatorHudView-JmYY1pBR.js +1 -0
- package/web/dist/assets/{Personal-Bp9nV4GR.js → Personal-DKLgLa7Z.js} +2 -2
- package/web/dist/assets/Settings-BwErnh-R.js +1 -0
- package/web/dist/assets/{Tabs-CWeQTADL.js → Tabs-8zsyEPSK.js} +1 -1
- package/web/dist/assets/{index-CsAZq0BQ.css → index-CRWqKxfY.css} +1 -1
- package/web/dist/assets/index-Ce6qF2nG.js +6 -0
- package/web/dist/index.html +2 -2
- package/adapters/claude-code/settings.json +0 -52
- package/web/dist/assets/Activity-CqJiquEq.js +0 -1
- package/web/dist/assets/Dashboard-DBOEi9lQ.js +0 -2
- package/web/dist/assets/Factories-Bpvv7L2H.js +0 -1
- package/web/dist/assets/GreenhouseView-GpBsYn50.js +0 -1
- package/web/dist/assets/JournalView-iLuLrOxE.js +0 -1
- package/web/dist/assets/Library-B4K-1iNF.js +0 -3
- package/web/dist/assets/Loops-BWSzaW8E.js +0 -2
- package/web/dist/assets/Markdown-0ORz7tAc.js +0 -69
- package/web/dist/assets/OperatorHudView-BAXwCEvY.js +0 -1
- package/web/dist/assets/Settings-CWWuaIp-.js +0 -1
- package/web/dist/assets/index-How7SzDZ.js +0 -6
package/js/hosts/installs.mjs
CHANGED
|
@@ -554,6 +554,13 @@ export const EMIT_HOST_SCOPE = new Map(HOSTS.flatMap(({ host }) => [
|
|
|
554
554
|
[host, [host, 'project']], [`${host}-global`, [host, 'global']],
|
|
555
555
|
]));
|
|
556
556
|
|
|
557
|
+
/**
|
|
558
|
+
* The inverse: `'<host> <scope>'` -> the emit name that installs it. One map for the two
|
|
559
|
+
* readers that had a hand copy each: `rebuild-all`'s default for an install with no marker
|
|
560
|
+
* (`js/build/generate.mjs`) and the console's install command (`js/web/actions.mjs`).
|
|
561
|
+
*/
|
|
562
|
+
export const EMIT_FOR = new Map([...EMIT_HOST_SCOPE].map(([emit, [host, scope]]) => [`${host} ${scope}`, emit]));
|
|
563
|
+
|
|
557
564
|
/** `root`'s own marker, resolved, or null. */
|
|
558
565
|
export function emitHostScopeOf(root) {
|
|
559
566
|
const emit = readMaybe(path.join(root, '.geneseed-emit'));
|
package/js/hosts/native.mjs
CHANGED
|
@@ -356,21 +356,30 @@ const WEBFETCH_MARKER = '<!-- webfetch: allow -->';
|
|
|
356
356
|
|
|
357
357
|
/**
|
|
358
358
|
* `_build_emit._claude_agent_frontmatter`. A read-only spec gets a `disallowedTools` DENYLIST;
|
|
359
|
-
* each opt-in marker takes its
|
|
360
|
-
*
|
|
359
|
+
* each opt-in marker takes its tools back off the list. Order is emit order.
|
|
360
|
+
*
|
|
361
|
+
* `Agent` and `Task` (the same tool, new name and old) are denied to EVERY read-only agent and
|
|
362
|
+
* no marker lifts them: a read-only agent that can dispatch can spawn a writer, and the denylist
|
|
363
|
+
* of the child, not the parent's, is what that writer runs under. The specs already say a seat
|
|
364
|
+
* dispatches no sub-agents; this is the boundary under the sentence.
|
|
365
|
+
*
|
|
366
|
+
* STILL OPEN: an MCP tool that writes (`mcp__github__push_files`, a database server). A denylist
|
|
367
|
+
* cannot name tools it has never seen, so a read-only agent in a session with such a server can
|
|
368
|
+
* still write through it, until this becomes an allowlist (`tools:`).
|
|
361
369
|
*/
|
|
362
370
|
function claudeAgentFrontmatter(stem, text, overrides) {
|
|
363
371
|
const fm = [`name: ${stem}`, `description: ${jsonDumps(agentDescription(text))}`];
|
|
364
372
|
const ov = agentOverride(overrides, stem);
|
|
365
373
|
if (isTruthy(ov.model)) fm.push(`model: ${formatValue(ov.model)}`);
|
|
366
374
|
if (isReadonly(text)) {
|
|
367
|
-
const list = ['Write', 'Edit', 'NotebookEdit'];
|
|
375
|
+
const list = ['Write', 'Edit', 'NotebookEdit', 'Agent', 'Task'];
|
|
368
376
|
if (!text.includes(WEBFETCH_MARKER)) list.push('WebFetch');
|
|
369
377
|
// Bash AND PowerShell: docs `tools-reference.md` says denying Bash turns PowerShell off
|
|
370
378
|
// only for settings rules and `--disallowedTools` — agent frontmatter is not named there,
|
|
371
379
|
// so a "read-only" agent on Windows could still run shell commands via PowerShell
|
|
372
|
-
// (Claude verdict R1).
|
|
373
|
-
|
|
380
|
+
// (Claude verdict R1). Monitor is the third shell: it runs a `command` in the background.
|
|
381
|
+
// The one opt-in marker lifts all three together.
|
|
382
|
+
if (!text.includes(BASH_MARKER)) list.push('Bash', 'PowerShell', 'Monitor');
|
|
374
383
|
fm.push(`disallowedTools: ${list.join(', ')}`);
|
|
375
384
|
}
|
|
376
385
|
return fm;
|
package/js/hosts/owned.mjs
CHANGED
|
@@ -176,9 +176,9 @@ export function hashesOf(doc) {
|
|
|
176
176
|
* An OpenCode manifest's `skill_denies` — the `permission.skill` denies Geneseed itself added
|
|
177
177
|
* (`opencodeLayer` records them; a deny the user wrote, even on a Geneseed skill, is never in
|
|
178
178
|
* it) — or `[]` when the manifest, or the key, is absent or malformed, which sweeps nothing.
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
179
|
+
* A skill-visibility deny is reversible: once uninstalled there is no skill left to hide, and
|
|
180
|
+
* the name is the user's to reuse — uninstall takes the recorded ones back, as it does the
|
|
181
|
+
* recorded `permission.bash` gates (`recordedGates`). One home because rebuild's
|
|
182
182
|
* deny sweep and uninstall must agree on what Geneseed owns.
|
|
183
183
|
*/
|
|
184
184
|
export function recordedDenies(doc) {
|
|
@@ -202,9 +202,10 @@ export function recordedEdit(doc) {
|
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* An OpenCode manifest's `bash_gates` — the `permission.bash` keys Geneseed itself added, which
|
|
205
|
-
* a later build may take back once their rule is off (`reconcileOpencodePermission`)
|
|
206
|
-
*
|
|
207
|
-
* such key, so its gates stay
|
|
205
|
+
* a later build may take back once their rule is off (`reconcileOpencodePermission`) and an
|
|
206
|
+
* uninstall takes back outright (`unmergeOpencodeJson`). Absent or malformed reads as nothing
|
|
207
|
+
* owned, like `recordedDenies`: a manifest from before 5.2.0 has no such key, so its gates stay
|
|
208
|
+
* until `--prune-gates` or a hand edit.
|
|
208
209
|
*/
|
|
209
210
|
export function recordedGates(doc) {
|
|
210
211
|
const g = doc && doc.bash_gates;
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
* and become a gate-error ask on every write in every repo; any surprise is a defer.
|
|
18
18
|
*
|
|
19
19
|
* The OpenCode guard (`adapters/opencode/plugins/geneseed-guard.js`, `ownershipBlock`) is this
|
|
20
|
-
* file's twin and cannot import it
|
|
20
|
+
* file's twin and cannot import it. Its constants are copied from here by `tests/twins.mjs`
|
|
21
|
+
* (the two marked blocks and three one-line constants); the function reads another payload
|
|
22
|
+
* and is kept in step by hand.
|
|
21
23
|
*/
|
|
22
24
|
import { appendFileSync, mkdirSync, readFileSync, readdirSync } from 'node:fs';
|
|
23
25
|
import os from 'node:os';
|
|
@@ -26,6 +28,10 @@ import { withoutBlocks } from '../lib/managed-block.mjs';
|
|
|
26
28
|
import { normcase } from '../lib/paths.mjs';
|
|
27
29
|
import { gitRootOf, mainWorktreeOf } from './gitref.mjs';
|
|
28
30
|
|
|
31
|
+
// ---- ownership shape twin: BEGIN — adapters/opencode/plugins/geneseed-guard.js and
|
|
32
|
+
// geneseed-context.js carry everything down to the END marker verbatim (node tests/twins.mjs
|
|
33
|
+
// --write keeps it), and the one-line `WRITE_NAME_RE`, `safeStem` and `DECLINED_RE` below too.
|
|
34
|
+
|
|
29
35
|
// D5: the build manifests that make a git root an "application". Exact names, plus two families.
|
|
30
36
|
const MANIFESTS = new Set(['package.json', 'pom.xml', 'pyproject.toml', 'go.mod', 'Cargo.toml',
|
|
31
37
|
'composer.json', 'Gemfile']);
|
|
@@ -36,6 +42,8 @@ const isManifest = (n) => MANIFESTS.has(n) || n.startsWith('build.gradle') || n.
|
|
|
36
42
|
// sits after the `\r`.
|
|
37
43
|
const SECTION_RE = /^## Ownership[ \t]*\r?$/m;
|
|
38
44
|
|
|
45
|
+
// ---- ownership shape twin: END
|
|
46
|
+
|
|
39
47
|
// Write-shaped tool names (Bob's `tool-gate` also routes reads here: `read_file` carries a path).
|
|
40
48
|
export const WRITE_NAME_RE = /write|edit|diff|replace|insert|move|rename|delete|remove|trash|copy/i;
|
|
41
49
|
|
|
@@ -51,6 +59,9 @@ function userTag() {
|
|
|
51
59
|
try { return safeStem(os.userInfo().username); } catch { return 'user'; }
|
|
52
60
|
}
|
|
53
61
|
|
|
62
|
+
// ---- ownership text twin: BEGIN — adapters/opencode/plugins/geneseed-guard.js carries everything
|
|
63
|
+
// down to the END marker verbatim (node tests/twins.mjs --write keeps it).
|
|
64
|
+
|
|
54
65
|
const TAIL = 'Opt out per repo: `## Ownership` with `mode: off` in the root `AGENTS.md`; per '
|
|
55
66
|
+ 'install: rebuild with `--no-ownership-gate`. Offer the full documentation '
|
|
56
67
|
+ '(`/document-project`) as yes / later. Stop and ask the developer now; re-issue the write only '
|
|
@@ -68,6 +79,8 @@ const REASON_NO_SECTION = 'Geneseed (Ownership) — this application\'s `AGENTS.
|
|
|
68
79
|
+ '`## Ownership` section. Before writing, ask the developer: add the Ownership section now '
|
|
69
80
|
+ `(ownership skill); ${SKIP}? ${TAIL}`;
|
|
70
81
|
|
|
82
|
+
// ---- ownership text twin: END
|
|
83
|
+
|
|
71
84
|
// D2: the developer's durable, personal, per-repo decline, in `.geneseed/ownership.md`. It holds
|
|
72
85
|
// until the line is deleted or the setup runs (which removes it); a `## Ownership` section in
|
|
73
86
|
// `AGENTS.md`, on or off, outranks it. The OpenCode twins (geneseed-guard.js,
|