Expand description
What is representable, per draft, per site, per stream — and why not.
One function answers that question — classify — and it has exactly
two callers: Capabilities::supports / Capabilities::supports_on,
which publish the table a scenario author reads before a run, and the
engine’s executor, which decides what actually happens during one. That
is the whole of the design: the table and the engine are the same code,
so the table cannot become a documented lie about the engine.
tests/action_matrix.rs asserts it against observed behaviour on all
thirteen drafts.
§Where each Refusal comes from
Not every refusal is a (site, kind) fact, so not every refusal is
classify’s to produce:
- Classified here, from
(site, kind)plusCapCtx:Refusal::WrongSite,Refusal::ControlStreamResetIllegal,Refusal::LengthChanged,Refusal::WouldRedefineSubgroupId,Refusal::WouldDestroyStatusObject,Refusal::ReservedHeaderModeandRefusal::PayloadNotDelimited. - Produced by the executor, because they depend on the action’s payload
or on session state rather than on the pair:
Refusal::WrongComposition(what aDelay/Holdwrapped),Refusal::ErrorCodeOutOfRange(the numeric code) andRefusal::SessionAlreadyClosing(a close already in flight). They are reachable, and the sweep observes them; they are simply not decidable from a kind. - Table-only:
Refusal::StreamNotFramedandRefusal::ControlFrameNotDecodable. Both appear only insideSupport::NotAttemptableandSupport::Unreachable, where nothing is ever attempted, so neither is ever emitted as aProxyEvent::ActionRefused.
tests/action_matrix.rs::every_declared_refusal_is_reachable_or_declared_table_only
asserts that split per variant, in both directions.
§The table answers for a build, not only for a draft
DraftVersion carries all thirteen variants under every feature set,
so Capabilities::for_draft answers for drafts this binary cannot
speak. A reduced-draft build — --no-default-features --features draft07, a shipped configuration and one of CI’s fourteen rows — cannot
frame a byte of the twelve drafts it left out, and
ProxySessionConfig::default().draft is Draft14 with nothing
validating it against the compiled set. draft_is_compiled is
therefore a fact classify reads, exactly like the draft number, and
the object and control sites on an uncompiled draft are
Support::Unreachable rather than Support::Yes. The two fail in
different decoders and report different events, so they are two reads
of the same fact rather than one; see Instead, which is where each
names what a run emits in its place. In the default all-drafts build
every row of the table is unchanged.
Structs§
- CapCtx
- The facts
classifyneeds. - Capabilities
- What a draft can express, queryable before a run.
- Unsupported
Matcher Key - A class rule keyed on something no unit it could claim ever carries.
Enums§
- Action
Kind - A capability, named independently of whether
Actioncan express it. - Instead
- What a run reports in place of the action event a
Support::Unreachablecell can never produce. - Matcher
Key - One value key a
Matchercan be built on. - NotAttemptable
- Why a
Support::NotAttemptablecell cannot be reached. - Precondition
- A runtime fact a
Support::Conditionalverdict depends on. - Refusal
- Why an action could not be executed.
- Site
- Where a decision was taken.
- Support
- Whether a capability is available.
Constants§
- DEFAULT_
DRAFT - The draft a session configuration takes when the caller names none.
Functions§
- classify
- The single source of truth for what is executable.
- draft_
is_ compiled - Whether this build compiled a codec for
draft. - supports_
matcher - Whether a rule keyed on
fieldcan ever claim a unit arriving askind, ondraft, in this build.