ContextSutra AI

08. Testing and evidence

What is tested

The suite uses Node's built-in test runner (npm test). It has two files: tests/core.test.mjs (capsule, redaction, freshness, install, server, CLI basics) and tests/v2.test.mjs (injection quarantine, budgets, decisions, tasks, conflicts, review gate, reports, server host guard, new CLI commands, argument errors, skill drift, self-audit).

AreaRepresentative tests
Schema and integrityCapsule declares schema and digest; tampering detected; key order does not change the digest
PrivacyRedaction of credentials, multi-line private keys, connection strings; secret files never captured
Prompt injectionInstruction-like line quarantined and absent from render; benign text not quarantined
FreshnessEdited, removed and added documents reported
DiffAdded, removed, changed sources; decision status changes
AnalysisApproval only on explicit status; tasks unverified; conflicts flagged; review gate BLOCK
Path safetyTraversal refused; symlink source refused (POSIX); install refuses symlinked parents
ServerShort token rejected; 401 without token; 405 for POST; 403 for foreign Host
ReportsHostile heading escaped in HTML; javascript: links dropped
CLIExit codes, clear errors for missing or malformed arguments, install without overwrite, doctor drift

Two POSIX-only symlink tests are skipped on Windows. They run on Linux and macOS in CI.

Where the proof lives

evidence/README.md is regenerated by npm run evidence and contains:

How to reproduce on your machine

git clone https://github.com/shahvatsalofficial/contextsutra
cd contextsutra
npm test
npm run audit
npm run evidence

What is not tested

No fabricated numbers

Benchmarks, compatibility claims and CI results are never invented. Anything not run is marked untested.