Anti-Hallucination Protocol
CLEO’s core mission is preventing hallucination - when AI generates plausible but incorrect data. Every operation undergoes four-layer validation.The Four Validation Layers
- Layer 1: Schema
- Layer 2: Semantic
- Layer 3: Cross-File
- Layer 4: State Machine
JSON Schema EnforcementEvery data structure is validated against a strict JSON Schema:
- Structure validation - Required fields, proper nesting
- Type checking - Strings, numbers, arrays, objects
- Enum constraints -
status: pending|active|blocked|done - Format validation - ISO 8601 timestamps, T### IDs
Exit Code Guarantees
Every operation returns a meaningful exit code:| Code | Category | Meaning |
|---|---|---|
| 0 | Success | Operation completed |
| 2 | Input | Invalid arguments |
| 4 | Resource | Not found |
| 6 | Validation | Schema/semantic failure |
| 10-14 | Hierarchy | Parent/depth/sibling issues |
| 20-22 | Integrity | Checksum/sequence/collision |
| 100-102 | Special | No data/exists/no change |
Exit codes enable LLM agents to branch programmatically without parsing error messages.
Checksum Protection
Critical files include checksums for integrity verification:Sequence Integrity
Task IDs follow a strict sequential pattern:Recovery Mechanisms
When validation fails, CLEO provides recovery paths:Checksum Mismatch
Checksum Mismatch
Orphaned Tasks
Orphaned Tasks
Schema Outdated
Schema Outdated
