Skip to content

Testing ​

Executable verification for repository changes. Publication and deployment remain separate release operations.

TierCommand or sourceUse
Local full verificationnpm run verifySource, contract, unit, native and packed checks in one checkout
Focused checksRoot and workspace npm scriptsFast feedback in the affected blast radius
CI stagesnpm run ci:<stage>Stage commands composed by .github/workflows/ci.yml
Performancenpm run test:performanceStrict local or controlled-host timing budgets
Manual live harnessesFour opt-in TypeScript scriptsProvider behavior with local credentials and retention controls

Local full verification ​

npm run verify runs scripts/ci-local.mjs. It needs no GitHub context and no frozen candidate. It runs the source checks, builds the public packages once with npm run build:public, then runs the contract, unit and native stages against those outputs. The native and language packed-consumer checks pack the current source freshly. Browser, delivery and performance checks are separate commands; run them when a change affects those boundaries.

CI stages ​

Each stage reads declared inputs and writes only its own outputs. A check never builds as a side effect; npm run typecheck reads prepared declarations, so run npm run prepare:typecheck in a fresh checkout. Stages that consume the candidate verify candidate-manifest.json against the exact source commit and version before using an archive. CORAL_ARTIFACT_DIR and CORAL_SITE_ARTIFACT_DIR select the frozen packages and site.

CI runs in three phases. Early checks start at once. Candidate checks start as soon as the frozen packages, and the site where needed, exist. Product checks start only after every early and candidate check passes. The final-candidate attestation then requires every result.

PhaseCommandContract
Earlynpm run ci:sourceToolchain, workflow policy, lint, Markdown, docs structure, links, dependency audit and root script tests; no builds
Earlynpm run ci:windows-riskReal Windows source and native builds, browser build-output tests, plus path, process and API-doc tests
Earlynpm run ci:packagesOrdered public and native-input build, browser build-output tests, six prepared packs and the candidate manifest
Candidatenpm run ci:siteAssemble the production site from hydrated declarations and freeze site.tar with its digests
Candidatenpm run ci:contractsRead-only typecheck, contract script tests, bounded seeded fuzz and the language specification
Candidatenpm run ci:nativeNative compile, corpus, parity and the packed frozen native consumer on Linux, macOS and Windows
Candidatenpm run ci:browser-prepareReplace the editor output with the frozen site for the browser smoke and full browser run
Productnpm run ci:unitEvery product unit suite once against packaged dist, except browser build-output tests; viz, MCP and editor only with coverage floors
Productnpm run ci:windows-unitThe same unit selection once on Windows, without coverage
Productnpm run ci:deliveryFrozen-site serving, API search, tamper rejection and comparison with one fresh build
Helpernpm run ci:hydrateVerify the candidate and restore only its compiled dist outputs
Helpernpm run ci:restore-siteVerify the frozen site digest, archive entries, source identity and integrity manifest

A pull request runs only the source checks when every changed path is a passive release record or root prose. Current authorities (PLAN.md, CLAUDE.md, release plans, and every plan or design of the active release at any depth), any docs/ change, an unknown base and a final-candidate dispatch run everything.

The candidate phase also runs the installed consumers: npm run smoke:consumer for Node 26, Node 24 and React 18 and 19, and npm run smoke:api-compat-consumers for the published baseline. Other stages call the helper commands themselves.

The Node 26 cell also runs the installed-renderer case. One consumer installs the frozen language, render, browser, viz and MCP archives and checks the language reader and the MCP Mermaid conversion chain. It renders every active source in each style and theme through the browser, MCP and public editor, and checks that disabled and headerless sources are refused. It then drives the installed browser bundles in Chromium as ESM, IIFE and a custom element, and compares browser and Node successor validation under a strict no-eval Content Security Policy. Run it locally with CORAL_CONSUMER_CASES=installed-renderer npm run smoke:consumer after npm run build:public; it needs the Playwright Chromium browser.

The delivery stage copies the frozen site into a disposable directory and passes it to npm run test:online-delivery:integration as CORAL_FROZEN_SITE. The test serves and tampers with that copy and compares it byte for byte with exactly one fresh build. Run without that variable, the test builds both sides itself.

Focused checks ​

CommandUse
npm run test:e2eChromium end-to-end behavior after npm run build; four workers, zero retries
npm run test:e2e:robustnessFocused robustness browser selection
npm run test:e2e:robustness:pairwiseBounded deterministic UI robustness profile
npm run test:fuzzBounded seeded language, open, GraphIR, SVG and browser-boundary fuzz
npm run test:fuzz:extendedLonger seeded fuzz campaign
npm run test:coverage:gateViz, MCP and editor coverage floors
npm run test:api-docsGenerated reference contracts, failure behavior and build wiring
npm run test:online-delivery:integrationReproducible site build, serving, API search and tamper rejection
npm run check:docsUser, library, contributor, example and link checks
npm run audit:fragmentsNon-blocking source and dependency fragment candidates
npm run smoke:consumerPacked blank-consumer runtime and type behavior
npm run smoke:api-compat-consumersNode.js 24.19.0 consumers of the immutable published 0.2.8 baseline
npm run api-compatAPI comparator fixtures, GraphIR adoption and read-only typecheck; run npm run prepare:typecheck or npm run build:public first
npm run smoke:nativePacked native grammar build and load

npm run test:api-compat checks the comparator against its own fixtures. It does not by itself compare the current declarations with a published release.

Package-level test scripts are appropriate while resolving a focused finding. Run broader checks when changes cross workspace or product boundaries.

GraphIR release dependency ​

All direct consumers pin one exact published @graph-ir/core version, and the lockfile records its registry identity. npm run test:graphir-adoption checks the pin, schema, migration, order and installed-bridge refusals. Do not substitute a no-save dependency, local path, sibling checkout or unpublished archive. GraphIR specification publication is outside this release.

Browser and performance tests ​

Normal browser tests use four workers and zero retries, and they run every functional assertion from the benchmark fixtures without timing loops.

npm run test:performance runs the language, render, viz and editor benchmark suites, then npm run test:e2e:performance. Build the editor first. Each runs with one worker and zero retries and fails on any functional error, invalid sample or budget overrun. A budget overrun reports PERFORMANCE BENCHMARKS FAILED.

A controlled host declares its comparable profile with CORAL_PERFORMANCE_PROFILE; a mismatch fails. GitHub-hosted shared runners are not measurement machines. On an unclassified GitHub environment the benchmark commands print PERFORMANCE BENCHMARKS NOT MEASURED and skip the sampling loops instead of reporting a pass. CI has no benchmark job. See performance budgets for fixtures and limits.

LLM harness boundary ​

Deterministic unit and corpus tests use synthetic fixtures and fake provider behavior. They require no network or key. The manual surfaces below are outside CI and npm run verify and require explicit authorization before any live provider call.

The no-key behavior is verified without invoking a provider or running an application build: npm test -w @coral-viz/diagram-editor -- --run test/llm/accuracy-harness.test.ts -t 'no configured API key'.

ScriptCredential namesOutput and retention
accuracy-harness.tsANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEYTimestamped scorecards and candidates under gitignored accuracy-harness-output/; delete after review
test-live.tsLLM_API_KEYResults to stdout only
test-e2e.tsLLM_API_KEYResults to stdout only
test-mermaid-adjust.tsLLM_API_KEYFixed prompt, converted source, and result to stdout only

Live or user-derived prompts, responses, scorecards, terminal captures, and keys stay local and are never committed. There is no production telemetry from these contributor harnesses.