mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-17 05:41:50 +01:00
v1.91.50.0 fix(install): skills only for the agents you installed, every runtime-root file their skills read (#1694, #1077)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
4faf399538
commit
9b39cc6906
11 files changed
+176
-11
No files matched your search
+40
-6
@@ -75,7 +75,9 @@ Inventory of every setup side effect, by phase (line numbers are approximate):
|
||||
| Phase | Writes | Scope |
|
||||
|---|---|---|
|
||||
| Build | `browse/dist`, `design/dist`, `make-pdf/dist`, `bin/gstack-cso-*` in the source checkout | source |
|
||||
| Generation | `.agents/`, `.kiro/`, `.factory/`, `.opencode/`, `.cursor/` renders in the source checkout; `gstack-patch-names` rewrites Claude `name:` fields in place | source |
|
||||
| Hosts record | `.gstack-installed-hosts` in the source checkout: every host setup installed from it, additive (#1694) | source |
|
||||
| Generation | renders for the recorded hosts only (`.agents/`, `.kiro/`, `.factory/`, `.opencode/`, `.cursor/`, `.copilot/`) in the source checkout; `gstack-patch-names` rewrites Claude `name:` fields in place | source |
|
||||
| Render prune | renders of hosts the record does not name: links into the checkout removed, generated files moved to `$GSTACK_STATE_ROOT/backups/host-renders/<ts>-<id>/`, other files kept | source / state root |
|
||||
| Chromium | Playwright cache (`~/.cache/ms-playwright`), lock under the state root | machine |
|
||||
| Config | `skill_prefix`, `timeline_stop_hook`, team-mode keys in `$GSTACK_STATE_ROOT/config.yaml` | state root |
|
||||
| Claude arm | `~/.claude/skills/gstack` link, one dir per skill with a `SKILL.md` link, alias copies | selected host |
|
||||
@@ -114,6 +116,29 @@ shell metacharacters) is named through a `<host>-<id>.root` alias symlink:
|
||||
worktree-isolated Claude Code refuses a command path containing a space in any
|
||||
quoting.
|
||||
|
||||
### Host renders in an install (#1694)
|
||||
|
||||
A checkout renders skills only for the hosts installed from it.
|
||||
`bin/gstack-host-renders.sh` owns the record, `.gstack-installed-hosts` in the
|
||||
checkout: setup adds each host it installs and never removes one, so
|
||||
`./setup --host codex` keeps a `--host factory` render. The first run after an
|
||||
upgrade seeds it from the hosts the checkout already serves (registry rows,
|
||||
install roots that resolve to it, host skills that link into its renders, and
|
||||
legacy copies with no runtime root). `scripts/build.sh` renders claude plus
|
||||
the recorded hosts and prints which hosts and why; a checkout with no record (a
|
||||
development checkout) or `GSTACK_RENDER_HOSTS=all` renders every host.
|
||||
|
||||
Every setup run then prunes the renders of unrecorded hosts with
|
||||
`bin/gstack-relink`'s proof rules: a symlink into the checkout (strong proof)
|
||||
is removed; a file proven generated (weak proof: the gen-skill-docs banner, the
|
||||
generator's exact `openai.yaml` shape, byte identity with the checkout) is
|
||||
moved to `$GSTACK_STATE_ROOT/backups/host-renders/<ts>-<id>/`; every other file
|
||||
stays where it is, and only directories left empty are removed. The backup's
|
||||
`prune.log` lists every path. A gstack-upgrade migration runs
|
||||
the same prune for an install upgraded without a setup run. Instruction-only
|
||||
hosts (Hermes, OpenClaw, GBrain) are never installed by setup, so a user who
|
||||
renders one by hand inside an install adds its name to the record first.
|
||||
|
||||
## Host tiers and capabilities
|
||||
|
||||
Every host declares `tier` and `capabilities` (`scripts/host-config.ts`).
|
||||
@@ -257,8 +282,14 @@ That expands to the full `HostConfig` with these defaults:
|
||||
(`~/.claude/skills/gstack` → `~/{globalRoot}`, `.claude/skills/gstack` →
|
||||
`{localSkillRoot}`, `.claude/skills` → `{hostSubdir}/skills`)
|
||||
- `suppressedResolvers`: the GBrain pair (`GBRAIN_CONTEXT_LOAD`, `GBRAIN_SAVE_RESULTS`)
|
||||
- `runtimeRoot`: the shared asset list (`bin`, `browse/dist`, `browse/bin`,
|
||||
`gstack-upgrade`, `ETHOS.md` + review checklist files)
|
||||
- `runtimeRoot`: `sharedRuntimeRoot()`, every file the skills run or read as
|
||||
`$GSTACK_ROOT/<path>` (`bin`, `lib`, the compiled tools, `freeze/bin`, the
|
||||
review checklists and specialists, the jargon list and question registry,
|
||||
the AskUserQuestion docs, the DX Hall of Fame, `VERSION`, and the
|
||||
office-hours and plan-design-review `SKILL.md` copies). It mirrors setup's
|
||||
`_link_runtime_dists` and `_copy_runtime_skill_refs`;
|
||||
`test/runtime-root-assets.test.ts` checks each staged root on disk. A host
|
||||
with extra assets passes them: `sharedRuntimeRoot(['qa/templates'])`.
|
||||
- `install`: `{ linkingStrategy: 'symlink-generated' }`
|
||||
- `learningsMode: 'basic'`
|
||||
|
||||
@@ -280,7 +311,7 @@ Review Army), `GBRAIN_RESOLVERS` (the default
|
||||
suppression pair), and `EXEC_STYLE_TOOL_REWRITES` (the OpenClaw-style
|
||||
lowercase-tool rewrites shared by openclaw and gbrain).
|
||||
|
||||
Good examples: `hosts/opencode.ts` (path + runtimeRoot overrides),
|
||||
Good examples: `hosts/opencode.ts` (path + extra runtime assets),
|
||||
`hosts/factory.ts` (tool rewrites and conditional fields), `hosts/hermes.ts`
|
||||
(AGENTS.md host with custom tool rewrites and resolver composition).
|
||||
|
||||
@@ -300,9 +331,12 @@ export const ALL_HOST_CONFIGS: HostConfig[] = [
|
||||
export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, myhost };
|
||||
```
|
||||
|
||||
### 3. Add to .gitignore
|
||||
### 3. Add to .gitignore and the render table
|
||||
|
||||
Add `.myhost/` to `.gitignore` (generated skill docs are gitignored).
|
||||
Add `.myhost/` to `.gitignore` (generated skill docs are gitignored), and add
|
||||
`myhost:.myhost` to `GSTACK_HOST_RENDER_DIRS` in `bin/gstack-host-renders.sh`
|
||||
so an install renders it only when it is installed and prunes it otherwise
|
||||
(#1694; `test/host-renders.test.ts` checks the table against `hosts/*.ts`).
|
||||
|
||||
### 4. Generate and verify
|
||||
|
||||
|
||||
@@ -647,6 +647,36 @@ whose hooks parse. This is a gstack bug: report the printed `<file>:<line>`.
|
||||
cannot be checked before the pull; setup then refuses the broken hook (see the
|
||||
entry above).
|
||||
|
||||
<a id="host-renders-pruned"></a>
|
||||
### `pruned <dir> (<host> is not installed from this checkout): ...` / `kept <path>: not proven generated (...)` / `host-render backup: <dir> (...)`
|
||||
|
||||
**Meaning.** A gstack checkout keeps skills only for the agents installed from
|
||||
it, listed in `.gstack-installed-hosts` in the checkout (#1694). Older installs
|
||||
rendered every agent's copy, so a global Claude install carried 632 `SKILL.md`
|
||||
files (34.7 MB) that Claude Code and Cursor-agent scan. setup removed the copy
|
||||
for an agent that is not installed from this checkout. Generated files were
|
||||
moved to the backup directory it printed; links into the checkout were removed;
|
||||
files it could not prove gstack generated (`kept ...`) were left in place.
|
||||
`prune.log` in the backup lists every path. The same prune runs once from the
|
||||
upgrade migration. Agents in the record are never pruned.
|
||||
|
||||
**Fix.** Nothing, if you don't use that agent. To get an agent back, install
|
||||
it from this checkout, which records it and renders its skills:
|
||||
|
||||
```bash
|
||||
./setup --host <name>
|
||||
```
|
||||
|
||||
For an instruction-only agent you render by hand (Hermes, OpenClaw, GBrain),
|
||||
add its name to `.gstack-installed-hosts` first, then run
|
||||
`bun run gen:skill-docs --host <name>`. To restore one file, `mv` it back from
|
||||
the backup. A `kept` file is yours: move or delete it when you no longer need it.
|
||||
The backup sits in gstack's state root, which no agent scans; delete it once
|
||||
you are sure you don't need it (about 36 MB for a pre-1.91.50 Claude install).
|
||||
|
||||
**Expected result.** The next `./setup` prints no `pruned` line, and
|
||||
`./setup --status` lists the agents you use.
|
||||
|
||||
<a id="cso-windows-msvc-compile"></a>
|
||||
### `CSO unavailable: its native helper was not built (windows-msvc-compile)`
|
||||
|
||||
|
||||
Reference in new issue
Block a user