# `PtcRunner.Kernel.CommandPath`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/command_path.ex#L1)

Schema-authorized diagnostic path.

Paths are minted only after every property or index has been walked through
the host/manifest schema, the exact selected branch of one compiled value
contract, the shared discriminator projection when no tagged-union branch
matches, or — for a contract schema rejected before it compiles — the
submitted document itself. The attestation prevents a caller-authored segment
list from being substituted at the diagnostic boundary, and carries the
authority that admitted it so a path cannot be moved to another document.

# `segment`

```elixir
@type segment() :: {:property, binary()} | {:index, non_neg_integer()}
```

# `t`

```elixir
@type t() :: %PtcRunner.Kernel.CommandPath{
  attestation: binary(),
  authority:
    :host
    | :project
    | :manifest
    | :component_override
    | {:value_contract_schema, binary()}
    | {:contract, PtcRunner.Kernel.CommandContractAuthority.t()},
  segments: [segment()]
}
```

# `component_override`

```elixir
@spec component_override([segment()]) :: {:ok, t()} | {:error, :invalid_command_path}
```

# `contract`

```elixir
@spec contract(PtcRunner.Kernel.CommandContractAuthority.t(), [segment()]) ::
  {:ok, t()} | {:error, :invalid_command_path}
```

# `host`

```elixir
@spec host([segment()]) :: {:ok, t()} | {:error, :invalid_command_path}
```

# `manifest`

```elixir
@spec manifest([segment()]) :: {:ok, t()} | {:error, :invalid_command_path}
```

# `project`

```elixir
@spec project([segment()]) :: {:ok, t()} | {:error, :invalid_command_path}
```

# `to_pointer`

```elixir
@spec to_pointer(t()) :: binary()
```

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

# `value_contract_schema`

```elixir
@spec value_contract_schema(binary(), map(), [segment()]) ::
  {:ok, t()} | {:error, :invalid_command_path}
```

Locates a fault inside a value-contract schema document that failed to compile.

A rejected contract has no compiled path schema to authorize against, so the
submitted document is the authority: a pointer is minted only when every
segment resolves in the document the author wrote. The pointer therefore
always names a key or index that file actually carries.

The document's logical name is attested with the segments. A diagnostic
boundary requires it to equal the source it names, so a pointer minted for
one contract file cannot be attached to a diagnostic about another.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
