Home / Concepts

Architecture

You and your tools

A developer, a CI job, or an AI editor that loaded the skills.

terminalCI pipeline18 agent skills

Command line shell

Reads files, writes reports, sets exit codes. The only part that touches the disk.

cli/evalsutracli/install

Deterministic core

Same input gives the same result. Fixture text is data and is never executed.

evaluatestatstracesecuritycapsule

Output and assurance

Reports for people and machines, and a self-audit that shows its working.

reportersaudit

Runtime

Node.js 22+ built-ins only. Zero dependencies. No network. No telemetry. No model calls.

Context (C4 level 1)#

ActorInteraction
Developer or CI jobruns evalsutra with a suite and observations, reads reports and exit code
AI IDE (Claude Code, Cursor, Codex, Gemini CLI, Copilot)loads installed SKILL.md files and uses its own AI to follow them
Target agentnot touched. It produces observations elsewhere
Filesystemthe only external system EvalSutra reads and writes

There is no network, database, queue, server or model call.

Containers and components (C4 levels 2 and 3)#

ComponentPathResponsibility
CLIpackages/cli/evalsutra.mjsargument parsing, exit codes, file I/O
Installerpackages/cli/install.mjsskill copy, lock file, traversal and symlink guard
Evaluatorpackages/core/evaluate.mjssuite validation, assertions, scoring, gate, comparison
Statisticspackages/core/stats.mjsWilson interval, pass@k
Security helperspackages/core/security.mjssecret redaction, stable JSON, SHA-256 digests
Trace analyserpackages/core/trace.mjstool trace findings
Repro capsulepackages/core/capsule.mjsexport and verify
Reporterspackages/reporters/HTML, JUnit; theme.mjs is the shared design system
Self-auditpackages/audit/audit.mjs29 checks, MD and HTML audit report
Skills.agents/skills/, skills/18 instruction files, canonical and plugin copy
Doc and evidence buildersscripts/build-docs.mjs, scripts/build-evidence.mjsthis documentation and its proof

Data flow#

From rules to a decision in five steps
  1. CLI reads suite and observations (readJson, errors become exit code 1 or 4).
  2. validateSuite rejects bad ids, unknown assertion types, unsafe regex, bad weights, bad thresholds.
  3. For each case and assertion, a pure function returns {status, reason, detail}. No assertion can run code from the fixture.
  4. Weak evidence sources downgrade passes to inconclusive.
  5. Weights give pass rate and coverage; counts give the gate.
  6. Digests of suite and observations, tool and Node versions go into provenance.
  7. Reporters render JSON, Markdown, HTML, JUnit.
  8. compare, gate, repro and audit consume the JSON report.

Key design decisions (ADRs)#

IDDecisionReasonTrade-off
ADR-1Plain JavaScript ES modules, no build stepnpx and clone both run immediately; nothing to compile or breakno static types; covered by tests instead
ADR-2Zero dependenciesno supply-chain risk, tiny audit surfacesome code (Markdown converter, Wilson) written in-house
ADR-3Missing evidence is inconclusiveprevents score inflationmore REVIEW results until evidence is complete
ADR-4Model judges cannot prove a passjudge output is an opinionLLM-graded rubrics cannot gate alone
ADR-5Replay runner onlylive execution needs sandbox and consent designusers must record observations elsewhere
ADR-6Regex is length-capped and screened, not RE2no native dependencyheuristic; upgrade if untrusted suites become common (marked shortcut: in code)
ADR-7Capsule is hashed, not signedsigning needs key managementdetects accidents, not forgers
ADR-8Reports contain no scriptsafe to open anywhereno interactive charts yet

Failure modes#

FailureBehaviour
Unreadable or invalid JSONexit 1 with the file path and parser message
Invalid suiteexit 4 listing every error
Missing observation or fieldinconclusive with reason code
Unsafe regexerror status, never executed
Output folder not writableexit 1
Install target outside projectrefused, exit 1
Modified skill at uninstallkept and reported

Extension points#

Add an assertion type in evaluate.mjs (validate, evaluate, test, audit row). Add a reporter in packages/reporters/. Add a skill folder under .agents/skills/ and run the sync (see Contributor handbook). Planned adapters (OpenTelemetry, Promptfoo, Inspect AI, Harbor, MCP Inspector) are described in Roadmap and status and are not implemented.

Deployment topology#

A single Node process on the user's machine or CI runner. Distribution: npm (npx evalsutra) and GitHub source (npx github:shahvatsalofficial/evalsutra). Nothing is hosted.

Observability#

Output is the report. Exit codes are the machine interface. There is no telemetry.