Repository navigation
Description
Context
#2534 removed the @schlessera/brain-ui-sdk/internal and ./internal/client re-exports that the 2026-10-22 review had listed as consumer-less. When that PR's reference count was rerun on epic/2542-dead-code at ac3cab77a, fifteen more names in ./internal had no importer outside ui-sdk. Most entered the entry after the review, or lost their last outside importer after it, so #2534's audited list does not cover them:
packages/ui-sdk/src/internal.ts:24(provider relay, added by CONTRACT: feat(ui-sdk): relay the brain CLI's paid providers through a metered host relay #2743):FIRST_PARTY_PROVIDER_RECIPIENTS,MAX_PROVIDER_REQUEST_BYTES,WORKER_PROVIDER_RELAY_SOCKET,providerUsage, and the typesProviderOperation,ProviderRelayOptions,ProviderRelayRefusal,ProviderUsagepackages/ui-sdk/src/internal.ts:72(reference-pool protocol, added by CONTRACT: feat(ui-sdk): add worktree checkpoints and access generations to the reference pool #2686): the typesNativePoolAccess,NativePoolCreatePurpose,NativePoolStatepackages/ui-sdk/src/internal.ts:20:assertScratchMaskpackages/ui-sdk/src/internal.ts:42:launchMaintenanceWorkerpackages/ui-sdk/src/internal.ts:5:probeWorkerHostAsyncpackages/ui-sdk/src/internal.ts:41:WORKER_PROVIDER_RELAY_DIR
The per-name command is #2534's:
git grep -lw -- "$NAME" -- packages tests scripts website template evals experiments \
':!packages/ui-sdk/**' ':!api-report/**' ':!**/*.md'A grep miss is not proof. In #2534, three names with no grep hit were still required. WorkerOutputStorage, SessionPromptFacts and LinkEdit are reached through inferred return types in ui-server, the Claude backend and ui-react. Removing any of them makes that package's declaration emit fail with TS2742 ("cannot be named without a reference to …"). packages/ui-server/tests/declaration-surface.test.ts catches this for ui-server only; nothing tests the Claude backend or ui-react this way. Several of the names above are types, so each candidate needs the emit check too.
Blocked by #2534
The line numbers above are those at PR #3413's head (97eaa645a), re-checked in triage. #3413 removes #2534's 66 names, is still open against epic/2542-dead-code, and rewrites the same internal.ts lines. #2534 stays open until that epic's batch lands on main, so this issue starts from main after #2534 closes, and re-runs every check at that base.
Declaration emit is already built, just not tested per package. bun run build runs tsc -p tsconfig.build.json for every publishable package (executeBuild, scripts/build-execution.ts:34), and CI's pack job runs it whenever a shipped package changes (scripts/ci-plan.ts:362-374). So a TS2742 in ui-backend-claude, ui-backend-pi or ui-react fails the build on the PR. What is missing is a fast unit-level test like ui-server's, which this issue does not add (see Out of scope).
Scope
- For each name above, confirm both checks at the PR's base: no grep hit, and declaration emit stays clean for every package that imports
@schlessera/brain-ui-sdk/internalor/internal/client(today ui-server, ui-backend-claude, ui-backend-pi and ui-react, each with itstsconfig.build.json). Also check that no open PR adds an import of the name. - Remove the names that pass from
packages/ui-sdk/src/internal.ts, and regenerateapi-report/ui-sdk.txt.
Out of scope
- Deleting the underlying declarations.
MaintenanceResult: ui-sdk: 71 internal entry names have no consumer outside the package #2534 kept it because open PR CONTRACT: feat(ui-server): fetch allow-listed repositories for module cron jobs on the host #3393 adds an import of it from./internal. Revisit only if that PR closes unmerged.- A permanent declaration-emit test for ui-backend-claude, ui-backend-pi or ui-react.
bun run buildalready fails on their emit errors. A dedicated test would add a full-program compile per package to the unit suite, which is a test-cost question for Epic: tests give faster feedback with less redundant work #1849, not dead-code work. - Other packages' internal entries (packages: delete internal entry points that no other package uses #1401) and a lint gate for ui-sdk (ci: no gate catches an export that no other file imports #2536 covers ui-server, ui-kit and ui-react).
Acceptance criteria
- The PR lists every name above with its grep result and the result of the declaration-emit check, both taken at its base.
- Each name is either removed from
./internalor kept, with the importer, open PR or emit diagnostic that requires it. -
api-report/ui-sdk.txtno longer lists the removed names. -
bun run typecheck,tests/api-surface.test.tsandpackages/ui-server/tests/declaration-surface.test.tspass, and the emit check is clean for all four consumer packages.
Verification
bun run typecheck
bun run test tests/api-surface.test.ts packages/ui-server/tests/declaration-surface.test.ts
bun run build --for ui-server,ui-backend-claude,ui-backend-pi,ui-react # tsc -p tsconfig.build.json per package; must exit 0Contract impact
None. Internal entries carry no compatibility promise (docs/decisions/public-export-boundary.md:21-25).
Found while working #2534 on 2026-11-03.
Triage 2026-11-03: declared #2534 as the blocker, because #3413 is still open on the epic branch and edits the same lines. Made the emit check a concrete bun run build --for ... command and recorded why no permanent per-package declaration test is added here. priority: p3 kept, equal to its blocker #2534 and #2542. Milestone 0.45.0: a direct follow-up of #2534 (0.45.0), and 15 names each with a grep and an emit check. No epic parent: #2542 bounds its outcome to the 2026-10-22 audited inventory, and these 15 names fall outside it. Brief complete: agent-ready together with blocked.
Activity
schlessera commentedon Nov 3, 2026
Triage 2026-11-03: #2534 is now the declared blocker. #3413 is still open on
epic/2542-dead-codeand rewrites the sameinternal.tslines, which the body cites at #3413's head97eaa645a. The declaration-emit check is now a concrete, dry-run-verifiedbun run build --for ui-server,ui-backend-claude,ui-backend-pi,ui-react. A permanent per-package declaration test is out of scope, becausebun run build, which the CIpackjob runs when a shipped package changes, already fails on those emit errors. Milestone 0.45.0.priority: p3kept, equal to #2534. No epic parent: #2542 is bounded to its audited inventory.agent-readyandblocked.schlessera commentedon Nov 4, 2026
Unblocked: #2534 closed when epic #2542's batch #3570 landed on main as
3ef7c51b2. #2534 was the only declared blocker, so I've removedblocked. Recheck the 15 names against the tree at3ef7c51b2before starting.schlessera commentedon Nov 15, 2026
Claimed for implementation. Claim token:
claim-cb58566d. Branch:chore/3412-ui-sdk-entry-names.schlessera commentedon Nov 16, 2026
Merged in #4073 as
524986d8athrough the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.