Repository navigation
feat(scripts): weekly flaky-test scan and its spec (T801 t2) - #192
Merged
Merged
Conversation
Add scripts/flaky-scan.mjs: it finds GitHub Actions jobs that failed and then passed on the same head SHA, and files 1 issue per flaky test (1 comment with new events on an open issue with the key). Dry run by default; only --apply writes, and a guard allows only the 2 issue writes. Caps: 3 new issues per repository, 15 per run. --out writes the JSON that the daily audit's Q1 reads for CI reruns. Plan T801, task t2 (Gap 2).
… actions on a comment read failure Cross-review R1-R3: a comments read failure no longer drops the repository's done actions (the 15-per-run cap held only by luck), a success in the same attempt is no flaky event, and the cross-SHA and success-then-failure tests now hold real jobs.
frostyard-machines
force-pushed
the
lucilla/flaky-test-scan
branch
from
November 4, 2026 14:35
469ea5c to
185fc5c
Compare
bketelsen
approved these changes
Nov 4, 2026
This was referenced Nov 4, 2026
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.
Summary
Plan T801, task t2 (section "Gap 2: weekly flaky-test scan").
Adds
scripts/flaky-scan.mjs(withscripts/lib/flaky-scan.mjsandtest/flaky-scan.test.mjs) and the specdocs/specs/flaky-test-scan.md, indexed indocs/README.mdand linked from the Observe station ofdocs/design/quality-loop.md.failureortimed_outand has a latersuccesson the same head SHA (a later attempt or a later run) is 1 flaky event. Jobs are read only for (workflow, SHA) groups with 2+ attempts, deduped by job id. The test name comes from the failed job's log (Go, TAP, pytest), else the failed step's name.repo/workflow/job/test, with a hidden marker<!-- flaky-scan key=… -->. An open issue with the key gets 1 comment with the new events only (or nothing). Caps: 3 new issues per repository, 15 per run.makeGhrefuses every write without--apply, and with it allows onlyPOST repos/R/issuesandPOST repos/R/issues/N/comments. No labels, no reruns, no workflow edits.--out FILE: JSONschema_version1 withrepos[].runs,rerunAttempts,flaky[], for the daily audit's Q1 (t12).Risk tier
Risk tier: 2 — new tooling that can open issues and comments with
--apply; nothing runs it in CI or on a schedule yet, and the default is read-only. No workflow, policy, or authority file changes.Docs housekeeping
TEMPLATE.mddocs/README.mddesign/quality-loop.md)Verification
node scripts/check-docs.mjsgreen (90 docs, 898 links)make cigreen locally: 85 tests pass (11 new)Real dry run, read-only,
--days 14on frostyard/frostnotes, bketelsen/pi-pocket-team, frostyard/snosi (3 min 31 s, exit 0): 10 flaky keys found, for examplebketelsen/pi-pocket-team/ci.yml/Test/Run the tests(run 40980615501: attempt 1 failure, attempt 2 success, 1 SHA). snosi gave 5 keys: 3open, 2skip(cap). snosi reached the 1,000-run API limit in 14 days; the spec says so (weekly is ~500).make cigreen at head185fc5c(rebased on main20fd8a3): 110 tests pass, 13 intest/flaky-scan.test.mjs.Revert test (scratch worktree at
185fc5c,laterSuccessindetectFlakyEventsset tofalse,node --test --test-reporter=tap test/flaky-scan.test.mjs): exit 1, 8 of 13 fail:Tests 2 and 3 are negative cases (0 events) that a "no event" revert cannot fail; they were proven separately: grouping by workflow only (no SHA) fails test 2, and dropping the later-attempt-or-run rule fails test 3.
Cross-review
Coder
github-copilot/mai-code-2-flash(code),claude-opus-5.5(docs); revieweropenai/gpt-6.1-sol.469ea5c: Not ready, 3 blockers, all accepted and fixed in185fc5c: R1 a comment-read failure dropped a repository's done actions, so the 15-per-run cap could break (now kept, with a test of 15 POSTs after the failure); R2 a success in the same attempt counted (now only a later attempt or run); R3 the cross-SHA and success-then-failure tests held no real jobs (now they do, plus a fake-ghscanner case).185fc5c(base20fd8a3): Ready, Blocking: none. Rebase resolution checked (both spec index lines kept).After merge (outside the graph): Lucilla adds the weekly schedule (Monday 05:30 America/New_York) writing
~/agents/odrade/reports/<date>-flaky-scan/scan.json, runs it once in dry-run mode, then with--apply. This unblocks the CI-reruns metric of t12.