Spectre.Governance.GC.Plan (Spectre v0.3.0)

Copy Markdown View Source

Content-addressed conservative garbage-collection decision.

A plan is evidence, not a delete command. Backends may execute eligible entries only while holding a transaction/lease that revalidates the same reference inventory; core never promises safe deletion from a stale scan.

Summary

Functions

Decodes and verifies canonical GC-plan evidence.

Encodes a GC plan with the production canonical codec.

Restores and verifies portable GC-plan evidence.

Returns portable GC-plan evidence.

Verifies plan structure, conservative decisions, and content identity.

Types

t()

@type t() :: %Spectre.Governance.GC.Plan{
  candidate_decisions: term(),
  candidate_inventory: term(),
  candidate_lineage_refs: term(),
  definition_decisions: term(),
  definition_inventory: term(),
  definition_lineage_refs: term(),
  digest: term(),
  evidence_digest: term(),
  inventory_complete: term(),
  inventory_snapshot_digest: term(),
  protected_candidate_refs: term(),
  protected_definition_refs: term(),
  requested_candidate_refs: term(),
  requested_definition_refs: term(),
  schema_version: term(),
  store_identity: term()
}

Functions

decode(encoded)

@spec decode(binary()) :: {:ok, t()} | {:error, term()}

Decodes and verifies canonical GC-plan evidence.

encode(plan)

@spec encode(t()) :: {:ok, binary()} | {:error, term()}

Encodes a GC plan with the production canonical codec.

from_data(data)

@spec from_data(map()) :: {:ok, t()} | {:error, term()}

Restores and verifies portable GC-plan evidence.

to_data(plan)

@spec to_data(t()) :: map()

Returns portable GC-plan evidence.

verify(plan)

@spec verify(t()) :: :ok | {:error, term()}

Verifies plan structure, conservative decisions, and content identity.