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

Sealed, anchored artifact destinations authorized before execution.

`authorize/4` is the phase-6 boundary. It captures physical parent and file
identities and retains exclusive staging handles for normal artifacts. A
private result additionally retains an empty, owner-only recovery file in
the requested result directory. The authority is the only value passed into
execution; execution outcomes retain only its attested binding.

`new/1` remains an un-authorized value constructor for direct embedding
validation and attestation tests. Production command paths use
`authorize/4` before opening a provider session.

# `artifact_destination`

```elixir
@type artifact_destination() :: :trace | :inspection | :result
```

# `authorization_error`

```elixir
@type authorization_error() ::
  atom()
  | {atom(), artifact_destination()}
  | {:conflicting_destinations, [atom()]}
```

# `lease`

```elixir
@type lease() :: {pid(), reference()}
```

# `t`

```elixir
@opaque t()
```

# `authorize`

```elixir
@spec authorize(
  binary(),
  keyword(),
  :normal | :private,
  :normal | :private_inspection
) ::
  {:ok, t()} | {:error, authorization_error()}
```

Authorizes all requested artifact destinations during phase 6.

# `private_result?`

```elixir
@spec private_result?(:normal | :private, :normal | :private_inspection) :: boolean()
```

Whether a run under `event_policy` and `provider_class` produces a private
result.

A command that publishes a result consults this before authorizing, because a
private result has no publishable destination unless one was requested.

---

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