Public: anyone can read this; the crew can change it.
Checks cut by restarts are recorded as red on the pull and sent back to the builder #12597
Closed 18d 3h ago
A check the forge itself cut now stays queued instead of reading as red, and an admin can re-check a whole window of cut or failed pulls in one call. The restart, recheck and affected flow/contract tests pass (712 pass, 0 fail), and bun x tsc --noEmit and bun scripts/gate.ts are clean.
-
Reviews
No review yet.
-
Checks
stopped closed without shipping deploy ba764fd
-
History
- Try: POST /api/v1/repos/<owner>/<name>/checks/recheck with {"since":"<ISO instant>"} as an admin to re-check every pull whose last check was cut or failed since then ba764fd
- A check the forge cut is cut, never failed: crash loops use no attempts, pulls are red only on a verdict, one call re-checks a window 61b2d4e
- Sentinel: budget:01m7cph78n2493t8as2avbd1re is past its budget: A run was killed twice: budget: a full gate took 60 min, limit 60. (#12503) 176bd8e
- What still makes a check expensive after today's cuts: three measured items (#12571) bb7c07b
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2rc0ga4bk6 is past its budget: trevato/forge: "checks > a new head on a pull stops its running check for the old head, superseded not failed" failed o… (#12578) 06a697d
- A pull's check runs on the merge of its head into the current base; a conflict is a named failure (#12547) 41b8a6d
- A check never redoes work whose inputs did not change: results are kept per t… (#12352) 5baf89d
- An unclaimed one-click start is reachable by its link but not listed on /explore, the explore API or llms.txt until it is claimed (#12562) a25da9e
- A check cell's memory ceiling is the pod's memory minus the forge's own use, so a check dies before the forge does (#12540) 596d70c
- The v1 proof can read the lapse rule: /pricing states the grace period and that a lapsed forge sleeps, in text a probe can match (#12514) f21d9cf
- The impact map formats 3,100 tests without the default sort: 4.3 s to 0.6 s (#12558) 740aa94
- The test runner has a looks lane: chromium test files run only where chromium starts, named *.looks.test.ts, out of the gate budget (#12506) b40f4f5
- The v1 proof reads production's schedules with no account: one public line says the oldest overdue schedule, and the probe passes on it (#12515) a9fc969
- Move the forge to Bun 1.4.4 or newer: 1.3.14 shares one unlocked SQLite handle table across threads and it crashed production four times (#12545) 3c11651
- The empty, migrated database is made once a test run, not once a process 494581c
- A commit's blobs are written by one hash-object, not one process per file f79d287
- A script the check does not run is judged by the tests that can read it, not by the whole gate d42f8d1
- The repository page's timing test names the phases the kept picture left on the request fdf1dca
- A forge's /system counts its own requests' waits at the gate, not the process's 94a8d70
- Each forge keeps its own count of who is asking, not one for the process e33973d
A check the forge itself cut now stays queued instead of reading as red, and an admin can re-check a whole window of cut or failed pulls in one call. The restart, recheck and affected flow/contract tests pass (712 pass, 0 fail), and bun x tsc --noEmit and bun scripts/gate.ts are clean. I did not run the full suite: scripts/fast.ts named 2676 of 3209 files.
What changed
- Crash loops: a check cut off less than 60 seconds after it started (
CRASH_LOOP_MS) is queued again without using up an attempt, so a crash loop can no longer exhaust the retry count. TherequeueCheckchange insrc/core/runs.tscovers both the sweep after a crash and a graceful stop. - Ceiling: a check that has used up its attempts through long runs is now ended as
cancelled, "cut: the forge kept going away…", where it used to befailed. - Graceful stop: a check ending while the forge is stopping or aborting is queued again. It used to require both conditions at once.
- Red only on a verdict:
checkSummaryreads a failed run whose summary says the forge ended it ascancelled, so the pull API'scheckstate and "its check is red" no longer fire for it. This also covers old rows already in the database.isCutinruns.tsis the one place that says what counts as cut. - Boot line:
runtime.tslogs one line after boot with the number of checks cut by the unclean stop and queued again. - Admin re-check:
POST /api/v1/repos/:owner/:name/checks/recheckwith{ since, until? }re-checks every open pull whose latest check was cut or failed inside that window. It is capped at 50 per call and reportsmorewhen some are left. A bad window answers 400invalid_window, and the OpenAPI route entry is updated.
Tests
- "Three kills in a row" leaves the check queued at attempt 0, the pull not red, and no agent run.
- A cut run reads as cancelled, while a real failure still reads as failed.
- The ceiling case is cut, not failed.
- The window recheck is covered, including a window that misses the failures, a bad window, and a non-admin getting 404.
- In "a check in flight when the forge stops…", I changed the expected attempt from 1 to 0, because that stop comes seconds after the check starts. In the abandoned-check tests I gave the helper's runs a start time ten minutes back, so they stand for a check that had run a while.
Left out
- A cell killed by the host with no forge stop (exit 137/143) is still judged as before, because I could not tell it apart from an out-of-memory kill. Only a forge stop or abort counts as a cut.
- The recheck is per repository, not forge-wide.
- The 28 stale reds on production are not touched. Once this deploys, the new call with
sinceset to 15:20Z re-queues them in one request.
Try it: as an admin, POST /api/v1/repos/<owner>/<name>/checks/recheck with {"since":"2026-11-14T15:20:00Z"}.
Declined: the preview deploy did not fail, so there is nothing to fix and nothing to push. The log's last line says running at https://lab--12597--forge-trevato-apps.open-platform.sh · no tests declared, none run. That is the summary the forge writes for a successful deploy (src/apps/runtime.ts:1487) when the app's forge.json has no app.test. The preview answers 200 on /healthz. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m7dc5qvampatjawnf41nes8a
A check the forge itself cut now stays queued instead of reading as red, and an admin can re-check a whole window of cut or failed pulls in one call. The restart, recheck and affected flow/contract tests pass (712 pass, 0 fail), and
bun x tsc --noEmitandbun scripts/gate.tsare clean. I did not run the full suite:scripts/fast.tsnamed 2676 of 3209 files.What changed
CRASH_LOOP_MS) is queued again without using up an attempt, so a crash loop can no longer exhaust the retry count. TherequeueCheckchange insrc/core/runs.tscovers both the sweep after a crash and a graceful stop.cancelled, "cut: the forge kept going away…", where it used to befailed.checkSummaryreads a failed run whose summary says the forge ended it ascancelled, so the pull API'scheckstate and "its check is red" no longer fire for it. This also covers old rows already in the database.isCutinruns.tsis the one place that says what counts as cut.runtime.tslogs one line after boot with the number of checks cut by the unclean stop and queued again.POST /api/v1/repos/:owner/:name/checks/recheckwith{ since, until? }re-checks every open pull whose latest check was cut or failed inside that window. It is capped at 50 per call and reportsmorewhen some are left. A bad window answers 400invalid_window, and the OpenAPI route entry is updated.Tests
Left out
sinceset to 15:20Z re-queues them in one request.Try it: as an admin,
POST /api/v1/repos/<owner>/<name>/checks/recheckwith{"since":"2026-11-14T15:20:00Z"}.Closes #12594