Insider.Sentinel.DraftCreation.Request (Insider Lab v0.1.0)

Copy Markdown View Source

A canonical, disclosure-approved request for one provider-created draft.

The request binds a verified draft proposal and inert candidate submission to one exact coding-agent handoff and one configured provider destination. Its idempotency key deliberately excludes the renewable disclosure decision, so reauthorization cannot select a second draft. This artifact grants no merge, deployment, credential, or unrestricted repository authority.

Summary

Functions

Builds a request after an authority has approved its exact provider-visible payload.

Returns the exact payload reference a trusted authority must approve.

Validates canonical structure and content identity, not authority authenticity.

Recomputes the provider-visible payload from the exact source artifacts.

Types

t()

@type t() :: %Insider.Sentinel.DraftCreation.Request{
  controls: term(),
  disclosure_decision: term(),
  handoff: term(),
  id: term(),
  idempotency_key: term(),
  integrity: term(),
  intent_id: term(),
  kind: term(),
  proposal: term(),
  provider: term(),
  schema: term(),
  submission: term()
}

Functions

canonical_binary(request)

@spec canonical_binary(term()) ::
  {:ok, binary()} | {:error, Insider.Protocol.Error.t()}

decode(value)

@spec decode(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}

decode_map(wire)

@spec decode_map(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}

new(proposal, submission, handoff, provider, disclosure_decision)

@spec new(term(), term(), term(), term(), term()) ::
  {:ok, t()} | {:error, Insider.Protocol.Error.t()}

Builds a request after an authority has approved its exact provider-visible payload.

payload_reference(proposal, submission, handoff, provider)

@spec payload_reference(term(), term(), term(), term()) ::
  {:ok, map()} | {:error, Insider.Protocol.Error.t()}

Returns the exact payload reference a trusted authority must approve.

to_wire_map(request)

@spec to_wire_map(t()) :: map()

validate(request)

@spec validate(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}

Validates canonical structure and content identity, not authority authenticity.

validate_with(request, proposal, submission, handoff, provider)

@spec validate_with(term(), term(), term(), term(), term()) ::
  {:ok, t()} | {:error, Insider.Protocol.Error.t()}

Recomputes the provider-visible payload from the exact source artifacts.