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

@@ -5,13 +5,29 @@
**Implements:** The Fourfold Work from [RED-BOOK.md](RED-BOOK.md) — Nigredo → Albedo → Citrinitas → Rubedo
**See Also:** [DEMO_COGNITION.md](DEMO_COGNITION.md) for live transcripts showing the Cognition Flow in action — one blessed query and one forbidden query demonstrating guardrails.
**See Also:** [DEMO_COGNITION.md](DEMO_COGNITION.md) for live transcripts showing the Cognition Flow in action — one blessed query and one forbidden query demonstrating guardrails.
**Layer 0 Spec:** [LAYER0_SHADOW.md](LAYER0_SHADOW.md) for the pre-boot classifier and routing membrane.
---
## The Flow (7 Layers)
## The Flow (8 Layers, with Layer 0 pre-boot)
```
┌────────────────────────────────────────────────────────────────────────────┐
│ LAYER 0: Shadow Eval (Pre-Boot) │
│ ────────────────────────────────────────────────────────────────────── │
│ Before doctrine loads: │
│ ├─ Classify: blessed | ambiguous | forbidden | catastrophic │
│ ├─ Topology detect: infra | data | identity | runtime | meta │
│ ├─ Risk estimate: 1 → 5 │
│ ├─ Routing: │
│ │ - blessed → Layer 1 (Boot) │
│ │ - ambiguous → clarification request (no load) │
│ │ - forbidden → Layer 4 (Guardrails) direct │
│ │ - catastrophic → fail closed + log anomalies/preboot_shield.jsonl │
│ └─ Full spec: LAYER0_SHADOW.md │
└────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────┐
│ LAYER 1: Boot (Doctrine Load) │
│ ────────────────────────────────────────────────────────────────────── │
@@ -236,5 +252,5 @@ For large projects:
---
**This is the Cognition Engine.** Every query flows through these 7 layers.
**Doctrine → Routing → Tools → Guardrails → Terraform → GitOps → Logs.**
**This is the Cognition Engine.** Every query flows through these 8 layers.
**Shadow Eval → Doctrine → Routing → Tools → Guardrails → Terraform → GitOps → Logs (then back to Shadow Eval).**