Resolves a compiled or source deployment prelude and validates every
tool:<name> requirement against the host-granted tools map before user
code is analyzed. Unknown requirement shapes fail closed.
Summary
Functions
Resolves prelude_or_source to a compiled artifact, then validates its
requires against the attach context (%PtcRunner.Lisp.Prelude.AttachContext{},
containing the granted tools: map).
Validates every public export's requires against the attach context.
Functions
@spec attach( PtcRunner.Lisp.Prelude.t() | String.t() | [PtcRunner.Lisp.Prelude.Bundle.selection()], PtcRunner.Lisp.Prelude.AttachContext.t() ) :: {:ok, PtcRunner.Lisp.Prelude.t()} | {:error, PtcRunner.Lisp.Prelude.ValidationError.t()}
Resolves prelude_or_source to a compiled artifact, then validates its
requires against the attach context (%PtcRunner.Lisp.Prelude.AttachContext{},
containing the granted tools: map).
Returns {:ok, %PtcRunner.Lisp.Prelude{}} on success.
Returns {:error, %ValidationError{}} when:
- the source fails compile-time validation (any compile reason), or
- attach-time
requiresvalidation fails (:prelude_attach_failed).
Raises ArgumentError for genuine programmer misuse: a value that is neither
a %PtcRunner.Lisp.Prelude{}, prelude source (binary), nor a list of
source-bearing prelude selection maps.
@spec validate_requires( PtcRunner.Lisp.Prelude.t(), PtcRunner.Lisp.Prelude.AttachContext.t() ) :: :ok | {:error, PtcRunner.Lisp.Prelude.ValidationError.t()}
Validates every public export's requires against the attach context.
Returns :ok when all required backing operations are provided (or when
there are no requires to check — e.g. dynamic-backed exports). Returns
{:error, %ValidationError{reason: :prelude_attach_failed}} naming the first
missing operation and the export that needs it.