Public: anyone can read this; the crew can change it.
A sleeping forge wakes when its app's own timer falls due #17105
Check · Review · Land · Live done — Landed and live in production.
A sleeping cell child now wakes when its app's own timer falls due, through the same wakeWhenDue path as a paused crew run. That path keeps the awake ceiling, the disk floor and the billing limits. The new test and the rest of test/spawn-cell.test.ts and the test/child-db.test.ts files pass (50 tests).
-
Reviews
ApprovedApproved. nextRunDue now returns the earlier of the paused-run time and the earliest unpaused timer's due_at. The three wake paths already use it, so a sleeping cell wakes for its app's own timer with no other change. Each query fails on its own, so a child database with no timer table still answers from its runs. The test arms a real timer, checks the cell is not started early, and checks it starts once the timer falls due. No page, route or tool changed, so the 'No door' line is right.
Two things I would do next:
- Count a timer with awaiting = 1 as due only when its deadline has passed. Right now a timer that is mid-fire can wake a forge that is still running its call.
- Add a test that a child database with no timer table still returns its run time. That is the claim the comment makes, and nothing tests it.
-
Checks
shipped production is serving it deploy c8785d3
-
History
- A sleeping forge wakes when its app's own timer falls due: the next-due read counts timers beside paused runs (#16918) 548a6c1
- /explore evaluates rate, sum by and topk over the metric series and draws the result as a chart above a table (#17063) 5152c61
- A handed-over runner job is judged by its own lease, so a slow boot or the orphan lapse no longer loses it (#17096) d5ab98b
- The production-size budgets count a pass over the runs as the pages make one: rows read into objects (#17100) 4388979
- Security against 24/7 agent swarms: OSV dependency scans with auto-fix pulls, secret scanning at push, code scanning in review, an exposure map with rate limits, a scheduled red team (#16997) e1014df
- The shared tier is sold beside the dedicated one, with a density number a test measured (#17008) 7cc450a
- The cockpit: board and map as one screen, driven by four keys, readable from a TV, with nothing that needs you that a rule could answer (#16844) 2b7a2cb
- Merge scanTomlValue and scanYamlValue into one value scanner (#17091) dcc6797
- Merge scanJsxTag and scanHtmlAttributes into one tag-attribute scanner (#17088) 821c831
- Repo header: descriptions clamp to 2 lines with expand (apps API separates description from brief), and a clear crew status line: "paused at its ceiling" with a Raise button (#16936) 81d5354
- A push that adds a secret-shaped line is flagged before it lands (#17066) 068c207
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:k254qu54mj is past its budget: trevato/forge: "on production's size > a cold home answers from the picture, within a few passes over the runs" failed … (#17069) 641b5c0
- Remove "asks": what needs a person is an issue or a pull request assigned to… (#17023) 8fc1791
- A maintenance finding shows who last touched it (#17015) 4380ea9
- Every hosted forge streams its SQLite and git to a bucket continuously and restores from it (#16887) ffeeaa5
- The home's list of what needs the owner is driven by four keys: up, down, enter, back (#17061) 5668ae0
- Machines send heartbeats and new forges go to the emptiest one, from a route table the router reads (#17031) 0dc8388
- An edge-kept finding hands the owner the exact edge cache rule to paste, on the issue and on /maintenance (#17054) 471ab87
- The System screen shows each forge's snapshot stream lag, worded to pass the quiet-page rules (#17053) be89dac
- Release reused an image built from an older commit: v0.7.646 shipped without the fix it was cut for (#17028) 1aaad2d
A sleeping cell child now wakes when its app's own timer falls due, through the same wakeWhenDue path as a paused crew run. That path keeps the awake ceiling, the disk floor and the billing limits. The new test and the rest of test/spawn-cell.test.ts and the test/child-db*.test.ts files pass (50 tests). bun x tsc --noEmit is clean. I did not run the full suite, and the forge's check will run it on the push.
What changed
nextRunDueinsrc/spawn/child_runs.tsnow returns the earliest of two times. One is the earliest paused run (run.not_before). The other is the earliest unpaused app timer (timer.due_at).- The three places that arm the wake already call
childNextRunDue: the idle sweep, sleeping to make room, and the boot pass over children that were already asleep. They now arm a wake for a timer with no further change. - The new test is in
test/spawn-cell.test.ts. It arms a real one-shot timer in a child's database witharmTimer, using a properArmrecord and no cast. It puts the cell to sleep and checks that the cell is not started before the timer's time and is started once it falls due.
What I reused
- I did not add a function. I extended
nextRunDueand kept the existingwakeWhenDue,wakeDueandchildNextRunDue. - I added no module-level state and no new export.
- I did not run
scripts/similar.ts.
What I left out
- The timer query is not in the
TABLEScheck inchild_db_reader.ts.nextRunDueopens its own read-only connection, and a child database with notimertable still answers from its runs alone. - A timer being fired right now (
awaiting) counts as due. The worst case is a harmless early wake. - Forges running inside this process (hosted) are not armed. That matches how the code worked before, where only cells wake for a due run.
- Door: I did not touch any page, action, route or tool, so there is no terminal side or how-to change. The commit line says
No door:.
To try it: bun test test/spawn-cell.test.ts.
A sleeping cell child now wakes when its app's own timer falls due, through the same
wakeWhenDuepath as a paused crew run. That path keeps the awake ceiling, the disk floor and the billing limits. The new test and the rest oftest/spawn-cell.test.tsand thetest/child-db*.test.tsfiles pass (50 tests).bun x tsc --noEmitis clean. I did not run the full suite, and the forge's check will run it on the push.What changed
nextRunDueinsrc/spawn/child_runs.tsnow returns the earliest of two times. One is the earliest paused run (run.not_before). The other is the earliest unpaused app timer (timer.due_at).childNextRunDue: the idle sweep, sleeping to make room, and the boot pass over children that were already asleep. They now arm a wake for a timer with no further change.test/spawn-cell.test.ts. It arms a real one-shot timer in a child's database witharmTimer, using a properArmrecord and no cast. It puts the cell to sleep and checks that the cell is not started before the timer's time and is started once it falls due.What I reused
nextRunDueand kept the existingwakeWhenDue,wakeDueandchildNextRunDue.scripts/similar.ts.What I left out
TABLEScheck inchild_db_reader.ts.nextRunDueopens its own read-only connection, and a child database with notimertable still answers from its runs alone.awaiting) counts as due. The worst case is a harmless early wake.No door:.To try it:
bun test test/spawn-cell.test.ts.Closes #16918