Skip to content

/sync-gbrain's read check works when the first page is over 64 KB (#4396) - #4497

Merged
capy-ai[bot] merged 2 commits into
mainfrom
fix/sync-gbrain-large-page-probe
Nov 18, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
fix/sync-gbrain-large-page-probe

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

/sync-gbrain's read check no longer reports unknown when the first page in your code source is over 64 KB.
Why: the check read the whole page to confirm its source and slug, and big pages (lockfiles) hit the 64 KiB output limit on every run.
Nothing to do: it now reads a 4 KB window of the page and still treats any cut-off output as unknown.

What changed
  • bin/gstack-gbrain-read-capability.ts reads the page with gbrain get <slug> --source <pin> --json --body window --max-bytes 4096. The source and slug checks are unchanged.
  • If that call fails (a gbrain older than 0.60.231.0 rejects the flags), the check falls back to the old whole-page read under the same 64 KiB limit, so small pages on older gbrain still read ready.
  • A spawn error, including the ENOBUFS Node raises when output passes the limit, still fails closed through the existing !result.error and length checks. Commands that read cut-off output now fail instead of judging part of it (GST-3086) #4492's shared spawn helper (lib/spawn-sync.ts) merged after this branch was cut; it changes only this file's import line, so after merge the probe uses that helper as well. A trial merge with main at 0ab5657 is clean, and typecheck plus the 52 focused tests pass on it.
  • Measured on a scratch gbrain 0.60.740.0 brain with a 317 KB page: the whole-page read returned 322,098 bytes and the check on main said unknown; the window read returned 5,254 bytes with slug and source_id, and the check said ready.
Why

Every /sync-gbrain run in a repo whose first listed page is large reported its read capability as unknown, so the readiness verdict never reached ready even though reads worked.

Blast radius

Only the read check's page fetch changes. On an older gbrain a small first page costs one extra rejected call before the fallback. A page that is still too big, or any failed call, reports unknown, never ready.

Pre-Landing Review

Pre-Landing Review: 4 issues — 1 auto-fixed, 0 asked, 0 deferred, 3 noted

  • Fixed: the paid readiness test test/skill-e2e-sync-gbrain-readiness.test.ts still expected only the old whole-page call; it now expects the windowed call, plus the fallback in its unknown case.
  • Second-model review: clean, no findings.
Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • bin/gstack-gbrain-read-capability.ts:79: the fallback assumes an older gbrain exits non-zero on the new flags. If one exits 0 with an error body, a small page reads unknown instead of ready (fails safe).
  • bin/gstack-gbrain-read-capability.ts:80: a timed-out windowed call starts the fallback, so the worst case waits about 20 s before unknown.
  • bin/gstack-gbrain-read-capability.ts:84: the windowed JSON shape (top-level source_id and slug) is checked against the repo's mock and the scratch brain above, not a test against a real gbrain.
Exploratory QA

Functional, fake gbrain on PATH, 3 probes, all pass: an 80 KB page reads ready through the window; an older gbrain that rejects the flags falls back and reads ready; an older gbrain with an 80 KB page reads unknown.

Issues

Fixes #4396

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed.

Scope: the committed changes from base fda9dea79f13 to HEAD on fix/sync-gbrain-large-page-probe. The working tree was clean. The change makes the /sync-gbrain read probe ask gbrain for a 4 KB window of the page (--body window --max-bytes 4096) and fall back to the whole-page read on older gbrain.

Documentation health:

  • changelog.d/fix-sync-gbrain-large-page-probe.md is current and describes the window, the fallback and that a cut-off response still counts as unknown.
  • docs/evals/detector-inventory.md is current. Its line reference :88 points to the ready status return.
  • sync-gbrain/SKILL.md.tmpl and sync-gbrain/SKILL.md are current. The probe's status contract did not change.

There is no coverage debt and no diagram drift.

Tests
  • CI free suite (Free Tests run 44352175135, workflow_dispatch at ad53d09): green, 1,698 test files carried.
  • bun test test/gbrain-read-capability.test.ts test/sync-gbrain-readiness-fixture.test.ts test/sync-gbrain-source-probe.test.ts: every focused test green, none red.
  • bun run typecheck:test: no new diagnostics; spawnSync timeout tripwire and module-size ratchet: 0 fail.
  • Paid periodic sync-gbrain-read-ready / sync-gbrain-read-unknown: not run; its call-list assertion now matches the free readiness fixture test, which passes.
Agent notes

Agent notes

  • Source: report and suggested one-line patch by @nfitzsimmons on sync-gbrain read probe reports unknown when the first listed page is over 64 KB #4396, read as text only. The --body window --max-bytes 4096 argument list is carried over from it (Co-authored-by on the commit); the fallback, tests and fixtures were written fresh on main.
  • Security read: no network, secrets, permissions, workflows, install scripts or dependencies touched. The new arguments are fixed literals; the slug still passes the existing validation before it reaches argv.
  • Flaky: Free Tests run 44349739917 attempt 1, free-suite (3), test/first-use.test.ts "where records live" (FIRST_USE_NO_PRIVATE_DRIVE listed drive folders unsorted), unrelated to this PR; one rerun under the standing flaky approval passed (job 134966182781); logged in handoffs/flaky-ledger.md.
  • CI carry: the pull_request run's merge base moved, so the carry came from a dispatched run (44352175135); macOS named regressions cleared against job 134970499323.
  • Decision trail: reports/GSTA-625-decisions.tsv in the GStack Minder drive.

Approvals

No approvals recorded for branch fix/sync-gbrain-large-page-probe.
Plan: exempt: bug fix
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=1 scope=frozen dispatches=4
Gate edits: none detected (8 listed, 8 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Refs p1/specialist-batched#1

{
  "schema_version": 1,
  "pr": 4497,
  "head": "ad53d0915982986b89e8bc4ca20f4b2bc26a34b6",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1698,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44352175135,
      "attempt": 1,
      "tree": "be3bd53c618a376a9a36c6ea364ed051b4bb2196"
    }
  ],
  "calls": 23,
  "session_kind": "unattended",
  "run": "ship-4497",
  "head_tree": "be3bd53c618a376a9a36c6ea364ed051b4bb2196",
  "product_patch_id": "817507fcf622393928a19045cd1fe15c62391b84",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 3,
    "rules": "1afa38a4be3b5eef",
    "base": "2767d229fb8c6aafa89f640a58ae1dbb3f67ca7d",
    "registry": "2767d229fb8c6aafa89f640a58ae1dbb3f67ca7d",
    "gate_scan": {
      "tagged": 0,
      "head": "ad53d0915982986b89e8bc4ca20f4b2bc26a34b6"
    },
    "reasons": [
      "runtime=3"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @be3bd53c618a (8 checks, current for ad53d0915982)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44352175135/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=be3bd53c618a tests=37839 skipped=67 runs=44352175135/1 profiles=ci-reuse/free-tests heads=ad53d0915982 verified=2026-11-18T17:00:11.471Z"
  ],
  "issues": {
    "fixes": [
      4396
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md, sync-gbrain/SKILL.md.tmpl and the changed changelog.d fragment"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}

)

The read check asks gbrain for a 4 KB window of the first page instead of
the whole page, and falls back to the whole-page read under the same 64 KiB
limit on a gbrain without body windows. Cut-off output is still unknown.

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

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit d789dd9 into main Nov 18, 2026
100 of 102 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494)
- /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496)
- On Capy, /ship no longer edits or comments on pull requests as you. (#4518)
- The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513)
- The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525)
- The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491)
- gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528)
- Uninstalling gstack keeps your own Codex hooks trusted. (#4528)
- Codex hook setup matches Codex more closely. (#4528)
- On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528)
- /review's checklist on Codex reads shell commands more carefully. (#4528)
- On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512)
- On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522)
- On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523)
- On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524)
- /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526)
- On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510)
- gstack knows when Codex is running unattended. (#4510)
- Codex reviewers start with a clean context. (#4510)
- Docs no longer say Codex has no hook support. (#4510)
- A command whose output was cut off no longer counts as a finished read. (#4492)
- A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516)
- Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505)
- /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497)
- Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530)
- Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532)
- gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503)
- `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483)
- The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515)
- When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515)
- When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515)
- The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527)
- /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527)
- Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527)
- /ship can now review results PRs that publish raw session data. (#4511)
- /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507)
- A second review round no longer reports done when nothing was reviewed. (#4520)
- The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506)
- gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502)
- A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519)
- `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529)
- Five small ship-tool fixes. (#4529)
- A ruling the owner gives while a `/ship` run is open can be relayed. (#4529)
- /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533)
- /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504)
- When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508)

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.

sync-gbrain read probe reports unknown when the first listed page is over 64 KB

1 participant