symfonic.services.shadow.classification¶
classification ¶
The effect-port classification table and its exhaustiveness check.
This module is the registry T2.3.7's shadow harness is governed by. It answers exactly two questions — "is this port classified?" and "what does shadow mode do with it?" — and refuses to answer either by guessing.
EffectPortClassification
dataclass
¶
An immutable table of port_id -> disposition.
Immutable because a classification that could be widened at runtime would let a shadow run mint its own permission halfway through, which is exactly what the fail-closed rule is protecting against.
assert_classifies ¶
Every named port has a row. Complements :meth:assert_exhaustive.
Family coverage proves the taxonomy is complete; it says nothing about whether the ports the framework actually declares are in the table. A port the runtime crosses but the table has never heard of is not "fail-closed" — it is simply never observed, because nothing routes it through the gateway. This is the check that names them.
Source code in src/symfonic/services/shadow/classification.py
assert_exhaustive ¶
Every declared family has at least one classified port.
Source code in src/symfonic/services/shadow/classification.py
classify ¶
The classification row, or a fail-closed refusal. Never a default.
Source code in src/symfonic/services/shadow/classification.py
extended_with ¶
A new table with extra rows. Never mutates the receiver.