Repository navigation
Description
Context
Part of #4278.
The maintainer's ruling of 2026-11-20 gives a checkout two modes: inspect (read-only, nothing snapshotted) and change (recorded as a git diff). The inspect mode was stated with one exception: "unless an npm install or so runs".
That exception has no home today. Reference source "is read-only to agents" by ruling (docs/decisions/reference-worktrees.md:23), and after #4295 an in-brain checkout is read-only in a default turn too. An agent that wants to run a project's tests or a type check while only looking at the code needs somewhere to put the dependencies.
Options
A. An install needs the change mode. Inspecting source never writes. A turn that needs to install or build asks for a managed worktree, or for the session's code-changes switch. Ignored install output can be regenerated under the approved Git receipt policy. Tracked changes such as a manifest or lockfile still count as checkout changes.
- For: inspect stays strictly read-only, which is what makes it free; no new mechanism.
- Against: "just run the tests" needs a grant, and a worktree copy of the source.
B. A disposable overlay per turn. An inspect checkout gets a writable upper layer that is discarded at turn end.
- For: installs work during inspection with no grant.
- Against: more machinery; bubblewrap overlays resolve their upper directory on the host, which ui-sdk: bound turn temp per worker and expose scoped usage and purge #1703 already found awkward; the upper layer needs a byte bound and a place that is not the brain.
C. A shared, host-managed dependency cache per source. The host installs dependencies for a sealed source once, by its lock file, and binds them read-only.
- For: fast repeated inspection.
- Against: running repository install programs needs a trust policy and the isolated maintenance boundary in
docs/decisions/governed-writable-workers.md. Each cache generation needs a scope, bound and activation rule.
Recommendation
A. It is what the draft record text assumes:
Inspecting source is read-only. A turn that needs to install or build asks for writable checkout access. The Git receipt keeps tracked changes and untracked non-ignored files. Ignored output can be regenerated.
What is needed
A maintainer ruling recorded here as **Decision (maintainer, <date>):**, then the sentence above (or its replacement) in docs/decisions/reference-worktrees.md.
Out of scope
- The brain's own
node_modules. It is code later turns execute and stays protected: ui-sdk: the root node_modules is walked on every admission; serve it from a host-owned module store #4300.
Acceptance criteria
- The ruling is recorded on this issue and in
docs/decisions/reference-worktrees.md. - If A: the refusal a default turn gets when it tries to install inside an inspect checkout names the way to get a writable one, by a test.
Verification
bun run test packages/ui-server/tests packages/ui-sdk/testsContract impact
None for A. B and C would add settings and need their own issue.
2026-11-20 triage at main 63bb400b3. The existing read-only reference rule is at docs/decisions/reference-worktrees.md:23-25. The quoted install exception still needs a choice among A, B and C. A lockfile edit remains a tracked change under the approved receipt policy.
Activity
schlessera commentedon Nov 20, 2026
Decision (maintainer, 2026-11-20): Option A. An install needs the change mode.
Inspecting source never writes. A turn that needs to install or build asks for a managed worktree, or for the session's code-changes switch (#4295). What it installs there is ignored by git, so it is neither recorded nor restored. The sentence in this issue goes into
docs/decisions/reference-worktrees.md. The refusal a default turn gets for a write inside an inspected checkout names both ways to get a writable one. This is implemented with #4295's refusal text.needs: decisionis removed.schlessera commentedon Nov 20, 2026
Claimed for implementation. Claim token:
claim-093550e7. Branch:feat/4295-workspaces-read-only.Worked as part of the #4278 epic integration branch epic/4278-host-overhead, together with #4295.
schlessera commentedon Nov 23, 2026
Closed by #4444, squash-merged to main as
a3395c4b2. The combined review found every non-native criterion met. Native-measurement criteria for this issue moved to #4420 by maintainer decision, because native proof cannot run on the integration host.