Spectre.GAM.Scope (Spectre v0.4.0)

Copy Markdown View Source

Ephemeral handle binding a scope identifier to authenticated ingress context.

A Scope is a projection over the Domain ledger. Copying this struct does not copy a Mandate, a balance, or any other authority.

Summary

Types

t()

Transparent binding used by the facade and application state owners.

Functions

Returns the Domain reference bound by both the handle and its context.

Pairs a Domain handle and context with matching Domain references.

Returns the durable Scope reference bound by the authenticated context.

Types

t()

@type t() :: %Spectre.GAM.Scope{
  context: Spectre.GAM.SubmissionContext.t(),
  domain: Spectre.GAM.Domain.t()
}

Transparent binding used by the facade and application state owners.

The fields are readable data, not an encapsulated execution capability. Authentication depends on the context seal and the live Domain/Scope fence, which are revalidated at the governed boundary, not on typespec opacity.

Functions

domain_ref(scope)

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

Returns the Domain reference bound by both the handle and its context.

new(domain, context)

@spec new(Spectre.GAM.Domain.t(), Spectre.GAM.SubmissionContext.t()) ::
  {:ok, t()} | {:error, term()}

Pairs a Domain handle and context with matching Domain references.

This is local construction, not authentication, durable Scope opening or seal/generation verification. Use the facade's authenticate/open/resume workflows; every governed operation still verifies the resulting handle.

ref(scope)

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

Returns the durable Scope reference bound by the authenticated context.