v1.57.9.0 feat: source-clean gbrain render (dev-setup --out-dir + machine-wide gbrain-refresh)#1951
Merged
Merged
Conversation
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>
|
Merging to
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 |
E2E Evals: ❌ FAIL18/21 tests passed | $4.19 total cost | 12 parallel runners
12x ubicloud-standard-8 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite Failures
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 dir—bin/dev-setuprenders into.claude/gstack-rendered(gitignored) and repoints workspace skill symlinks;setuphonorsGSTACK_SKIP_GBRAIN_REGEN(passed inline) and uses a PID-unique detection tmp.bin/dev-teardownremoves 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:uservariant into~/.claude/skills/gstackfor all projects, guarded against symlinked / non-gstack targets, self-documenting about thereset --hardre-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-okcoverage.(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-okexit-code suite added totest/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-docsproduces zero drift — generated SKILL.md is byte-identical to main.Pre-Landing Review
Eng review CLEAR —
/plan-eng-reviewrun 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.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
bun testpasses (exit 0)bun run gen:skill-docs→ zero drift (output byte-identical to main)🤖 Generated with Claude Code
Documentation
CONTRIBUTING.md: added a "Brain-aware blocks in a dev workspace (gbrain installed)" subsection explaining thatbin/dev-setuprenders the brain-aware SKILL.md variant into.claude/gstack-rendered/(gitignored), repoints workspace symlinks, passesGSTACK_SKIP_GBRAIN_REGEN=1inline so tracked source stays canonical, and thatgstack-config gbrain-refreshrenders blocks into the global install for other projects. Updated the Conductor workspace-hooks table for thebin/dev-setup/bin/dev-teardownrows.