Repository navigation
Description
Part of #4426. Found in the first independent review of PR #4490, which fixes #4486 and #4487. Line numbers refer to that PR's head 6c7256f8c.
Context
restrictFailedCheckouts (packages/ui-server/src/brain/checkout-restrictions.ts:4-21) masks a single workspaces/<name> subtree. Workspace qualification accepts hard links that stay inside workspaces/, so a file shared with a writable sibling checkout keeps a writable name outside the mask. A write through that name is still journaled under the sibling.
Separately, the strict checkout masks are mounted before the provider folder masks (workerCommand, packages/ui-sdk/src/server/worker-launcher.ts:726-733). When a denied provider folder sits inside a masked checkout, it may need a mountpoint that the read-only mask can't provide, and the launch would fail.
Scope
Alias handling at checkout level for a failed checkout, and mask ordering across the two mount plans. No change to receipts.
Acceptance criteria
- A file hard-linked between a failed checkout and a writable sibling either can't be written through the sibling, or the restriction widens to the sibling with a recorded cause.
- A denied provider folder inside a failed checkout still lets the worker launch, in both governed and strict mode, because the descendant mask is collapsed into the checkout mask.
- Real-namespace tests cover both, each with a mutation receipt.
Out of scope
Receipt capture, discovery (#4492), and the .gitignore and worktree release paths (#4493).
Notes for the implementer
Both parts are findings from reading the code, not observed failures. Write the real-namespace test for each first. If the nested provider mask launches correctly without a change, record that receipt on this issue and drop that criterion rather than changing the mount order. For the first part: resolveWorkerProtection (packages/ui-sdk/src/server/worker-protection.ts) runs its hard-link check (checkTree) only on read-only paths, not on a mask_directory, so a failed checkout's hard-linked file is not detected when its subtree is masked.
Verification
bun run test on the real-namespace checkout tests in packages/ui-server/tests/code-change-receipt.test.ts (governed and strict), with a failing-first and a mutation receipt for each criterion; bun run check:pr --base origin/main; recorded independent review (core package).
Contract impact
None expected: worker mounts and journal detail only. If a refusal reason or journal detail shape changes, follow docs/integration-contract.md.
Dependencies
restrictFailedCheckouts and checkout-restrictions.ts exist only in PR #4490. Re-check the citations above on main once it merges.
Blocked by #4486
2026-11-23 triage at main 356fa7d: citations still hold at PR #4490 head c1f7103a1; added exclusions, verification, contract impact and the dependency on #4486; type: bug replaced by type: fix.
Activity
schlessera commentedon Nov 23, 2026
Unblocked: #4486 is closed, so
scripts/sync-project.tsis removing theblockedlabel.