Files
vm-cloudflare/layer0/entrypoint.py
2025-12-17 00:02:39 +00:00

18 lines
577 B
Python

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