DocShell.Presentation.ArtifactAdmission (DocShell v2.0.0)

Copy Markdown View Source

Selects a completed artifact variant under explicit runtime constraints.

The v2 declaration assigns runtime requirements to each presentation rather than inheriting one list across fallback and enhancement. Selection is deterministic: caller preferences precede lexical presentation IDs. A static mode excludes connected output and live transport. Nothing here discovers runtimes or grants permission; the host supplies their actual availability. Legacy renderer admission remains in DocShell.Presentation.Renderer.

Summary

Functions

Checks an existing available selection against its declared feature and runtime policy.

Selects an admitted presentation and variant, or reports unavailable essential content.

Validates a separately versioned capability declaration and caller constraints.

Functions

admitted?(selection, block, capabilities, constraints)

@spec admitted?(map(), map(), map(), map()) :: boolean()

Checks an existing available selection against its declared feature and runtime policy.

This does not choose another presentation or rerun producer validation. The host must supply a producer-admitted receipt; a declaration is not proof of artifact meaning, source authenticity or actual deployed runtime support. Inputs are the already validated declarations used by ArtifactBlock.verify_receipt/3.

select(block, descriptor, capabilities, constraints)

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

Selects an admitted presentation and variant, or reports unavailable essential content.

validate(capabilities, constraints)

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

Validates a separately versioned capability declaration and caller constraints.