SPEC-085-A: Sourcer Worktree Isolation

Implements ADR-085. Mirrors SPEC-042-A (agent worktree isolation) for swarm/sourcing.sh. Composes with SPEC-084-A.

Status: design (Proposed). The code change is staged for a live-run-capable environment — see §Verification.

Goal

Run each sourcing cycle in a dedicated detached-origin/main git worktree instead of the shared . checkout, so multiple sourcers (and a sourcer beside the prover/dispatcher) never contend on one working tree.

Functions to add (swarm/sourcing.sh)

Mirror the prover’s helpers (ADR-042) as small, self-contained copies (DRY-by-pattern; both cite ADR-042):

Changes to existing functions

Env knobs (new / reused)

Tests

Out of scope

Extracting a shared worktree library from agent.sh (cross-file refactor of a CODEOWNERS surface); per-invocation worktree teardown (stable reuse mirrors the prover).