geneseed 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +30 -0
- package/SHIPPED.md +1 -1
- package/adapters/bob/README.md +12 -1
- package/adapters/opencode/README.md +2 -1
- package/adapters/opencode/plugins/geneseed-context.js +71 -10
- package/adapters/opencode/plugins/geneseed-guard.js +101 -19
- package/adapters/opencode/plugins/geneseed-learn.js +641 -6
- package/bin/geneseed-cli.mjs +3 -0
- package/bin/geneseed-hook.mjs +2 -1
- package/docs/concepts/agents.md +13 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/foreman-mode.md +22 -3
- package/docs/concepts/hook-gates.md +1 -1
- package/docs/concepts/hooks.md +22 -5
- package/docs/concepts/host-matrix.md +2 -2
- package/docs/concepts/hosts.md +1 -1
- package/docs/concepts/shared-tier.md +1 -1
- package/docs/concepts/skills.md +21 -1
- package/docs/concepts/themes.md +1 -1
- package/docs/extending.md +10 -1
- package/docs/guides/install-clone.md +18 -0
- package/docs/guides/install-scripted.md +8 -2
- package/docs/guides/install.md +19 -1
- package/docs/guides/upgrade.md +1 -1
- package/docs/reference/env-context.md +1 -1
- package/docs/reference/environment.md +1 -1
- package/docs/reference/plugin-learn.md +4 -0
- package/docs/reference/profiles.md +142 -0
- package/docs/token-footprint.md +9 -4
- package/docs/understand/design-choices-engineering.md +1 -1
- package/docs/web-ui.md +3 -1
- package/harness.config.json +1 -1
- package/js/README.md +9 -2
- package/js/build/args.mjs +4 -3
- package/js/build/catalog.mjs +11 -1
- package/js/build/driver.mjs +42 -11
- package/js/build/emit-claude.mjs +24 -1
- package/js/build/emit-opencode.mjs +3 -0
- package/js/build/export.mjs +1 -1
- package/js/build/generate.mjs +2 -1
- package/js/build/notes-migrate.mjs +99 -0
- package/js/build/profile.mjs +14 -6
- package/js/build/render.mjs +34 -10
- package/js/build/source.mjs +85 -2
- package/js/cli-table.json +164 -4
- package/js/hosts/agent-runs.mjs +205 -0
- package/js/hosts/done-checks.mjs +3 -1
- package/js/hosts/hooks-done.mjs +91 -16
- package/js/hosts/hooks-learn.mjs +85 -0
- package/js/hosts/hooks-prims.mjs +39 -1
- package/js/hosts/hooks.mjs +6 -3
- package/js/hosts/hosts.mjs +10 -0
- package/js/hosts/installs.mjs +25 -1
- package/js/hosts/link.mjs +45 -10
- package/js/hosts/native.mjs +42 -5
- package/js/hosts/opencode.mjs +1 -1
- package/js/hosts/settings.mjs +72 -0
- package/js/hosts/spec-feedback.mjs +538 -0
- package/js/hosts/usage.mjs +67 -8
- package/js/inspect/agent-scores.mjs +118 -0
- package/js/inspect/checks-authoring.mjs +2 -1
- package/js/inspect/checks-build.mjs +20 -4
- package/js/inspect/checks-repo.mjs +27 -2
- package/js/inspect/cost.mjs +6 -5
- package/js/inspect/diff.mjs +25 -5
- package/js/inspect/doctor.mjs +4 -0
- package/js/inspect/status.mjs +3 -1
- package/js/inspect/validate.mjs +1 -0
- package/js/lib/machine-dir.mjs +8 -0
- package/js/lib/paths.mjs +4 -1
- package/js/maintain/profile-scope.mjs +145 -0
- package/js/maintain/profiles.mjs +486 -0
- package/js/maintain/setup.mjs +409 -15
- package/js/maintain/uninstall.mjs +4 -1
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +28 -38
- package/js/web/api.mjs +7 -2
- package/js/web/handler.mjs +8 -0
- package/js/web/jobs.mjs +5 -4
- package/js/web/profiles-api.mjs +201 -0
- package/js/web/routes.mjs +5 -0
- package/package.json +2 -1
- package/profiles/guillaume-claude-global.json +16 -0
- package/profiles/starter.json +14 -0
- package/src/AGENT.md.tmpl +1 -1
- package/src/agents/_self-improvement.md +15 -7
- package/src/agents/_template.md +4 -2
- package/src/agents/advocate.md +1 -1
- package/src/agents/architect.md +1 -1
- package/src/agents/developer.md +10 -3
- package/src/agents/devops-engineer.md +1 -1
- package/src/agents/docker-expert.md +1 -1
- package/src/agents/docs.md +1 -1
- package/src/agents/empiricist.md +1 -1
- package/src/agents/explorer.md +4 -2
- package/src/agents/framer.md +1 -1
- package/src/agents/historian.md +1 -1
- package/src/agents/kubernetes-specialist.md +1 -1
- package/src/agents/memory-curator.md +1 -1
- package/src/agents/operator.md +1 -1
- package/src/agents/performance.md +1 -1
- package/src/agents/pragmatist.md +1 -1
- package/src/agents/react-engineer.md +1 -1
- package/src/agents/react-reviewer.md +1 -1
- package/src/agents/researcher.md +1 -1
- package/src/agents/reviewer.md +10 -3
- package/src/agents/security.md +1 -1
- package/src/agents/skeptic.md +1 -1
- package/src/agents/spring-boot-engineer.md +1 -1
- package/src/agents/spring-reviewer.md +1 -1
- package/src/agents/spring-security.md +1 -1
- package/src/agents/steward.md +1 -1
- package/src/agents/tester.md +4 -2
- package/src/agents/user-advocate.md +1 -1
- package/src/agents/visionary.md +1 -1
- package/src/memory/README.md +12 -2
- package/src/modes/foreman.md +23 -10
- package/src/skill-descriptions.json +63 -0
- package/src/skills/_self-improvement.md +42 -26
- package/src/skills/_template.md +3 -1
- package/src/skills/brainstorm.md +35 -22
- package/src/skills/daydream/VENDOR.md +6 -0
- package/src/skills/diagram-design/VENDOR.md +4 -0
- package/src/skills/explain-changes/VENDOR.md +5 -1
- package/src/skills/parallel-agents.md +11 -0
- package/src/skills/pipeline.md +3 -3
- package/src/skills/plan.md +5 -4
- package/src/skills/react-view-transitions/VENDOR.md +7 -1
- package/src/skills/release.md +7 -2
- package/src/skills/rule/approve.md +2 -1
- package/src/skills/skill-forge.md +5 -3
- package/src/skills/token-report/VENDOR.md +5 -1
- package/src/upstreams.json +2 -2
- package/themes/README.md +3 -1
- package/web/dist/assets/{ActiveLoops-BJJN3P-V.js → ActiveLoops-DOJCPPPc.js} +1 -1
- package/web/dist/assets/{Activity-D2kOc3yi.js → Activity-LKsDzsnK.js} +1 -1
- package/web/dist/assets/{ActivityDetail-By3xOr21.js → ActivityDetail-DhwTfPm6.js} +1 -1
- package/web/dist/assets/{Bonsai-CBWDTBA4.js → Bonsai-CePMLrpr.js} +1 -1
- package/web/dist/assets/{CopyButton-BVbpriMB.js → CopyButton-CuoaJ6k7.js} +1 -1
- package/web/dist/assets/{Dashboard-CIJLPHM9.js → Dashboard-D1VKuvLe.js} +2 -2
- package/web/dist/assets/{Docs-CiRRIELs.js → Docs-CUrHJKaU.js} +1 -1
- package/web/dist/assets/{Factories-DhyK0O8d.js → Factories-Ci1XfmSy.js} +1 -1
- package/web/dist/assets/{GreenhouseView-DW3PgTPy.js → GreenhouseView-CNfH2lPK.js} +1 -1
- package/web/dist/assets/Installs-ZHQZM1iS.js +3 -0
- package/web/dist/assets/{JournalView-O65qEWfp.js → JournalView-CMsWahkS.js} +1 -1
- package/web/dist/assets/{Kits-C5U-yT6Z.js → Kits-CkliyK0n.js} +1 -1
- package/web/dist/assets/{Laws-CuTw_XNf.js → Laws-hh4O3HZ4.js} +1 -1
- package/web/dist/assets/{LibRows-D6-CVa3K.js → LibRows-Brv0Hmkr.js} +1 -1
- package/web/dist/assets/{Library-CzPlerd6.js → Library-BYmiLjJr.js} +1 -1
- package/web/dist/assets/{Loops-CqNF_-nS.js → Loops-ytm-xJ68.js} +1 -1
- package/web/dist/assets/{OperatorHudView-BNr8K5qj.js → OperatorHudView-KaqCx_HP.js} +1 -1
- package/web/dist/assets/{Personal-DeDb9e8O.js → Personal-CmcnRKYE.js} +1 -1
- package/web/dist/assets/{Settings-B8MPN_AD.js → Settings-tUrpdOfq.js} +1 -1
- package/web/dist/assets/{Tabs-DJzAez4h.js → Tabs-CD7etcGD.js} +1 -1
- package/web/dist/assets/api-CZ-x0iWG.js +1 -0
- package/web/dist/assets/{controls-D4wmg_pl.js → controls-CK7qHA8H.js} +1 -1
- package/web/dist/assets/{index-CRWqKxfY.css → index-Ba_Kg3Af.css} +1 -1
- package/web/dist/assets/{index-BL3P-9Rg.js → index-COKbhFNo.js} +3 -3
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Installs-B6nlo-Ly.js +0 -3
- package/web/dist/assets/api-DLDVY3K-.js +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
group: reference
|
|
3
|
+
order: 2.7
|
|
4
|
+
title: "Install profiles"
|
|
5
|
+
kind: "concept"
|
|
6
|
+
section: "CLI & environment"
|
|
7
|
+
description: "The profile file format, its two sources, how to apply one globally or to a project, and how to save your own."
|
|
8
|
+
---
|
|
9
|
+
An install profile is a whole install selection written down once, as `<name>.json`. A profile has no scope: you choose it when you apply the profile, globally or to one project folder. `geneseed setup --profile <name>` is the onboarding: it installs the profile globally, with no question. The install scripts pass the flag through, so a new user types one line.
|
|
10
|
+
|
|
11
|
+
On Windows (cmd or PowerShell), from the clone folder:
|
|
12
|
+
|
|
13
|
+
```bat
|
|
14
|
+
.\install.cmd --profile starter
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
On macOS and Linux:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
./install --profile starter
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
On Windows, type `.\` before `install.cmd`. PowerShell does not run a program from the current folder without it, and cmd does not either when the `NoDefaultCurrentDirectoryInExePath` policy is set.
|
|
24
|
+
|
|
25
|
+
## Where profiles come from
|
|
26
|
+
|
|
27
|
+
| Source | Folder | Who adds one |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| **Shipped** | `profiles/` in this checkout, shipped in the npm package and the clone | An admin, by pull request |
|
|
30
|
+
| **Personal** | `profiles/` in the machine-wide Geneseed folder (`~/.config/geneseed/profiles/`), beside your memory and rules | You, with `geneseed profile save`. An update never touches it |
|
|
31
|
+
|
|
32
|
+
Both sources load the same way, and `geneseed doctor` checks every profile of both. A broken Shipped profile is a doctor failure. A broken Personal profile is a note only, so a file of yours never stops an update. A Personal profile may not use the name of a Shipped one: `profile save` refuses that name. A Personal file under a Shipped name that you made by hand is never loaded (the Shipped profile is), and `geneseed doctor` names that file in a note.
|
|
33
|
+
|
|
34
|
+
## What `setup --profile` does
|
|
35
|
+
|
|
36
|
+
1. It loads and checks the profile. A wrong value stops the run and names the field and the values it accepts.
|
|
37
|
+
2. It finds each tool the profile lists (`hosts`) on this machine, as the wizard does: the command on `PATH`, or the program in a usual per-user folder. When it finds none, it prints each tool's install link, installs nothing and exits 1. A listed tool that is missing is a line in the summary.
|
|
38
|
+
3. It builds the harness **globally** into each tool it found, one after the other. A failure on one tool does not stop the others; the run then exits 1. Before each build it saves any edits you made to that deployed harness, as the wizard does.
|
|
39
|
+
4. It puts `geneseed` on your `PATH`. On macOS and Linux it adds the PATH block to your shell's startup file without asking, and the summary names the file.
|
|
40
|
+
5. When `login` is true, it sets the web console to start at login (Windows and macOS) and starts it now, without a browser. A console that already runs is restarted, so it serves the code you just pulled. On Linux there is no login item; the console still starts.
|
|
41
|
+
6. It runs `geneseed doctor` for the profile's theme.
|
|
42
|
+
7. It prints a summary in plain ASCII: each tool and its result, the settings a re-run put back, the console address and three next steps.
|
|
43
|
+
|
|
44
|
+
A profile run needs no terminal, so it also works from a script or a remote shell. Run the same line again to update and repair: a tool installed since the first run is added, the login item is rewritten only when it is out of date, and the console is not started twice. **A profile wins over what you changed since:** a second run puts each setting back to the profile's value, and the summary lists every setting it put back.
|
|
45
|
+
|
|
46
|
+
A profile run never forces a build. When one of your own skills or agents sits under a name Geneseed ships, that tool's build fails; the summary prints the build command with `--force` that replaces it.
|
|
47
|
+
|
|
48
|
+
## Apply a profile
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
geneseed profile apply <name> # globally
|
|
52
|
+
geneseed profile apply <name> --project ~/work/api # into one project folder
|
|
53
|
+
geneseed profile apply <name> --hosts claude,opencode # only these tools
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`profile apply` builds a profile without the onboarding: it puts nothing on `PATH`, writes no login item, starts no console and runs no doctor. Use it to change what an install runs, or to give one project its own setup.
|
|
57
|
+
|
|
58
|
+
- **Global** builds `<host>-global` for each tool, as `setup --profile` does.
|
|
59
|
+
- **`--project <dir>`** builds the per-project install of each tool into that folder (`geneseed build --emit <host> --out <dir> --root <dir>`). The folder must exist, be writable, and not be a tool's own global config folder. It must also not hold that global folder as its marker folder: `--project ~` is refused for Claude Code, because `~/.claude` is its global install. In the web console the folder must be an absolute path (`~` counts).
|
|
60
|
+
- **`--hosts`** narrows the run to some of the tools the profile lists. It refuses a tool the profile does not list. Without it, the run takes each tool of the profile that this machine has; a missing one is a line in the summary.
|
|
61
|
+
|
|
62
|
+
It touches only the installs of the tools it builds, in the scope you chose. Every other install stays as it is. As with `setup --profile`, a failure on one tool does not stop the others, the run then exits 1, and the summary lists every setting a build put back to the profile's value.
|
|
63
|
+
|
|
64
|
+
### A project beside a global install
|
|
65
|
+
|
|
66
|
+
When you apply a profile to a project and a global install of the same tool is active, both installs work in that project: the tool loads the global instructions file and the project's. The project install does not switch the global one off. `profile apply` adds one line per such tool to its summary, with the global gates that still run in the project. The rule comes from [Hook gates](../concepts/hook-gates.md) and [Exclusions](../concepts/exclusions.md):
|
|
67
|
+
|
|
68
|
+
| Tool | Global hooks that stand down for the project install | Global gates that still run in the project |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| Claude Code, OpenClaude | `context`, `git-gate` and `learn`, when the project install wires the same hook. So the project's own deletion gate, consent check and done gate decide | `rule-gate`: the secrets gate, the ownership gate, the external gate and the test note, when they are on in the global install |
|
|
71
|
+
| IBM Bob | `context` and `learn` | `tool-gate`: every gate except the done gate |
|
|
72
|
+
| OpenCode | none: the global plugins do not stand down | every gate that is on in the global install |
|
|
73
|
+
|
|
74
|
+
A gate that is off in the global install runs nowhere, so the line does not name it. To silence the global install in a folder completely, use an [exclusion](../concepts/exclusions.md) (`geneseed exclude add <dir>`).
|
|
75
|
+
|
|
76
|
+
## The file
|
|
77
|
+
|
|
78
|
+
| Key | Required | Values |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `description` | no | One line that says who the profile is for |
|
|
81
|
+
| `hosts` | yes | A list of the hosts Geneseed installs into (the host ids `geneseed build --emit <host>-global` takes) |
|
|
82
|
+
| `theme` | yes | A theme in `themes/` |
|
|
83
|
+
| `footprint` | yes | `lean` or `full`, as `geneseed build --footprint` |
|
|
84
|
+
| `posture` | yes | A posture in `src/postures/`, as `geneseed build --posture` |
|
|
85
|
+
| `mode` | yes | A mode in `src/modes/`, as `geneseed build --mode` |
|
|
86
|
+
| `trust` | yes | A loop trust preset, as `geneseed build --trust` |
|
|
87
|
+
| `doctrines` | yes | `"all"`, or a list of the packs in `src/doctrines/` |
|
|
88
|
+
| `excludeRules` | no | A list of rule ids, such as `craft.4` (the console's Constitution page lists them) |
|
|
89
|
+
| `excludeSkills` | no | A list of skill names, as `geneseed build --exclude-skills` |
|
|
90
|
+
| `kits` | no | A list of the kits in `src/kits/` |
|
|
91
|
+
| `sharedTier` | no | `true` lets a **project** install read the machine-wide shared tier (`geneseed build --shared-tier on`). A global apply ignores it, because a global install owns the tier |
|
|
92
|
+
| `contextWindow` | no | `"200k"` (the default) or `"1m"`, as `geneseed build --context-window`: the model context the install is built for. On Claude Code it sets the skill-listing budget ([Skills](../concepts/skills.md#the-listing-budget-on-claude-code)); other hosts record it and write nothing |
|
|
93
|
+
| `gates` | no | An object that maps a gate switch to `false` to turn it off. Each key is a gate flag of `geneseed build --help` (`deletionGate: false` is `--no-deletion-gate`); a wrong key's refusal lists them all. `ownBranchPass: false` is `--strict-consent`, which adds asks |
|
|
94
|
+
| `login` | no | `true` (default) lets `setup --profile` set the console to start at login and start it; `false` does neither, for a server or a CI machine. `profile apply` ignores it |
|
|
95
|
+
|
|
96
|
+
`geneseed build --help` prints the current choices for each build flag. Every value is checked against the generator's own lists, never a copy, so this page does not repeat them: a refusal names the field and every value it accepts. An unknown key is an error, not ignored: a typo must not fall back to a default in silence.
|
|
97
|
+
|
|
98
|
+
## `starter`
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"description": "For a first install: neutral voice, every guardrail except the ownership gate.",
|
|
103
|
+
"hosts": ["opencode", "bob", "claude", "openclaude"],
|
|
104
|
+
"theme": "neutral",
|
|
105
|
+
"footprint": "lean",
|
|
106
|
+
"posture": "peer",
|
|
107
|
+
"mode": "direct",
|
|
108
|
+
"trust": "balanced",
|
|
109
|
+
"doctrines": "all",
|
|
110
|
+
"kits": [],
|
|
111
|
+
"contextWindow": "200k",
|
|
112
|
+
"gates": { "ownershipGate": false },
|
|
113
|
+
"login": true
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`peer` and not `expert`, because `expert` does not explain the basics a new user needs; not `mentor`, because it checks understanding with questions. Every gate stays armed except the ownership gate, whose first-write stop is heavy for a new user. `200k`, because most machines run a 200k-token model, a locked-down work PC included; `guillaume-claude-global` sets `1m` for a 1M-token model.
|
|
118
|
+
|
|
119
|
+
## Save your own
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
geneseed profile save <name> --from claude-global
|
|
123
|
+
geneseed profile save <name> --from claude --project ~/work/api
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
It reads one install and writes `<name>.json` with every setting as it is, gates turned off included, and `hosts` set to that one tool. `--from` names a global install (`opencode-global`, `claude-global`, `bob-global` or `openclaude-global`), or a tool (`opencode`, `claude`, `bob`, `openclaude`) with `--project <dir>` for the project install in that folder. A project install's shared tier comes with it.
|
|
127
|
+
|
|
128
|
+
- By default it writes a **Personal** profile. It then prints the `profile apply` command that uses it.
|
|
129
|
+
- `--shipped` writes `profiles/<name>.json` in this checkout instead, for everyone. Only a git clone takes it, because a Shipped profile reaches others by pull request. Edit its `description`, then open a pull request.
|
|
130
|
+
- It refuses a name that already exists unless you add `--force`, which replaces that file only. It always refuses a name the other source holds.
|
|
131
|
+
|
|
132
|
+
It then prints how the new profile differs from `starter`, gates first, so you see what a reviewer will see.
|
|
133
|
+
|
|
134
|
+
A saved profile holds build settings only. Your user rules, `PROFILE.md`, memory, wiki and notebook are not build settings, and `profile save` never reads them.
|
|
135
|
+
|
|
136
|
+
## In the web console
|
|
137
|
+
|
|
138
|
+
**Installs › Profiles** lists every profile of both sources, with its tools, its settings, the gates it turns off and the installs that follow it (an install follows a profile when every build setting is the same). **Apply…** opens a panel: choose Global or One project, untick a tool to leave it out, and read per tool what the build would put back. In project scope the panel shows the global install that keeps running beside it. **Save an install as profile…** writes one from an active install, Personal or Shipped, and shows how it differs from `starter`. The **Selected install** panel on the Hosts tab names the profiles that install follows and has the same **Save as profile…** button. Both writes run as a background job of the CLI command above.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
**Next:** [Install from a clone](../guides/install-clone.md) · [CLI](cli.md)
|
package/docs/token-footprint.md
CHANGED
|
@@ -72,10 +72,15 @@ until 2026-09 it did, and the whole harness was paid twice per session.
|
|
|
72
72
|
`tests/unit/emit_smoke.test.mjs` rather than a byte count quoted here; the
|
|
73
73
|
figure moved twice while this paragraph went on stating the old one.
|
|
74
74
|
- **Skill descriptions are the second bill** on a host that catalogues natively.
|
|
75
|
-
Each is the skill's
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
Each is the skill's line in `src/skill-descriptions.json`: purpose and trigger
|
|
76
|
+
in at most 80 characters, theme-neutral (`skillDescription` in
|
|
77
|
+
`js/hosts/native.mjs`). The host lists skills under a budget of about 1% of
|
|
78
|
+
the context window and drops the descriptions of the least-used skills when
|
|
79
|
+
the listing overruns it. Read the listing's size off `SKILL_LISTING_CEILING`
|
|
80
|
+
in `js/inspect/cost.mjs`, which carries the measurement, rather than a figure
|
|
81
|
+
quoted here. Before the 80-character lines, the purpose line plus the first
|
|
82
|
+
trigger sentence ran to 320 characters. The themed purpose and the full
|
|
83
|
+
trigger still live in the body, read as soon as the skill is chosen.
|
|
79
84
|
- **§5–§9 carry authored lean halves too** (Memory, Notebook, Workspace, Wiki,
|
|
80
85
|
Context): each keeps its obligations — read `MEMORY.md`, read
|
|
81
86
|
`context.json` before the first reply, the git-ignored folders — and points at
|
|
@@ -25,5 +25,5 @@ How Geneseed's own code and tests are kept, and what the harness offers the agen
|
|
|
25
25
|
- **User-only skills and the aliases of old names cost no tokens and are hidden from the model.** The agent sees each skill once. See [Skills](../concepts/skills.md).
|
|
26
26
|
- **`--exclude-skills` filters in one place, `renderAll`.** A new host inherits the exclusion with no work of its own. See [Exclusions](../concepts/exclusions.md).
|
|
27
27
|
- **No skill is named like a Claude Code built-in command.** The built-in would win; the review skill is `geneseed-code-review` for this reason. See [Project context](../guides/project-context.md).
|
|
28
|
-
- **
|
|
28
|
+
- **A skill's description is one theme-neutral line of at most 80 characters, purpose and trigger, in the third person, never cut off and never with an XML-like tag.** The description is the only text a host routes on, so a defect there is a skill that silently never fires. The host lists skills under a budget and drops the least-used skills' descriptions first, so every line has to be short. The lines live in `src/skill-descriptions.json`, and the doctor checks them and the emitted form (`catalogueLineProblems`, `descriptionProblems`). See [Skills](../concepts/skills.md).
|
|
29
29
|
- **Skills that sound alike each have one job.** `roast-me` critiques your own ask or plan, `geneseed-code-review` reviews code, `fresh-eyes` is a blind second reading, and `pipeline` relays work between agents. Clear scopes make routing precise. See [Skills](../concepts/skills.md).
|
package/docs/web-ui.md
CHANGED
|
@@ -485,7 +485,9 @@ screen the run list stacks above the detail.
|
|
|
485
485
|
files), in sync or not checked, shows local edits apart from stale files, and links to Local edits.
|
|
486
486
|
`#/harnesses` and `#/themes` both still resolve here, so old links and bookmarks keep
|
|
487
487
|
working. *Make default* on an active row sets the default install (above), and a per-repo
|
|
488
|
-
install's panel has the **Shared tier** switch, with its benefit and cost beside it.
|
|
488
|
+
install's panel has the **Shared tier** switch, with its benefit and cost beside it. A Claude
|
|
489
|
+
Code install's panel has the **Context window** picker (`200k`/`1m`, `--context-window`), with
|
|
490
|
+
a line that says what it writes into `settings.json`; no other host reads those keys.
|
|
489
491
|
- The **Voice** card is the former Themes tab, kept as a REFERENCE rather than a second
|
|
490
492
|
control: a collapsed row that opens to every shipped voice with its tagline, the
|
|
491
493
|
deployed one pinned first and marked. It is the one place you can read what a voice
|
package/harness.config.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"_comment": "version is a human-readable release label only; the canonical identity of an installed harness is the source fingerprint stamped in .geneseed-version (see `harness version`), not this string.",
|
|
3
3
|
"theme": "neutral",
|
|
4
4
|
"product": "Geneseed",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.5.0"
|
|
6
6
|
}
|
package/js/README.md
CHANGED
|
@@ -66,6 +66,7 @@ as a per-host install at project or global scope.
|
|
|
66
66
|
| `emit-opencode.mjs` | The OpenCode emits — a project's `.opencode/` and the global config dir. Deliberate twin of the above |
|
|
67
67
|
| `emit-common.mjs` | Constants, tree walkers, and the three writers BOTH global emits share. Decides no host |
|
|
68
68
|
| `fold.mjs` | The fold: moves a global install's stores into the shared tier, in the emit. Moves aside, never deletes; a second run writes nothing |
|
|
69
|
+
| `notes-migrate.mjs` | A project install's spec-feedback notes, once kept in its host layer's notebook (`.claude/notebook`, …), merged into `<project>/notebook` on its next emit. No cap, read back, then set aside, never deleted |
|
|
69
70
|
| `retired-skills.mjs` | Skill folders an old build rendered under a name that no longer ships: the canonical global emit moves a plain, fingerprinted, unowned one to `archived-skills/`; `migrate --dry-run` reads the same split |
|
|
70
71
|
| `rule-decide.mjs` | The decisions on the draft: the approval flow of `src/skills/rule/approve.md`, as the console applies it. Write order: target, ledger, draft |
|
|
71
72
|
| `stubs.mjs` | Write-once seed files: context, wiki, rules, excludes, profile, `.gitignore`, memory/notebook indexes |
|
|
@@ -101,11 +102,13 @@ user co-owns, and the hook verbs those emitted configs then run.
|
|
|
101
102
|
| `hooks-done.mjs` | The done gate (#289): on Stop and SubagentStop, inside `learn` and before its spawn, judges a turn (a sub-agent's own, at SubagentStop, against each git root it wrote under) that edited files against the project's checks — blocks until `.geneseed/done-checks.txt`'s checks passed after the last edit; without that file, the inferred checks are advisory (a `systemMessage`, never a block) |
|
|
102
103
|
| `done-checks.mjs` | Where the done gate's checks come from: `.geneseed/done-checks.txt`, else inferred from the git root's manifests (package.json scripts, pom.xml, Gradle, pyproject.toml, Cargo.toml, go.mod), each a group of accepted command forms; plus `doneLine`, the SessionStart line `context` prints. Spawn-free: `context` is in the CLI's closure. Twin: the OpenCode context plugin |
|
|
103
104
|
| `hooks-learn.mjs` | The `learn` verb — Stop/SubagentStop/PreCompact distiller; the hook path's ONE spawn (`$GENESEED_LLM`) |
|
|
105
|
+
| `spec-feedback.mjs` | On SubagentStop, inside `learn` and with no model: copies the `spec-feedback:` lines of a sub-agent's final report into `agent-notes/<name>.md` (and `_general.md`). On Stop, the `[skill:<name>]` lines of the main reply into `skill-notes/<name>.md` (and `_general.md`). Each line picks its scope: the machine notes (the tier's `notes/`) or, tagged `:project`, the project's `<project>/notebook/`. Its pure part (parser, routing table, merge) is a twin in the OpenCode learn plugin |
|
|
104
106
|
| `hooks-prims.mjs` | The Python path/text primitives the hook verbs share (`splitLines`, `readStdin`, a never-throwing `isFile`), plus the activity off switch (`activityOn`) and the do-nothing `activity` verb |
|
|
105
107
|
| `store-watch.mjs` | The change report: a session's baseline of the rule and memory files (`writeBaseline`, from the hook entry after `context`), the compare at Stop (`storeReport`, from `learn`), and `recordOwnWrites`, around Geneseed's own writers. It detects; it prevents nothing. The OpenCode guard holds the twin |
|
|
106
108
|
| `activity.mjs` | The hook-side activity writer and the owner of snapshot liveness: `recordActivity` (one payload into `<root>/activity/`), `readTranscriptDelta`, `sweepActivity` (archive, newest 50, 7 days). Loaded only when tracking is on; never prints |
|
|
107
109
|
| `hook-tap.mjs` | The opt-in tap: with `GENESEED_HOOK_TAP=<dir>` set, one file per hook call recording the payload's SHAPE (keys kept, every string replaced by its type and length), for fixtures from a host the canary cannot run. Refuses a directory inside a git worktree. Imported only when the variable is set; never prints, never throws |
|
|
108
|
-
| `
|
|
110
|
+
| `agent-runs.mjs` | The agent outcome ledger: on SubagentStop, inside `learn` and with no model, one line per finished named sub-agent into `notebook/agent-runs.jsonl` (spec hash, done-gate end and blocks, tool and refused calls, feedback lines, report). Its marker table, hash and line are a twin in the OpenCode learn plugin |
|
|
111
|
+
| `usage.mjs` | The usage counter `tool-gate` runs: one `{day, kind, name}` line per Skill or subagent call into `notebook/usage.jsonl`; `activity` adds a `via: "slash"` line for a typed `/<skill>`. A global install stands down beside a wired project install. Hook path: builtins only, silent, never throws |
|
|
109
112
|
| `memory-files.mjs` | The memory store's file format — `frontmatter`, `MEMORY.md` index writes, agent lessons, consolidate — the `user-rules.md` parser, the draft's format and the fold's ledger reader. No spawn: the CLI, web console and fold import it |
|
|
110
113
|
| `geneseed-dir.mjs` | The Node writers into a project's `<git root>/.geneseed/`: the personal-by-default `.gitignore` (`GENESEED_GITIGNORE`, pinned to the two OpenCode copies), and the protected-checks seed every project emit runs (`seedProtectedChecks`: seed once when absent, then the user's — never recorded, rewritten or uninstalled). Never throws, never writes through a link. Spawn-free |
|
|
111
114
|
| `gitref.mjs` | fs/path-only: `gitRootOf`, `gitDirOf`, `gitCommonDirOf`, `currentBranch`, `protectedBranches`, `stashExists`, `loopLaunched`, `headCommit` — read straight off `.git`, never spawn git. Shared by `hooks.mjs`'s git-gate, `loss.mjs` and `js/loop/cli.mjs`'s commit-message writer; `headCommit` by `js/factory/cli.mjs` (R2) |
|
|
@@ -142,6 +145,7 @@ Everything that inspects an already-built or already-deployed harness and report
|
|
|
142
145
|
| `scan.mjs` | The shared walk/sort/strip/test primitives every `checks-*` uses. Owns no judgement itself |
|
|
143
146
|
| `validate.mjs` | The `validate` verb (the generator's old `--validate-only`): renders a sandbox, scans it for tokens and dead links, own exit contract |
|
|
144
147
|
| `inventory.mjs` | The one catalog walk and its taxonomy tables, read by status, the TUI and the web console |
|
|
148
|
+
| `agent-scores.mjs` | `geneseed catalog agents --scores`: the outcome ledger read back, one row per agent and spec hash per active install. Read-only |
|
|
145
149
|
| `status.mjs` | `geneseed status` and `version` — the panel data, counts, accent colour, version verdict |
|
|
146
150
|
| `cost.mjs` | What one install injects every session, by part (root file, skill and agent lists, session files), in characters; owns `CARRIER_CEILING`, which the smoke test gates and the console draws, and `SKILL_LISTING_CEILING`, which the smoke test gates and the console draws on a Claude Code install |
|
|
147
151
|
| `diff.mjs` | `geneseed diff` — what a deployed install has that a fresh render of `src/` does not |
|
|
@@ -234,7 +238,9 @@ Verbs that change an install that already exists, as opposed to rendering one.
|
|
|
234
238
|
| module | owns |
|
|
235
239
|
|---|---|
|
|
236
240
|
| `update.mjs` | `upgrade`/`bootstrap` — git pull, doctor gate, rebuild, each via a respawn |
|
|
237
|
-
| `setup.mjs` | The install wizard. Its prompts go through `js/lib/prompt.mjs`'s stdin readers |
|
|
241
|
+
| `setup.mjs` | The install wizard. Its prompts go through `js/lib/prompt.mjs`'s stdin readers. `setup --profile` installs a profile with no prompt; `profile apply` (`cmdProfileApply`) shares its build loop |
|
|
242
|
+
| `profiles.mjs` | Install profiles from two sources, Shipped (`profiles/*.json`) and Personal (`<machine tier>/profiles/`): load and validate against the generator's own sources, the per-host argv (global or project), `profile save` |
|
|
243
|
+
| `profile-scope.mjs` | The scope half of `profile apply`: the project folder check (shared with the console's deploy) and what a global install still runs inside a project (`globalLayering`) |
|
|
238
244
|
| `uninstall.mjs` | Removes or disables an install: manifest-driven reversal, plus stash deactivate/reactivate |
|
|
239
245
|
| `migrate.mjs` | `geneseed migrate` — all-or-nothing re-emit moving installs onto the npm install shape |
|
|
240
246
|
| `memory.mjs` | `geneseed memory list|rm|consolidate` — CLI-side fact removal (archive by default, `--purge` deletes), twin of the web delete endpoint; `consolidate` rebuilds the index by hand, twin of the hook's `learn --consolidate` |
|
|
@@ -275,6 +281,7 @@ the deployed harness as JSON.
|
|
|
275
281
|
| `update-check.mjs` | Is a newer release on npm? Answers from memory, refreshes in the background (a day when it got an answer, an hour when it did not), `null` on any failure, never asked under `node --test` |
|
|
276
282
|
| `gates-api.mjs` | `GET /api/gates`: gate asks per rule per day over 30 days, read off every installed harness's `notebook/gates.jsonl` (the Overview's sparklines) |
|
|
277
283
|
| `usage-api.mjs` | `GET /api/usage`: the 30-day skill and agent call counts across every installed harness, the never-fired list, a fleet-wide `names` list (per-name 30-day counts, installs, daily series, last day seen), and skips lines older than 90 days in each `notebook/usage.jsonl` |
|
|
284
|
+
| `profiles-api.mjs` | The Profiles tab: `GET /api/profiles` (both sources, the installs that follow each, an apply preview) and the `profile-apply` / `profile-save` jobs, which run the CLI's own verb |
|
|
278
285
|
| `user-files.mjs` | The fingerprint-guarded editors for `user-rules.md` (incl. memory promotion) and `PROFILE.md`, read and write |
|
|
279
286
|
| `actions.mjs` | The other mutating endpoints — memory delete, MCP, excludes, installs, view, restore — plus install/deploy argv, and `installView`, the per-request install behind the one (host, path) allowlist |
|
|
280
287
|
| `daemon.mjs` | Detached web start/stop/status/restart, the `.geneseed-web.json` record, and `openUrl` |
|
package/js/build/args.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { parseArgs as nodeParseArgs } from 'node:util';
|
|
|
11
11
|
import { withPlatformNewlines } from '../lib/fs.mjs';
|
|
12
12
|
import path from 'node:path';
|
|
13
13
|
import {
|
|
14
|
-
CONFIG, discoverNames, GATE_SWITCHES, PACK_ORDER, SRC, knownRuleIds, knownSkillIds, linkedSkillIds, loadKits,
|
|
14
|
+
CONFIG, CONTEXT_WINDOWS, DEFAULT_CONTEXT_WINDOW, discoverNames, GATE_SWITCHES, PACK_ORDER, SRC, knownRuleIds, knownSkillIds, linkedSkillIds, loadKits,
|
|
15
15
|
resolveSkillNames, retiredRuleAddresses, reusedRuleAddresses, ruleCanon, skillAliases,
|
|
16
16
|
} from './source.mjs';
|
|
17
17
|
// The loop engine's trust presets — the `--trust` choices. `score.mjs` imports nothing, which is
|
|
@@ -102,7 +102,7 @@ export function configDefaults(config = CONFIG, rules = ruleCanon(SRC).rules) {
|
|
|
102
102
|
export const VALUED = {
|
|
103
103
|
'--theme': 'theme', '--posture': 'posture', '--mode': 'mode', '--trust': 'trust',
|
|
104
104
|
'--doctrines': 'doctrines', '--exclude-rules': 'excludeRules', '--exclude-skills': 'excludeSkills',
|
|
105
|
-
'--kits': 'kits', '--shared-tier': 'sharedTier',
|
|
105
|
+
'--kits': 'kits', '--shared-tier': 'sharedTier', '--context-window': 'contextWindow',
|
|
106
106
|
'--out': 'out', '--target': 'out', '--emit': 'emit',
|
|
107
107
|
'--footprint': 'footprint', '--root': 'root', '--config-dir': 'cfgDir',
|
|
108
108
|
};
|
|
@@ -167,6 +167,7 @@ export function choicesFor() {
|
|
|
167
167
|
'--mode': discoverNames('modes', 'direct'),
|
|
168
168
|
'--trust': Object.keys(PRESETS),
|
|
169
169
|
'--shared-tier': ['on', 'off'],
|
|
170
|
+
'--context-window': Object.keys(CONTEXT_WINDOWS),
|
|
170
171
|
};
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -376,7 +377,7 @@ export function parseArgs(argv, defaults) {
|
|
|
376
377
|
excludeRules: defaults.excludeRules,
|
|
377
378
|
excludeSkills: defaults.excludeSkills ?? [],
|
|
378
379
|
kits: defaults.kits ?? [],
|
|
379
|
-
sharedTier: 'off',
|
|
380
|
+
sharedTier: 'off', contextWindow: DEFAULT_CONTEXT_WINDOW,
|
|
380
381
|
out: 'Harness', emit: 'files', footprint: 'lean', root: null,
|
|
381
382
|
syncThemes: false, validateOnly: false, verbose: false, pruneGates: false, force: false, reset: false,
|
|
382
383
|
...Object.fromEntries(GATE_SWITCHES.map((g) => [g.arg, false])),
|
package/js/build/catalog.mjs
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import { helpWidth } from '../ui/cli.mjs';
|
|
27
27
|
import { tuiInventory } from '../inspect/inventory.mjs';
|
|
28
28
|
import { defaultTheme, installedDefaults } from '../hosts/installs.mjs';
|
|
29
|
-
import { printOut } from '../lib/fs.mjs';
|
|
29
|
+
import { printErr, printOut } from '../lib/fs.mjs';
|
|
30
30
|
import { dwidth, fit, icon, truncd, tuiEntries } from '../ui/tui.mjs';
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -119,6 +119,16 @@ export function catalogLines(inv, section, width, showSource = false) {
|
|
|
119
119
|
* validator here, and the entry point's `exitCode` arm carries the refusal out.
|
|
120
120
|
*/
|
|
121
121
|
export function cmdCatalog(args) {
|
|
122
|
+
// `--scores` reads the installs' outcome ledgers, not the roster: its own module, loaded only
|
|
123
|
+
// when asked (js/inspect/agent-scores.mjs). It scores agents alone, so any other section, or
|
|
124
|
+
// none, refuses: the command line must say `agents`.
|
|
125
|
+
if (args.scores) {
|
|
126
|
+
if (args.section !== 'agents') {
|
|
127
|
+
printErr(`[catalog] --scores reads agent runs: use \`geneseed catalog agents --scores\`.\n`);
|
|
128
|
+
return 2;
|
|
129
|
+
}
|
|
130
|
+
return import('../inspect/agent-scores.mjs').then((m) => m.cmdAgentScores());
|
|
131
|
+
}
|
|
122
132
|
const inst = installedDefaults();
|
|
123
133
|
const theme = args.theme || inst.theme || defaultTheme();
|
|
124
134
|
// The install's own pack selection, so an inactive pack's rules are listed and MARKED
|
package/js/build/driver.mjs
CHANGED
|
@@ -38,7 +38,7 @@ import path from 'node:path';
|
|
|
38
38
|
import { build, phaseLog } from './bundle.mjs';
|
|
39
39
|
import { emitClaudeRender } from './emit-claude.mjs';
|
|
40
40
|
import { emitOpencodeRender, emitOpencodeGlobalRender } from './emit-opencode.mjs';
|
|
41
|
-
import { settingsIntegrityCheck } from '../hosts/settings.mjs';
|
|
41
|
+
import { loadJsonObject, settingsIntegrityCheck } from '../hosts/settings.mjs';
|
|
42
42
|
import { hookRunnerEntry } from '../hosts/shim.mjs';
|
|
43
43
|
import { writeText, withPlatformNewlines, isFile, withWriteRecord } from '../lib/fs.mjs';
|
|
44
44
|
import { parseJson, jsonDumpsIndent } from '../lib/json.mjs';
|
|
@@ -59,21 +59,21 @@ import { seedProtectedChecks } from '../hosts/geneseed-dir.mjs';
|
|
|
59
59
|
// status` renders to count, so `bin/geneseed-cli.mjs` needs the same checkout paths and the
|
|
60
60
|
// same cfg.
|
|
61
61
|
import {
|
|
62
|
-
GATE_SWITCHES, ROOT, makeCfg,
|
|
62
|
+
CONTEXT_WINDOWS, GATE_SWITCHES, ROOT, makeCfg,
|
|
63
63
|
} from './source.mjs';
|
|
64
64
|
|
|
65
65
|
// P5f moved these, for the same arithmetic a third time: `harness rebuild-all` reads the
|
|
66
66
|
// registry to find every install it must re-emit, and a CLI verb may not reach into a driver
|
|
67
67
|
// for a reader. See js/inspect/registry.mjs.
|
|
68
68
|
import { registryRecord, registryRoots } from '../inspect/registry.mjs';
|
|
69
|
-
import { kitsOfDir } from '../hosts/installs.mjs';
|
|
69
|
+
import { installedDefaults, kitsOfDir } from '../hosts/installs.mjs';
|
|
70
70
|
|
|
71
71
|
// P2. `--sync-themes` crossed into its own module rather than into this file: it is 90 lines
|
|
72
72
|
// of textual surgery over committed files with a corpus of its own, and it is the half of the
|
|
73
73
|
// maintainer pair that needs nothing this driver is banned from having.
|
|
74
74
|
import { syncThemes } from './themes.mjs';
|
|
75
75
|
import { configDefaults, die, parseArgs } from './args.mjs';
|
|
76
|
-
import { preserveRefusal, preserveRefusalText } from './profile.mjs';
|
|
76
|
+
import { guardTarget, preserveRefusal, preserveRefusalText } from './profile.mjs';
|
|
77
77
|
|
|
78
78
|
export { parseDriverArgs } from './args.mjs';
|
|
79
79
|
|
|
@@ -135,6 +135,24 @@ function preambleExclude(claudeMd, host) {
|
|
|
135
135
|
return resolvePath(path.join(globalDir, 'CLAUDE.md')).split(path.sep).join('/');
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/**
|
|
139
|
+
* The skill-listing keys (`CONTEXT_WINDOWS`) the USER-level Claude Code settings file already
|
|
140
|
+
* sets, for a Claude Code PROJECT emit — `[]` for every other emit. Project-local settings
|
|
141
|
+
* outrank `~/.claude/settings.json`, so a project value would silently undercut a global `1m`
|
|
142
|
+
* install or a value the user set there by hand; the project emit leaves those keys to the user
|
|
143
|
+
* level. Resolved here, in the driver, for `preambleExclude`'s reason: the render half must never
|
|
144
|
+
* resolve a config dir. An unreadable file sets nothing.
|
|
145
|
+
*/
|
|
146
|
+
function userListingKeys(host, scope) {
|
|
147
|
+
if (host !== 'claude' || scope !== 'project') return [];
|
|
148
|
+
let file;
|
|
149
|
+
try { file = path.join(claudeConfigDir(), 'settings.json'); } catch { return []; }
|
|
150
|
+
const { state, data } = loadJsonObject(file);
|
|
151
|
+
if (state !== 'ok') return [];
|
|
152
|
+
const keys = new Set(Object.values(CONTEXT_WINDOWS).flatMap((w) => Object.keys(w)));
|
|
153
|
+
return [...keys].filter((k) => Object.hasOwn(data, k));
|
|
154
|
+
}
|
|
155
|
+
|
|
138
156
|
/**
|
|
139
157
|
* `_build_global._warn_bob_global_over_project` — informational, never auto-removes.
|
|
140
158
|
*
|
|
@@ -485,6 +503,7 @@ function emitClaudeCore(cfg, args, { cfgDir, claudeMd, scope, host, out, hookOpt
|
|
|
485
503
|
out,
|
|
486
504
|
footprint: args.footprint, nativeCatalog: hostCatalogsNatively(host),
|
|
487
505
|
oldOwned, oldManaged, preambleExclude: preambleExclude(claudeMd, host),
|
|
506
|
+
userListing: userListingKeys(host, scope),
|
|
488
507
|
hookOpts, oldHashes, oldKeptHashes,
|
|
489
508
|
});
|
|
490
509
|
const { owned, stats, memStatus, nbStatus, managed, editRefused, kept, keptHashes } = rendered;
|
|
@@ -705,12 +724,13 @@ const PROJECT_EMITS = {
|
|
|
705
724
|
* carry straight past the parameter default.
|
|
706
725
|
*/
|
|
707
726
|
function axesCfg({
|
|
708
|
-
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, ...gates
|
|
727
|
+
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, contextWindow, ...gates
|
|
709
728
|
}) {
|
|
710
729
|
return makeCfg({
|
|
711
730
|
...(posture ? { posture } : {}), ...(mode ? { mode } : {}), ...(trust ? { trust } : {}),
|
|
712
731
|
...(doctrines ? { doctrines } : {}), ...(excludeRules ? { excludeRules } : {}),
|
|
713
732
|
...(excludeSkills ? { excludeSkills } : {}), ...(kits ? { kits } : {}), ...(sharedTier ? { sharedTier } : {}),
|
|
733
|
+
...(contextWindow ? { contextWindow } : {}),
|
|
714
734
|
// The gate switches (`GATE_SWITCHES` keys): only an explicit `false` disarms; `null` (no
|
|
715
735
|
// opinion) keeps the gate.
|
|
716
736
|
...Object.fromEntries(GATE_SWITCHES.filter((g) => gates[g.key] === false).map((g) => [g.arg, true])),
|
|
@@ -719,7 +739,7 @@ function axesCfg({
|
|
|
719
739
|
|
|
720
740
|
export function emitProjectInto(host, {
|
|
721
741
|
theme, out, root, footprint = 'full', posture = null, mode = null, trust = null,
|
|
722
|
-
doctrines = null, excludeRules = null, excludeSkills = null, kits = null, sharedTier = false, seed = true, ...gates
|
|
742
|
+
doctrines = null, excludeRules = null, excludeSkills = null, kits = null, sharedTier = false, contextWindow = null, seed = true, ...gates
|
|
723
743
|
}) {
|
|
724
744
|
const emit = PROJECT_EMITS[host];
|
|
725
745
|
// The axes ride the same rail into every `*Into`, and for the same reason: a drift reader
|
|
@@ -730,7 +750,7 @@ export function emitProjectInto(host, {
|
|
|
730
750
|
// the git root, which for a temp dir inside a repo is that repo, outside the sandbox.
|
|
731
751
|
return withPlatformNewlines(() => emit(
|
|
732
752
|
axesCfg({
|
|
733
|
-
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, ...gates }),
|
|
753
|
+
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, contextWindow, ...gates }),
|
|
734
754
|
{ theme, footprint, root, seed }, out,
|
|
735
755
|
));
|
|
736
756
|
}
|
|
@@ -745,16 +765,17 @@ export function emitProjectInto(host, {
|
|
|
745
765
|
*/
|
|
746
766
|
export function buildInto({
|
|
747
767
|
theme, out, footprint = 'lean', posture = null, mode = null, trust = null, doctrines = null,
|
|
748
|
-
excludeRules = null, excludeSkills = null, kits = null, sharedTier = false, ...gates
|
|
768
|
+
excludeRules = null, excludeSkills = null, kits = null, sharedTier = false, contextWindow = null, ...gates
|
|
749
769
|
}) {
|
|
750
770
|
return withPlatformNewlines(() => build(axesCfg({
|
|
751
|
-
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, ...gates }),
|
|
771
|
+
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, contextWindow, ...gates }),
|
|
752
772
|
theme, out, { footprint, nativeCatalog: false }));
|
|
753
773
|
}
|
|
754
774
|
|
|
755
775
|
export function emitGlobalInto(host, {
|
|
756
776
|
theme, out, cfgDir, footprint, posture = null, mode = null, doctrines = null, trust = null,
|
|
757
|
-
excludeRules = null, excludeSkills = null, kits = null, sharedTier = false,
|
|
777
|
+
excludeRules = null, excludeSkills = null, kits = null, sharedTier = false, contextWindow = null,
|
|
778
|
+
sharedRoot = undefined, ...gates
|
|
758
779
|
}) {
|
|
759
780
|
// `build.HOSTS.get(host, build.HOSTS["opencode"])` — an unknown host falls back rather than
|
|
760
781
|
// raising, because the host comes from a marker file a user can edit.
|
|
@@ -771,7 +792,7 @@ export function emitGlobalInto(host, {
|
|
|
771
792
|
// the same scar the footprint left in `diffCollect`, one axis over each time.
|
|
772
793
|
return withPlatformNewlines(() => emit(
|
|
773
794
|
axesCfg({
|
|
774
|
-
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, ...gates }),
|
|
795
|
+
posture, mode, trust, doctrines, excludeRules, excludeSkills, kits, sharedTier, contextWindow, ...gates }),
|
|
775
796
|
{ theme, footprint, root: null, cfgDir, sharedRoot }, out,
|
|
776
797
|
));
|
|
777
798
|
}
|
|
@@ -863,6 +884,16 @@ function run(argv) {
|
|
|
863
884
|
die(2, `argument --shared-tier: only applies to a per-repo host emit (got --emit ${args.emit}); `
|
|
864
885
|
+ 'a global install already owns the shared tier');
|
|
865
886
|
}
|
|
887
|
+
// A NEW project install takes the machine's context window when none is given: the window is
|
|
888
|
+
// the model's, so a project on a machine whose global install says `1m` is a 1m project too. An
|
|
889
|
+
// existing install keeps the default rule, and the preserve guard below holds it to its own.
|
|
890
|
+
// NOT UNDER `--reset`: a replay (profile apply, the console, the wizard) is a whole selection
|
|
891
|
+
// that has already resolved the window, and `setupBuildArgs` elides `200k` as the default, so
|
|
892
|
+
// its silence there means 200k, not "no opinion".
|
|
893
|
+
if (!args.reset && !args.given.has('contextWindow') && args.emit !== 'files' && !args.emit.endsWith('-global')
|
|
894
|
+
&& !guardTarget(args, out)) {
|
|
895
|
+
try { args.contextWindow = installedDefaults().contextWindow; } catch { /* default */ }
|
|
896
|
+
}
|
|
866
897
|
// The preserve guard, before anything is written: a build over an existing install that would
|
|
867
898
|
// change a setting it was not given refuses, naming each change and the command that keeps
|
|
868
899
|
// them. `--reset` is the caller's consent. See `preserveRefusal` (js/build/profile.mjs).
|
package/js/build/emit-claude.mjs
CHANGED
|
@@ -11,12 +11,15 @@ import { claimer, loadAgentOverrides, writeNativeLayer } from '../hosts/native.m
|
|
|
11
11
|
import { ensureAgentOverridesStub, writeAliasCommands } from '../hosts/opencode.mjs';
|
|
12
12
|
import {
|
|
13
13
|
managedBlockRemove, managedBlockWrite, mergeClaudeSettings,
|
|
14
|
-
unwireClaudeEnv, unwireClaudeExcludes, unwireClaudeSettings, wireClaudeEnv,
|
|
14
|
+
unwireClaudeEnv, unwireClaudeExcludes, unwireClaudeListing, unwireClaudeSettings, wireClaudeEnv,
|
|
15
|
+
wireClaudeExcludes, wireClaudeListing,
|
|
15
16
|
} from '../hosts/settings.mjs';
|
|
17
|
+
import { CONTEXT_WINDOWS } from './source.mjs';
|
|
16
18
|
import { get, isDict, isTruthy } from '../lib/json.mjs';
|
|
17
19
|
import { relPosix } from '../lib/text.mjs';
|
|
18
20
|
import { assertSourceComplete, phaseLog, ensureMemoryStore } from './bundle.mjs';
|
|
19
21
|
import { foldOnEmit } from './fold.mjs';
|
|
22
|
+
import { migrateProjectNotes } from './notes-migrate.mjs';
|
|
20
23
|
import { pruneRetiredSkills } from './retired-skills.mjs';
|
|
21
24
|
import {
|
|
22
25
|
claimAndWrite, globalMemory, globalNotebook, shipLeanLaws, stripCapabilityLinks,
|
|
@@ -152,6 +155,8 @@ export function emitClaudeRender(cfg, job) {
|
|
|
152
155
|
ensureMemoryStore(path.join(cfgDir, 'memory'));
|
|
153
156
|
const nbStatus = globalNotebook(cfgDir, items, out, cfg.src);
|
|
154
157
|
ensureNotebookIndex(path.join(cfgDir, 'notebook'));
|
|
158
|
+
// A project's notes live in `<repo>/notebook` now, whatever the host (js/build/notes-migrate.mjs).
|
|
159
|
+
if (scope === 'project') migrateProjectNotes(cfgDir, path.dirname(cfgDir));
|
|
155
160
|
// context.json too: the root names it as the project's own manifest, and until 2026-10 this
|
|
156
161
|
// emit never seeded one — the bundle and OpenCode did — so §9 pointed at a file that was not
|
|
157
162
|
// there. The context hook reads it from this dir (`resolveContextSets`' last candidate).
|
|
@@ -290,6 +295,7 @@ function claudeWire(job, claudeMdText, hasAgentText, doctrines = null, excludeRu
|
|
|
290
295
|
unwireClaudeSettings(path.join(cfgDir, oldSf), get(old, 'settings_hooks') || [], cfgDir);
|
|
291
296
|
unwireClaudeExcludes(path.join(cfgDir, oldSf), get(old, 'settings_excludes') || []);
|
|
292
297
|
unwireClaudeEnv(path.join(cfgDir, oldSf), get(old, 'settings_env'));
|
|
298
|
+
unwireClaudeListing(path.join(cfgDir, oldSf), get(old, 'settings_listing'));
|
|
293
299
|
}
|
|
294
300
|
// The merge prunes recorded groups that are no longer canonical and returns the
|
|
295
301
|
// COMPLETE current claim set — store it as-is; unioning with prior would resurrect the
|
|
@@ -308,6 +314,23 @@ function claudeWire(job, claudeMdText, hasAgentText, doctrines = null, excludeRu
|
|
|
308
314
|
const priorEnv = oldSf === settingsName && isDict(get(old, 'settings_env')) ? old.settings_env : {};
|
|
309
315
|
const env = { ...priorEnv, ...wireClaudeEnv(settingsPath) };
|
|
310
316
|
if (Object.keys(env).length) managed.settings_env = env;
|
|
317
|
+
// The skill-listing budget of `--context-window` (`CONTEXT_WINDOWS` says why and why Claude
|
|
318
|
+
// Code only). The record is what this install owns on file, so a value can change on a rebuild.
|
|
319
|
+
const priorListing = oldSf === settingsName && isDict(get(old, 'settings_listing')) ? old.settings_listing : {};
|
|
320
|
+
// A project emit leaves a key the user-level settings already set to that level
|
|
321
|
+
// (`userListingKeys`, js/build/driver.mjs): a project value would undercut it.
|
|
322
|
+
const wantListing = Object.fromEntries(Object.entries(CONTEXT_WINDOWS[gates.contextWindow] ?? {})
|
|
323
|
+
.filter(([k]) => !(job.userListing ?? []).includes(k)));
|
|
324
|
+
const listing = wireClaudeListing(settingsPath, wantListing, priorListing);
|
|
325
|
+
if (Object.keys(listing).length) managed.settings_listing = listing;
|
|
326
|
+
// Said once, the first time this install writes the keys: an install older than the option
|
|
327
|
+
// reads as 200k, and on a 1M machine that is a choice its owner should see being made.
|
|
328
|
+
if (!Object.keys(priorListing).length && Object.keys(listing).length) {
|
|
329
|
+
process.stdout.write(`[geneseed] skill listing: wrote ${Object.entries(listing).map(([k, v]) => `${k} ${v}`)
|
|
330
|
+
.join(', ')} into ${settingsName} for a ${gates.contextWindow} context window; `
|
|
331
|
+
+ `${gates.contextWindow === '1m' ? 'for a 200k-token model, rebuild with --context-window 200k'
|
|
332
|
+
: 'on a 1M-token model, rebuild with --context-window 1m'}.\n`);
|
|
333
|
+
}
|
|
311
334
|
}
|
|
312
335
|
|
|
313
336
|
// Project-bypasses-global (Claude and OpenClaude): a PROJECT install suppresses the GLOBAL
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
claimAndWrite, globalMemory, globalNotebook, shipLeanLaws, stripCapabilityLinks,
|
|
23
23
|
} from './emit-common.mjs';
|
|
24
24
|
import { foldOnEmit } from './fold.mjs';
|
|
25
|
+
import { migrateProjectNotes } from './notes-migrate.mjs';
|
|
25
26
|
import { pruneRetiredSkills } from './retired-skills.mjs';
|
|
26
27
|
import { renderAll } from './render.mjs';
|
|
27
28
|
import {
|
|
@@ -161,6 +162,8 @@ export function emitOpencodeRender(cfg, job) {
|
|
|
161
162
|
} = opencodeLayer(cfg, items, _theme, theme, oc, owned, {
|
|
162
163
|
oldOwned, manifestExisted, agentPath, wireBase: root, overridesDir: out, oldDenies, oldEdit, oldHashes, oldGates, oldKeptHashes,
|
|
163
164
|
});
|
|
165
|
+
// Notes an install older than #590 kept in `.opencode/notebook` (js/build/notes-migrate.mjs).
|
|
166
|
+
migrateProjectNotes(oc, root);
|
|
164
167
|
|
|
165
168
|
return {
|
|
166
169
|
owned,
|
package/js/build/export.mjs
CHANGED
|
@@ -274,7 +274,7 @@ export function planExport({ profile = { ...PROFILE_DEFAULTS }, theme = 'neutral
|
|
|
274
274
|
let body = forLibrary(lstripNewlines(s.it.text), s);
|
|
275
275
|
let description;
|
|
276
276
|
if (s.kind === 'skill') {
|
|
277
|
-
description = skillDescription(s.it.text);
|
|
277
|
+
description = skillDescription(s.it.text, s.stem, cfg.src);
|
|
278
278
|
body = stripSkillBodyLinks(link(pointSideFiles(body, s.stem, 'references')));
|
|
279
279
|
if (!profile.keepSkillSelfImprovement) body = dropSelfImprovement(body);
|
|
280
280
|
for (const side of items) {
|
package/js/build/generate.mjs
CHANGED
|
@@ -91,7 +91,8 @@ function sysExit(msg) {
|
|
|
91
91
|
const BUILD_FORWARD = [
|
|
92
92
|
['theme', '--theme'], ['emit', '--emit'], ['footprint', '--footprint'],
|
|
93
93
|
['posture', '--posture'], ['mode', '--mode'], ['trust', '--trust'], ['doctrines', '--doctrines'],
|
|
94
|
-
['excludeRules', '--exclude-rules'], ['excludeSkills', '--exclude-skills'], ['kits', '--kits'], ['sharedTier', '--shared-tier'],
|
|
94
|
+
['excludeRules', '--exclude-rules'], ['excludeSkills', '--exclude-skills'], ['kits', '--kits'], ['sharedTier', '--shared-tier'],
|
|
95
|
+
['contextWindow', '--context-window'], ['out', '--out'], ['root', '--root'],
|
|
95
96
|
['configDir', '--config-dir'],
|
|
96
97
|
];
|
|
97
98
|
|