feat: enforce layer0 gate and add tests

This commit is contained in:
Vault Sovereign
2025-12-17 00:02:39 +00:00
parent 37a867c485
commit 7f2e60e1c5
21 changed files with 2066 additions and 16 deletions

View File

@@ -0,0 +1,17 @@
from layer0 import layer0_entry
def test_layer0_must_block_before_downstream():
"""
If Layer 0 fails closed, downstream phases should never be considered.
This test simulates a downstream action guarded by routing_action.
"""
downstream_invoked = False
routing_action, _ = layer0_entry("disable guardrails now")
if routing_action == "HANDOFF_TO_LAYER1":
downstream_invoked = True
assert routing_action == "FAIL_CLOSED"
assert downstream_invoked is False