aisp-validator
v0.3.0
Published
AISP 5.1 document validator - validates AI Symbolic Protocol specifications with <2% ambiguity
Maintainers
Readme
AISP Validator
Validate AISP 5.1 documents — AI Symbolic Protocol with <2% ambiguity.
Install
npm install aisp-validatorCLI Usage
# Validate a document
npx aisp-validator validate spec.aisp
# Detailed output with JSON
npx aisp-validator validate spec.aisp --long
npx aisp-validator validate spec.aisp --jsonOutput:
✓ VALID
Tier: ◊⁺⁺ Platinum
Semantic (δ): 1.000
Pure (ρ): 1.857Node.js Usage
import AISP from 'aisp-validator';
await AISP.init();
const result = AISP.validate(`
𝔸1.0.example@2026-01-16
γ≔test
⟦Ω:Meta⟧{ ∀D:Ambig(D)<0.02 }
⟦Σ:Types⟧{ T≜ℕ }
⟦Γ:Rules⟧{ ∀x:T:x≥0 }
⟦Λ:Funcs⟧{ f≜λx.x }
⟦Ε⟧⟨δ≜0.75;τ≜◊⁺⁺⟩
`);
console.log(result.valid); // true
console.log(result.tier); // '◊⁺⁺'
console.log(result.tierName); // 'Platinum'
console.log(result.delta); // 0.82Browser Usage
<script type="module">
import AISP from 'aisp-validator/browser';
await AISP.init('/path/to/aisp.wasm');
const result = AISP.validate(source);
</script>Quality Tiers
| Tier | Symbol | δ Threshold | Description | |------|--------|-------------|-------------| | Platinum | ◊⁺⁺ | ≥ 0.75 | Production ready | | Gold | ◊⁺ | ≥ 0.60 | Pre-production | | Silver | ◊ | ≥ 0.40 | Development | | Bronze | ◊⁻ | ≥ 0.20 | Draft | | Reject | ⊘ | < 0.20 | Invalid |
Required Blocks
Every AISP document needs 5 blocks:
| Block | Purpose |
|-------|---------|
| ⟦Ω⟧ | Meta/Foundation |
| ⟦Σ⟧ | Types/Glossary |
| ⟦Γ⟧ | Rules/Inference |
| ⟦Λ⟧ | Functions |
| ⟦Ε⟧ | Evidence |
API
| Method | Returns | Description |
|--------|---------|-------------|
| AISP.init() | Promise | Initialize WASM (call once) |
| AISP.validate(src) | Object | Full validation result |
| AISP.isValid(src) | boolean | Quick valid check |
| AISP.getTier(src) | string | Tier symbol only |
| AISP.getDensity(src) | number | Semantic density δ |
| AISP.validateFile(path) | Object | Validate file (Node.js) |
Validation Result
{
valid: true, // Document passes validation
tier: '◊⁺⁺', // Quality tier symbol
tierName: 'Platinum', // Tier name
tierValue: 4, // Numeric (0-4)
delta: 0.82, // Semantic density [0,1]
pureDensity: 1.85, // Symbol concentration
ambiguity: 0.01, // Must be <0.02
errorCode: 0 // 0 = success
}What is AISP?
AI Symbolic Protocol is a formal specification language for AI-to-AI communication:
- <2% Ambiguity — Eliminates interpretation errors
- Formal Semantics — Based on type theory
- Machine-Readable — Designed for AI agents
- Human-Auditable — Clear structure for review
Links
- AI Guide — Full AISP 5.1 spec
- Human Guide — Introduction
- GitHub
Author
Bradley Ross — GitHub @bar181
License
MIT
