Repository navigation
Description
Part of #1345.
Context
Delivered prerequisite outputs: #1399 (merged in #1461).
Ruled 2026-10-09 (maintainer): a helper only one backend imports belongs in that backend. The binding inventory applies that rule here (docs/decisions/backend-authoring-toolkit.md:41).
What the ruling still requires on a6b945b, with every consumer outside packages/ui-sdk:
| Name | Exported from | Imported by | Status |
|---|---|---|---|
bashCommand |
SDK /internal (packages/ui-sdk/src/internal.ts:7) |
Claude only: packages/ui-backend-claude/src/input-rewrite-hooks.ts:2, src/tool-policy.ts:3 |
single-backend → moves here (the inventory assigns it to this issue, backend-authoring-toolkit.md:41) |
loadedSdkIdentity |
SDK /internal (internal.ts:9) |
Claude only: packages/ui-backend-claude/src/runtime-probe.ts:18 |
single-backend → moves here |
VERSION_PROBE_TIMEOUT_MS |
SDK /internal (internal.ts:14) |
Claude (src/runtime-probe.ts:26, src/turn-runner.ts:18) and the host (packages/ui-server/src/brain/client.ts:5) |
host plus one backend → not single-backend; classified in #2772 |
claudeMaskFilename, claudeReportedMaskPath, piMaskFilename, piReportedMaskPath |
SDK /internal (internal.ts:12) |
each backend its own pair (packages/ui-backend-claude/src/mask-tool.ts:9-10, packages/ui-backend-pi/src/bridge-tools.ts:39-40) and the host both filename rules (packages/ui-server/src/brain/mask-application.ts:6, :79) |
host plus one backend each → classified in #2772 |
The body previously said the four mask helpers "are public" in /server and required their absence from the /server api-report. That is already true: they are only in /internal (packages/ui-sdk/src/internal.ts:12), and packages/ui-sdk/tests/backend-toolkit.test.ts:22-28 already asserts the ordinary entries exclude them. That criterion was satisfied without this issue; it is replaced below by ownership checks.
Scope
- Move
bashCommandandloadedSdkIdentityintopackages/ui-backend-claude(source, with their unit tests), import them locally there, and remove them frompackages/ui-sdk/src/internal.tsand any SDK source left unused. - Update the
bashCommandrow ofdocs/decisions/backend-authoring-toolkit.md(:41), recordloadedSdkIdentity's move beside it, and update the affected API reports.
Out of scope
VERSION_PROBE_TIMEOUT_MSand the four mask helpers: their consumers include the host, so the single-backend rule does not settle them (ui-sdk: classify the SDK helpers that only the host and one backend import #2772).execWrapperSpawnOptions(ui-sdk: classify the SDK helpers that only the host and one backend import #2772),GIT_LOCK_KEY,canonicalModelId,SUBPROCESS_ENV, and the 41 shared worker-host helpers (ui-sdk: both backends import 41 worker-host helpers that exist only in /internal, against the toolkit ruling #2489).- Any behaviour change in Bash input reading, lock selection or SDK identity probing.
Acceptance criteria
-
git grep -nE '\b(bashCommand|loadedSdkIdentity)\b' -- packages/ui-sdk/srcreturns nothing. -
git grep -nE 'import .*\b(bashCommand|loadedSdkIdentity)\b.*brain-ui-sdk' -- packagesreturns nothing; Claude imports them from its own source. -
api-report/ui-sdk.txtno longer lists either name; no public.//server//client//protocolentry changes. -
packages/ui-sdk/tests/backend-toolkit.test.tsstill passes, and the moved helpers' tests run inpackages/ui-backend-claudeunchanged in their assertions. - Claude's hook, lock-selection and runtime-probe tests pass unchanged.
Verification
git grep -nE '\b(bashCommand|loadedSdkIdentity)\b' -- packages
bun run test packages/ui-sdk packages/ui-backend-claude
bun run api-report
bun run typecheckContract impact
None. Both names leave SDK /internal only, which is not a supported entry; no public name is removed, so no CONTRACT: commit and no breaking label. A patch changeset for the affected packages if their declaration output changes.
2026-10-24: rewrote around the remaining backend ownership moves. Added bashCommand (assigned here by the toolkit inventory); recorded that the mask helpers are already internal-only, so the public-removal criterion was satisfied; moved VERSION_PROBE_TIMEOUT_MS and the mask helpers to #2772 because the host imports them too; removed contract and breaking because no supported public entry loses a name.
Activity
[-]ui-sdk: move the Claude and pi mask filename helpers out of the public server entry[/-][+]ui-sdk: move single-backend helpers out of the SDK and into their backend[/+]schlessera commentedon Oct 10, 2026
Unblocked: #1399 merged in #1461 (02fd0b9). The helpers both backends import are now public on
@schlessera/brain-ui-sdk/server.execWrapperSpawnOptions(host + pi),bashCommand(Claude only),SUBPROCESS_ENV(host only),GIT_LOCK_KEYandcanonicalModelIdstay in/internal; see the inventory indocs/decisions/backend-authoring-toolkit.md.schlessera commentedon Oct 21, 2026
2026-10-21 dependency-priority reconciliation: #1400 explicitly waits for this helper move and has priority p2. Raised this blocker from p3 to p2 under the repository rule that a blocker must have at least the priority of the work it blocks. This preserves the approved scope, readiness, assignment and release attribution; no implementation or new schedule is claimed.
[-]ui-sdk: move single-backend helpers out of the SDK and into their backend[/-][+]backends: move the Claude-only SDK helpers bashCommand and loadedSdkIdentity into the Claude backend[/+]schlessera commentedon Oct 24, 2026
2026-10-24: body rewritten against a6b945b.
/internal(packages/ui-sdk/src/internal.ts:12), andpackages/ui-sdk/tests/backend-toolkit.test.ts:22-28already asserts the ordinary entries exclude them. The old "absent from/server" criterion was already met.packages/ui-server/src/brain/mask-application.ts:6,:79).VERSION_PROBE_TIMEOUT_MSlikewise has a host consumer (packages/ui-server/src/brain/client.ts:5). The 2026-10-09 single-backend rule does not settle host-plus-one-backend helpers, so both moved to ui-sdk: classify the SDK helpers that only the host and one backend import #2772, which asks for that classification.bashCommand, whichdocs/decisions/backend-authoring-toolkit.md:41assigns to this issue.contractandbreaking: the remaining moves take names out of SDK/internalonly, and no supported public entry loses a name.Removed body lines, kept as history: "2026-10-09: sequenced against the other code-quality issues to avoid overlapping edits; see the epic's planned-order comment." / "Updated 2026-10-12: removed completed blocker declarations, retained delivered-output context and all remaining prerequisites; readiness and existing rulings preserved."