Skip to content

ui-server: decide where a dependency install may write while a checkout is only inspected #4298

Closed

Description

@schlessera

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.

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

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/tests

Contract 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

  1. added
    type: feat
    area: ui-server
    needs: decision
    on Nov 20, 2026
  2. added
    priority: p2
    on Nov 20, 2026
  3. schlessera commented on Nov 20, 2026

    @schlessera
    OwnerAuthor

    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: decision is removed.

  4. added
    agent-ready
    and removed
    needs: decision
    on Nov 20, 2026
  5. self-assigned this
    on Nov 20, 2026
  6. schlessera commented on Nov 20, 2026

    @schlessera
    OwnerAuthor

    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.

  7. added this to the 0.45.0 milestone on Nov 21, 2026
  8. schlessera commented on Nov 23, 2026

    @schlessera
    OwnerAuthor

    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.

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-serverpriority: p2type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions