symfonic.services.shadow.trust¶
trust ¶
SHD-TR — extension trust classes.
The effect-port classification governs effects that cross framework ports. Preserved in-process Python tools, plugin callbacks, and contributed stages can open a socket without asking anybody, so classifying ports alone would let a shadow run claim suppression it never achieved. This registry closes that gap with a second axis: every registered tool, plugin, and contributed stage is either port-mediated (all of its effects cross classified ports) or opaque (unknown, therefore non-shadowable and non-replayable).
Three rules make the axis conservative rather than decorative:
- The default is opaque. An extension nobody classified is opaque, and so is every adopter-registered extension until it is promoted deliberately.
- Promotion requires a construction proof — injected framework port clients only, or framework-owned audited code — verified by somebody other than the extension itself. Self-declaration is refused by type.
- Promotion requires a named human reviewer from the owning capability, and that approval is what the cutover evidence records.
ConstructionProof
dataclass
¶
ConstructionProof(method: ProofMethod, verified_by: str, injected_ports: frozenset[str] = frozenset(), audited_module: str = '', self_declared: bool = False)
Why this extension's effects cannot leave the classified ports.
ExtensionRecord
dataclass
¶
ExtensionRecord(extension_id: str, kind: ExtensionKind, origin: ExtensionOrigin, trust: TrustClass, reason: str, proof: ConstructionProof | None = None, approval: ReviewerApproval | None = None)
What the registry knows about one extension.
ExtensionTrustRegistry ¶
Assigns and enforces trust classes. Default-deny by construction.
Source code in src/symfonic/services/shadow/trust.py
classify_port_mediated ¶
classify_port_mediated(extension_id: str, kind: ExtensionKind, *, proof: ConstructionProof, approval: ReviewerApproval, origin: ExtensionOrigin = ExtensionOrigin.FRAMEWORK) -> ExtensionRecord
Promote to port-mediated. Refuses everything short of the bar.
Source code in src/symfonic/services/shadow/trust.py
demote ¶
Force an extension to opaque and bar re-promotion under this id.
Source code in src/symfonic/services/shadow/trust.py
record_of ¶
The record, or a synthesized opaque one. Never raises for unknown.
Source code in src/symfonic/services/shadow/trust.py
register ¶
register(extension_id: str, kind: ExtensionKind, *, origin: ExtensionOrigin = ExtensionOrigin.ADOPTER, reason: str = 'registered without a construction proof') -> ExtensionRecord
Register an extension as opaque. This is the only bulk entry point.
Source code in src/symfonic/services/shadow/trust.py
ProofMethod ¶
Bases: StrEnum
The only two ways an extension can be port-mediated by construction.
ReviewerApproval
dataclass
¶
A named human from the owning capability signing off on a promotion.