Closed phase-1 parser rejection.
Unknown switches are deliberately not retained. The value may carry only a declaration-owned accepted list. Missing-value, destination, and collision failures retain only declaration-owned switch names, never caller-owned paths.
Summary
Functions
Builds the rejection for a ptc docs page name nothing serves.
Builds the rejection for an envelope destination that already exists.
Builds the rejection for a ptc init --example name nothing embeds.
Builds the rejection for a project document that declares no host.
Types
@type t() :: %PtcRunner.Kernel.CommandRejection{ accepted: [binary()], code: atom(), command: atom(), conflicts: [binary()], destination: binary() | nil, kind: :generic | :unknown_switch | :missing_switch_value | :positional_arity | :invalid_destination | :unknown_page | :unknown_example | :destination_exists | :destination_collision | :private_output_recovery_collision | :init_destination_collision | :project_host_undeclared, option: binary() | nil }
Functions
@spec destination_collision( PtcRunner.Kernel.CommandDeclaration.command(), atom(), atom(), PtcRunner.Kernel.CommandDeclaration.frontend() ) :: t()
@spec docs_page_unknown() :: t()
Builds the rejection for a ptc docs page name nothing serves.
Bare ptc docs already lists the served set, so the failing form is the one
case where a reader is holding a name and cannot see the alternatives. The
list is declaration-owned, like the accepted switches of unknown_switch/2;
the caller's own token is not retained.
@spec envelope_destination_exists( PtcRunner.Kernel.CommandDeclaration.command(), PtcRunner.Kernel.CommandDeclaration.frontend() ) :: t()
Builds the rejection for an envelope destination that already exists.
The reserve behind every published artifact refuses to clobber, so an existing envelope path is a failure however late it is discovered. Discovering it at admission is the difference between refusing a command and refusing it after the workflow has executed and been billed. The caller's path is not retained; the switch name is declaration-owned.
@spec example_unknown() :: t()
Builds the rejection for a ptc init --example name nothing embeds.
Same shape as docs_page_unknown/0: the embedded set is declaration-owned and
is listed, while the caller's own token is not retained.
@spec init_destination_collision(PtcRunner.Kernel.CommandDeclaration.frontend()) :: t()
@spec invalid_destination( PtcRunner.Kernel.CommandDeclaration.command(), atom(), PtcRunner.Kernel.CommandDeclaration.frontend() ) :: t()
@spec missing_switch_value( PtcRunner.Kernel.CommandDeclaration.command(), binary(), PtcRunner.Kernel.CommandDeclaration.frontend() ) :: t()
@spec positional_arity(PtcRunner.Kernel.CommandDeclaration.command()) :: t()
@spec private_output_recovery_collision( PtcRunner.Kernel.CommandDeclaration.frontend() ) :: t()
@spec undeclared_project_host(:models | :doctor) :: t()
Builds the rejection for a project document that declares no host.
Restricted to the two commands that need one, so generic/2 cannot mint a
command/code pair the envelope contract refuses and CommandOutcome would
raise on.
@spec unknown_switch(atom(), PtcRunner.Kernel.CommandDeclaration.frontend()) :: t()