Skip to content

ui-sdk: 15 more internal entry names have no outside importer after #2534 #3412

Closed

Description

@schlessera

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:

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/internal or /internal/client (today ui-server, ui-backend-claude, ui-backend-pi and ui-react, each with its tsconfig.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 regenerate api-report/ui-sdk.txt.

Out of scope

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 ./internal or kept, with the importer, open PR or emit diagnostic that requires it.
  • api-report/ui-sdk.txt no longer lists the removed names.
  • bun run typecheck, tests/api-surface.test.ts and packages/ui-server/tests/declaration-surface.test.ts pass, 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 0

Contract 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

  1. added
    type: chore
    area: ui-sdk
    priority: p3
    agent-ready
    blocked
    on Nov 3, 2026
  2. added this to the 0.45.0 milestone on Nov 3, 2026
  3. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Triage 2026-11-03: #2534 is now the declared blocker. #3413 is still open on epic/2542-dead-code and rewrites the same internal.ts lines, which the body cites at #3413's head 97eaa645a. The declaration-emit check is now a concrete, dry-run-verified bun run build --for ui-server,ui-backend-claude,ui-backend-pi,ui-react. A permanent per-package declaration test is out of scope, because bun run build, which the CI pack job runs when a shipped package changes, already fails on those emit errors. Milestone 0.45.0. priority: p3 kept, equal to #2534. No epic parent: #2542 is bounded to its audited inventory. agent-ready and blocked.

  4. removed
    blocked
    on Nov 4, 2026
  5. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #2534 closed when epic #2542's batch #3570 landed on main as 3ef7c51b2. #2534 was the only declared blocker, so I've removed blocked. Recheck the 15 names against the tree at 3ef7c51b2 before starting.

  6. self-assigned this
    on Nov 15, 2026
  7. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-cb58566d. Branch: chore/3412-ui-sdk-entry-names.

  8. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4073 as 524986d8a through 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-sdkpriority: p3type: chore

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions