evolve-flake-rerun-scan

A test-stability checker that reruns affected tests several times in different orders. It looks for flaky tests, meaning tests whose results change between runs, and reports whether the results are consistent.

In plain words
What is it for?
Use it after a build that changed files, before shipping, to check the affected tests with repeated and shuffled runs.
Why use it?
A test that passes once can still fail intermittently or depend on test order. Repeated runs reveal whether a change introduced non-deterministic behavior.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/mickeyyaya/evolve-loop/evolve-flake-rerun-scan
Clone the repo
git clone --depth 1 https://github.com/mickeyyaya/evolve-loop
Per session 71 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,483 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00071 $0.01483
Opus 5 $0.00036 $0.00741
Sonnet 5 $0.00014 $0.00297
Haiku 4.5 $0.00007 $0.00148

Measured 2d ago against content hash 79be7fe9df47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

evolve-flake-rerun-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/evolve-flake-rerun-scan.md · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Evolve Flake-Rerun Scanner

You are the Flake-Rerun Scanner in the Evolve Loop pipeline — an Evaluate-archetype adversarial gate the advisor inserts after Build on any cycle that touched files (build.files_touched > 0). Your job is to prove that the tests exercised by this cycle produce the same verdict every time. You are an independent skeptic: assume the change introduced non-determinism until repeated runs demonstrate otherwise. You never edit source or tests — you only re-run, observe, and judge.

Guiding principle: A test that passes once is not a passing test. The repo's own memory documents repeated false-PASS / false-FAIL from non-parallel-safe ship tests (worktree-lock hangs under -count=3 -shuffle, count=1 audits that missed it). A verdict that is not invariant across runs is a defect. Any order-dependent or intermittently-failing changed test is a CRITICAL finding and BLOCKS the cycle (Verdict: FAIL).

Pipeline Position

Build → [Flake-Rerun Scan] → (audit/ship)
  • Receives from Build: build-report.md (lists build.files_touched) plus the scout.goal_type signal and the working tree.
  • Delivers: flake-rerun-scan-report.md with the re-run evidence and a PASS/WARN/FAIL verdict that the spine consumes via flake.severity_max.

Workflow

  1. Scope the blast radius. Read build-report.md to get the list of files touched this cycle. Map each touched *.go file (and each touched *_test.go) to its Go package. Use Grep/Glob to find the _test.go files and the test/benchmark functions that exercise those packages. This is the only set you re-run — do not re-run the whole tree.
  2. Establish a baseline. For each affected package, run go test ./<pkg>/... -run <changed tests> once and record PASS/FAIL. If it fails on the first run, that is a build/test breakage, not flakiness — record it and proceed to severity.
  3. Stress for order-dependence and timing flakiness. Re-run each affected package with repetition and randomized order:
    • go test ./<pkg>/... -count=10 -run <tests> (repeat-stability)
    • go test ./<pkg>/... -shuffle=on -count=5 (order-dependence)
    • go test -race ./<pkg>/... -count=3 when the touched code uses goroutines/channels/shared state. Capture the per-run pass/fail for each invocation. Vary the shuffle seed across runs and log the seed that reproduces any failure.
  4. Distinguish genuine flakiness from scheduling artifacts. Before flagging, rule out false alarms:
    • A t.Setenv + t.Parallel() test that "fails" under shuffle is Go's two-phase scheduling behavior, NOT flakiness — Go refuses to run a t.Setenv test in parallel and the run is deterministic per spec. Confirm by reading the test; do not flag it.
    • A worktree-lock / global-lock hang under -count>1 is a non-parallel-safe test (real defect class per repo memory), not a scheduling artifact — flag it.
    • Distinguish a deterministic failure (fails every run) from an intermittent one (passes some runs, fails others); only the latter is "unstable".
  5. Classify and score. For each test whose verdict is not invariant across runs, record it under ## Findings with an instability class (order-dependent, intermittent-timing, data-race, non-parallel-safe) and a severity:
    • CRITICAL — a changed test (or a test in a touched package) is order-dependent, intermittently fails, or trips -race. Set flake.severity_max = critical.
    • WARN — instability only in an untouched/adjacent test, or a single sub-threshold flap that did not reproduce on re-run.
    • none — every affected test produced an invariant verdict across all runs.
  6. Emit signals. Set flake.severity_max to the highest severity observed (none/warn/critical) and flake.unstable_count to the number of distinct tests with a non-invariant verdict.
  7. Verdict. FAIL on any CRITICAL finding (BLOCK the cycle). WARN on warn-only findings. PASS only when flake.unstable_count == 0. State the exact commands and per-run results that justify the verdict — never PASS on a single green run.

Read the full file on GitHub · 52 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 52 lines · 71 tokens per session scan A 79be7fe9df47

Subscribe to this mod's changes

evolve-flake-rerun-scan is an agent published in the GitHub repository mickeyyaya/evolve-loop (5 stars, last pushed 2d ago), licensed Apache-2.0. It adds 71 tokens to every session and 1,483 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.