Spectre.Forge.Proposal (Spectre v0.3.0)

Copy Markdown View Source

Content-addressed Forge output wrapping an inert governance ChangeSet.

A Proposal carries Reflection, Experience, critic and oracle lineage. It has no activation capability and is useful only when passed to the trusted governance Composer as its contained ChangeSet.

Summary

Functions

Decodes and verifies a Proposal.

Encodes a Proposal with the production canonical codec.

Restores a Proposal from decoded transport data.

Builds and seals a Forge Proposal.

Returns the stable textual Proposal reference.

Returns the Forge Proposal transport schema version.

Returns portable Proposal data.

Revalidates the complete Proposal.

Types

t()

@type t() :: %Spectre.Forge.Proposal{
  change_set: Spectre.Governance.ChangeSet.t(),
  critiques: [Spectre.Forge.Critique.t()],
  digest: String.t(),
  experience_snapshot_digest: String.t(),
  oracle_approvals: [Spectre.Forge.OracleApproval.t()],
  parent_proposal_digest: String.t() | nil,
  reflection_digest: String.t(),
  schema_version: pos_integer(),
  trusted_oracle_refs: [String.t()]
}

Functions

decode(encoded)

Decodes and verifies a Proposal.

encode(proposal)

Encodes a Proposal with the production canonical codec.

from_data(data)

Restores a Proposal from decoded transport data.

new(proposal)

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

Builds and seals a Forge Proposal.

ref(proposal)

@spec ref(t()) :: String.t()

Returns the stable textual Proposal reference.

schema_version()

@spec schema_version() :: pos_integer()

Returns the Forge Proposal transport schema version.

to_data(proposal)

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

Returns portable Proposal data.

verify(proposal)

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

Revalidates the complete Proposal.