ArchSutra AI / Handbook
Performance and quality metrics
Measured speed, memory, test coverage and robustness checks, with the exact commands and caveats.
All numbers are measured, reproducible, and from a developer laptop (Windows 11), so absolute timings are pessimistic compared with Linux CI because of slower file-system access and antivirus scanning.
Speed and memory (synthetic repositories)#
Generated by node scripts/bench.mjs into docs/proof/benchmarks.md. Each case runs in a fresh process so peak memory is meaningful.
| Case | Files scanned | Time | Peak RSS |
|---|---|---|---|
| small (200 files) | 201 | about 0.4 s | about 60 MB |
| medium (1 000 files) | 1 001 | about 2 s | about 100 MB |
| at the default file limit (5 000) | 5 000 | about 6 to 10 s | about 240 MB |
| over the limit (20 000 generated) | 5 000, reported as truncated | about 7 s | about 240 MB |
Speed on real repositories#
From docs/proof/realworld/results*.json (52 repositories, shallow clones): median 1.2 s per repository; typical small libraries under 0.5 s; the largest (5 000-file limit reached: django, webpack, prettier) take roughly 8 to 10 s on a quiet machine and up to 35 s when the machine is busy. Timings include reading files and all rules.
Bounds (why runtime is limited)#
| Limit | Default | Effect |
|---|---|---|
| Files | 5 000 | stop collecting, mark truncated |
| Size per file | 512 KiB | larger files skipped and counted |
| Total bytes | 120 MiB | stop collecting, mark truncated |
| Traversal time | 15 s | stop walking, mark truncated |
| Text cache | 160 MiB | beyond that files are re-read instead of cached |
| Line length scanned | 2 000 characters | longer lines skipped (also a ReDoS guard) |
The 15-second budget covers the directory traversal only; the rule scan after it is bounded by the file, size and byte caps. Truncation is always reported in the output ("TRUNCATED" and a blind-spot line), never silent.
Test coverage#
Node's built-in coverage over dist/ (report: docs/proof/coverage.txt):
| Metric | Value |
|---|---|
| Lines | 92.4% |
| Branches | 80.7% |
| Functions | 91.1% |
Weakest areas: CLI argument-error branches and rarely used verify branches. CI prints coverage on every run; no minimum is enforced yet.
Robustness checks in the test suite#
| Check | Test |
|---|---|
| Pathological and very long lines finish under 3 s (ReDoS guard) | adversarial inputs: long and pathological lines ... |
| Hostile file names, binary content, bidi characters never crash or execute | hostile file names and binary content ... |
| Path traversal rejected | safeJoin rejects traversal, export ... blocks escaping --output |
| Symlinks not followed | walk does not follow symlinks |
| Secrets never appear in output | redact ..., audit finds seeded problems ... |
| Total-byte budget reported as truncation | total-bytes budget truncates and reports it |
Quality gates in CI#
Typecheck (strict TypeScript), 36 tests on Ubuntu and Windows across Node 20, 22 and 24 (plus Ubuntu on the newest Node), structural verification of skills, agents, links and diagrams, a self-audit with --fail-on high, a production-dependency check, CodeQL, and (on pull requests) the DCO check. macOS is not in CI.