symfonic.services.shadow.gateway¶
gateway ¶
The shadow effect gateway โ the only way an effect leaves a shadow run.
Every framework port a shadow invocation crosses is routed here. The gateway has three possible behaviours and no fourth: deny, deterministically stub, or abort the whole run because the port is unclassified. There is deliberately no pass-through, not even behind a flag โ a flag would make the suppression claim a runtime property instead of a structural one.
DeterministicStub ¶
A pure function of (port, operation, payload). No state, no clock.
Determinism is the requirement, not realism: a comparator can only call a divergence real if re-running the same input twice gives the same answer.
ShadowEffectGateway ¶
ShadowEffectGateway(classification: EffectPortClassification, *, run_id: str, responder: StubResponder | None = None, ledger: EffectLedger | None = None)
Routes port calls through the classification; records every attempt.
Source code in src/symfonic/services/shadow/gateway.py
abort ¶
invoke ¶
Deny, stub, or abort. Never performs the effect.