Repository navigation
Make the plan-review test judge reject failed sessions and steady two flaky tests - #4849
Merged
Merged
Conversation
… flaky tests Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
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.
The plan-review test judge now fails a Claude Code session whose final result reports an error, even when the process exits 0, so a broken session can no longer pass a quality check. Two tests that failed at random are steadier, and one of them now says why when it fails. Nothing to do.
What changed
test/plan-floor-review.test.ts with the old judge helper and with this branch's: the three judge tests fail before and pass after.
Before/after as text: test/plan-floor-review.test.ts with the old judge helper (left) and this branch's (right): the three judge tests fail before and pass after
A second-model review of the plan-review judge found that it trusted an answer from a session that ended in an error: when Claude Code exits 0 but its last result event says
is_error: true, the judge used the assessment it had seen earlier. The judge (test/helpers/plan-floor-review.ts) now rejects that session. It also runs Claude Code with slash commands and hooks turned off, like gstack's other Claude Code calls, and skips a plain notice line in the output while still failing on a broken JSON event.The question-log Bun-config test (
test/bun-config-shell-bins.test.ts) failed twice in CI with one leftover record written a few milliseconds before the failing test began. Eachgstack-question-logwrite starts a background developer-profile update that keeps writing into the test's state folder after the test returns; the test now turns that update off withGSTACK_QUESTION_LOG_NO_DERIVE=1. This is the probable cause, not a reproduced one: 48 stress runs of the real test and 300 tight-loop trials never failed.A brain-sync merge test (
test/brain-sync.test.ts) failed once withpush_failedand no message. Its assertion now prints the whole status, so the next failure names its cause.Why
These are the daily repairs for tests that failed at random in CI. A random failure costs a rerun on every pull request it hits, and a quality judge that accepts a failed session can pass work it never assessed.
Blast radius
Only test code changes. The judge helper is used by the paid plan-review cases and their unit tests, and its new rejection path is covered by
test/plan-floor-review.test.ts(script ran: 84 pass, and the two new tests fail on the old helper). One real judge run with the pinned Claude Code 2.1.326 and the new flags returned a valid assessment.Tests
Tests ran: targeted 104
Tests ran: brainsync 11
bun run typecheckreports zero errors;bun run typecheck:testreports no new diagnostics. The full free suite ran in CI.Pre-Landing Review
No issues found.
Documentation
Scope: this branch changes only tests: the plan-floor review judge helper and its test, the gstack-question-log Bun-config test and one brain-sync assertion. It also adds the changelog fragment
changelog.d/flaky-tests-and-stricter-plan-review-judge.md. The audit checked docs/flaky.md, docs/TESTING_INTERNALS.md, docs/evals/detector-inventory.md and theGSTACK_QUESTION_LOG_NO_DERIVEcomment in bin/gstack-question-log for statements the diff makes untrue.Result: the docs are current and no docs needed edits. The changelog fragment matches the code changes: the judge now rejects a session whose final result has
is_error: true, runs with hooks and slash commands turned off, and skips lines that are not JSON events. The question-log test turns off the background profile update.Debt: docs/evals/detector-inventory.md cites
test/helpers/plan-floor-review.ts:278-280forpickPlanFloorProductType. That reference was already stale before this branch, and the function is now at line 327.Agent notes
Agent notes
Issue GST-4001. Daily flaky-test pass, 2026-11-26.
Gate edits: none detected (8 listed, 6 read)
Approvals
Plan: exempt: bug fix to test helpers and flaky tests
Plan check: exempt bug fix