Skip to content

v1.91.271.0 fix(evals): run train-bisect steps under bash; lint sh-run workflow steps for bash-isms - #3509

Merged
capy-ai[bot] merged 3 commits into
mainfrom
fix/train-bisect-shell
Oct 27, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
fix/train-bisect-shell

Conversation

@garrytan

@garrytan garrytan commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3509,
  "head": "87056df4f6c68225025849db3ca18d39b1098324",
  "version": "1.91.267.0",
  "base": "main",
  "gate": {
    "remote-gate (Ubicloud, tree 8704dec0f975)": {
      "pass": 9314,
      "fail": 0,
      "skip": 0
    },
    "ci-free-tests (run 40459195966)": {
      "pass": 21,
      "fail": 0,
      "skip": 0
    },
    "ci-windows-free-tests (run 40459195841)": {
      "pass": 6,
      "fail": 0,
      "skip": 0
    },
    "workflow-tests-focused": {
      "pass": 121,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "pregate": "requires-remote cleared @8704dec0f975 (1 checks, current for 53c40b0a3e50)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40459195966",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40459195841",
    "pregate.json/remote_gate: remote-gate tree=8704dec0f975 tests=9314"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 2,
    "scope": "frozen"
  },
  "carry": {
    "from": "53c40b0a3e5029af2982034e6269adf1795b46d0",
    "reason": "base merge + release metadata",
    "product_patch_id": "dbe4d015d1465d85ae483e3ced7636af78941695",
    "changed_paths": [
      "metadata:CHANGELOG.md",
      "product:NOTICE.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:autoplan/DRIVER.md",
      "product:autoplan/DRIVER.md.tmpl",
      "product:autoplan/sections/eng-phase.md",
      "product:autoplan/sections/eng-phase.md.tmpl",
      "product:bin/gstack-approvals",
      "product:bin/gstack-autoplan",
      "product:bin/gstack-coauthor-trailers",
      "product:bin/gstack-decision-trail",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-review-scope",
      "product:bin/gstack-ship-receipt",
      "product:bin/gstack-worktree-audit",
      "product:capy/skill/gstack/captain.md",
      "product:docs/CONTRIBUTOR_REFERENCE.md",
      "product:docs/capy-install.md",
      "product:docs/recommended-harness.md",
      "product:docs/review-policy.md",
      "product:docs/ship-policy.md",
      "product:docs/standalone-binaries.md",
      "product:docs/troubleshooting.md",
      "product:docs/unattended.md",
      "product:landing-report/SKILL.md",
      "product:landing-report/SKILL.md.tmpl",
      "product:lib/approval-record.ts",
      "product:lib/autoplan-gate-cost.ts",
      "product:lib/captain-brief.ts",
      "product:lib/owner-brief.ts",
      "product:lib/result-codes-release.ts",
      "product:lib/review-scope.ts",
      "product:lib/ship-policy.ts",
      "product:lib/ship-receipt-docs.ts",
      "product:lib/ship-receipt-prose.ts",
      "product:lib/ship-receipt.ts",
      "product:licenses/MIT-pstack.txt",
      "metadata:package.json",
      "product:review/checklist.md",
      "product:scripts/resolvers/review-army.ts",
      "product:ship/SKILL.md",
      "product:ship/SKILL.md.tmpl",
      "product:ship/sections/changelog.md",
      "product:ship/sections/changelog.md.tmpl",
      "product:ship/sections/documentation.md",
      "product:ship/sections/documentation.md.tmpl",
      "product:ship/sections/pr-body.md",
      "product:ship/sections/pr-body.md.tmpl",
      "product:ship/sections/review-army.md"
    ],
    "merge_commits": 1,
    "range_diff": "1:  60fb50c = 1:  60fb50c fix(evals): run train-bisect steps under bash; lint sh-run workflow steps for bash-isms (GSTA-125)\n2:  53c40b0 = 2:  53c40b0 fix: pre-landing review fixes",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ]
  }
}

What changed

The new workflow-shell lint is red on main (train-bisect's prefix step runs under sh with ${PREFIX_SHA:0:12}) and green with defaults.run.shell: bash

The new test/workflow-shell-lint.test.ts is red on main (d9b0d60): the train-bisect job's "Verify the prefix checkout" step runs under sh and uses ${PREFIX_SHA:0:12}. With defaults.run.shell: bash on the job it is green.

Before/after as text: The new workflow-shell lint is red on main (train-bisect's prefix step runs under sh with ${PREFIX_SHA:0:12}) and green with defaults.run.shell: bash
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+this branch (after): bun test test/workflow-shell-lint.test.ts
-main d9b0d60 (before): bun test test/workflow-shell-lint.test.ts
 
 bun test v1.4.4 (38afee6c8)
 
 test/workflow-shell-lint.test.ts:
+(pass) workflow run-step shells > the detector names bash-only constructs and accepts POSIX sh [0.92ms]
+(pass) workflow run-step shells > the effective shell follows step, job defaults, workflow defaults, then the runner default [0.97ms]
+(pass) workflow run-step shells > no run step whose effective shell is sh uses a bash-only construct [7.66ms]
+(pass) workflow run-step shells > evals.yml train-bisect runs its steps under bash (the first bisect run died at ${PREFIX_SHA:0:12} under sh) [5.72ms]
-(pass) workflow run-step shells > the detector names bash-only constructs and accepts POSIX sh [0.77ms]
-(pass) workflow run-step shells > the effective shell follows step, job defaults, workflow defaults, then the runner default [0.18ms]
-166 |     const sh = steps.filter((step) => step.shell === 'sh');
-167 |     // Container jobs without a shell default are where this bites; a parse that
-168 |     // found none would pass vacuously.
-169 |     expect(sh.length, 'expected at least one sh-defaulted container step to lint').toBeGreaterThan(0);
-170 |     const problems = sh.flatMap((step) => bashisms(step.run).map((name) => `${step.file} ${step.job} / "${step.step}": ${name}`));
-171 |     expect(problems, 'give the job defaults.run.shell: bash (or the step shell: bash)').toEqual([]);
-                                                                                              ^
-error: give the job defaults.run.shell: bash (or the step shell: bash)
 
+ 4 pass
+ 0 fail
+ 43 expect() calls
+Ran 4 tests across 1 file. [32.00ms]
-- []
-+ [
-+   ".github/workflows/evals.yml train-bisect / "Verify the prefix checkout": substring expansion ${x:offset:length}",
-+ ]
-
-- Expected  - 1
-+ Received  + 3
-
-(fail) workflow run-step shells > no run step whose effective shell is sh uses a bash-only construct [7.58ms]
-172 |   });
-173 | 
-174 |   test('evals.yml train-bisect runs its steps under bash (the first bisect run died at ${PREFIX_SHA:0:12} under sh)', () => {
-175 |     const steps = runSteps().filter((step) => step.file === path.join('.github', 'workflows', 'evals.yml') && step.job === 'train-bisect');
-176 |     expect(steps.map((step) => step.step)).toContain('Verify the prefix checkout');
-177 |     for (const step of steps) expect(step.shell, step.step).toBe('bash');
-                                                                  ^
-error: Verify the prefix checkout
-
-Expected: "bash"
-Received: "sh"
-
-(fail) workflow run-step shells > evals.yml train-bisect runs its steps under bash (the first bisect run died at ${PREFIX_SHA:0:12} under sh) [5.12ms]
-
- 2 pass
- 2 fail
- 40 expect() calls
-Ran 4 tests across 1 file. [30.00ms]
 

Why

Every train-bisect job in evals.yml has died at its first run step. A container job's run steps default to sh -e {0} (the runner log shows shell: sh -e {0} for that step and /usr/bin/bash -e {0} for the bare-runner route job in the same run), and the CI image's sh is dash, so ${PREFIX_SHA:0:12} is a "Bad substitution" (exit 2) before any case runs. Run 40456150409 (gate.bisect-b3d085bb87ee-d9b0d60082cc, dispatched from GSTA-96's red train) failed all three prefixes at that step; the checkout itself was right (HEAD = PREFIX_SHA). The bisect is the train's way of attributing a red gate to one PR, so without it a red train can only rebuild or drop PRs by hand. GSTA-125 for GStack Minder.

Approvals

No approvals recorded for branch fix/train-bisect-shell. Standing approvals cited: CREW rule 5 (gates and bisects pre-approved; this PR dispatched nothing paid) and rule 22 (/ship before READY, this run).

Summary

  • .github/workflows/evals.yml, train-bisect: defaults.run.shell: bash on the job, with a comment naming the failed run. Every run step of the job now executes under bash --noprofile --norc -e -o pipefail {0}. The one step that pipes (the Codex login) already ran under its own shell: bash with set -euo pipefail, which is left in place as in the sibling eval-slices and eval-rerun jobs; the other steps run single commands.
  • test/workflow-shell-lint.test.ts (new, free, offline): parses every workflow under .github/workflows/ and every composite action under .github/actions/, computes each run step's effective shell (step shell → job defaults.run.shell → workflow defaults.run.shell → GitHub's default: sh in a container job, pwsh on Windows, bash otherwise), and fails on a bash-only construct in a step whose effective shell is sh: ${x:0:n} (named, positional and @/* parameters), ${x//…}/${x^^}/${x,,}/${x@…}, ${!x}, [[, arrays and ${x[@]}, declare -a/mapfile/readarray, set -o pipefail, PIPESTATUS, <<<, <(…), $'…', source, function. Comment lines are ignored. Positive controls for each construct, negative controls for the POSIX forms (${x:-d}, ${1:-x}, ${x#p}, $(…), $((…))). A fourth test pins train-bisect to bash by name. 317 run steps scanned, 23 sh-defaulted (the four container workflows), 8 pwsh.
  • CHANGELOG [Unreleased] entry; the restamp at merge heads it.

Other sh-run steps with bash-isms

None. The lint's sh set is the 23 run steps of the container jobs in evals.yml (eval-slices, eval-rerun, train-bisect), evals-periodic.yml (schema-canary, eval-slices, gate-census), evals-marathon.yml (eval-slices) and eval-sweep.yml (sweep); every one but the train-bisect prefix step is POSIX (bun run build, echo … >> "$GITHUB_ENV", mkdir/cp, the slice runners). The composite actions all declare shell: bash. Windows jobs default to pwsh and are outside this lint.

History

  • The train-bisect job shipped in 1.91.162.0 (2026-10-19, GSTA-49 T1b: "bisects run one executor per prefix"). The repository's git history was flattened on 2026-10-25 (d73b547 is the root commit), so git log -S 'Verify the prefix checkout' only reaches that commit; the CHANGELOG dates it.
  • No bisect has ever passed in CI. gh run list -w evals.yml --limit 1000 filtered on gate.bisect returns exactly two runs, both 2026-10-27: run 40456150409 (failure: train-bisect (1)(2)(3) each failed at "Verify the prefix checkout") and run 40456458218 (cancelled while its three prefixes were still setting up). The job had never executed before that day.

Test plan

  • bun test test/workflow-shell-lint.test.ts: 4 pass (2 fail on main, as pictured)
  • bun run typecheck and bun run typecheck:test: clean, no new diagnostics
  • bun test on the 10 workflow tests: 121 pass
  • docker run … rhysd/actionlint:1.7.11: clean
  • gstack-pregate --remote (Ubicloud): 9314 tests, 0 failed, $0.05
  • CI at 53c40b0: Free Tests, Windows Free Tests, Workflow Lint, Quality gate, Version Gate, Skill Docs Freshness, E2E Evals (pr-summary) green

🤖 Generated with Claude Code

Gate integrity

No threshold, trial count, case kind, budget or reservation changed; scripts/lib/shard-engine.ts and the bisect's spend path are untouched.

Open in Capy

Test Coverage

All new code paths have test coverage: the YAML change is pinned by the fourth test (train-bisect steps resolve to bash), and the detector and the effective-shell resolver each have a positive and a negative control per construct and per precedence level. Red on main (2 fail), green here (4 pass).

  • Tests ran: remote-gate (Ubicloud, tree 8704dec0f975) 9314, 0 failed, $0.05 (an earlier run at the pre-review tree f14fd5c3f178 was also 9314/0).
  • Tests ran: ci-free-tests run 40459195966 (21 shards + macOS named regressions) green; ci-windows-free-tests run 40459195841 (6 shards) green; both at 53c40b0.
  • Tests ran: workflow-tests-focused 121 (test/workflow-shell-lint.test.ts and 9 sibling workflow tests).
  • Tests ran: test-quick-local count unavailable — the local bun run test:quick lane on this 2-core Capy machine ran 10604 tests with 15 environment failures (Playwright Chromium not installed, CSO native core not built, .agents/skills not generated), none touching this diff; after playwright install chromium the 16 browser files reran 234 pass / 0 fail. The remote gate and CI are the lanes of record.

Pre-Landing Review

Pass 1 (full diff, 199 lines): 5 specialists dispatched (testing, maintainability, security, performance, simplification), all NO FINDINGS; core checklist found 2 INFORMATIONAL items, both auto-fixed in 53c40b0 (the CHANGELOG said no train-bisect step pipes; the substring-expansion pattern missed ${@:2} and ${1:0:2}, shown by QA probe P5). Pass 2 (range 60fb50c..53c40b0, 10 lines): NO FINDINGS. Red Team not activated (under 200 lines, no CRITICAL).
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=0 fixed=2 scope=frozen
Gate edits: none detected (2 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Adversarial review: native Claude pass (claude-sonnet-5-5 subagent) completed with one INVESTIGATE item (below, noted) and "Recommendation: Ship as-is"; outside voice GPT-6.1 (openai/gpt-6.1-sol subagent) completed with NO FINDINGS and "Recommendation: Ship as-is". Codex CLI is not installed on this machine, so the GPT subagent is the outside coverage; both reviewed the test file in summary mode.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL [ADVISORY] test/workflow-shell-lint.test.ts:28 Detector does not list some rarer dash failures: == inside [ ], &>, |&, brace expansion {a,b}, echo -e (the native adversarial pass; ${x/a/b}, ${x^^}, ${x,,} it also named are already caught)

Exploratory QA

Surface: the CI step script and the static lint (no server, API or browser). Probes, all on this machine (~/.capy/work/gsta125/qa):

  • P4a the real "Verify the prefix checkout" script under dash -e (the container default): exit 2, Bad substitution, $GITHUB_OUTPUT left empty. P4b the same script under bash --noprofile --norc -e -o pipefail: exit 0, short=60fb50c19c66 written. Reproduces the CI failure and the fix.
  • P2a a scratch copy of .github plus the test: 4 pass. P2b defaults.run.shell removed from train-bisect: 2 fail naming train-bisect / "Verify the prefix checkout": substring expansion. P2c a [[ injected into eval-slices' POSIX seed step: 1 fail naming that step. P2d a POSIX ${RECEIPTS:-…} injected into the same step: 4 pass (no false positive).
  • P5 ${@:2} and ${1:0:2} undetected before the pass-1 fix, detected after; ${1:-x} stays clean.
  • actionlint 1.7.11 (the Workflow Lint image) on the whole tree: clean.
    No fixes beyond the two review items; nothing blocked or not run.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped. bun run eval:select reports evals.yml as a full-gate input, so the train gate (not this PR) carries the paid coverage; the bisect job only runs under a mode == 'bisect' route, so the first real proof is the next red train's bisect.

Greptile Review

No Greptile comments.

Scope Drift

Scope Check: CLEAN (the Captain's scope: evals.yml train-bisect, one test, its CHANGELOG entry; nothing else touched).

Plan Completion

The task's four "done" items: (1) defaults.run.shell: bash on train-bisect, other jobs and workflows checked, none needed a fix; (2) the free lint test; (3) typecheck, the new test, the sibling workflow tests and actionlint pass, history and bisect-run census above; (4) /ship run, this body carries its receipt, READY follows. No deferrals.

Verification Results

Obligations: typecheck PASS, typecheck:test PASS (819 known, none new), new test PASS, sibling workflow tests PASS (121), actionlint PASS, remote gate PASS (9314/0), CI PASS at 53c40b0, pregate verify ok (remote gate receipt plus macOS and Windows obligations cleared with the CI runs). Local test:quick lane: environment failures as described, not counted as PASS.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. Documentation audit made no edits and found no blockers.

Scope: base d9b0d60 to head 53c40b0 on fix/train-bisect-shell, 3 committed files (.github/workflows/evals.yml, CHANGELOG.md, test/workflow-shell-lint.test.ts), no staged, unstaged or untracked content. I inventoried 127 candidate docs (including docs/ and nested design/eval docs) and scanned them for references to the train-bisect job, workflow shell defaults and workflow lint. Only CONTRIBUTING.md and docs/PROJECT_STRUCTURE.md were read for the passages that mention workflow lint or the workflows directory. Banned-terms check: none.

Documentation health:

  • CHANGELOG.md: reviewed in the diff, left unedited (ship-owned, protected).
  • CONTRIBUTING.md: current (Workflow Lint fork-PR check still accurate).
  • docs/PROJECT_STRUCTURE.md: current.
  • docs/ship-policy.md, docs/captain.md, docs/troubleshooting.md, docs/TESTING_INTERNALS.md: bisect described at the ship-queue level; consistent with the fix.
  • All other candidate docs: no contradiction with the diff.

Coverage debt: no new public surface. The new lint test has no explanation or how-to coverage (optional follow-up in TESTING_INTERNALS). No diagram drift.

…teps for bash-isms (GSTA-125)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits October 27, 2026 06:02
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
MERGE_CONDITION: sha=53c40b0a3e5029af2982034e6269adf1795b46d0
next: NEW_VERSION=1.91.271.0; commit and push only the stamp diff above (FILES), with no edit of your own: the train's verify accepts the CHANGELOG only as the base's plus this PR's entry re-headed; merge with the expected head 53c40b0 and recompute on a stale queue.
GSTACK_RESULT: skill=restamp status=complete run=/workspace/gstack/.gstack/tmp/restamp-journal.json

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(evals): run train-bisect steps under bash; lint sh-run workflow steps for bash-isms v1.91.271.0 fix(evals): run train-bisect steps under bash; lint sh-run workflow steps for bash-isms Oct 27, 2026
@capy-ai
capy-ai Bot merged commit 584e9c1 into main Oct 27, 2026
62 of 63 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