# `Pixir.Delegate.Evidence`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/delegate/evidence.ex#L1)

Delegate audit-evidence metadata and mirror helpers.

The Session Log remains Pixir's source of truth. This module adds a narrow
survivability layer for Delegate executor use: when a write-capable Delegate starts
and reaches terminal/reportable states, Pixir mirrors available parent and child
Session Logs plus a small metadata file under the user-global Pixir root. That mirror
is not a second result store; it is an out-of-workspace audit-preservation copy so an
executor does not depend only on workspace-local `.pixir` for proof.

Path blocking in `Pixir.Tools.Executor` is still useful defense in depth. The stronger
guarantee here is that a bounded-write Delegate can report where durable evidence also
lives outside the delegated workspace write scope. This is not a shell sandbox:
user-global Pixir state is local filesystem state and should be treated as audit
preservation, not containment against an arbitrary host process.

Workspace-local source Logs use the canonical Session-id grammar and the same
`lstat`-based static path preflight as `Pixir.Log`. Existing or dangling symlinks are
reported as failed mirror evidence without reading their targets. The accepted
same-UID check/reopen race remains; this mirror does not provide descriptor-relative
or race-free filesystem access.

# `annotate_payload`

```elixir
@spec annotate_payload(map()) :: {:ok, map()} | {:error, map()}
```

Attach current Delegate evidence-location metadata to a result payload.

# `refresh_payload`

```elixir
@spec refresh_payload(map()) :: {:ok, map()} | {:error, map()}
```

Refresh Delegate evidence mirror state, then attach evidence metadata to the payload.

This function is intentionally lifecycle-safe: callers may invoke it at Delegate start,
after child spawn, terminal completion, and final render. Existing mirror logs are only
replaced by same-size-or-larger source logs; if a workspace-local source regresses, the
older mirror is retained and the regression is reported in metadata.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
