Skip to content

fix(flaky-scan): skip dynamic workflows, read runs per day, retry a 5xx read (T801 t2) - #195

Merged
bketelsen merged 2 commits into
mainfrom
lucilla/flaky-scan-dynamic
Nov 4, 2026
Merged

bketelsen merged 2 commits into
mainfrom
lucilla/flaky-scan-dynamic

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #192 (plan T801, task t2, section "Gap 2"). The first live dry run of scripts/flaky-scan.mjs (2026-11-04, --profiles, 39 repositories, 7 days) found 3 defects. The --apply run and the weekly schedule wait for this fix.

  1. False positive from Dependabot. Dependabot update runs are GitHub-generated (path: dynamic/dependabot/dependabot-updates). 1 SHA gets 1 run per ecosystem, all with the job name Dependabot; 1 ecosystem failing and another passing looked like a flaky test (bketelsen/trimlights, SHA 11815ec). Runs whose path starts with dynamic/ are now skipped and not counted.
  2. 1,000-run limit. 1 Actions runs query returns at most 1,000 runs; frostyard/lab has 1,214 runs in 7 days, so events were lost. Runs are now listed 1 UTC day at a time (created=YYYY-MM-DD), deduped by id. A day that still reaches 1,000 is listed in the new repos[].truncatedDays field and printed as a warn line on stderr.
  3. Transient 502. 1 HTTP 502 on a runs list made frostyard/frostread an error. A read that fails with a 5xx is now retried once after 2 s. A write is never retried: a 5xx on a POST can still have created the issue.

The spec docs/specs/flaky-test-scan.md states the 3 rules and the new field. .memory/corrections.jsonl gets 2 lines (the #192 review blockers and this live-run lesson), as the blocker-to-guard rule asks.

Risk tier

Risk tier: 2 — the tool can open issues and comments with --apply; this change narrows what it reports (skips dynamic runs) and only adds reads. No risk path is touched (scripts/flaky-scan.mjs, scripts/lib/flaky-scan.mjs, test/, docs/specs/, .memory/ are not in .github/risk-paths.json).

Docs housekeeping

  • Spec changed alongside the implementing code
  • No new doc; links unchanged

Verification

  • make ci green locally: 217 tests pass (17 in test/flaky-scan.test.mjs, 4 new); check-corrections --base origin/main: 5 lines, append-only.
  • Live dry run of this branch on the 3 affected repositories (--now 2026-11-04T15:00:00Z, exit 0): bketelsen/trimlights 201 runs, 0 flaky (the Dependabot key is gone); frostyard/lab 1,214 runs, truncatedDays: []; frostyard/frostread 89 runs, no error, 1 key.

Revert tests (scratch worktree at 2806aef, node --test --test-reporter=tap test/flaky-scan.test.mjs, 1 revert at a time, restored after each):

Reverted Failing tests
dynamic/ filter removed GitHub-generated dynamic runs (Dependabot) are no flaky events and are not counted
per-day loop replaced by 1 created=>=FROM query --out JSON shape is pinned in the CLI output; runs are read 1 day at a time, deduped by id, and a day with 1000 runs is reported; a 5xx read is retried once; a 5xx write is not retried
5xx retry removed a 5xx read is retried once; a 5xx write is not retried

After merge: 1 dry run and 1 --apply run over the profiles, scan.json in ~/agents/odrade/reports/<date>-flaky-scan/, then the weekly Monday 05:30 schedule.

Cross-review

Coder claude-opus-5.5; reviewer openai/gpt-6.1-sol. Initial review at 88b9228 (base 1b02a12): Ready, Blocking: none, no findings. CI green at that head (docs-gate, risk-paths, fleet-conventions, scaffold-e2e); no risk:high match.

…etry a 5xx read once

The first live dry run (39 repositories, 2026-11-04) showed 3 defects:
- Dependabot runs (path dynamic/...) have 1 run per ecosystem on 1 SHA,
  all with the job name Dependabot: a false flaky event in trimlights.
- frostyard/lab reached the 1,000-run limit of 1 runs query in 7 days.
- 1 HTTP 502 on a runs list made frostyard/frostread an error.

Skip dynamic/ runs, list runs per UTC day (truncatedDays names a day
that still reaches the limit), and retry a 5xx read once after 2 s.
Writes are never retried.
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 4, 2026
@bketelsen
bketelsen merged commit d502e0e into main Nov 4, 2026
5 checks passed
@bketelsen
bketelsen deleted the lucilla/flaky-scan-dynamic branch November 4, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants