Skip to content

ui-server: a bad .gitignore or a failed worktree release capture still stops the whole turn #4493

Open

Description

@schlessera

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

Two paths next to the one fixed for #4486 still stop or refuse the whole turn for a failure in one checkout:

  • capture.policy reads checkout-local .gitignore entries before attachBrainCheckouts runs (begin, packages/ui-server/src/brain/turn-journal.ts:835). A non-regular or oversized .gitignore in one checkout refuses every writable workspace turn.
  • releaseWorktree (packages/ui-server/src/brain/turn-journal.ts:936-950) calls the turn-wide stop callback when the endpoint capture of one managed worktree fails.

Both behave the same on main.

Scope

Apply the proportionate containment rule to both paths, or record in code why narrower containment can't be enforced.

Acceptance criteria

  • A bad .gitignore in one checkout restricts only that checkout, with a durable cause. Sibling checkouts and notes keep their coverage, and the turn is admitted.
  • A failed release capture for a managed worktree keeps the partial receipt and isolates that worktree. Otherwise, the code and a test state that stopping the turn is required.
  • Each change answers the guard checklist.

Out of scope

Checkout discovery (#4492) and failed-checkout masks (#4491).

Notes for the implementer

Both paths behave the same on main (begin and releaseWorktree in packages/ui-server/src/brain/turn-journal.ts), but the per-checkout restriction they should reuse is introduced by PR #4490. The guard checklist is in docs/decisions/proportionate-containment.md#checklist-for-a-new-or-changed-guard.

Verification

Failing-first unit tests in packages/ui-server/tests/turn-journal.test.ts for a non-regular and an oversized .gitignore in one checkout, and for a failed endpoint capture of one managed worktree; a mutation receipt for each; bun run check:pr --base origin/main; recorded independent review (core package).

Contract impact

None expected. If journal detail or a refusal message shape changes, follow docs/integration-contract.md.

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 (the restriction to reuse); type: bug replaced by type: fix.

Activity

  1. added
    area: ui-server
    priority: p2
    on Nov 23, 2026
  2. added
    type: fix
    blocked
    agent-ready
    and removed on Nov 23, 2026
  3. schlessera commented on Nov 23, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #4486 is closed, so scripts/sync-project.ts is removing the blocked label.

  4. removed
    blocked
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-serverpriority: p2type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions