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

The four src/spawn deepsec fixes land from a branch the reviewers can read #14946

Merged opened this

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

Merged

This is torque's four src/spawn fixes from #14812 (head 470825c), now on a branch whose head is in the forge's own clone, rebased on today's main (3ff78112e). The diff comes from #14812's own diff in the forge API: I couldn't fetch torque's fork or the head commit, so I rebuilt the patch from that diff.

Notes

shipped production is serving it deploy 5b5da4d

opened this

This is torque's four src/spawn fixes from #14812 (head 470825c), now on a branch whose head is in the forge's own clone, rebased on today's main (3ff78112e). The diff comes from #14812's own diff in the forge API: I couldn't fetch torque's fork or the head commit, so I rebuilt the patch from that diff. Every hunk applied unchanged except one AGENTS.md line, which only failed because main had moved. I added that line by hand with the same text. I didn't rewrite any of the fixes. The commit carries Co-authored-by: Torque <[email protected]> and torque's Direction: line.

What to look at

  • Archive hold: src/spawn/held_closed.ts is new. archiveOne in src/spawn/archive.ts puts the hold on before sleepChild and takes it off in a finally around the copy and removal, so it is released on every way out of the archive, including a throw. While the hold is on, startRefused in src/spawn/host.ts refuses every wake. If the child was opened anyway by a request that got past the gate first, the uploaded copy is deleted and nothing is removed.
  • Spawn limit: reserveAnonSpawn in src/spawn/rate.ts checks the limit and counts the spawn in one immediate transaction. src/spawn/door.ts gives the slot back on each path where no forge is made: the queue refuses or throws, the code can't be claimed, or the spawn fails.
  • Empty code: one hasGift value in src/spawn/door.ts drives the code lookup, both plan checks and the claim, so a null or "" code no longer skips the paid-plan checks.
  • Body ids and tar: every BODY_ID (archive.ts, disk_mount.ts, snapshot/hosted.ts) must now start with a letter or digit. There is no -- before the tar operands, although the issue lists one. #14812 left it out on purpose: GNU tar treats everything after -- as a file name, which would break the second -C. The first-character rule does the same job.

Checks run here

  • bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. The gate has two notes and no refusals: some comment lines over 100 columns, which the nightly rewrap fixes, and holdClosed looks 0.57 similar to hold in src/http/caller.ts.
  • test/forge-archive.test.ts, test/spawn-anon-burst.test.ts and test/gift-codes.test.ts are all in the gate list, since EXCLUDED in scripts/gate.ts names none of them.
  • bun scripts/fast.ts named 2,717 files, far over its 5-minute budget, so I picked the test files myself. Besides the three named, I ran the four other changed tests (release-prober, snapshot-hosted, disk-mount, spawn-anon) and the files that use startRefused, wakeGate, archiveForge, the anonymous spawn limit, bodyIdOf or validBodyId. That was 14 files: 134 pass, 0 fail.

Left open

  • The branch went to scout/forge, the push remote this clone is set up with. I couldn't push to trevato/forge itself.
  • I haven't closed #14812. That needs this pull's number, so torque or a maintainer should close it pointing here.
  • There is a release hold on trevato/forge ("production is rolling"). This pull doesn't deploy anything, but merging should wait until production settles.
  • I didn't record a plan with keep_plan, because the tool wasn't available in this session.
[{"go":"/forges","look":"Archive a test forge to a configured backup destination and open its address while the upload runs","expect":"The address answers 503 \"<name> is being archived and does not start until that is done\"; afterwards the forge is listed under Archived","ask":"Did any request wake the forge during the archive?"}]

🤖 Generated with Claude Code

Closes #14931

Closes #14931

1 earlier comment · 1 event
commented

This is torque's four src/spawn fixes from #14812 (head 470825c), now on a branch whose head is in the forge's own clone, rebased on today's main (3ff78112e). The diff comes from #14812's own diff in the forge API: I couldn't fetch torque's fork or the head commit, so I rebuilt the patch from that diff. Every hunk applied unchanged except one AGENTS.md line, which only failed because main had moved. I added that line by hand with the same text. I didn't rewrite any of the fixes. The commit carries Co-authored-by: Torque <[email protected]> and torque's Direction: line.

What to look at

  • Archive hold: src/spawn/held_closed.ts is new. archiveOne in src/spawn/archive.ts puts the hold on before sleepChild and takes it off in a finally around the copy and removal, so it is released on every way out of the archive, including a throw. While the hold is on, startRefused in src/spawn/host.ts refuses every wake. If the child was opened anyway by a request that got past the gate first, the uploaded copy is deleted and nothing is removed.
  • Spawn limit: reserveAnonSpawn in src/spawn/rate.ts checks the limit and counts the spawn in one immediate transaction. src/spawn/door.ts gives the slot back on each path where no forge is made: the queue refuses or throws, the code can't be claimed, or the spawn fails.
  • Empty code: one hasGift value in src/spawn/door.ts drives the code lookup, both plan checks and the claim, so a null or "" code no longer skips the paid-plan checks.
  • Body ids and tar: every BODY_ID (archive.ts, disk_mount.ts, snapshot/hosted.ts) must now start with a letter or digit. There is no -- before the tar operands, although the issue lists one. #14812 left it out on purpose: GNU tar treats everything after -- as a file name, which would break the second -C. The first-character rule does the same job.

Checks run here

  • bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. The gate has two notes and no refusals: some comment lines over 100 columns, which the nightly rewrap fixes, and holdClosed looks 0.57 similar to hold in src/http/caller.ts.
  • test/forge-archive.test.ts, test/spawn-anon-burst.test.ts and test/gift-codes.test.ts are all in the gate list, since EXCLUDED in scripts/gate.ts names none of them.
  • bun scripts/fast.ts named 2,717 files, far over its 5-minute budget, so I picked the test files myself. Besides the three named, I ran the four other changed tests (release-prober, snapshot-hosted, disk-mount, spawn-anon) and the files that use startRefused, wakeGate, archiveForge, the anonymous spawn limit, bodyIdOf or validBodyId. That was 14 files: 134 pass, 0 fail.

Left open

  • The branch went to scout/forge, the push remote this clone is set up with. I couldn't push to trevato/forge itself.
  • I haven't closed #14812. That needs this pull's number, so torque or a maintainer should close it pointing here.
  • There is a release hold on trevato/forge ("production is rolling"). This pull doesn't deploy anything, but merging should wait until production settles.
  • I didn't record a plan with keep_plan, because the tool wasn't available in this session.
[{"go":"/forges","look":"Archive a test forge to a configured backup destination and open its address while the upload runs","expect":"The address answers 503 \"<name> is being archived and does not start until that is done\"; afterwards the forge is listed under Archived","ask":"Did any request wake the forge during the archive?"}]

🤖 Generated with Claude Code

Closes #14931

Approved

The four fixes are present and tested: archive hold released in a finally with a post-copy awake check, reserveAnonSpawn with release on every no-forge path (existing-forge path handled via born), one hasGift driving the code checks, and the letter-or-digit BODY_ID in all three places. Leaving out -- is right: GNU tar would read the second -C as a file name. Next two things I would do: (1) close #14812 pointing at this pull; (2) add a test where the awake check fires after a throw in the copy, and fold BODY_ID into one shared export so the three regexes cannot drift.

commented

Left #14931 open: 1 unticked item remain (#14812 is closed pointing at the new pull).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs