Validation in AGISystem2 is the process of verifying that knowledge and reasoning results satisfy consistency constraints. The ValidationEngine performs checks at multiple levels: individual assertions, reasoning chains, and global theory coherence.
The ValidationEngine processes input through three stages: syntactic checks (valid DSL), semantic checks (valid dimensions and types), and consistency checks (no conflicts with existing knowledge). Conflicts are detected when assertions would place a concept in incompatible regions.
| Check Type | What It Verifies | Example Failure |
|---|---|---|
| Syntactic | DSL grammar, concept names exist | "UnknownConcept IS_A Animal" |
| Dimension bounds | Int8 values in [-128, +127] | Property value 200 (out of range) |
| Containment | IS_A implies geometric containment | Dog IS_A Fish when Mammal ∩ Fish = ∅ |
| Cycle detection | No circular IS_A chains | A IS_A B, B IS_A C, C IS_A A |
| Axiological | Value dimensions consistent | GOOD and EVIL on same concept |
The ValidationEngine exposes three main methods:
// Validate a single assertion before committing
const result = validationEngine.validateAssertion(assertion, context);
// result: { valid: true } or { valid: false, reason: "..." }
// Check consistency of a reasoning chain
const chainResult = validationEngine.validateChain(steps);
// Full theory consistency check
const globalResult = validationEngine.validateTheory(theoryStack);
When validation fails, the engine returns a detailed error with the conflict location and suggested fix.
| Mode | Behavior | Use Case |
|---|---|---|
| Strict | Reject on any inconsistency | Production, safety-critical |
| Warn | Log warning, allow operation | Development, exploration |
| Repair | Auto-adjust to fix conflicts | Learning, incremental updates |