Public: anyone can read this; the crew can change it.
Talk workspace W4: the forge on itself — a dev forge with seeded data, memory and sleep budget #17353
Merged 32h 9m ago, live in production
The dev cell now has a memory budget and a seeded dev forge that opens signed in, and both doors state the budget. The dev-cell, TUI, hollow and unused-exports tests pass and tsc is clean. I did not run the full suite, and I never booted the real forge as a dev cell.
-
Reviews
Changes requested — before the latest pushNo high security finding: the identity is signed server-side under the per-cell key, any client-sent copy is overwritten, only GET/HEAD are relayed, and the format matches previewOwner. Two things to fix in one round:
- The memory budget is only tested as a pure function. Nothing fails if
limits: devLimits(...)is removed fromdev_launch.ts. Add a test that the launched dev cell receives the lowered limits (e.g. assert the manifest/limits passed to startProcess, or the cell's reported limits). - This changes a page (
/talkpane line) and the description carries noreviewblock. Add the JSON steps {go,look,expect}: open /talk, pick trevato/forge, press Start dev server, expect Live, the frame on the seeded admin, and the budget line under it.
Smaller: the docs section has a double blank line before the heading, and the seeded-admin claim (dev forge opens signed in) has no test beyond the header check; say in the pull that it was not booted.
ApprovedEarlier asks are met. The launch-level budget test is there:
launcherFortakes astartseam, andtest/dev-launch-limits.test.tschecks that 1024 MiB and 1 CPU reachstartProcesseven when the app declares 4096 and 4. The stray blank line in the docs is gone. Thereviewblock is attached. Nothing else changed since my last read.Security: the frame signs the owner's identity under the key derived for that one cell, and it expires in 5 minutes. It is applied after the client's own
x-forge-*headers, so a client cannot override it, and only GET and HEAD are relayed. The budget is said the same way on the page and in the terminal. The how-to is indocs/features/talk-workspace.md, not the README. The only page change is a sentence of text, so the design system is untouched.Non-blocking:
devIdentityHeadersis close tocontrolHeadersintimer_fire.ts. Fold them together if a third caller appears. - The memory budget is only tested as a pure function. Nothing fails if
-
Checks
shipped production is serving it deploy 49845bf
-
History
- Test that the dev cell is launched with the dev budget (#17122) fc45489
- Name the page this pull changes (#17122) 9ae5935
- Keep the dev budget's constants private so every export has a caller (#17122) a6da276
- Declare doors for the dev budget module 5196924
- Try: open /talk, pick trevato/forge, press Start dev server, and read the budget under the frame 19eeb4a
- Talk workspace W4: a dev forge from the branch with seeded data, a memory and sleep budget (#17122) 9f2be01
- Talk workspace W3: Test what I touched, Commit and Open pull (#17307) 24db731
- anonymous-deep: whether the loop is behind is said by each test, never read from the process's own lag (#17350) 9b843ee
- The bundle's boot is held by counted work: the imports it resolves on the way to /readyz, against the source boot's (#17347) 57790fd
- Revert #17320: the bundle boot's CPU share doesn't separate bundle from source on Linux (#17346) 2e737a7
- A spawn whose first proof answered still settles it, so the new home is asked… (#17331) 8485415
- Full-suite report files every tally echo under the budget note's file (failed… (#17333) 466ceda
- The crew falls back to the capped key when every plan's window is full, and Settings → Crew shows and steers it (#17168) 4cad6ca
- The bundle's boot is held to a share of the source boot's CPU, measured in the same run, not a wall-clock bound (#17320) 252f7b6
- server.ts imports page, studio, render and API modules on the first request to their prefix (#17313) 9f6e1c4
- The test budget is CPU time: a test starved on a loaded box is not red, one that spends its seconds is (#17310) 3814902
- Advisory integrations: notify on a new exploited advisory (#17326) 31c05ee
- A workspace's dev checkout is synced with the forge's own git, never the operator's environment (#17318) 9a612d3
- fork-flows: the test's forks do not follow, so the background fast-forward cannot move them between two reads (#17328) fe88e40
- sweepSoon starts its sweep on the next turn of the loop, so "sweeping a check… (#17327) 1c9fc4c
7 earlier comments
This push answers the gate feedback on #17353. tsc is clean, and test/dev-budget.test.ts and test/hollow.test.ts pass (32 tests). I did not run the full suite.
- Dead code:
DEV_MEMORY_MIBandDEV_CPUSinsrc/apps/dev_budget.tswere exported but only a test used them. They are now private, andtest/dev-budget.test.tsasserts the literal1024. That also makes the test stricter, since it no longer reads the value from the module it checks. - Look pages: the new commit carries
Looks: src/web/pages/talk.ts. The earlier doors commit already had that line too, so I am treating this as covered by the line, not by the gate. - Name the issue: the commit message cites
#17122. - Both doors: the gate reports this rule as satisfied. The terminal (
src/tui/screens/talk_chats.ts) and the web page (src/web/pages/talk_preview.ts) both state the budget throughdevBudgetWords. Thedocs/features/talk-workspace.mdhow-to was updated earlier in the pull. as neverin tests: neithertest/dev-budget.test.tsnortest/dev-cell-launch.test.tsusesas neveroras unknown, so there was nothing to change.
I left two gate notes alone:
- Comment width: the 100-column comments the gate flagged in
talk_chats.tsandtalk_preview.tsare noted only, and the nightly rewrap handles them. - Duplicate functions: the gate says
devIdentityHeadersis 0.74 similar tocontrolHeadersinsrc/apps/timer_fire.ts. I kept it separate. The two differ in identity format and lifetime, since the dev one is a 5-minute admin identity with no idempotency key. Merging them would add parameters without removing real duplication.
<!-- look-pages a6da2766f913 --> Look pages for a6da276, from the gate:
look pages (none): this pull changes src/web/pages/talk_dev.ts, src/web/pages/talk_preview.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
I pushed an empty commit with the line Looks: /talk. That is the only thing the gate flagged as open, so I made no code change. /talk is the page this pull changes, and it is in app.looks.
I ran bun scripts/gate.ts --explain before pushing. The other four rules you listed (both doors, a test building the real input, naming the issue, and every export having a caller) all pass. I didn't re-run bun x tsc --noEmit or any tests, since nothing in the code changed.
The gate still prints two notes that I left alone:
- Comment width:
bun scripts/gate.ts --fixrewrapped nothing, and the gate says the nightly rewrap handles those lines on main. - Duplicate function:
devIdentityHeadersinsrc/apps/dev_budget.tsscores 0.74 againstcontrolHeadersinsrc/apps/timer_fire.ts. I kept the two separate because the shapes only look alike; merging them would be a refactor outside this pull. The gate treats it as a note, not a refusal.
The gate may re-read the commit line on the new push; the forge's check will say if it still wants something.
🤖 Generated with Claude Code
This feedback is the gate's result for the commit I just pushed: look pages (named) means the /talk line was accepted. It asks for nothing else, so I made no change and pushed nothing.
The four rules it repeats (both doors, a real test input, naming the issue, every export having a caller) all passed in the last bun scripts/gate.ts --explain run. I didn't re-run bun x tsc --noEmit or the tests this turn, since no code changed.
The two gate notes from last turn are unchanged and I left them: the comment-width rewrap that the nightly job handles on main, and the 0.74 similarity between devIdentityHeaders and controlHeaders. I kept those two functions separate because merging them is a refactor beyond this pull.
🤖 Generated with Claude Code
This round adds the launch-level budget test, removes the double blank line in the docs, and adds the review block below. The new test and test/dev-cell-launch.test.ts pass, and bun x tsc --noEmit and the gate are clean.
What changed
- Launch test:
launcherForinsrc/apps/dev_launch.tsnow takes an optionalstartargument that defaults tostartProcess.test/dev-launch-limits.test.tshands it a recorder that refuses to start, then checks that the manifest passed in has 1024 MiB and 1 CPU. The app in the test declares 4096 MiB and 4 CPUs. I confirmed the test fails whenlimits: devLimits(...)is removed from the launcher. - Docs: the extra blank line before "The forge on itself" in
docs/features/talk-workspace.mdis gone.
Not done
- Mocking: I first mocked
startProcesswithmock.module, but the gate's test-honesty rule refuses that, so I added thestartargument instead. - Booting: I didn't boot the app, so the claim that a dev forge opens signed in as the seeded admin is covered only by the header test in
test/dev-budget.test.tsand the signed-identity check intest/dev-cell-launch.test.ts. Nothing tests the sign-in end to end. - Duplicate function: I kept
devIdentityHeadersandcontrolHeadersseparate; the gate treats the overlap as a note.
[
{"go": "/talk", "look": "the repository picker", "expect": "trevato/forge can be chosen"},
{"go": "/talk (trevato/forge chosen), press Start dev server", "look": "the pane line, then the frame", "expect": "the pane says Live, and the frame opens on the seeded admin without a sign-in"},
{"go": "/talk, under the frame", "look": "the budget line", "expect": "it reads: at most 1024 MiB of memory, and it sleeps after 10 minutes unused"}
]
🤖 Generated with Claude Code
I changed nothing this turn, so there is nothing new to push. The branch already matches origin, and I found nothing in the four refusals that needed a fix.
- Look pages: the gate reads this as a note, not a failure.
src/web/pages/talk_dev.tsandsrc/web/pages/talk_preview.tschanged, and commit9ae593597carriesLooks: /talk. - Both doors: the gate passes.
src/tui/screens/talk_chats.tsalready says the dev budget, matching the page. as never: the pull adds none to its tests.test/dev-budget.test.ts,test/dev-cell-launch.test.tsandtest/dev-launch-limits.test.tsbuild real inputs.- Name the issue: the gate passes. Every commit carries
(#17122), and the last has aDirection:line. - Dead code:
test/unused-exports.test.tsandtest/hollow.test.tspass, so every new export has a caller.
bun x tsc --noEmit is clean, and the three dev-budget tests pass. I did not run the wider set scripts/fast.ts names. It reaches 2960 files and would take hours, and the forge runs the full check on push.
Two gate notes I left alone:
- Comment width:
bun scripts/gate.ts --fixrewrapped nothing. The nightly rewrap handles the two files it names on main. - Duplicate function:
devIdentityHeadersscores 0.74 againstcontrolHeadersinsrc/apps/timer_fire.ts. They sign differently shaped identities for different callers, so I kept both. A shared helper would couple the dev cell to timers for a one-line HMAC.
Description for the pull
The dev cell for a branch now runs on a dev budget: lower memory and cores, and it sleeps after 5 idle minutes. The frame tells the dev server who is looking, signed under the cell's own key. A dev forge therefore opens on its seeded admin. Both the /talk page and the terminal (src/tui/screens/talk_chats.ts) say the budget in the same words.
Not done: no shared signing helper with the timers, and no per-user budget settings.
Try it: open /talk, pick trevato/forge, press Start dev server, and read the budget under the frame.
🤖 Generated with Claude Code
The dev cell now has a memory budget and a seeded dev forge that opens signed in, and both doors state the budget. The dev-cell, TUI, hollow and unused-exports tests pass and
tscis clean. I did not run the full suite, and I never booted the real forge as a dev cell. That check is left to the forge's check on this push.What changed
FORGE_APP_ENV=preview, so choosing trevato/forge and pressing Start dev server (din the terminal) already runs the forge's existing preview seed in the cell's own data. I added no new seed code.devIdentityHeadersinsrc/apps/dev_budget.tsdoes this, andtalkDevFrameinsrc/web/pages/talk_dev.tsapplies it. The forge's preview rule already turns that identity into its seeded admin. The headers are signed fresh for each request and expire after 5 minutes. The cell's owner is a verified writer, and the frame still relays only GET and HEAD.devLimitslowers the app's declared limits to 1024 MiB and one core for dev cells. It never raises a lower declared value. The forge declares 2048 MiB and 2 cores inforge.json, so a dev forge gets half that. It is applied insrc/apps/dev_launch.ts.DEV_IDLE_MSis unchanged. It is now stated alongside the memory budget.devBudgetWords()feeds the page's pane info line and the terminal'spview, so they say the same thing. The how-to is a new section indocs/features/talk-workspace.md.devCommand,startProcess,seedPreviewand the dev cell registry.test/dev-budget.test.tscovers the limits, the shared wording and the signed identity.test/dev-cell-launch.test.tsnow also checks that the running dev server receives a signature that verifies under its own key, and that a forged client header is overwritten.Left out
forge.jsongets noapp.dev. Thedevscript inpackage.json(bun run --watch) is used, which restarts the forge on each change.Try it: open
/talk, pick trevato/forge, press Start dev server, and wait for Live. The frame shows the forge's seeded preview admin, and the pane line under it names the budget. The terminal shows the same line in thepview.No
reviewblock is attached, and the terminal-door gate rule passes.🤖 Generated with Claude Code
Closes #17122