Repository navigation
Description
Context
Observed while implementing #2699. A brain without a packaged CLI (node_modules/.bin/brain) falls back to ["bun", "scripts/brain-cli.ts"] (export function brainCliCommand, packages/ui-server/src/brain/client.ts:147-151). The masked workers that build a provider-restricted turn's private index and read its taxonomy (runMaskedBrainCli, packages/ui-server/src/brain/private-index.ts:66) pass that argv to the launcher, which refuses any relative executable (if (!isAbsolute(input.brainPath), packages/ui-sdk/src/server/worker-launcher.ts:516-518: "an absolute brain path and worker executable are required").
So on such a brain, every types: provider selector refuses ("the brain's taxonomy could not be read: Agent worker boundary unavailable: an absolute brain path and worker executable are required…"), and the private index build fails (logged as an incomplete index), even when the fallback script is protected by the policy. The failure message reads as a host boundary problem, which it is not. Reproduced by the scripts/brain-cli.ts fallback test added in #2699 (packages/ui-server/tests/private-index.test.ts), which uses a configured absolute command to prove the protected case for that reason.
Scope
Preserve brainCliCommand's existing packaged-CLI preference and script fallback. Make the fallback launchable through the masked worker by resolving its runtime executable to an absolute admitted path; do not weaken the worker launcher's absolute-path requirement. Verify script resolution in the immutable startup view and preserve all provider masks and taxonomy-code protection from #2699. Exact helper placement is an implementation choice.
Out of scope
- Whether the fallback is protected (ui-server: protect the code a type-translated turn's taxonomy runs #2699 refuses an unprotected one by name).
- Host-side CLI calls that do not run in a worker.
Acceptance criteria
- A fictional brain with no packaged CLI and a protected
scripts/brain-cli.tscompletes masked taxonomy and private-index operations through the real worker boundary; the pre-fix failure is the absolute-executable refusal, not a load error. - An unprotected fallback still refuses under ui-server: protect the code a type-translated turn's taxonomy runs #2699, and inaccessible runtime/script paths refuse visibly without host execution or broader mounts.
- Packaged CLI selection and ordinary host fallback behavior remain unchanged; focused controls cover both.
- Record failing-first and restored mutation receipts, then run private-index coverage and affected preflight.
Verification
ui-server private-index tests, then bun run check:pr --base origin/main.
Contract impact
None expected.
2026-10-25 triage at main 827861e1fa71cd4a26b52f1ef0f96b849381acdf: Scoped the concrete mismatch using the existing supported fallback and immutable-worker contract; no new unsupported-layout policy is selected. #2699 supplies the protected-taxonomy path and negative case, so retain an explicit dependency. Source inspection is not an executed real-worker reproduction.
Activity
schlessera commentedon Oct 25, 2026
2026-10-25 triage at main
827861e1fa71cd4a26b52f1ef0f96b849381acdf: Scoped the concrete mismatch using the existing supported fallback and immutable-worker contract; no new unsupported-layout policy is selected. #2699 supplies the protected-taxonomy path and negative case, so retain an explicit dependency. Source inspection is not an executed real-worker reproduction.CONTRACT: fix(ui-server): read a type selector's taxonomy only from p…
schlessera commentedon Nov 3, 2026
Claiming (token
claim-2865-k7q3), branchfix/2865-masked-brain-cli-fallbackfrom mainadf371ffa. Path collisions on cited files: client.ts with #3467 and #3482, worker-launcher.ts with #3408/#3464/#3465 (this change does not plan to edit the launcher). Citations drifted:brainCliCommandis nowclient.ts:136-140, the launcher refusalworker-launcher.ts:515-517.schlessera commentedon Nov 3, 2026
2026-11-03: refreshed drifted citations against main
e6a417ba6:brainCliCommandisclient.ts:147-151, the launcher refusalworker-launcher.ts:516-518;runMaskedBrainCli(private-index.ts:66) is unchanged. No scope change.schlessera commentedon Nov 3, 2026
Draft PR #3494 at head
69abbbe7d. Masked workers now run the fallback'sbunas the server's own runtime; the script stays relative, inside the startup view. Local failing-first, mutation andcheck:prreceipts are in the PR. Real-worker tests that need nested user namespaces still need hosted proof. The PR stays a draft until hosted proof and integration; the claim stays with this PR.fix(ui-server): run the scripts/brain-cli.ts fallback in the masked w…