Skip to content

Windows: a python3 that won't run no longer deletes skills on update, and long test commands fail clearly - #4793

Merged
capy-ai[bot] merged 4 commits into
mainfrom
windows-python3-stub-and-long-test-commands
Nov 24, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
windows-python3-stub-and-long-test-commands

Conversation

@garrytan

@garrytan garrytan commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

On Windows, an update no longer deletes your brain-aware skills when python3 is the Microsoft Store alias, and a pre-ship test command too long for Git Bash is split to fit or refused clearly instead of running cut off.
Why: keeps install and upgrade working on Windows, where gstack promises minimal support (#4752 by @Barack-zero-to-one, #4773 by @targetpark).
Nothing to do.

What changed

gstack-config gbrain-refresh runs after every team-mode update. It used the first python3 on PATH without checking that it runs, and the Microsoft Store alias exits 49, so a healthy gbrain read as "not detected" and the brain-aware render was removed. It now uses the first of python3 and python that actually runs, then a plain-text read that no longer stops the script when a field is missing. When gbrain's state cannot be read at all, because the detector failed or its file is unreadable, an existing render is left exactly as it is, including a customized one (pinned overlay, Plan Mode off or a loadout).

Git Bash keeps only the first 8,186 characters of a bash -c argument started from a Windows program. The test-file budget now counts the set -o pipefail; prefix on every platform and uses that limit on Windows, so long file lists are split into commands that fit. Any bash -c command still over the limit on Windows is refused before it starts, with "argument list too long for Git Bash". A runner that takes no file list (cargo test -p) is never split, and when one command of a split list runs no tests the whole run fails as zero-run, as it would alone.

Why

A python3 that won't run turned every Windows update into a silent loss of the brain-aware skills. A test command cut off mid-filename failed with an empty log and no hint of the cause. Both break core paths that Windows support covers.

Blast radius

Only gstack-config gbrain-refresh and the local test runner's command building change. Where python3 works, the refresh behaves as before. On Linux and macOS the test-file budget shrinks by 17 bytes for the prefix. The 8,186 figure is the reporter's measurement on Git for Windows 2.53, consistent with the Cygwin/MSYS runtime's argument buffer; we have no Windows machine to confirm it. No CI, install script, dependency, network or secrets changes.

Documentation

Scope: The audit covered the committed diff against main at tree 623f5e10165135019ed9d31f836c821f40edf9bc. It checked the changed code (bin/gstack-config, lib/pregate/checks/lanes.ts, lib/pregate/supervise.ts, lib/script-invocation.ts) and the changelog.d fragment against docs/pregate.md, docs/troubleshooting.md, docs/loadouts.md, docs/gbrain-write-surfaces.md and CONTRIBUTING.md. The working tree had no staged, unstaged or new files outside this change.

Result: Docs updated. There are three factual edits, split between docs/pregate.md and docs/troubleshooting.md. The old docs said a Windows test-command chunk could hold about 24 KB of file names. The code now keeps each chunk under the 8,186 characters Git Bash keeps (#4773), and it refuses a longer bash -c command with an "argument list too long for Git Bash" message. The docs now say both things. The gbrain-refresh docs (docs/gbrain-write-surfaces.md, docs/loadouts.md, CONTRIBUTING.md) still describe the change correctly, so they were left alone. Nothing needed regenerating, because the edited files are authored docs, not templates. CHANGELOG, VERSION, the changelog.d fragment and generated output were not touched.

Debt: None found. Nothing is blocked.

Tests

Each fix has a test that fails on the code before it and passes after:

  • test/gstack-config-gbrain-refresh.test.ts: the Store alias as python3 only and as both names; a healthy gbrain keeps its render with no Python that runs; a failed or unreadable detection never removes or re-renders an existing render, customized or not.
  • test/pregate-lanes-arg-limit.test.ts: the whole Windows command, prefix included, fits 8,186 characters; a runner with no file list is never split; a zero-test chunk fails the run even beside a chunk with an unreadable summary.
  • test/script-invocation.test.ts: 8,186 characters start, 8,187 are refused with an argument-limit error, Linux unchanged.

CI: Free Tests run 45442863332 green at dda1df6 (1,780 files), Windows Smoke run 45442864704 green.

Issues

Fixes #4773
Refs #4752

Review notes
  • A failed detector still overwrites gbrain-detection.json with a made-up no-cli record, so a later ./setup may render without brain blocks until a refresh succeeds. This already happens on main, nothing is deleted, and it ships as a disclosed note (follow-up GST-3684).
  • ./setup has its own render decision and does not share the refresh's keep-on-unreadable rule.
  • Whether a split run counts as zero-run depends on where the split falls when some files register no tests.
Agent notes
Agent notes

Rebuilt on main from #4752's diff, read as text only; the outside branch was never checked out or run. Credit: Co-authored-by Barack-zero-to-one on the first commit. Owner thread GSTA-842 (GST-3674).

Approvals

Approved: yes (record r-0febbb6310cb). The full approval record stays private.
Plan: exempt: bug fix, no plan needed (R4)
Plan check: exempt bug fix

REVIEW_LOOP: passes=3 blocking_found=3 deferred=0 noted=2 fixed=2 scope=frozen open=1 unbound=8 ledgers_read=4 dispatches=3
Gate edits: none detected (8 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Ruled note: bin/gstack-config:1233:outside-voice at f923012 ruled by GStack Minder (relayed from GSTA-36:2026-11-24T17) at 2026-11-24T16:50:40.177Z: pre-existing on main, a failed detector overwrites gbrain-detection.json; below the floor, follow-up filed (approval a-ae392287b3e8)

{
  "schema_version": 1,
  "pr": 4793,
  "head": "dda1df651f7c115ebcdbd70d8c45b3ff921da7c9",
  "version": "1.103.2.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1780,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 45442863332,
      "attempt": 1,
      "tree": "35b93637b233432044339c938b59bea317238f0d"
    }
  ],
  "calls": 46,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/gsta842/ship",
  "head_tree": "35b93637b233432044339c938b59bea317238f0d",
  "product_patch_id": "0d9fc8ec28bc764fd3e399b4f56febae730d3a20",
  "gstack_version": "1.103.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 90,
    "rules": "33831f8248a814fd",
    "base": "df760be4d7fb2ceb58a429e49635ea711408787b",
    "registry": "df760be4d7fb2ceb58a429e49635ea711408787b",
    "gate_scan": {
      "tagged": 0,
      "head": "dda1df651f7c115ebcdbd70d8c45b3ff921da7c9"
    },
    "reasons": [
      "gate-class",
      "runtime=90"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @35b93637b233 (8 checks, current for dda1df651f7c)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/45442863332/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45442863332/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45442864704/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=35b93637b233 tests=39444 skipped=75 runs=45442863332/1 profiles=ci-reuse/free-tests heads=dda1df651f7c base_moved=f34b7aac222c verified=2026-11-24T18:06:35.752Z"
  ],
  "issues": {
    "fixes": [
      4773
    ],
    "refs": [
      4752
    ]
  },
  "docs": {
    "status": "updated",
    "scope": "README.md, docs/, bench/README.md against the committed diff"
  },
  "review_loop": {
    "passes": 3,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 2,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 3,
    "ledgers_read": 4,
    "unbound": 8,
    "dispatches": {
      "specialist": 3
    }
  },
  "ruled_notes": [
    {
      "finding": "bin/gstack-config:1233:outside-voice",
      "head": "f923012b9cac229c0d1eb1bff3d15da29db32e6d",
      "by": "GStack Minder",
      "reason": "pre-existing on main, a failed detector overwrites gbrain-detection.json; below the floor, follow-up filed",
      "at": "2026-11-24T16:50:40.177Z",
      "approval": "a-ae392287b3e8",
      "relayed": "GSTA-36:2026-11-24T17"
    }
  ],
  "gate_dispositions": []
}

…pdate, and long test commands fail clearly

gstack-config gbrain-refresh now uses the first of python3 and python that
actually runs, then a plain-text read, so the Microsoft Store python3 alias
(exit 49) no longer turns a healthy gbrain into "not detected". When the
detector fails or its file cannot be read, the existing Claude render is
kept instead of removed (#4752).

On Windows, a bash -c command longer than the 8,186 characters Git Bash
keeps is refused with an "argument list too long" error instead of running
cut off, and the lane file-list budget counts the "set -o pipefail; "
prefix and fits that limit (#4773).

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

trunk-io Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 24, 2026 16:30
… that ran nothing fails the run

gbrain-refresh now leaves an existing Claude render untouched whenever
gbrain's state cannot be read, including with a pinned overlay, Plan Mode
off or a loadout, where it used to re-render without brain blocks.

When a long test-file list runs as several commands, one that exits 0
having run no tests now fails the run as zero-run, as it would alone,
instead of being hidden by the other commands' counts.

Review-Finding: bin/gstack-config:1335:completeness reader=core
Review-Finding: lib/pregate/checks/lanes.ts:457:completeness reader=core
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…k beats an unreadable count

A test runner without a {files} placeholder, such as the built-in
cargo test -p, takes no file arguments, so the smaller Windows budget no
longer splits its selection into several identical runs. When one command
of a split list ran no tests and another printed no summary gstack can
read, the run now fails as zero-run instead of passing with the count
unavailable.

Review-Finding: lib/pregate/checks/lanes.ts:442:completeness reader=core
Review-Finding: lib/pregate/checks/lanes.ts:456:completeness reader=core
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…it, and longer ones are refused

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 3b9d975 into main Nov 24, 2026
62 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 25, 2026
- ### Fixed (#4786)
- Screenshots, PDFs and page dumps taken in the Aside browser are no longer lost before you can see them. (#4786)
- ### Fixed (#4787)
- `/cso --comprehensive` can now prepare npm apps whose lockfile lists bundled dependencies, such as Next.js apps on Tailwind CSS 4. (#4787)
- A first version's ruled-out line now counts only against the one reply it cites. (#4800)
- A first version's plan can say the owner ruled something out, and that line now counts only when he actually said it. (#4789)
- /ship's documentation check updates your repo's own docs again, including docs written as templates. (#4810)
- ### Fixed (#4798)
- /autoplan approval asks with more than 26 choices now label them AA, AB and so on instead of punctuation. (#4798)
- /land-and-deploy no longer leaves an auto-merge request behind or deletes `main`. (#4795)
- When the branch you push moved on the remote since your last fetch, the pre-push credential guard now tells you to run `git fetch` instead of failing with ENOBUFS or telling you to rotate a credential that is already on the remote. (#4794)
- ### Fixed (#4796)
- The pre-merge secrets check now scans an added file over 16 MiB instead of failing it unread. (#4796)
- On Windows, an update no longer deletes your brain-aware skills when `python3` is the Microsoft Store alias. (#4793)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.

pregate on Windows: a lane command over 8,186 characters is cut by Git Bash and the lane exits 2 with no output

1 participant