Pixir.Delegate.Evidence (pixir v0.1.6)

Copy Markdown View Source

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.

Summary

Functions

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

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

Functions

annotate_payload(payload)

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

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

refresh_payload(payload)

@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.