Validate 3Lens contracts and run regression tests. Use when checking contract compliance, validating attribution coverage, or running CI validation checks.
Validation operations ensure code changes comply with 3Lens contracts and don't introduce regressions.
# Validate Inspector contract
3lens validate inspector
# Validate Capture contract
3lens validate capture
# Validate Entity Graph contract
3lens validate entity-graph
# Validate Attribution contract
3lens validate attribution
# Validate Fidelity contract
3lens validate fidelity
# Validate Overhead contract
3lens validate overhead
# Run all contract validations
3lens validate all
# Verbose output
3lens validate all --verbose
# Ensure all metrics have culprit paths
3lens validate attribution
Fails if any metrics exist without a clickable path to culprit entities.
| Contract | Purpose |
|---|---|
inspector | The 5 Inspector questions |
capture | Event schema, render events |
entity-graph | Stable namespaced IDs, typed nodes/edges |
attribution | Weighted blame chains |
fidelity | EXACT/ESTIMATED/UNAVAILABLE |
overhead | Capture modes, performance budget |
shader-graph | Runtime introspection |
Add validation to your CI workflow:
# .github/workflows/ci.yml
- name: Validate Contracts
run: pnpm 3lens validate all
{
contract: string,
passed: boolean,
checks: {
name: string,
passed: boolean,
message?: string
}[],
summary: {
total: number,
passed: number,
failed: number
}
}
Contracts are defined in .cursor/contracts/:
inspector.md - Inspector contractcapture.md - Capture contractentity-graph.md - Entity graph contractattribution.md - Attribution contractfidelity.md - Fidelity contractoverhead.md - Overhead contractshader-graph.md - Shader graph contract