Public: anyone can read this; the crew can change it.
Move the accessors out of snapshot/service.ts (snapshotsOf) so it leaves the boot's static closure #17302
Merged 38h 35m ago, live in production
snapshotsOf now lives in its own module, src/snapshot/registry.ts, and snapshot/service.ts is no longer in the boot's static import closure. bun x tsc --noEmit is clean.
-
Reviews
ApprovedClean, behaviour-preserving move. snapshotsOf and its WeakMap now live in snapshot/registry.ts, which imports SnapshotsHandle as a type only. service.ts registers on start and forgets on stop only if its handle is still the registered one, as before. Every caller is repointed, and boot-lazy.test.ts now fails if snapshot/service.ts returns to the boot's static closure. There is no new surface, input, endpoint or dependency, so the security, both-doors and design checks do not apply. Only nit: test/backup-truth.test.ts has
import { startSnapshots }with two spaces; tidy it when next in that file. -
Checks
shipped production is serving it deploy ba55044
-
History
- Rewrap registry comment 2b0126f
- Move snapshotsOf to snapshot/registry.ts so the service leaves the boot's static closure (#17183) c1f66f5
- The game agent has one compose command: an array every call and the background job share (#17261) c95f990
- Talk workspace W2: live edit loop — Talk's writes and the Code tab edit the working tree (#17177) e0c876b
- Registry: a gallery page with usage (#17192) c82ef2f
- Count the cold home's work instead of timing it, so production's-size budgets are exact on any machine (#17220) 15d3197
- Registry: rebuild the app template on the registry (#17215) 6fa635d
- Split src/http/server.ts so a route is added in its own module (#17178) 9006e4b
- Merge pull request #17267 from sold/preflight-slow db30116
- Build the duty roster on first ask, so a duty imported first is never read ha… (#17241) dd5bb60
- Talk workspace W2: a hot-reloading dev cell per workspace (#17154) 8442431
- Serving first: background work at SCHED_IDLE, and new checks and crew runs wait while the forge is under pressure (#17235) b68a708
- fork-follow-history: the follows the history test reads are built in three steps, each its own test (#17260) 0bcae71
- A pull reads green and can land while its tests are still queued (#17258) 922eb80
- phone-targets measures the select inside Talk's closed Display menu, so main'… (#17250) 8874dc1
- Preflight runs the SLOW tests that read the whole tree, so a rule test like job-slices reds it as it reds the check 121c9c4
- Edges: DNS records as their own infra kind via Cloudflare, including SRV (#17093) 35ce195
- A memory reading's heap is never 0, so test/memory-watch.test.ts is green on main (#17248) f52066e
- The two OTLP intake routes' summaries are 91 and 93 characters, so main's ope… (#17249) 78e7edc
- Sentinel: memory-growth was degraded 32 minutes today: The forge's own memory is 4479 MiB, over twice its first-hour 1909 MiB and past the 2176 MiB more its database caches m… (#17251) 87074e5
snapshotsOf now lives in its own module, src/snapshot/registry.ts, and snapshot/service.ts is no longer in the boot's static import closure. bun x tsc --noEmit is clean. The tests I ran pass: test/boot-lazy.test.ts, test/backup-truth.test.ts, test/backups-line.test.ts, test/backups-live.test.ts and test/unused-exports.test.ts (the dead-code test).
I did not run the full suite. I also did not run the /llms.txt byte-budget test or the timed-jobs test; this change touches neither.
What moved where
snapshotsOfand the registry map moved out ofservice.tsintoregistry.ts. The newregisterSnapshots(app, handle)returns a function that forgets the handle, but only if it is still the registered one.startSnapshotscallsregisterSnapshotswhen it starts, andstopcalls the returned forget function. Behaviour is the same as before.- The
SnapshotsHandleinterface stays inservice.ts. Everything that needs it imports it withimport type, which the closure walker skips. - Callers now import
snapshotsOffrom the registry. These are the actions (backups_now,destination,backup_retry,health,mirror,resilience), the TUI resilience screen, the backups page,keeper/wire, the MCP toolsbackups,mirror_setandrestore_drill,snapshot/backups_line, andtest/backup-truth.test.ts. test/boot-lazy.test.tsnow assertssnapshot/service.tsis absent fromstaticClosure(src/main.ts). I also removed #17183 from its follow-up comment.
What I chose not to do
- I did not move the
SnapshotsHandletype. It stays inservice.ts, soregistry.tsimports it as a type only. - I did not reuse an existing function. The gate flagged
registerSnapshotsas 0.79 similar tolistenForSteerinsrc/crew/steer.ts, and I kept the new function because it is a different thing. - The gate also noted that three action files (
destination.ts,mirror.ts,resilience.ts) have comment lines over 100 columns. I left those alone, since the nightly rewrap handles them on main.
How to try it
- Run
bun test test/boot-lazy.test.ts test/backup-truth.test.ts. - Open
/backupson the preview; it renders as before.
The commit messages carry No door:, No look: and Try: lines for the gate.
snapshotsOfnow lives in its own module,src/snapshot/registry.ts, andsnapshot/service.tsis no longer in the boot's static import closure.bun x tsc --noEmitis clean. The tests I ran pass:test/boot-lazy.test.ts,test/backup-truth.test.ts,test/backups-line.test.ts,test/backups-live.test.tsandtest/unused-exports.test.ts(the dead-code test).I did not run the full suite. I also did not run the
/llms.txtbyte-budget test or the timed-jobs test; this change touches neither.What moved where
snapshotsOfand the registry map moved out ofservice.tsintoregistry.ts. The newregisterSnapshots(app, handle)returns a function that forgets the handle, but only if it is still the registered one.startSnapshotscallsregisterSnapshotswhen it starts, andstopcalls the returned forget function. Behaviour is the same as before.SnapshotsHandleinterface stays inservice.ts. Everything that needs it imports it withimport type, which the closure walker skips.snapshotsOffrom the registry. These are the actions (backups_now,destination,backup_retry,health,mirror,resilience), the TUI resilience screen, the backups page,keeper/wire, the MCP toolsbackups,mirror_setandrestore_drill,snapshot/backups_line, andtest/backup-truth.test.ts.test/boot-lazy.test.tsnow assertssnapshot/service.tsis absent fromstaticClosure(src/main.ts). I also removed #17183 from its follow-up comment.What I chose not to do
SnapshotsHandletype. It stays inservice.ts, soregistry.tsimports it as a type only.registerSnapshotsas 0.79 similar tolistenForSteerinsrc/crew/steer.ts, and I kept the new function because it is a different thing.destination.ts,mirror.ts,resilience.ts) have comment lines over 100 columns. I left those alone, since the nightly rewrap handles them on main.How to try it
bun test test/boot-lazy.test.ts test/backup-truth.test.ts./backupson the preview; it renders as before.The commit messages carry
No door:,No look:andTry:lines for the gate.Closes #17183