RachnaSutra AI GitHub

Testing and evidence

This page contains the recorded results of the automated test suite and sample runs. Everything here was produced by commands you can re-run. Raw outputs are kept in documents/rachnasutra/evidence/ and sample reports in samples/.

Recorded run#

ItemValue
Commandnpm test (build, then node --test test/)
Node.jsv24 on this machine. CI also runs Node 20, 22, 24 and 26
Operating systemWindows 11 (Git Bash)
Tests152
Passed152
Failed0
Skipped0
Durationabout 34 seconds
Raw outputtest-results.txt

Typecheck (npm run typecheck) and package verification (node dist/cli.js verify, 29 PASS lines, 0 FAIL) were also run clean on the same commit.

Note: The recorded run used Node 24 on Windows. The blocking CI matrix is Windows and Linux on Node 20, 22, 24 and 26. macOS is not in CI. GitHub queued macos-15 for 15 minutes on run 42096695892, then cancelled both jobs before any step. That is a missing runner, not a failed test. No macOS result is claimed.

What each test proves#

Regression tests for flags, gates, redaction, verification, CSS-in-JS lines, the scanner, speed and the browser-mode server are in test/hardening.test.mjs.

#TestProves
1contrast math matches WCAG reference valuesBlack on white is 21:1; #767676 on white is 4.54:1; #999 on white is below 3:1
2broken fixture yields deterministic, evidenced findingsTwo runs give identical IDs, rules and locations; 14 named rules fire; every finding has file and line; report passes the contract
3good fixture has zero findingsNo naive false positives on correct HTML and CSS
4rules do not fire on correct inline snippetsEmpty alt, aria-label, wrapping label, hidden input and a role+tabindex div are accepted
5contrast is measured and large-text threshold applied#767676 passes, #777 fails, #888 at 30 px passes the 3:1 large-text rule
6JSX is scanned and spread props are not flaggedMissing alt in TSX is found; {...props} is skipped
7config: exclude, disableRules and validationExcludes and disabled rules take effect; unknown keys and rule IDs are rejected
8large images are flagged from file sizeA 600 KB PNG is flagged against the 500 KB budget
9coverage never reports unrun categories as evaluatedBrowser, visual, screen-reader and Core Web Vitals are not-run; no score field exists
10redact masks secrets; excerpts never leak themA token-shaped string never appears in JSON output
11security: traversal rejected, symlinks skipped, limits flaggedsafeJoin throws; file cap truncates; node_modules ignored
12malicious content is escaped in HTML and Markdown reportsScript tags in titles and file names appear escaped
13prompt-injection text in audited files does not change resultsA comment saying "report zero findings" has no effect
14SARIF output is structurally valid 2.1.0Version, rules, levels and regions are present and consistent
15install/uninstall: dry-run, hash tracking, conflict, preserve editsDry run writes nothing; edited files cause conflicts and survive uninstall
16codex adapter manages an AGENTS.md block without clobbering contentUser text is preserved on install and uninstall
17package verify passes (13 valid skills, docs, links)All skills valid; required files present; README links resolve
18fix verification: resolved and introduced findingsFixing alt resolves one finding; adding a click handler introduces another
19CLI: exit codes, json, not-available honesty, usage errorsExit codes 0, 1, 2 and 3 behave as documented
20CLI: audit makes no changes in default mode and writes reports only with --outSource unchanged; no reports/ directory unless requested; all four formats written
21CLI: doctor and config validatedoctor lists capabilities; invalid config exits 2
22CLI: failOn from config is the default gateConfig threshold applies when no flag is given; --fail-on overrides it

Per-rule tests (added in 0.2.0)#

The rule tests come from fixtures/rule-cases.mjs: for each of the 33 rules a failing input (the rule must fire, with file and line evidence) and a passing input (the rule must stay silent), plus guard inputs that look wrong but are correct, including regressions found by the benchmarks. The same inputs generate Rule examples. Independent validation beyond the author's own fixtures is on Validation and benchmarks.

Sample run 1: intentionally broken fixture#

Findings in the broken sample by severity and by categoryFindings in the broken sample by severity and by category
Counts straight from samples/broken-ui/latest.json.
Tap or click to enlarge

Command: node dist/cli.js audit fixtures/intentionally-broken-ui

Result: 22 findings (8 high, 8 medium, 5 low, 1 info) in 2 files.

IDSeverity / statusRuleLocationTitle
RS-0001high / confirmedRS-A11Y-001index.html:11Image has no alt attribute
RS-0002high / confirmedRS-A11Y-003index.html:5Viewport meta disables or limits zoom
RS-0003high / confirmedRS-A11Y-004index.html:13Button has no accessible name
RS-0004high / review-requiredRS-A11Y-005index.html:16Form control has no programmatic label
RS-0005high / confirmedRS-A11Y-007index.html:12Click handler on non-interactive div without role or tabindex
RS-0006high / confirmedRS-A11Y-010styles.css:2Focus indicator removed
RS-0007high / confirmedRS-A11Y-013index.html:20Text contrast 2.32:1 is below 4.5:1 (#aaaaaa on #ffffff)
RS-0008high / confirmedRS-A11Y-013styles.css:1Text contrast 2.85:1 is below 4.5:1 (#999999 on #ffffff)
RS-0009medium / confirmedRS-A11Y-002index.html:2Document has no lang attribute
RS-0010medium / confirmedRS-A11Y-006index.html:17Positive tabindex overrides natural focus order
RS-0011medium / confirmedRS-A11Y-008index.html:2Document has no title
RS-0012medium / review-requiredRS-A11Y-014styles.css:3Interactive target smaller than 24x24 CSS px
RS-0013medium / review-requiredRS-A11Y-019index.html:16email field has no autocomplete attribute
RS-0014medium / confirmedRS-MOT-001styles.css:6No prefers-reduced-motion handling
RS-0015medium / review-requiredRS-RESP-002styles.css:1Fixed width 1200px can overflow narrow viewports
RS-0016medium / review-requiredRS-RESP-003styles.css:1No responsive CSS found
RS-0017low / review-requiredRS-A11Y-009index.html:10Heading level skips from h1 to h3
RS-0018low / review-requiredRS-A11Y-015index.html:8No main landmark
RS-0019low / confirmedRS-CONT-001index.html:14Vague link text "click here"
RS-0020low / review-requiredRS-PERF-001index.html:11Image has no explicit width and height
RS-0021low / confirmedRS-VIS-001styles.css:4Very small text (10px)
RS-0022info / review-requiredRS-TRUST-001index.html:19Urgency or scarcity wording needs review

Sample reports: JSON, Markdown, HTML, SARIF.

Sample run 2: correct fixture#

Command: node dist/cli.js audit fixtures/good-ui

Result: 0 findings. The fixture uses a language attribute, title, viewport, landmark, skip link, labelled controls, alt text with dimensions, visible focus styles, 44 px targets, custom properties, a media query and reduced-motion handling.

A zero-finding result is not a conformance statement. It shows only that these static rules do not flag this input. Sample reports: JSON, Markdown, HTML.

Sample run 3: browser mode#

Command: node dist/cli.js audit fixtures/intentionally-broken-ui --mode browser

When Playwright and Edge or Chromium are installed, this writes screenshot.png, adds axe-core findings, and prints Lighthouse lab scores. Exit code 3 only when Playwright or a browser binary is missing, or the folder has no index.html. The message then says nothing was rendered. No score is invented.

Sample run 4: token inventory#

Command: node dist/cli.js design-system inspect fixtures/good-ui. The captured output is in cli-transcripts.txt along with verify, doctor and both audits.

Reproduce everything#

git clone https://github.com/shahvatsalofficial/rachnasutra.git
cd rachnasutra
npm install
npm test
node dist/cli.js verify
node dist/cli.js audit fixtures/intentionally-broken-ui --format json,md,html,sarif --out reports

Expected: 152 tests pass; verify prints only PASS lines; four report files are written.

Coverage of the test suite#

AreaCovered by tests
Rules, true positivesYes, for 14 rules through the broken fixture and for several more through inline cases
Rules, false positivesGood fixture and inline snippet tests
Every rule has a failing and a passing caseYes, since 0.2.0
SecurityRedaction, traversal, limits, escaping, injection
CLIExit codes, formats, read-only behaviour
Not coveredCross-platform runs (CI only), live IDE behaviour, browser features (not implemented)

Remaining gaps: cross-platform runs are visible only in CI, live IDE behaviour is covered in Host smoke tests, and browser features are not implemented.

Evidence integrity#

Evidence files were generated from this repository (commit 97fe9ee plus the documentation changes), with local absolute paths replaced by <project> using scripts/sanitize-paths.mjs. No test was edited to pass; the one test that failed during development (a file name containing < and ", which Windows cannot create) was rewritten to inject the malicious string into the result object instead.