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

17
layer0/entrypoint.py Normal file
View File

@@ -0,0 +1,17 @@
from .shadow_classifier import ShadowClassifier, Classification, ShadowEvalResult
from .preboot_logger import PrebootLogger
classifier = ShadowClassifier()
def layer0_entry(query: str) -> tuple[str, ShadowEvalResult]:
"""
Main entrypoint called before Layer 1 (Doctrine Load).
Returns the routing action and the full evaluation result.
"""
result = classifier.classify(query)
if result.classification in (Classification.CATASTROPHIC, Classification.FORBIDDEN):
PrebootLogger.log(result, query)
return result.to_routing_action(), result