- Added gstack-flaky run wrapper that reruns a test command once when a few tests fail and the runner made no retries of its own.
- Added --max-reruns option (default 3) to limit the number of failed tests that triggers a rerun.
- Added --rerun-scope test option to rerun only the failed tests instead of the whole command.
- Added a dedicated JUnit flaky ledger at GSTACK_FLAKE_LEDGER_JUNIT that records one redacted line per flaky pass and per test that failed its rerun.
- Added gstack-flaky ids --junit command that prints the test ids contained in a report.
- Added docs/flaky.md covering GitHub Actions setup, rerun scope, rules, output, and exit codes.
- A test that fails once and then passes on rerun is treated as a flaky pass, so the CI job stays green while a warning and step-summary row name the test.
- A rerun is counted only when the runner reports a full green run, so real failures, coverage threshold failures, tests not reached in the first run, crashes, and cancelled jobs remain red.
- Exit codes are now 0 for pass (including flaky passes), 1 for a test failure, 2 for usage errors, and 3 for no usable report, crash, or killed runner, each accompanied by a FLAKY_ line and a fix: line.
- A missing, stale, empty, or malformed report never results in a passing status.
From gstack
A test that fails once in CI and passes when run again no longer turns the job red, and every such flake is recorded for the daily flaky-fix pass. gstack-flaky run wraps any test command that writes a JUnit report. When a few tests fail, it runs the command once more. A test that failed and then passes is a flaky pass, so the job stays green, a warning and a step-summary row name it, and one line goes on a ledger. A rerun counts only when the runner itself reports a full green run, so a real failure, a coverage threshold, a test the first run never reached, a crash or a cancelled job stays red. bin/gstack-flaky run --junit -- : reruns the whole command once when at most --max-reruns (3) tests failed and the runner made no retries of its own. --rerun-scope test opts in to rerunning only the failed tests, for suites with no coverage gate and no fail-on-flaky policy. Ledger at GSTACK_FLAKE_LEDGER_JUNIT, kept apart from the free suite's file-level ledger: one redacted line per flaky pass and per test that failed its rerun, with tree, commit, branch, run URL, attempts, scope and the first lines of the error. gstack-flaky ids --junit prints the test ids a report holds. Exit codes: 0 pass (flaky passes included), 1 a test failed, 2 usage, 3 no usable report, a crash or a killed runner, each with a FLAKY_ line and a fix: line. A missing, stale, empty or malformed report never passes. docs/flaky.md covers the GitHub Actions setup, rerun scope, rules, output and exit codes. Tests in test/flaky-run.test.ts use captured Playwright and bun JUnit reports.