Skip to content

v1.57.9.0 feat: source-clean gbrain render (dev-setup --out-dir + machine-wide gbrain-refresh)#1951

Merged
garrytan merged 11 commits into
mainfrom
garrytan/dont-change-gstack-source
Jun 10, 2026
Merged

v1.57.9.0 feat: source-clean gbrain render (dev-setup --out-dir + machine-wide gbrain-refresh)#1951
garrytan merged 11 commits into
mainfrom
garrytan/dont-change-gstack-source

Conversation

@garrytan

Copy link
Copy Markdown
Owner

Summary

Local gbrain availability no longer mutates tracked gstack source. Six feature commits:

Source-clean rendering

  • feat(gen-skill-docs): add --out-dir with surgical section-path rewrite — render the Claude SKILL.md + sections into a separate dir; rewrite only ~/.claude/skills/gstack/<skill>/sections/ refs to the out-dir (bin/docs refs stay on the install). Default output unchanged.
  • feat(dev-setup): render gbrain :user variant to an untracked workspace dirbin/dev-setup renders into .claude/gstack-rendered (gitignored) and repoints workspace skill symlinks; setup honors GSTACK_SKIP_GBRAIN_REGEN (passed inline) and uses a PID-unique detection tmp. bin/dev-teardown removes the render.
  • feat(dev-skill): refresh the untracked brain-aware render on template change — only when the render dir already exists.

Machine-wide + shared gate

  • feat(gstack-config): gbrain-refresh renders brain-aware blocks into the install — renders the :user variant into ~/.claude/skills/gstack for all projects, guarded against symlinked / non-gstack targets, self-documenting about the reset --hard re-run.
  • feat(gbrain-detect): add --is-ok live-detection exit-code gate — one shared "is gbrain usable" check (exit 0 iff ok), replacing per-caller JSON greps.

Tests — behavioral out-dir test + static tripwires + --is-ok coverage.

(The v1.57.x.0 (#NNNN) commits in the log are prior PRs already on main, picked up via merge — not part of this change.)

Test Coverage

All new code paths have test coverage.

  • test/gen-skill-docs-out-dir.test.ts — behavioral: worktree byte-unchanged, out-dir gains the inline block, section refs rewritten (bin refs preserved), section file gains the SAVE block.
  • test/dev-setup-render-isolation.test.ts + test/gbrain-refresh-install-render.test.ts — static tripwires (inline-not-export guard, gstack-clone guard, rewrite gating, teardown, gitignore).
  • --is-ok exit-code suite added to test/gbrain-detect-shape.test.ts (no-cli→nonzero, healthy→0, agrees-with-JSON no-skew).

Free bun test: green (exit 0). bun run gen:skill-docs produces zero drift — generated SKILL.md is byte-identical to main.

Pre-Landing Review

Eng review CLEAR — /plan-eng-review run on this exact diff (logged clean today): decisions E1B (render out of dev-setup), E2B (shared --is-ok), E3C (both test tiers), E4=B2 (untracked render), C (machine-wide build-now). 0 critical gaps.

Codex outside voice ran during the review (10 findings): 1 disproven by verification (SAVE-bearing sections are read), 5 folded in as hardening (inline-not-export guard, gstack-clone guard, live --is-ok, stronger behavioral test, PID-unique tmp), 2 accepted/benign, 2 resolved by choosing the untracked-render approach.

Design Review

No frontend files changed — design review skipped.

Eval Results

Free suite green. Gate E2E: every test that got CPU passed (27/27 across completed batches); 3 files (plan-devex-plan-mode, office-hours-auto-mode, ios) hit 300s wall-clock timeouts under concurrent multi-workspace machine load, then passed clean when re-run serially (10 pass / 1 skip / 0 fail). The timing-out skills have SKILL.md byte-identical to main, so the timeouts were environmental, not regressions. Full gate E2E will re-run on CI's dedicated runners.

Plan Completion

Plan delivered in full (6 tasks): T1 gen-skill-docs --out-dir, T2 --is-ok, T3 setup/dev-setup/teardown, T4 dev-skill, T5 tests, T6 gstack-config machine-wide render. 0 deferred.

TODOS

No TODO items completed in this PR.

Test plan

  • Free bun test passes (exit 0)
  • bun run gen:skill-docs → zero drift (output byte-identical to main)
  • Behavioral out-dir + static tripwire tests pass
  • Gate E2E timed-out files pass serially (10 pass / 1 skip / 0 fail)

🤖 Generated with Claude Code

Documentation

  • CONTRIBUTING.md: added a "Brain-aware blocks in a dev workspace (gbrain installed)" subsection explaining that bin/dev-setup renders the brain-aware SKILL.md variant into .claude/gstack-rendered/ (gitignored), repoints workspace symlinks, passes GSTACK_SKIP_GBRAIN_REGEN=1 inline so tracked source stays canonical, and that gstack-config gbrain-refresh renders blocks into the global install for other projects. Updated the Conductor workspace-hooks table for the bin/dev-setup / bin/dev-teardown rows.

garrytan and others added 11 commits June 8, 2026 06:20
Single source of truth for 'is gbrain usable'. Runs live detection (never
reads the possibly-stale gbrain-detection.json) and exits 0 iff status is ok,
so setup, bin/dev-setup, and gstack-config can gate brain-aware rendering on
one shared check instead of re-grepping the JSON.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
--out-dir <abs-dir> mirrors the Claude skill tree (SKILL.md + sections) into a
separate directory instead of writing in place, and rewrites the literal
section-base path (~/.claude/skills/gstack/<skill>/sections/) in generated
content to point at the out-dir. The rewrite is surgical: only /sections/ paths
move; bin/, browse/, docs/ references stay pointed at the global install.
Global extras (proactive-suggestions.json) are skipped in out-dir mode. Default
(no flag) behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e dir

Stops the dev/Conductor workspace from dirtying tracked SKILL.md source. setup
honors GSTACK_SKIP_GBRAIN_REGEN (passed inline by dev-setup, never exported) and
skips the in-place :user regen; detection is still persisted (PID-unique tmp so
concurrent workspaces can't clobber it). dev-setup instead renders the :user
variant into .claude/gstack-rendered (gitignored, per-workspace) and repoints
the workspace SKILL.md symlinks at it, so the workspace gets brain-aware blocks
while the worktree stays canonical. dev-teardown removes the render.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… change

After the default in-place regen (which keeps the worktree canonical and runs
validation), also re-render the :user variant into .claude/gstack-rendered when
it exists, so live template edits reflect at the workspace's runtime. Never
creates the render dir during plain template dev.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…he install

Extends gbrain-refresh to render the :user variant into the global install
(~/.claude/skills/gstack) so every project's Claude sessions get brain-aware
blocks, not just the gstack dev workspace. Guarded against mutating the wrong
directory: the target must exist, not be a symlink (a symlinked install points
at a dev worktree), and look like a real gstack clone (VERSION + package.json).
Idempotent and self-documenting. CLAUDE.md's deploy section now notes that
'git reset --hard' reverts the blocks and to re-run gbrain-refresh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fills the two automated-coverage gaps from the eng review: --is-ok exit-code
gate (no-cli -> nonzero, healthy -> 0, plus an agrees-with-JSON no-skew check
reusing the deterministic fake-gbrain harness) and a static tripwire that
dev-skill re-renders the :user variant into the workspace render dir only when
it already exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Jun 10, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

E2E Evals: ❌ FAIL

18/21 tests passed | $4.19 total cost | 12 parallel runners

Suite Result Status Cost
e2e-browse 4/4 $0.19
e2e-deploy 3/3 $0.76
e2e-design 3/3 $0.45
e2e-plan 6/9 $2.69
e2e-workflow 1/1 $0.08
llm-judge 1/1 $0.02

12x ubicloud-standard-8 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite

Failures

  • ❌ /office-hours-spec-review: error_max_turns
  • ❌ /office-hours-spec-review: error_max_turns
  • ❌ /office-hours-spec-review: error_max_turns

@garrytan garrytan merged commit 8241949 into main Jun 10, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant