Search docs
Project reference
Testing and evaluation
Use Node.js 22.18 or later and Python 3 for packaging. Shared tests and evaluation inputs must be synthetic.
pnpm install --frozen-lockfile
pnpm typecheck
pnpm test
pnpm test:security
pnpm build
pnpm eval
pnpm release:check
For npm, use npm test, npm run test:security, npm run build, npm run eval, and npm run release:check. Read actual results and status codes before making claims.
Fixture and integration checks
- Assert that protection preserves ordinary amounts and source identifiers. Cover Unicode spans, overlapping findings, unsupported inputs, excessive sizes, credential blocks, CLI exit codes, and value-free JSON.
- Use mock provider traffic for relay tests. Check denial with zero upstream calls, valid streaming, cancellation, and request fields that contain supported identifiers. Use isolated settings for native installer checks.
- The security suite checks relay origin and host validation, token validation, invalid UTF-8, restricted routes, and zero upstream calls for rejected requests. The release check validates browser network policies and the extension permission set. CI also scans Git history and the dependency lockfile and runs CodeQL.
- Test the built extension and PWA in a browser. Verify that raw markers do not reach the provider page or its network, copy works, and changing destinations prevents insertion. Reload the PWA offline after initialization.
- Keep evaluation scenarios separate from rule design examples. Record corpus size, benign examples, classification and masking metrics, and limits in the benchmark records.
Run both installed agent clients against isolated synthetic settings with node tests/e2e/native.mjs claude-code codex. Use node tests/e2e/codex.mjs to verify the pinned Codex client against the local mock in an environment that permits loopback sockets. CI also runs the packaged Playwright browser checks.
Multilingual and configuration coverage
The security CI job runs the same deterministic matrix as npm run test:security. Its fixtures use synthetic text and assert both sensitive-value removal and preservation of unrelated text.
- Localized labels test customer ID and date of birth in Spanish, French, German, Portuguese, Hindi, Arabic, Chinese, Japanese, and Korean. The matrix combines label variants with separators, wrapped values, and LF and CRLF line endings.
- Multilingual context crosses every baseline evaluation family with Spanish, French, German, Portuguese, Hindi, Bengali, Arabic, Chinese, Japanese, Korean, Russian, and Thai surrounding prose. Localized prose and native label recognition are separate coverage dimensions.
- Configuration checks UTF-8 BOM, shell export and numbered snippets, quoting, comments, and multiline values for dotenv. Source fixtures cover JavaScript, TypeScript, Python, Go, Kotlin, Java, C, C#, Rust, Ruby, PHP, and PowerShell, with Dockerfile, YAML, TOML, INI, Java properties, and JSON variants. These are tests of specific syntax forms.
- Regression tests check original UTF-16 spans for non-ASCII decimal digits and preserve known placeholders, environment lookups, and ordinary currency amounts.
Release checks
Test the unpacked extension on Chrome and Edge and record insertion versus copy separately for ChatGPT, Claude, Gemini, Grok, DeepSeek, and Perplexity. Install the web app on Android and iPhone and verify airplane-mode reload, protection, and clipboard use. Run both native guard smoke tests and a configured live Codex relay smoke test with synthetic inputs. Record observed versions, auth modes, results, and limitations in the compatibility run log.
Image redaction checks
The security suite checks OCR box mapping, pixel masks, uncertainty, and bounds. Packaged Chromium CI synthesizes light PNG and dark JPEG screenshots, runs offline web OCR and extension OCR, and runs the built terminal command against a generated fixture. It checks the sensitive regions, verifies that nearby refund text survives, and exercises unsupported input, manual masks, and exported PNGs. Release checks enforce the existing 3 MB extension and CLI archive budget.
The pinned Codex executable attaches a synthetic PNG through the real client protocol. The mock upstream checks masked pixels and verifies that unreadable images cause zero upstream calls.