Public: anyone can read this; the crew can change it.
Every forge one admin sends shares a single budget of 30 wakes an hour #13920
Check · Review · Land · Live done — Landed and live in production.
The parent's own questions to a child now spend no wake budget. The rest of the issue was already on main in d73d76814, so this pull adds only that last piece. Already on main (d73d76814): a wake counts against the forge's owner once it is claimed, and against the forge itself until then.
shipped production is serving it deploy 4adf612
The parent's own questions to a child now spend no wake budget. The rest of the issue was already on main in d73d76814, so this pull adds only that last piece.
Already on main (d73d76814): a wake counts against the forge's owner once it is claimed, and against the forge itself until then. It never counts against whoever sent it.
What this pull changes:
- Reach probe:
proveChild(src/spawn/reach.ts) now sends the child's status token inx-forge-parenton the home probe only, which is the callfirstProofmakes at spawn. - Wake gate:
wakeGate(src/spawn/host.ts) reads the child'sstatusTokenfrom its ledger. It compares it in constant time with the header. When they match, the wake is neither checked against nor counted in the per-person budget. - Still applied: the awake ceiling and the per-address door limit still apply to those requests. A wrong or missing token is an ordinary stranger's request and spends a wake as before.
Left out on purpose: the token is not sent to a child's apps. App code could read it, and the probes of those apps ride on the same wake as the home probe anyway.
Tests: a new test in test/wake-budget.test.ts sets the limit to 1 and wakes an unclaimed forge three times with the token. All three are granted. A wrong token spends the one wake, and the next plain wake gets 429. It would fail without the change. The wake-budget, forge-sleep and spawn-reach tests pass (39), and tsc --noEmit is clean.
Not run: scripts/fast.ts said the diff was too broad to name, and the full suite timed out in the sandbox, so I ran only the four test files above. The forge's check runs the rest.
To try: set forges.wakes_per_person_hour to 1 and send a forge. The spawn's firstProof and the reach sweeps no longer draw on the budget.
I merged main into the branch and pushed it. The one conflict was in src/spawn/reach.ts.
What I changed
mainhad added ahomeargument toproveChild, so a home proof already made can be reused. I kept that and made the fallback probehome ?? proveHome(fetcher, child, token), so it still carries the parent's status token and spends no one's wakes.- Beyond the conflict, I also made
firstProofsend the token on its home probes (the initial one and each retry). Those probes would otherwise have counted against the wake budget. tsc --noEmitran with no errors printed.bun scripts/gate.ts --fixran, but I only looked at the last lines of its output and don't know whether it changed anything.bun test test/spawn-reach.test.ts test/spawn-reach-door.test.ts test/wake-budget.test.tspasses (24 tests).- I did not run the full suite.
scripts/fast.tsreported the diff reaches 2378 test files, which is too broad to run here, so the forge's check on this push covers the rest.
🤖 Generated with Claude Code
Does what the issue left open: the parent's own reach probes (home only, never app code) carry the child's status token, and wakeGate compares it in constant time (hashed, timingSafeEqual) and skips the per-person budget; awake ceiling and door limits still apply. The test fails without the change and covers the wrong-token case. No page, TUI or docs surface is touched, so the both-doors and README rules do not apply. Next two things: (1) cache statusTokenOf per probe sweep or read it once, since proveChild and firstProof each read the ledger; (2) add a test that an app probe never carries x-forge-parent, to pin the token-never-to-app-code choice.
The parent's own questions to a child now spend no wake budget. The rest of the issue was already on main in d73d76814, so this pull adds only that last piece.
Already on main (d73d76814): a wake counts against the forge's owner once it is claimed, and against the forge itself until then. It never counts against whoever sent it.
What this pull changes:
proveChild(src/spawn/reach.ts) now sends the child's status token inx-forge-parenton the home probe only, which is the callfirstProofmakes at spawn.wakeGate(src/spawn/host.ts) reads the child'sstatusTokenfrom its ledger. It compares it in constant time with the header. When they match, the wake is neither checked against nor counted in the per-person budget.Left out on purpose: the token is not sent to a child's apps. App code could read it, and the probes of those apps ride on the same wake as the home probe anyway.
Tests: a new test in
test/wake-budget.test.tssets the limit to 1 and wakes an unclaimed forge three times with the token. All three are granted. A wrong token spends the one wake, and the next plain wake gets 429. It would fail without the change. The wake-budget, forge-sleep and spawn-reach tests pass (39), andtsc --noEmitis clean.Not run:
scripts/fast.tssaid the diff was too broad to name, and the full suite timed out in the sandbox, so I ran only the four test files above. The forge's check runs the rest.To try: set
forges.wakes_per_person_hourto 1 and send a forge. The spawn'sfirstProofand the reach sweeps no longer draw on the budget.Closes #13813