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

A closing forge forgets its repositories in every process-wide map keyed by repository #17594

opened this

Merged 16h 13m ago, live in production

Today's leaks across files under bun test --no-isolate share one shape. The one in src/ was crew/hotfiles.ts's touched: a module-level map keyed by repository id outlived the forge whose repositories it held, and the next file's flow page named that forge's hot file.

Notes

opened this

Today's leaks across files under bun test --no-isolate share one shape. The one in src/ was crew/hot_files.ts's touched: a module-level map keyed by repository id outlived the forge whose repositories it held, and the next file's flow page named that forge's hot file. A second forge in the process, or an in-process restart, reads the same leftovers.

  • Inventory: test/module-state.baseline.txt lists 215 module-level collections from before #12569. 21 of them are keyed by a repository id (.set(repoId, .get(repo.id, …). Most are learned pull files, in-flight guards, swept-once marks and per-repository samples.
  • One place: kernel/repo_keyed.ts holds a set of such maps. Each of the 21 modules adds its map at module level as it loads, never from a function, so the module-state rule stays as it was. app.close() deletes the closing forge's own repository ids from each before it closes its database. Another forge's entries stay.
  • Guard: test/repo-keyed.test.ts closes one of two forges and checks that only its repositories leave the learned pulls. It also scans src/ so a new module-level map keyed by repository id must be registered.

Measured with flow-clog-page as it was before its own fix: beside hot-files-relieves in one --no-isolate process it was 10 pass, 3 fail. With this alone, the pair is 12 pass, 0 fail, and --parallel=2 --no-isolate with six hot-file test files is 36 pass, 0 fail, twice. The module-state rule, the new test, the touched modules' tests and the cross files: 200 pass, 0 fail.

The other two leaks today were test state, a module-level fixture and one engine shared by a file's tests, and were fixed in their files.

No door: two actions register a map; nothing a person reaches changes, on any door. Try: on the preview, open /flow after a restart: its clog sentence names only this forge's files. Direction: a red that is not the pull's must not hold it; state belongs to a forge (#12569, #17537).

Co-Authored-By: Claude Fable 5 <[email protected]>

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs