Skip to content

Fix GBrain reads and validation on Windows - #4499

Closed
SatriaSuriaAriffin wants to merge 3 commits into
garrytan:mainfrom
SatriaSuriaAriffin:codex/windows-validation-fixes
Closed

SatriaSuriaAriffin wants to merge 3 commits into
garrytan:mainfrom
SatriaSuriaAriffin:codex/windows-validation-fixes

Conversation

@SatriaSuriaAriffin

@SatriaSuriaAriffin SatriaSuriaAriffin commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

GStack now reads the right GBrain page on Windows even when the GBrain command returns Markdown.
Large changes need fewer repeated Git commands, and Windows tests use native paths and launchers.
Nothing to configure after updating.

Live evidence

On Windows, the same regression expected ready and received unknown with the upstream reader at fda9dea7. It passed with the repaired reader. The test supplies Markdown first, then verifies that the structured response names the same source and page.

bun --no-env-file --config=NUL test test/gbrain-read-capability.test.ts -t 'native Markdown get falls back'
Liveness proof

Screenshot supplied by the contributor after typing GSTACK PR in the browser address bar.

Contributor liveness screenshot
Agent notes

The original local validation covered 132 focused Windows cases across the run and rechecks. The follow-up preserves the hook scanner's matching behavior, keeps individual test deadlines, sets the scoped Windows runner's outer deadline to 12 minutes within the existing 20-minute job, and adds the requested changelog fragment. See the Checks tab for the new run.

(cherry picked from commit b2d9143c04cc10df739ad660f45b1e732fe8c348)
@trunk-io

trunk-io Bot commented Nov 18, 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

@capy-ai

capy-ai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Thank you, @SatriaSuriaAriffin. Two parts of this are real, and we're picking them up:

  1. The read check ignores a verified sync of this project when the machine's latest code sync was for a different project. On main (9610ba4), bin/gstack-gbrain-read-capability.ts reads only the latest code stage, so syncing a second repo makes the first one report "run /sync-gbrain" again. Your fallback to the recorded code_sources entry fixes that, and it helps on every platform.
  2. The fallback for gbrain builds whose get --json prints Markdown on Windows, together with rejecting slugs that hold characters cmd.exe treats specially.

What happens next: a maintainer will rebuild those two parts on current main and credit you. This branch won't be merged, because we don't merge outside changes to CI workflows or the test runners. We'll link the rebuild here and close this PR when it lands.

The other changes (diff-scope speedups, doctor output, native-path test helpers, the Windows shard timeout) go beyond what we keep working on Windows today, which is install, startup and the core workflows, so we aren't taking them. If one of them fixes a core workflow that fails for you on Windows, an issue with the command you ran and its output would help us take it.

@capy-ai capy-ai Bot added bug Something isn't working S3 Severity 3: everything else needs Windows verification Merged fix awaiting confirmation on real Windows hardware labels Nov 19, 2026
@capy-ai

capy-ai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Thanks @SatriaSuriaAriffin. The per-repo sync record part of this PR is now on main in #4532 (104fc72), rewritten with you credited as co-author. The GBrain read check now uses each repo's own sync record, so syncing a second repo no longer makes the first one ask for /sync-gbrain again. Your guard is kept: an older record can't hide a newer failed sync of the same repo.

We didn't take the Markdown fallback. Current gbrain returns JSON for get --json, and gbrain call goes through gbrain's write path and is refused on remote brains, so a read-only check shouldn't use it. If a gbrain build really does ignore --json, the check already fails safe by asking for a sync. The % quoting issue on Windows is real. The fix we want is to launch gbrain without cmd.exe, which touches every gbrain call, so it will be its own change. If you have a gbrain version that prints Markdown for get --json, please post the version and the exact output so we can follow up in gbrain.

@capy-ai

capy-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Closing this PR now. As we said on 11-19, the part we took (the GBrain read check uses each repo's own sync record) landed in #4532 (104fc72) with you credited as co-author, and shipped in v1.102.0.0. We aren't taking the Markdown fallback. The Windows % quoting problem is real, but the fix we want is to launch gbrain without cmd.exe, which touches every gbrain call, so it will be its own change. Thank you for the work here.

@capy-ai capy-ai Bot closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs Windows verification Merged fix awaiting confirmation on real Windows hardware S3 Severity 3: everything else

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant