Repository navigation
Fix three flaky test causes found in the 2026-11-08 harvest (GST-1912) - #4167
Merged
Merged
Conversation
- gbrain prune test: stub pgrep so a parallel test's 'gbrain autopilot' process cannot refuse the removal (Free Tests 42448270551 shard 3). - third-party-actions: a lettered option that marks the step blocked or waiting on the user is the defer option (gate 42431616220, tpa-present). - gstack-hook-check: a Bun killed by a signal makes the check unavailable (exit 3) instead of failing every hook (Free Tests 42327570347 shard 8). - floor actor: bind a cropped Write overwrite to the sole pending owned Write, checking every visible diff row (census 42252633016, plan-ceo-finding-floor). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
The test-of-test ratchet fails a new file that imports only test code. The cases now live in test/plan-count-file-permission.test.ts, the ratchet's suggested owner, and the fixture map points there. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A Bun killed by a signal used to end the check before the shell parse and merge-marker scan. Those checks now still run: a shell failure exits 1 and setup refuses that hook, and otherwise the check exits 3 as before with TypeScript hooks left unverified. Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
When Bun printed a fail row for one entry and was then killed by a signal, the check dropped that row and exited 3, so setup registered a hook it knew was broken. Rows Bun printed now count: a fail row fails its hook, an ok row adds its imports to the marker scan, and only entries with no row are unchecked. Exit 3 applies only when an entry has no row and nothing else failed. Review-Finding: v2/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The widened defer rule counted a refusal such as "I will not mark this step as blocked on you" as a defer option, which loosens the paid consent gate. This change returns test/helpers/third-party-actions.ts and its test to origin/main; that flaky case moves to a separate fix. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…log entry 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.
Three flaky-test causes are fixed, and
./setupno longer tells people their healthy hooks are broken when Bun crashes during the hook check. This serves gstack's goal of a test suite and setup you can trust: a red run or a setup error should mean something is really wrong.What changed
A Bun crash during the hook check no longer reports healthy hooks as broken.
Before/after as text: A Bun crash during the hook check no longer reports healthy hooks as broken
Hook check when Bun crashes (Free Tests 42327570347 shard 8). Bun segfaulted in the one-process bundle probe, and the check reported four healthy hooks as "does not parse", so setup exited 1 with "this is a gstack bug". Now the rows Bun printed before the crash still count: a reported failure still fails its hook, an ok row still feeds the merge-marker scan, and the shell parse checks still run. Only an entry Bun never reported is unchecked, and the check exits 3 (unavailable, the same as a missing Bun) only when such an entry exists and nothing else failed. A Bun that exits normally without a report still fails every entry it left out.
gbrain prune test (Free Tests 42448270551 shard 3).
test/gbrain-prune-gone-worktrees.test.tssaw a parallel shard's livegbrain autopilotprocess throughpgrep -f, so the removal refused. The fixture now stubspgrepto "no match", astest/gstack-gbrain-sync.test.tsalready does.plan-ceo-finding-floor overwrite binding (census 42252633016 slice 7). The floor actor did not recognize Claude Code's cropped "Do you want to overwrite …?" diff for its own working plan, so the menu waited out
PERMISSION_UNANSWERED_MS. The binding now handles an overwrite like a cropped Create: it binds to the sole pending owned Write and checks every visible row against the current file bytes and the pending content. The cases live intest/plan-count-file-permission.test.ts, the owner test the test-of-test ratchet names.The third-party-actions defer change this PR first carried is gone: review found it counted "I will not mark this step as blocked on you" as a defer option, so those two files are back to main and that flake gets its own fix.
Why
These were open entries in the crew's flaky ledger. Each one failed a PR or census check on a correct run, or (setup) told users healthy hooks were broken. Now those runs pass, and setup refuses only hooks that really fail.
Blast radius
bin/gstack-hook-checkchanges behavior only when its Bun process dies by a signal, and its three consumers stay fail-closed. Setup refuses every hook with a fail line, andbin/gstack-session-updateholds the update on exit 3 or an incomplete report (walked inhook_report, and the signal cases run intest/setup-hook-syntax-gate.test.ts). Everything else is test helpers and fixtures.Summary
Flaky reds on correct runs cost every lane a rerun and hide real failures. This branch removes three causes with a failing-first test each, moves the new overwrite cases into their owner test so the ratchet stays green, and makes the hook check keep what Bun already reported when Bun crashes.
Test Coverage
Coverage: deterministic (each changed runtime file has a changed test naming it).
Regression proof: "a failure bun reported before it was killed still fails its hook" fails at d174289 (expected 1, received 3) and passes at 38ef0ad; the crash-plus-broken-shell assertion fails on the original script (expected 1, received 3) and passes after the fix.
Tests ran: targeted 257
Tests ran: tests (bun run test) carried from CI at the final head
Pre-Landing Review
Pass 1 fixed one finding (a crash skipped the shell checks), pass 2 found nothing to fix, and Step 11's outside voice found two blockers: a pre-crash fail row was discarded (fixed in 38ef0ad under a granted fix-check) and the widened defer rule accepted a negated mark (reverted to main in 17edf5b under a second grant). Both fix-checks were clean. The last outside voice at 17edf5b: CLEAN.
Gate edits: none detected (13 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
bin/gstack-doctor:202still words exit 3 as "bun not found", which misdiagnoses a Bun crash.bin/gstack-session-update:104after a Bun crash with a broken shell hook, the hold names hook-check-unavailable instead of the broken file (the update still holds).setup:4364in the crash-plus-real-failure case, setup's lists leave out the TypeScript hooks it registers unchecked, and the "registered unchecked" warning does not print.bin/gstack-hook-check:205after a late crash the check can exit 0 while stderr still says the entries cannot be checked.bin/gstack-hook-check:262a signal landing between two ok rows of one entry leaves its later imports unscanned for merge markers.Exploratory QA
Functional smoke on
bin/gstack-hook-checkat b0336fb (3 probes, all pass): the real checkout exits 0 with an ok per hook; a Bun killed by SIGSEGV exits 3 with no fail lines; a Bun that exits 0 with no report exits 1 with a fail line per TypeScript hook. After the fix, a Bun that prints a fail row and then crashes exits 1 with that fail line (scripted repro and test).Eval Results
Test-harness files changed. The focused paid runs at 429777e: tpa-present PASS 1/1 ($0.08) and plan-ceo-finding-floor PASS 1/1 (cost not printed). tpa-present's harness change was later reverted to main. The 54-test PR profile was not run (over the $10 focused cap); this is a known gap for a --no-screen READY.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Daily flaky pass, exempt from planning.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. No documentation edits were needed.
Scope: 6 commits from 6042f6a to a1e7432 on
fix-flaky-tests-2026-11-08, 8 committed files and no working-tree changes. The only user-facing change is inbin/gstack-hook-check: when Bun is killed by a signal during bundling, the rows it already reported still count, the shell checks still run, and the check exits 3 only when a hook went unreported and nothing else failed. The rest is test fixes plus the changelog.d fragment.Documentation health:
docs/troubleshooting.md: current. Theauto-update-hook-check-unavailableentry already counts a crash as an unavailable reason, and the setup refusal entry still describes real parse failures correctly.bin/gstack-hook-checkheader comment: current. It documents the new exit-3 crash case.AGENTS.md,README.md,CONTRIBUTING.md: current. No surface they describe changed.Coverage debt: setup's existing warning, "the hook parse check could not run (exit N); hooks are registered unchecked", has no troubleshooting entry. Only reference coverage exists, in the script header and the changelog fragment. This gap predates the branch, and the change now makes the warning reachable after a Bun crash.
Diagram drift: none.
Test plan
🤖 Generated with Claude Code
Agent notes
Refs GST-1912
Approvals
Approved: yes (record r-ce7fab9a6a7b). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: exempt: flaky
REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=6 fixed=2 scope=frozen unrecorded=1 ledgers_read=8 fix_checks=2 dispatches=8
Gate edits: none detected (13 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review-loop grants: a-357b0f3ee235 (fix-check at d174289), a-1a987d0e4fd4 (fix-check at 38ef0ad, split).