Public: anyone can read this; the crew can change it.

A wake counts against the forge's owner once it is claimed and against the forge itself until then, never against whoever sent it #13903

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Issue #13813. forges.wakesperpersonhour (default 30) was counted against the ledger's ownerId, which is whoever sent the forge. All 18 forges on production were sent by one admin, so the whole host had 30 wakes an hour; measured on 2026-11-16, one list call spent 15 of them and the ramp needed the limit raised to 200.

Notes

shipped production is serving it deploy 4adf612

opened this

Issue #13813. forges.wakes_per_person_hour (default 30) was counted against the ledger's ownerId, which is whoever sent the forge. All 18 forges on production were sent by one admin, so the whole host had 30 wakes an hour; measured on 2026-11-16, one list call spent 15 of them and the ramp needed the limit raised to 200. A room of people each waking their own forge would have been refused with "waking too often, try in N s".

Whose budget a wake now counts against (wakeBudget, src/spawn/sleep.ts; read in wakeGate, src/spawn/host.ts)

The forge isThe wake counts against
unclaimedthe forge itself. A visitor opening a claim link is never refused because other forges woke
claimedits owner, the person who claimed it (the first admin in the forge's own tables, as the forges list already reads it)
a site admin's ownthe same two rules. See below

Never against the sender: the ledger's ownerId is no longer read for wakes (it still counts a person's forges and storage).

Two things decided from the code, said plainly

  • A site admin is not exempt. forges.per_person and forges.storage_mb exempt site admins in code and in their own words ("site admins are not counted"). The wake limit never did, in code or in words, so that is taken as intended: an admin's own forge is counted like anyone's. What ends here is only the accident that every forge an admin sent for someone else was counted as the admin's.
  • The owner's budget is theirs for that forge. The person who claims a forge is an account on that forge, not on this host, and the address they typed at the claim is not proven, so the host has nothing safe to join one person's forges by (joining by address would let anyone spend a stranger's budget by typing their address). A person who owns three forges therefore has the limit on each, where a person who made three for themselves had it once across them. The key also carries the owner's name, so wakes from before the claim are not counted against the new owner.

The refusal says whose wakes are spent, when the forge can be woken again, and the limit by the name it has in admin limits and where that is; the page and the plain answer (git, API) are the same sentence, and Retry-After is unchanged:

kiln has been woken 30 times in the last hour, which is all of the 30 wakes an hour its owner carol has. It can be woken again in 12 minutes; an admin of this host can raise "Wakes per person per hour" at https://forge.example/admin/limits.

Unclaimed: "... all of the 30 wakes an hour a forge has until someone claims it."

Cost: one read of the sleeping forge's own tables (off the serving thread, childPerson, at most 2 s) before a wake is granted; a forge that is awake, or whose wake is already granted, is not asked. If the read does not come in time the wake counts against the forge itself.

Not in this pull: the limit's value and every other limit are unchanged, and none is added. The parent's own questions (x-forge-parent, the proof at spawn) still spend a wake, as the issue notes; with the budget per forge that is one of 30 for the new forge, not one of the sender's.

Checked: bun x tsc --noEmit exit 0; bun scripts/gate.ts exit 0; on Linux in the 0.7.614 image, the always-run set plus wake-budget (new) and forge-sleep: 1493 pass, 0 fail. The new test's "forges one admin sent do not share a budget" is the measured failure: with the limit at 1, the second forge's first wake was refused before.

🤖 Generated with Claude Code

Approved

Approved. The wake budget is keyed on the forge plus its claimant, or on the forge alone until claimed, and never on the sender. The refusal says whose wakes are spent, the wait, and the limit by its label and URL. The page and the plain-text answer carry the same sentence. Tests cover the key, the wording, and two forges from one sender not sharing a budget. The how-to is updated in docs/features/forge-sleep.md, and README is untouched. It is a narrow fix with no new dependency. I read the diff and tests only; I did not fetch the preview or open the phone and desktop screenshots.

Two things I would do next:

  1. The refusal shows the owner's username to anyone who loads a sleeping forge, signed in or not. Decide whether that is public anyway. If not, say "its owner" without the name on the unauthenticated waking page.
  2. The key changes when an unclaimed forge is claimed, so claiming resets that forge's budget. Add a test that pins this on purpose, or carry the count across. The fresh expression in wakeGate (src/spawn/host.ts) is also dense and would read better as a named helper.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs