PS-3BD799E0 · CASE 01
captures payment before sending the receipt
- seed
- 0
- randomSeed
- 0
- timerJitter
- 0 to 27 ms
- reproduces
- 30/30 runs fail
- found in
- 6 probes, 2 shrink steps
The exorcist for flaky tests
A 1-in-30 ghost becomes a 30/30 bug you can replay. A Kiro agent fixes it, and six deterministic seals decide whether the fix ships.
Fig. 1 · the subject
01Detect
6 of 13 tests in haunted-demo failed at least once, each run under its own chaos vector. Hover or focus a cell to see the vector that run used.
Phase 1 shows the scan: scattered failures. Phase 2 shows the possession seed failing every run. Phase 3 shows the same runs passing after the exorcism.
failedpassedskipped
02Possess
A fast-check search over the chaos vector finds a failing run, then shrinks it to the perturbations that matter. What is left fails every time: the possession seed.
PS-3BD799E0 · CASE 01
03Autopsy
Which perturbation was active, which line it reached, and which assertion broke. Read top to bottom.
expected [ 'payment-captured', 'receipt-sent' ], actual [ 'receipt-sent', 'payment-captured' ]
04Exorcise
The exorcist agent proposes a fix. Deterministic code accepts or rejects it against the canon, E-1 to E-6. The exorcisms in this demo were recorded from real poltergeist exorcise runs with the headless Kiro agent, and replay here without a Kiro call.
1 revision · 419 s · branch exorcist/timer-race--captures-payment-before-sending-the-receipt
| Seal | Rule | Evidence | Result |
|---|---|---|---|
| E-1 | seed reproduces before the fix | seed fails 30 of 30 runs before the fix (needs 29) | ✓ pass |
| E-2 | seed passes after the fix | seed fails 0 of 30 runs after the fix (needs 0) | ✓ pass |
| E-3 | 500 chaos seeds + full suite | 500 chaos vectors: 0 failed (sample seed 1189583782); full suite: 16 tests, 0 failed, 1 other known ghost ignored | ✓ pass |
| E-4 | test not weakened | no assertion removed or loosened, no skip, retry or longer timeout in 2 changed files | ✓ pass |
| E-5 | only autopsy files touched | changed src/checkout.ts, tests/timer-race.possessed.test.ts; all inside the autopsy scope | ✓ pass |
| E-6 | regression test pins the seed | tests/timer-race.possessed.test.ts pins no seed values and runs in 16 ms | ✓ pass |
05Proof
Failure rate in the scan before the fix, and under 500 fresh chaos seeds after it.
captures payment before sending the receipt
16.7%→0.0%
→Try it
Runs on the bundled haunted-demo: scan, possess, and a replayed exorcism. No credits, nothing leaves your machine.
$ npx -y github:let-the-dreamers-rise/poltergeist demo
$ npx -y github:let-the-dreamers-rise/poltergeist demo --runs 30┌──────────────────────────────────────────────┐│ POLTERGEIST · scan of haunted-demo · 30 runs │└──────────────────────────────────────────────┘ TEST FLICKER RATE VERDICT────────────────────────────────────────────── ────────────────────────────── ────── ─────────catalog prices a vip seat ☠☠█☠███☠☠█☠☠☠☠☠☠☠█☠☠██☠█☠██☠██ 56.7% HAUNTEDshared cart starts empty ██☠█☠☠☠██☠███████☠██☠☠█☠█☠☠█☠☠ 43.3% HAUNTEDoffers a valid next slot █☠███☠█☠█☠██☠█☠██☠☠████☠█☠████ 33.3% HAUNTEDreads seat availability █☠██☠██☠███☠█☠██☠████☠☠███████ 26.7% HAUNTEDcaptures payment before sending the receipt ████████☠█☠██████☠██☠████☠████ 16.7% HAUNTEDgives 20 bookings unique ids █████☠████████☠███████████████ 6.7% HAUNTEDstable controls counts seats in a fresh cart ██████████████████████████████ 0.0% STABLEstable controls formats booking ids ██████████████████████████████ 0.0% STABLEstable controls formats slot labels ██████████████████████████████ 0.0% STABLEstable controls rejects unknown skus with a l… ██████████████████████████████ 0.0% STABLEstable controls totals a fresh cart ██████████████████████████████ 0.0% STABLEcatalog loads the catalog ██████████████████████████████ 0.0% STABLEshared cart adds a seat ██████████████████████████████ 0.0% STABLE ✗ 6 haunted, 0 possessed, 7 stable of 13 tests over 30 runs $ npx -y github:let-the-dreamers-rise/poltergeist possess --file tests/timer-race.test.ts -t "captures payment before sending the receipt"┌──────────────────────────────────────────────────────────────────────────────────┐│ POLTERGEIST · possess captures payment before sending the receipt · haunted-demo │└──────────────────────────────────────────────────────────────────────────────────┘ possession seed seed=0 randomSeed=0 timerJitterMs=27✗ POSSESSED: the seed fails 30 of 30 runs (E-1 met) $ npx -y github:let-the-dreamers-rise/poltergeist exorcise timer-race--captures-payment-before-sending-the-receipt --dry-runCHECK RULE RESULT───── ────────────────────────────── ──────E-1 seed reproduces before the fix ✓ pass seed fails 30 of 30 runs before the fix (needs 29)E-2 seed passes after the fix ✓ pass seed fails 0 of 30 runs after the fix (needs 0)E-3 500 chaos seeds + full suite ✓ pass 500 chaos vectors: 0 failed (sample seed 1189583782); full suite: 16 tests, 0 failed, 1 other known ghost ignoredE-4 test not weakened ✓ pass no assertion removed or loosened, no skip, retry or longer timeout in 2 changed filesE-5 only autopsy files touched ✓ pass changed src/checkout.ts, tests/timer-race.possessed.test.ts; all inside the autopsy scopeE-6 regression test pins the seed ✓ pass tests/timer-race.possessed.test.ts pins no seed values and runs in 16 ms seed failure rate 30/30 (100.0%) → 0/30 (0.0%) ✓ EXORCISED: all six seals hold
⌘Built with Kiro
Requirements written in EARS form. Each task in tasks.md traces back to one.
Product, tech, the exorcism canon and this design system, loaded into every agent call.
Verify on save, canon sync, a fence that denies test-weakening writes, and report regeneration.
kiro-cli chat --no-interactive in a git worktree, up to four revisions per ghost.
The agent, steering, canon and fence in one install: kiro-cli powers install ./power.