Repository navigation
fix(capy-install): read project pins with an isolated Bun (GST-1747) - #4115
Merged
Merged
Conversation
bin/gstack-capy-install runs bin/gstack-runtime-pins.ts from the caller's
project directory. Its three calls (read_pins, pins_accept, node_accept)
now pass --no-env-file --config="${GSTACK_BUN_CONFIG:-/dev/null}", so the
project's bunfig.toml and .env do not load into the installer.
test/bun-entry-isolation.test.ts also checks Bun runners held in a
variable: any variable at a command position launching a TypeScript file,
and any Bun-named variable running -e or a script.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…un (GST-1747) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changes
bin/gstack-capy-installreads the caller's Bun and Node pins by runningbin/gstack-runtime-pins.tswhile its working directory is still the caller's project. Its three calls (read_pins,pins_accept,node_accept) now pass--no-env-file --config="${GSTACK_BUN_CONFIG:-/dev/null}", with the standardGSTACK_BUN_CONFIGdefinition at the top of the script, as AGENTS.md requires for every Bun gstack starts. A project'sbunfig.tomland.envno longer load into the installer.test/bun-entry-isolation.test.tsonly recognized a literalbunor a$BUN-style variable, so it missed a runner held in"$RUNNER". The shell-caller detector now also flags:;,&&,|,$(,!, a case arm,then/do/else/exec) that launches a.ts/.tsx/.mtsfile;$REC_BUN,$_bun) running-e/-p, a script or a bin path.Across the tracked tree it flags exactly the three installer lines and nothing else; new negative cases (
cp "$SRC" x.ts,"$NODE" -e,"$RUNNER" --version,[ -f "$X/y.ts" ]) stay clean.Tests
gstack-capy-installcase: install and--checkfrom a project whosebunfig.tomlpreloads a file that logs each run; asserts the log stays empty while Bun and Node pins still resolve through the parser. Fails on main (9 preload runs across the read,--bunand--nodecalls), passes here.bun-entry-isolationrepo scan fails on main namingbin/gstack-capy-install:193,232,355; passes here.bun run typecheckclean;typecheck:testratchet: none new. Credential scan: 0 high, 0 advisory.No network, secrets, permissions, workflow or dependency changes.
What changed
The installer's three pins-parser calls now start Bun with
--no-env-fileand--config, like every other Bun gstack starts.Before/after as text
Why
AGENTS.md says every Bun that gstack starts ignores the working directory's
.envfiles andbunfig.toml. The Capy installer broke that rule in one place. It reads a project's Bun and Node pins by runningbin/gstack-runtime-pins.tsfrom inside that project, so the project's Bun configuration loaded into the installer. Now those calls are isolated, and the shell scan intest/bun-entry-isolation.test.tscatches a Bun held in a variable, so the same gap can't come back unnoticed.Blast radius
Only the three pins-parser calls in
bin/gstack-capy-installchange. Every runner the installer picks is a Bun at or above the 1.3.3 floor, and those versions all accept both flags. With no projectbunfig.toml, the isolated and plain calls print the same pins output (script ran: the adversarial reader compared them). The widened scan flags exactly these three lines across the tracked tree and nothing else (script ran: the repo-scan test passes at this head).Approvals
No approvals recorded for branch capy/gst-1747-installer-bun-isolation.
Summary
The Capy installer now reads a project's pins with an isolated Bun, so the project's
bunfig.tomland.envdon't load into it. The Bun-isolation shell scan now also recognizes Bun runners held in variables, and a new installer test covers install and--checkfrom a project with its ownbunfig.toml.docs/capy-install.mdnow says how the pins parser runs.Test Coverage
All new code paths have test coverage. Coverage: deterministic (the one changed runtime file has a changed test naming it).
Tests ran: focused 70
Pre-Landing Review
Pre-Landing Review: No issues found.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=3 dispatches=1 est_input_tokens=3211
Gate edits: none detected (6 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review plan: light depth, one pass. A batched specialist (testing, security, state machines, red team) found nothing. The native adversarial reader recommended shipping as-is and left two notes below the blocking floor. Outside voice: skipped by the review plan (code class, no numeric claims).
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
bin/gstack-capy-install:194read_pins discards the parser's stderr; a failed isolated parser call falls back to the jq reader without a message (pre-existing fallback; unreachable with runners at or above the 1.3.3 floor)test/bun-entry-isolation.test.ts:46the shell scanner does not flag a Bun-named variable runningx <pkg>; the only caller (gstack-browser-ensure) changes into gstack's root firstExploratory QA
Surface: functional (the installer's pins read). Smoke, three probes, all on current inputs, verdict pass:
bun test test/gstack-capy-install.test.ts -t "ignores the project's bunfig"): 1 pass, 0 fail.bunfig.tomldeclares a preload; the preload never runs and the pins print.Not run: the Windows
GSTACK_BUN_CONFIG=NULbranch (Linux machine; CI's windows-smoke covers it).Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Intent: run the installer's pins parser with an isolated Bun and make the isolation scan catch variable-held Bun runners.
Delivered: the three installer calls pass the isolation flags, the scan covers variable runners, one new installer test, a changelog fragment and one docs line.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Verification Results
No Step 8.1 obligations (no plan bound to this branch).
TODOS
No TODO items completed in this PR.
Documentation
Scope: committed and working-tree diff from aaff474 on capy/gst-1747-installer-bun-isolation (installer pins-parser Bun isolation, isolation test widened to variable-held runners, new installer regression test, changelog fragment), plus docs that mention the runtime pins parser or Bun isolation.
Result: updated
docs/capy-install.mdPreflight step 2 to say the pins parser runs with--no-env-file --config="${GSTACK_BUN_CONFIG:-/dev/null}", so a project'sbunfig.tomland.envnever load into the installer. AGENTS.md and the changelog fragment were already accurate.Debt: none found.
Test plan
bun test test/gstack-capy-install.test.ts test/bun-entry-isolation.test.ts: 70 pass, 0 fail🤖 Generated with Claude Code