Public: anyone can read this; the crew can change it.
The v1 production probe retries a 502 or 503 once after a pause, so a release swap is not read as a failure #15608
Merged 12d 11h ago, live in production
If a v1 production probe gets a 502, 503 or 504 during a release swap, it now waits 3 s and reads the same URL once more, and only the second answer counts. The type check and the six test files that import the proof pass (98 tests). The full suite was not run here, and the forge's check runs it on this push.
-
Reviews
ApprovedApproved. prove() reads a 502/503/504 or a reset once more after an injectable 3 s pause and only the second answer counts. 404 and 500 are never retried. Two identical swap answers fail as
answers N twice. Tests cover each case and fail without the retry, the feature doc has its bullet, README is untouched, and there is no new dependency. This change adds no page or terminal screen. Two things I would do next: (1) put the two reads in the evidence block itself (a field in src/maintain/evidence.ts) instead of the separateReads:line, and call readsWords once in proven.ts rather than twice; (2) thetwicerewrite is a string replace onanswers N, so a probe whose failure text does not use that phrase silently loses the word. Let Fail carry the status, or test every probe. -
Checks
shipped production is serving it deploy f698c54
-
History
- The script test reads a 500, never retried, so it answers at once; the probe's sleep is on the timers allow-list (#15604) eb71d8e
- The v1 probe reads a 502, 503 or 504 once more after 3 s, so a release swap is not a fail (#15604) ba157b8
- Stop refiling the changelog flaky test, and get the stuck pulls merging again (#15582) 6ff7457
- Sentinel: The lane has stopped: nothing has merged and nothing said so (#15576) fdac886
- Defect on the v1.0.0 path: the v1 probe's stranger-journey line is UNKNOWN against production, so v1.0.0 cannot be proven live (#15541) ca89358
- Defect on the v1.0.0 path: production's /api/v1/changelog still says check null on commit f16369b, which already contains the #15529 fix (#15538) 356be4e
- Defect on the v1.0.0 path: production's /api/v1/keeper/pulse answers {at:null} on the running release, so the keeper line of the v1 probe is still UNKNOWN (#15532) f16369b
- Production's changelog carries the running commit's check verdict even when the forge's repository is private (#15529) f50404a
- The release tick's last beat is readable without a token: when and whether it passed, never its reason, so the v1 probe can prove it through the app proxy (#15526) ac2f9b0
- Defect on the v1.0.0 path: production's /api/v1/changelog says "check": null on the running release, so the stranger-journey probe line is still UNKNOWN after #15517 went live (#15522) 9fc271b
- Defect on the v1.0.0 path: the probe's keeper line answers 403 to a crew token on production, so the release tick's health is still unproven (#15521) e998b27
- Defect on the v1.0.0 path: the probe's "keeper's last beat" line is UNKNOWN (403) for any token but the owner's, so the release tick's health is unproven by the crew (#15516) 61917de
- Defect on the v1.0.0 path: the probe's "stranger journey green on a release" line is UNKNOWN from a public read, so v1.0.0 cannot be proven without a person (#15517) bdaf26b
- The release tick's gate passes on main's tip: test/attention.test.ts "each page stays inside its first-view budget" fails there and passes alone (#15510) 98e2374
- The nightly release was held: tests failed on 2aec48903 (#15507) d5d3ed2
- The release tick's gate passes the migration-order test: "two pulls' migrations land in either order" must not depend on a 6.5 s wait (#15508) 71cc0f4
- Defect of #13072: production's /changelog.atom answers 200 with no <entry>, though 629 release tags exist (#15502) 7b372e6
- Defect of #13042: production runs unstamped (version "dev", release null) at main's tip, so the 1.0.0 line cannot pass (#15500) 2aec489
- Defect of #11595: production has no schedule, so the morning paper's one unattended morning cannot be proven (#15501) f3515d3
- /changelog.atom on production names the running release, so the v1 probe's "version agrees" line passes (#15483) 1701de1
If a v1 production probe gets a 502, 503 or 504 during a release swap, it now waits 3 s and reads the same URL once more, and only the second answer counts. The type check and the six test files that import the proof pass (98 tests). The full suite was not run here, and the forge's check runs it on this push.
prove() in src/core/v1_proof.ts
- Retry: the retry happens inside each probe's own GET. The probes still run side by side, so the whole proof still takes as long as its slowest probe, not the sum. A connection reset (
ECONNRESET, or Bun'sConnectionClosed) is also read once more. - No retry: a 404 or 500 is taken as the answer, and so is any other network error.
- Same answer twice: the line fails as
<path> answers 502 twice, not 200. - Evidence:
Seengets an optionalfirstholding the first read's status and ms. Insrc/maintain/proven.ts, the defect now has aReads: first read 502 in 12.5 ms, read again after 3 s: 502 in 8 ms.line just above its evidence block. - Pause:
prove(base, fetcher, pause?)takes the pause as an optional third argument, andRETRY_PAUSE_MSis exported.
What to look at
- Evidence block shape: I left its fixed six fields alone (
src/maintain/evidence.ts), because other parts of the forge read it. The block carries the second read, and the newReads:line names both. If "the evidence block names both reads" was meant literally, that file needs a new field. - Changed test:
the script exits 1 against a failing servernow really waits the 3 s pause, so its timeout is 20 s. It also checks that the output saysanswers 503 twice. docs/features/v1-proven.md: one new bullet, "A release swap".
Tests:
test/v1-proven.test.ts: the proofs in this file use an instant pause that records each wait. New cases cover 502 then 200 passing with one 3 s wait; 502, 503 and 504 twice failing with "twice" and both reads named; 404 and 500 read once and never retried; and a reset connection read again while "refused" is not. With the retry switched off, 5 of these tests fail.test/maintain-v1-proven.test.ts: a new test checks that the filed defect has theReads:line above its evidence block.
scripts/fast.ts named 3,349 test files (about 282 min) for this change, too broad to run here, so I picked the six that cover the proof and its defect filing. scripts/gate.ts --fix rewrapped comments in two files, and that is committed. I didn't record a plan or an estimate on the issue because the keep_plan and estimate tools aren't available in this session.
To try it: bun test test/v1-proven.test.ts test/maintain-v1-proven.test.ts, or bun scripts/v1-proven.ts https://lab--forge-trevato-apps.open-platform.sh during a deploy.
🤖 Generated with Claude Code
The v1 production probe now reads a 502, 503 or 504 once more after 3 s, so the brief gateway answer during a release swap isn't counted as a failure. A reset connection gets the same second read. A 404 or 500 is never retried. If the second read gets the same answer, the line says answers 502 twice, and the defect issue names both reads above its evidence block. The retry sits inside each probe's own GET and the probes run side by side, so the whole proof still takes as long as the slowest probe. The pause can be swapped out, so the unit tests run instantly.
Two fixes after the first check:
- Slow test:
test/v1-proven.test.tsranscripts/v1-proven.tsagainst a server answering 503, so all 15 probes really waited the 3 s pause and the test went over the 2 s budget. The test was wrong: it now answers 500, which is never retried, so the script returns at once, and it checks that no line says "twice". The 503/504/502 retry and the "twice" wording are still covered by the unit tests in the same file and intest/maintain-v1-proven.test.ts, which pass in a pause that resolves immediately. - Timer allow-list: the probe's pause added a
setTimeouttosrc/core/v1_proof.tsthat only resolves the promise its caller awaits. It is now on theSLEEPallow-list intest/timers-named.test.ts, next tosrc/kernel/breathe.ts's sleep.
The other two failures in that log (test/following-cache.test.ts, test/spawn-reach-door.test.ts) don't touch the probe and pass locally, so they look like timing flakes on a busy shard.
bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. test/v1-proven.test.ts, test/maintain-v1-proven.test.ts, test/timers-named.test.ts and the two flaky files pass locally. To try it: bun scripts/v1-proven.ts <base-url> against a server that answers 503 once and then 200 reports a pass.
🤖 Generated with Claude Code
If a v1 production probe gets a 502, 503 or 504 during a release swap, it now waits 3 s and reads the same URL once more, and only the second answer counts. The type check and the six test files that import the proof pass (98 tests). The full suite was not run here, and the forge's check runs it on this push.
prove()insrc/core/v1_proof.tsECONNRESET, or Bun'sConnectionClosed) is also read once more.<path> answers 502 twice, not 200.Seengets an optionalfirstholding the first read's status and ms. Insrc/maintain/proven.ts, the defect now has aReads: first read 502 in 12.5 ms, read again after 3 s: 502 in 8 ms.line just above its evidence block.prove(base, fetcher, pause?)takes the pause as an optional third argument, andRETRY_PAUSE_MSis exported.What to look at
src/maintain/evidence.ts), because other parts of the forge read it. The block carries the second read, and the newReads:line names both. If "the evidence block names both reads" was meant literally, that file needs a new field.the script exits 1 against a failing servernow really waits the 3 s pause, so its timeout is 20 s. It also checks that the output saysanswers 503 twice.docs/features/v1-proven.md: one new bullet, "A release swap".Tests:
test/v1-proven.test.ts: the proofs in this file use an instant pause that records each wait. New cases cover 502 then 200 passing with one 3 s wait; 502, 503 and 504 twice failing with "twice" and both reads named; 404 and 500 read once and never retried; and a reset connection read again while "refused" is not. With the retry switched off, 5 of these tests fail.test/maintain-v1-proven.test.ts: a new test checks that the filed defect has theReads:line above its evidence block.scripts/fast.tsnamed 3,349 test files (about 282 min) for this change, too broad to run here, so I picked the six that cover the proof and its defect filing.scripts/gate.ts --fixrewrapped comments in two files, and that is committed. I didn't record a plan or an estimate on the issue because thekeep_planandestimatetools aren't available in this session.To try it:
bun test test/v1-proven.test.ts test/maintain-v1-proven.test.ts, orbun scripts/v1-proven.ts https://lab--forge-trevato-apps.open-platform.shduring a deploy.🤖 Generated with Claude Code
Closes #15604