Repository navigation
Conversation
…gers the flake (GSTA-158) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…closed duplicates and nonzero reruns Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gstack-flaky never greens an incomplete run: a targeted rerun needs the runner's summary proving the first run complete, otherwise (and always for generic runners) the rerun repeats the whole command. A rerun clears a test only when it exits 0 and the test passes once on its first attempt. Killed runners exit 3 (FLAKY_COMMAND_KILLED) and signals are forwarded. The first report is restored at --junit with reruns kept beside it; ids are redacted at every output; the ledger gets its own GSTACK_FLAKE_LEDGER_JUNIT; fixtures are registered in FREE_FIXTURES. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A cancel forwarded to a runner that traps the signal now counts as killed for every later attempt, so a cancelled job is never rerun or greened. A whole-command rerun clears nothing when its report has a failed test, misses a first-run test, or its runner counted failures outside the report. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… the run A coverage threshold or a fail-on-flaky policy fails a run for a reason a narrowed rerun cannot reproduce, so either forces a whole-command rerun. --junit refuses an existing file that is not a JUnit report instead of deleting it. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t-in A rerun counts only on the runner's own full green verdict: exit 0, no failed or missing test, nothing counted outside the report. That covers every way a run can fail, which a narrowed rerun cannot (a coverage threshold with an lcov reporter, a fail-on-flaky policy, a test never reached). --rerun-scope test reruns the failed test alone, with its preconditions documented and the complete-run checks kept as a safety net. An unreadable existing --junit file is a usage error, not a crash. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…158) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ntry moves to changelog.d Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…entry moves to changelog.d Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…er does not read it as a network op Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…; retarget to main Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Merging to
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 |
Contributor
|
Reopening to schedule the main-base checks after retargeting from gsta158-flaky-run (#3612 landed). |
… orphan free-suite check at 97487df) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
|
Frozen in wave |
3 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 2, 2026
* Attribute every paid trial's cost: bind label-named records by testName, price aborted SDK sessions from streamed usage, model-free cases cost $0 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: case cost adds streamed sessions to record sums and keeps record cost_known Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: the paid report headline counts ledger-only session cost once Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: a cost-only record never sets the trial model Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: recordE2E writes cost_case_id only for a registered label-named case Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: CHANGELOG for paid-report cost attribution (Unreleased) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: the headline adds only streamed session cost; cache writes without a 5m key Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: how the paid report prices a trial and what stays cost-unknown Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Price PTY sessions from their transcripts: pin a session id, sum the session's and its subagents' usage into the ledger's streamed_cost_usd Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: transcript pricing never throws from a PTY ledger writer Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: pin transcript-cost.ts as non-behavioral at HARNESS_VERSION 6 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: recognise --session-id= and --resume= forms Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: CHANGELOG for PTY transcript pricing (Unreleased) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: PTY sessions priced from their transcripts Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: price PTY transcripts without adding a launch argument; native AUQ capture opts out Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: harness notes and CHANGELOG match the transcript claim Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(flaky): gstack-flaky run reruns a failed JUnit test once and ledgers the flake (GSTA-158) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(flaky): stream output, keep unreported runner failures red, fail-closed duplicates and nonzero reruns Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes gstack-flaky never greens an incomplete run: a targeted rerun needs the runner's summary proving the first run complete, otherwise (and always for generic runners) the rerun repeats the whole command. A rerun clears a test only when it exits 0 and the test passes once on its first attempt. Killed runners exit 3 (FLAKY_COMMAND_KILLED) and signals are forwarded. The first report is restored at --junit with reruns kept beside it; ids are redacted at every output; the ledger gets its own GSTACK_FLAKE_LEDGER_JUNIT; fixtures are registered in FREE_FIXTURES. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: latch cancellation and check whole-command rerun reports A cancel forwarded to a runner that traps the signal now counts as killed for every later attempt, so a cancelled job is never rerun or greened. A whole-command rerun clears nothing when its report has a failed test, misses a first-run test, or its runner counted failures outside the report. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: whole-command rerun when coverage or runner-flaky tests can fail the run A coverage threshold or a fail-on-flaky policy fails a run for a reason a narrowed rerun cannot reproduce, so either forces a whole-command rerun. --junit refuses an existing file that is not a JUnit report instead of deleting it. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(flaky): rerun the whole command by default; targeted rerun is opt-in A rerun counts only on the runner's own full green verdict: exit 0, no failed or missing test, nothing counted outside the report. That covers every way a run can fail, which a narrowed rerun cannot (a coverage threshold with an lcov reporter, a fail-on-flaky policy, a test never reached). --rerun-scope test reruns the failed test alone, with its preconditions documented and the complete-run checks kept as a safety net. An unreadable existing --junit file is a usage error, not a crash. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: gstack-flaky CHANGELOG entry and standalone-binaries row (GSTA-158) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(flaky): quarantine registry for repeat flakes (GSTA-158 P2) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(flaky): bound renewal dates; match non-ASCII paths in check --base Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(flaky): reword the FLAKY_QUARANTINE_BASE hint so the egress scanner does not read it as a network op Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(agent-sdk): every SDK caller passes the claude_code preset or names why not The SDK's default system prompt is a bare stub that drops the line telling the model to run /skill through the Skill tool. runAgentSdkTest now refuses a missing, empty or bare-string prompt; non-preset callers name a reason; a free tripwire scans test/ and scripts/ for the same mistake. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: record the SDK prompt guard as a non-behavioral harness change and baseline its tripwire harness-version: runAgentSdkTest validates systemPrompt before starting; every live caller already passed the claude_code preset, so no verdict can change. test-of-test ratchet: the tripwire's subject is the eval harness by design. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: name the preset literal callers pass and the unnamed-prompt refusal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(eval-plan): frontier models under test (R54) Haiku and Sonnet are not models under test. dry-run refuses a plan whose every arm is Haiku or Sonnet unless --tier-question names what it asks about that tier, warns on a mix, and re-costs the plan on Opus 5.5 and GPT-6.1 Sol. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(eval-plan): trim R54 skill prose and raise the eval-plan context ceiling The R54 paragraph and CHECK: frontier bullet were cut to the minimum; the exemptions and verdict rule stay in docs/TESTING_INTERNALS.md. The remaining growth is the feature, so only the eval-plan eager ceiling moves (4887 -> 5458, the capture helper's value); other skills' ceilings are left as they were. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(eval-plan): pilot start keeps the R54 refusal; --tier-question rejects a flag Review pass 1 (full depth) found the frontier refusal could be skipped by starting a pilot on Haiku or Sonnet arms behind a dry run made on other arms, or behind a dry-run.json written before the check existed. startPilot now refuses a pilot whose every arm is Haiku or Sonnet unless its dry run recorded a tier question. dry-run --tier-question no longer takes the next flag as its answer. The testing doc now says the frontier re-cost is printed for comparison with the brief cap, not enforced. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(support-tiers): Windows CI in the present tense now that windows-smoke is required (#3806) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: empty commit for a clean check set at the same tree (cancelled orphan free-suite check at 97487df) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(skills): /eval-plan entry names the R54 frontier check Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
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.
What changed
A test that flakes twice in a row: with P1 alone the job fails; quarantined under P2 it gets 3 attempts of the whole command and passes only on a fully green run.
Text version
Why
"We should have a flaky test fix pass every day that tries to fix flaky tests" (Garry, CREW rule 16). A test that flakes often keeps turning PRs red while someone fixes it, and the only escape today is skipping it, which hides it for good. Quarantine keeps the test running with an owner and an expiry, and it still cannot turn a red run green.
Blast radius
Only
gstack-flakychanges, and only for repositories that add.gstack/quarantine.json: with no registry,runbehaves exactly as P1 apart from the newquarantined=0field onFLAKY_RESULT. gstack's own CASE_QUARANTINE and EVAL_POLICY are untouched. Evidence:test/flaky-run.test.ts(41 P1 cases) passes unchanged apart from that one expected line.Approvals
Source: gstack-approvals record for gsta158-quarantine (display only; not an approval citation).
Summary
Stacked on #3612 (GSTA-158 P1). Plan: GSTA-158 plan-v2 (D2 to D5), approved by Garry ("Do it. Order priority by what saves money fastest").
lib/quarantine.ts: the registry (schema 1), add/renew/release,check [--base],report [--ledger].lib/flaky-run.ts: quarantine as a larger attempt budget. When every test the latest whole-command attempt failed is a live quarantined id, and nothing else blocks (no kill, no missing report, no failure outside the report, no missing first-run id), the command may run again, up to 3 attempts. Green only on an attempt with the runner's full green verdict; a quarantined test red on every attempt ishard-break. Non-quarantined failures keep one rerun.--rerun-scope testgets the same budget on the targeted path with P1's safety net.bin/gstack-flaky:quarantinesubcommands,run --base <ref>,::erroron a hard break.docs/flaky.md#quarantine, the daily flaky-pass template anddocs/captain.md.Adaptation from the approved narrowing. Plan D2 said a quarantined test blocks only when every one of its attempts is red. P1 was narrowed (GStack Minder approved) so a rerun counts only on the runner's own full green verdict, because exit status can come from outside the JUnit report (a coverage threshold in bunfig.toml with an lcov reporter, fail-on-flaky, global setup). So quarantine cannot infer "only quarantined tests failed" from the report and turn a red attempt green; it is a larger budget under the same verdict rule instead. Regression test: a fake runner exits 1 with a green report while a quarantined test fails, and the run stays red (
test/quarantine.test.ts, "false-green regression" and the bin-level coverage-style case).Pre-Landing Review
Previous /ship invocation (0246abd → b9dde42): a specialist pass and an adversarial pass found 2 blocking issues, both fixed in b9dde42 with tests: a future-dated
renewedAtlet a renewal outlive the 14 + 7 day rule, andgit diffquoting non-ASCII paths let an entry forüber.test.tsslip pastcheck --base's same-change refusal. A pass-2 range review was clean.This invocation (36ee5c1, after merging P1's c86543f): specialist and adversarial passes both NO FINDINGS. The remote pregate then failed
test/egress-receipt-wiring.test.ts(NEW-SINK SCANNER read the literalgit fetchin theFLAKY_QUARANTINE_BASEhint as a network op); 8935529 rewords the hint, no exemption added, and a range review was clean.Gate edits: none detected (no assertion, threshold or skip weakened;
test/flaky-run.test.tsgainsquarantined=0in one expected line).Review notes (informational, not looped)
--junit,checktakes the cap from the entries' ownsuiteTests; a hand-edited registry can inflate it. Pass--junittocheckin CI.quarantine reportthrows on a malformed entry (noexpiresAt);runignores such an entry andcheckrefuses it, so it cannot cause a false green.enteredAt;check --basedoes not consultbase.releasedfor new entries.Documentation
Updated:
docs/flaky.md(§ Quarantine, Ledger kinds, output and exit codes),docs/standalone-binaries.md,docs/captain.md(daily flaky pass),captain/templates/automation-flaky-pass.md,changelog.d/gsta158-quarantine.md.Test plan
bun test test/quarantine.test.ts test/flaky-run.test.ts test/changelog-fragments.test.ts test/egress-receipt-wiring.test.ts: 94 pass, 0 fail at 8935529bun run typecheck,bun run typecheck:test(no new diagnostics), free-fixtures, module-size ratchet, bun-entry-isolation, spawnsync tripwire, state-root ratchet, changelog-fragmentsIssues
None linked.