HttpOnly cookie that page
script cannot read (shared-session decision (b); see
Authentication).
Until every browser-side use is migrated, scripts/check-browser-session-surface.js
keeps the existing surfaces from growing. It runs in bun check:changed
whenever app or package source changes, and in bun check/bun validate.
Rules
The guard scansapps/*/src and packages/*/src. It skips tests, stories,
generated output and the paused backend and tanstack-web runtimes.
Limits.
- Only
src/trees are scanned. App-root files such asnext.config.ts, Worker entries outsidesrc/, andscripts/are not covered. - The Flutter app (Dart) is excluded. It holds bearer tokens in native secure storage by design.
- The rules are lexical. A token returned through an indirect variable, or a client created through a re-exported helper, needs review rather than this guard.
The allowlist is
scripts/browser-session-surface-allowlist.json, and it only
shrinks:
- A new match fails. Fix it by calling a same-origin API through
@tuturuuu/internal-api, never by adding a browser client. - A token response that must exist (native, CLI or provider OAuth) needs an
allowlist entry with a
reasonand a security review. - An entry that no longer matches also fails until it is removed, so migrated files drop out of the list.
Short-lived capabilities inventory
Script may hold a capability only when it is scoped to one topic or object, lasts at most 5 minutes (15 minutes for private download links) and cannot be exchanged for a session. Inventory as of 26 Oct 2026:
The Meet
*-check.ts tickets (600–1800 s) are integration-check fixtures, not
browser capabilities. The clamps are scheduled with the storage helper
migration in the shared-session plan.