Compile-time validation failure for a deployment prelude.
Returned as {:error, %ValidationError{}} from
PtcRunner.Lisp.Prelude.Compiler.compile/1 when the prelude SOURCE is
malformed in a way that does not depend on a selected runtime (parse
errors, reserved-namespace declarations, duplicate refs, bad visibility,
invalid arity/signature metadata, and similar facts), and from
PtcRunner.Lisp.Prelude.Attach.validate_requires/2 with the
:prelude_attach_failed reason when a public export requires a tool
operation the selected runtime does not provide.
Fields
reason— a stable, matchable atom. Compile-time reasons::reserved_namespace,:duplicate_ref,:invalid_visibility,:invalid_requires,:invalid_metadata,:qualified_self_reference,:missing_namespace,:invalid_namespace,:invalid_signature,:parse_error,:unbound_var,:unknown_namespace,:compile_error,:unrecognized_node. Dependency reasons (declared prelude-to-prelude deps)::unknown_dependency,:dep_ref_in_def,:dependency_cycle. Attach-time reason::prelude_attach_failed.message— human-readable detail naming the offending namespace, symbol, or value. Must not contain secrets.details— bounded structured compiler detail for allowlisted public diagnostic rebuilding, elsenil. Renderers must never forwardmessageas a substitute for this field.namespace— the declaring namespace when known, elsenil.ref— the offending export ref when known, elsenil.form_index— zero-based position of the offending TOP-LEVEL form in the compiled source, when the failure belongs to one form, elsenil. The top-level walk records it directly on walk failures and carries it on definition specs for later validation phases.span—{offset, length}byte span of that offending top-level form in the compiled source. A parser failure may instead carry a zero-length position span such as{byte_size(source), 0}for EOF. Other failures keepnilwhen no position can be proved. Top-level form spans are resolved once, at the compile boundary, byPtcRunner.Lisp.Prelude.ErrorSpan. Bundle compilation resolves them in a separate bounded worker so optional attribution cannot change the primary compile result.
Summary
Functions
Builds a validation error.
Types
@type byte_span() :: {non_neg_integer(), non_neg_integer()}
@type reason() ::
:reserved_namespace
| :duplicate_ref
| :invalid_visibility
| :invalid_requires
| :invalid_metadata
| :qualified_self_reference
| :missing_namespace
| :invalid_namespace
| :invalid_signature
| :parse_error
| :unbound_var
| :unknown_namespace
| :compile_error
| :unrecognized_node
| :unknown_dependency
| :dep_ref_in_def
| :dependency_cycle
| :prelude_attach_failed