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

Move the accessors out of looks/service.ts (keepLook, lookUrl, memoryPressure) so it leaves the boot's static closure #17277

opened this

Merged 32h 50m ago, live in production

src/looks/service.ts no longer loads before /readyz. test/boot-lazy.test.ts now asserts it is absent from staticClosure(src/main.ts), and that test passes. I did not run the full suite; the forge runs it on the push.

Notes

opened this

src/looks/service.ts no longer loads before /readyz. test/boot-lazy.test.ts now asserts it is absent from staticClosure(src/main.ts), and that test passes. I did not run the full suite; the forge runs it on the push.

What moved

  • keepLook is now in src/looks/keep.ts.
  • The grant-door lookUrl is now grantLookUrl in src/looks/grant_url.ts. I renamed it because core/looks.ts already exports a different lookUrl.
  • memoryPressure is now in src/looks/memory_pressure.ts. cgroupMemoryPressure stays in the service; only memoryPressure moved.
  • NOT_SERVING is now in src/looks/why.ts. why.ts imported it from the service, which was the one remaining static path to it.
  • The service imports all four back and re-exports none. The pages, actions and http/server.ts import the new modules, and so do the tests that used the old names.

What I did differently from the issue

  • I moved the functions instead of building a registry the service fills at start. They are pure, so a registry would only have added state.
  • The NOT_SERVING move wasn't in the issue. The closure assertion failed without it.

Checks

  • tsc is clean and unused-exports passes. Those cover the dead-code check, since nothing is re-exported.
  • boot-lazy, looks, front, look-secure-grant, look-archive, main-looks, looks-owner, look-probe and look-none pass, apart from the one test below.
  • The real-Chromium test, "a real capture through the grant door", fails in this sandbox. It fails the same way with my changes stashed, so the move did not cause it.
  • I did not run the llms.txt budget or the during timing tests. Nothing here touches them.

Reused: I ran no similarity search (scripts/similar.ts), since I wrote no new logic, only moved functions.

Try it: boot the app and open / on the preview. The front page, a look's picture and the OG image behave as before.

No door: an internal move, with no page, action, route or tool change.

🤖 Generated with Claude Code

Closes #17182

5 earlier comments
commented

src/looks/service.ts no longer loads before /readyz. test/boot-lazy.test.ts now asserts it is absent from staticClosure(src/main.ts), and that test passes. I did not run the full suite; the forge runs it on the push.

What moved

  • keepLook is now in src/looks/keep.ts.
  • The grant-door lookUrl is now grantLookUrl in src/looks/grant_url.ts. I renamed it because core/looks.ts already exports a different lookUrl.
  • memoryPressure is now in src/looks/memory_pressure.ts. cgroupMemoryPressure stays in the service; only memoryPressure moved.
  • NOT_SERVING is now in src/looks/why.ts. why.ts imported it from the service, which was the one remaining static path to it.
  • The service imports all four back and re-exports none. The pages, actions and http/server.ts import the new modules, and so do the tests that used the old names.

What I did differently from the issue

  • I moved the functions instead of building a registry the service fills at start. They are pure, so a registry would only have added state.
  • The NOT_SERVING move wasn't in the issue. The closure assertion failed without it.

Checks

  • tsc is clean and unused-exports passes. Those cover the dead-code check, since nothing is re-exported.
  • boot-lazy, looks, front, look-secure-grant, look-archive, main-looks, looks-owner, look-probe and look-none pass, apart from the one test below.
  • The real-Chromium test, "a real capture through the grant door", fails in this sandbox. It fails the same way with my changes stashed, so the move did not cause it.
  • I did not run the llms.txt budget or the during timing tests. Nothing here touches them.

Reused: I ran no similarity search (scripts/similar.ts), since I wrote no new logic, only moved functions.

Try it: boot the app and open / on the preview. The front page, a look's picture and the OG image behave as before.

No door: an internal move, with no page, action, route or tool change.

🤖 Generated with Claude Code

commented

The boot's static closure no longer holds src/looks/service.ts: keepLook, the grant lookUrl, memoryPressure and NOT_SERVING now live outside it. The first push left a duplicate import in test/look-none.test.ts, which failed the duplicate-import rule. That test now imports NOT_SERVING and whyNoPicture from ../src/looks/why.ts in one statement.

  • Checked locally: test/look-none.test.ts and test/dup-imports.test.ts pass (11 tests), and bun x tsc --noEmit is clean. I did not run the full suite.
  • Behaviour: nothing changed, and no page changed.
  • Not done: I did not run scripts/gate.ts before pushing, so the --fix comment rewrap was not run. The forge's check will report if it matters.
  • Try it: open / on the preview. The front page and a look's picture should load as before.

🤖 Generated with Claude Code

commented

I merged main into this branch and pushed. The only conflict was in test/boot-lazy.test.ts.

In that test, both sides had edited the list of services the boot must not reach. main added snapshot/service.ts, and this branch adds looks/service.ts. I kept both in the list and made the comment cite #17182 and #17183.

bun x tsc --noEmit is clean, and test/boot-lazy.test.ts and test/look-none.test.ts pass (12 tests). I did not run the full suite, so the forge's check on this push is the full verdict.

The pull's content is unchanged. keepLook, the grant lookUrl, memoryPressure and NOT_SERVING still live outside looks/service.ts, so the boot no longer pulls the service in. Behaviour and pages are unchanged. To try it, open / on the preview. The front page and a look's picture should load as before.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed it. The merge conflicted only in test/boot-lazy.test.ts. After the merge, bun x tsc --noEmit was clean and test/boot-lazy.test.ts passed (7 tests). I didn't re-run the rest of the suite; the forge runs the full check on this push.

In that test, main had added checks/service.ts to the list of services the boot must not import statically. This branch had added looks/service.ts. I kept both in the list, plus main's re-wrapped comment above it. Nothing else changed from this branch's earlier work: the accessors still move out of looks/service.ts.

commented

I merged main into the branch again, resolved both conflicts, and pushed.

  • src/looks/service.ts: main had moved appsRuntime to apps/runtime_registry.ts, so I took its import. The merge then left an unused plainProof import, because its only caller now lives in looks/grant_url.ts; I removed it in a separate commit.
  • test/boot-lazy.test.ts: I kept both exclusions in the list of services the boot must not import statically, apps/runtime.ts from main and looks/service.ts from this branch. I also updated the comment: #17179 and #17182 are marked as done.

bun x tsc --noEmit is clean. test/look-archive.test.ts and test/boot-lazy.test.ts pass (13 tests). One test in the earlier wider run of look-related files failed; I never saw its name, and it passes when run on its own. I did not run the full suite; the forge runs it on this push.

commented

The red "the repository has no duplicate import beyond the allowlist (rule duplicate-import)" on this pull is its own: test/look-none.test.ts line 8 imports "../src/looks/why.ts" again; it is already imported on line 7. Merge the second import into the first. Main is green on the rule.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs