| name | ari-vitest-guardian |
| description | Vitest-specific testing skill for ARI's 80%+ coverage requirement and security path testing |
| triggers | ["run tests","test ari","check coverage","test security paths"] |
ARI Vitest Guardian
Purpose
Ensure ARI maintains its testing requirements:
- 80%+ overall code coverage
- 100% coverage on security paths (kernel/sanitizer, agents/guardian, governance/arbiter)
- All new features include tests
- Bug fixes include regression tests
ARI Test Structure
tests/
โโโ unit/ # Component tests
โ โโโ kernel/ # sanitizer, audit, event-bus (100% required)
โ โโโ system/ # router
โ โโโ agents/ # core, guardian, executor, planner, memory-manager
โ โโโ governance/ # council, arbiter, overseer (100% required)
โโโ integration/ # Full pipeline tests
โโโ security/ # Injection defense tests (100% required)
Commands
npm test
npm run test:watch
npm run test:coverage
Workflow
When Running Tests
- Execute
npm test via Bash
- Parse Vitest output for failures
- If security tests fail โ CRITICAL priority
- If coverage drops below 80% โ Block commit
- Report results with file:line references
When Writing New Tests
Follow ARI's test structure:
import { describe, it, expect, beforeEach } from 'vitest';
import { Component } from '../../src/layer/component.js';
describe('Component', () => {
let component: Component;
beforeEach(() => {
component = new Component();
});
describe('featureName', () => {
it('should handle expected case', () => {
const result = component.method('input');
expect(result).toBe('expected');
});
});
});
Security Path Testing
These paths require 100% coverage:
| Path | File | Critical Functions |
|---|
| Sanitizer | src/kernel/sanitizer.ts | sanitize(), detectInjection() |
| Guardian | src/agents/guardian.ts | assessThreat(), calculateRisk() |
| Arbiter | src/governance/arbiter.ts | validateConstitutional() |
| Audit | src/kernel/audit.ts | log(), verifyChain() |
Integration with CI
ARI uses GitHub Actions for CI. Tests must pass before merge.