Development
Maintainer reference for building, verifying and landing changes. The short version for contributors is in CONTRIBUTING.md.
Build and test
Section titled “Build and test”cargo test # the Rust suitenpm run check # npm gates; see the omissions belownpm run test:action # the Action's logic, no networkCI also builds rustdoc with warnings denied, so a broken intra-doc link fails the lint job. Run it locally with
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items.
cargo test --lib is the fast inner loop. It is not sufficient to trust a change to a rule or to
extraction; see Fixtures.
Every npm gate that runs the analyzer builds --release --locked first, so it never measures a
binary older than the working tree. An up-to-date build is a sub-second no-op.
Framework seam
Section titled “Framework seam”Vitest’s test API names and default file globs live in src/framework/vitest.rs, described as data
(Dialect, FileDefaults) and reached through framework::current(). Its configuration readers
live beside it in src/framework/vitest/. Code outside the adapter asks the dialect what a name
means (a test, a hook, a table member) instead of spelling the name. Modules listed as neutral in
src/framework/tests.rs may not contain any name the dialect declares as a string literal; the
test names the file and literal it rejects.
The analysis core
Section titled “The analysis core”The analyzer is built in layers that each read only the layer below: lang (parsing, scopes,
resolution; the only importer of oxc_*), inventory (registration sites by provenance), normal
(normal forms and identities), corpus (each test keyed for comparison, or excluded with a reason)
and rules (findings). Unit tests check every layer, and normal has its own mutation scope
(npm run mutants:next-core).
Gates npm run check does not run
Section titled “Gates npm run check does not run”They are slow: check:memory, check:memory:scaling, check:coverage:rust, check:mutation.
CI runs the first three; check:mutation runs weekly from mutants.yml. npm run check:not-run
prints the current list.
npm run evaluate:corpus is a measurement rather than a gate, so it stays out of npm run check
as well: it runs every recall case, reports each violation with its denominator instead of
stopping at the first one, and exits 0 on violations unless --fail-on-violation (or
--fail-on-regression, with --baseline-binary) is given. npm run check:recall stays the
enforced contract; fixtures/recall/README.md documents the corpus and the comparison classes.
Collection oracle
Section titled “Collection oracle”npm run check:oracle collects every fixture directory and recall case with the pinned Vitest and
compares the result with what the analyzer extracts: test titles per file, and hook declaration
sites. Vitest runs as vitest list --staticParse=false with a probe runner, so describe callbacks
run and test and hook bodies do not. An import of a module that does not exist loads as a stub, and
a file whose collection reads a stub, or that imports one only for its side effects, is not
compared. The gate assumes a missing module registers no tests or hooks when it loads.
The same collection checks the registration sites: every test and suite Vitest collects must have a site of its kind on the line Vitest places it on, or a wrapper call or module load that accounts for it. Sites that register nothing Vitest collected are counted, not failed. A test whose title the analyzer did not prove is counted rather than compared by title. Floors on the files and tasks compared keep a shrunken comparison from passing.
Known disagreements are listed with their
reasons in scripts/check/collection-oracle-known.json; the gate fails on a disagreement that is not
listed and on a listed one that no longer occurs, so a fix deletes its entry.
The gate also runs the owned cases in fixtures/oracle/<dir>/, each with an expected.json that
pins, per file, the tasks Vitest collects, the file’s wrapper and hook-wrapper sites, and what
the analyzer excludes. A pin the analyzer does not meet yet is held: wrapperSitesToday or
nextToday records today’s value and waitsOn says in plain words what it waits on. A held value
fails the gate the moment the target is met, so the expectation changes with the support; the
knownSites and knownTitles lists work the same way as the central list. A directory with no
usable expected.json, a file it does not declare, and a declared file Vitest cannot compare all
fail, and at least one case file must be compared.
What Vitest collected is cached under ~/.cache/vitest-dedup/oracle-vitest/ (or
$XDG_CACHE_HOME) and reused while nothing it could read has changed. The key covers every file
git lists for the checkout and every file under fixtures/, tests/fixtures/ and scripts/
(ignored ones included), except Rust sources and the root target/ and node_modules/; the
installed packages as node_modules/.package-lock.json records them; the environment Vitest
receives; and Node’s version. A Rust-only change therefore reuses it, and any other change collects
everything again. The analyzer side and every comparison always run, and the gate prints how many
collections it reused. The cache is off under CI, with VITEST_DEDUP_ORACLE_CACHE=0, outside a
git checkout, when any file the key covers is a symlink, and when node_modules, at any depth,
holds a link other than the repository’s own workspaces and .bin executables (npm link changes
nothing npm records). A storage error loses only the cache, never the gate. Key
directories unused for a week are removed. When the cache is off, the oracle collects at
most two directories at once and compares their results in the original order.
Generated title check
Section titled “Generated title check”npm run check:title-properties draws .each and .for cases from a fixed seed (--seed picks
another, --cases sets how many) and collects each with the pinned Vitest and the analyzer. A title
the analyzer proves must be the one Vitest collects; refusing one is allowed. A different title, a
different row count, or a proved title for a case Vitest cannot collect fails. Cases holding values
near the 40-unit display cut run again under a longer taskTitleValueFormatTruncate. Each
disagreement is shrunk to a minimal test file and printed with the case it started from; add it to
scripts/vitest-harness/title-values.test.ts once fixed. The run also fails when fewer cases were
compared, or fewer titles proved, than its floors. The measured floors apply to the default seed and
case count only; any other run must compare at least one case and prove at least one title.
Hooks-only differential check
Section titled “Hooks-only differential check”npm run check:hooks-differential tests the hook-wrapper claim (a helper call that
registers only hooks) against Vitest on generated cases: each known way a helper’s call can run a
hidden test, in each way a helper is declared and reached, plus bodies the claim admits. A hidden test
Vitest collects with no site fails, as does an admitted body not read as hook-wrapper, a route
Vitest collects nothing from, and a case Vitest cannot collect. Cases the analyzer gets wrong today
are listed with reasons in scripts/check/hooks-differential-known.json; one that starts passing
fails, so its entry goes when support lands.
Run modes
Section titled “Run modes”--changed-since analyzes all files so an unchanged cross-file twin remains available, then
withholds findings without a changed participant. Withholding findings marks the run incomplete.
--debug-memory --reporters jsonl reports retained storage under fields.engine, further split into
engineFields cases, suites, hooks, sites, blind files and the two export caches. These buckets sum
to retainedBytes. engineMemoryNotice states which private hash-table and allocator overhead is
outside the estimate; RSS is a separate measurement.
Duplicate rules
Section titled “Duplicate rules”npm run check:corpus runs the analyzer over fixtures/duplicates/, fixtures/observed/ and
fixtures/mixed/ and judges every rule pairwise against the fixture headers: every pair a positive
expectation declares must be linked by its rule, no pair declared silent may be linked, and any other
linked pair is a failure until it is adjudicated into a header or into
scripts/check/next-duplicates-known.json with a reason. npm run check:recall judges every recall
case against the manifest the same way. A listed delta that stops being observed fails, so its entry
goes when the header or the analyzer moves. The headers and manifest still state some facts of the
earlier analyzer; the known list holds those deltas until they are rewritten. Floors on fixtures,
cases, tests analyzed, required pairs and recall keep an empty read from passing.
npm run check:parameterization-runtime also executes the owned consolidation and inline-snapshot cases under Vitest;
the same source supplies the corpus expectations. CI runs both checks.
The name rule compares proven title segments in one file and renders supported literal table titles. Empty callbacks and todos keep their names, since a name never reads the callback; every other exclusion is preserved. Unknown title values, unsupported formatting and suite-table titles do not anchor name findings. Distinct rendered titles across copied tables remain separate findings.
The suite rule compares complete inline blocks with matching literal title paths,
modifiers, options and enclosing setup. It reports a block only when every run condition is a
literal that keeps it active (skipIf(false), runIf(true)): an inactive or unknown condition is
treated like describe.skip, so the copies’ children are compared one by one. It also excludes
table-derived suites, inert suites and blocks containing excluded tests. Suite containers do not
increase test counts. Reported copies suppress cross-copy test and name findings, and the suite
finding’s covers keeps their highest severity and locations: the exit code and threshold count
it as those findings, so copying a whole block never gates more leniently than the same tests
written out. A child suppressed inline is not carried. Within-copy and unrelated findings
remain visible. Nested suite copies remain independent suite findings. Mixed child clusters stay
visible when they also contain unrelated or within-copy evidence.
The row rule compares rows within one declaration using proven inputs, rendered
names and equivalent callback/context keys. It supports directly written tables of primitive
values and shallow literal rows. Fixed-parameter arrow callbacks may ignore trailing cells;
rest parameters, destructuring and ordinary functions retain the whole row. Unknown/effectful
cells, nested reference values, suite tables, imported/member constants and unresolved title
formatting remain unsupported. In particular, dollar substitutions, string %i conversions and
whole null rows cannot anchor row findings yet. Existing corpus exclusions still apply.
The parameterization rule groups same-file callbacks with the same literal shape,
exact setup and modifiers, and different normalized bodies. It accounts for every row, visits
declarations in a stable order by their distinct body sets, and retains a representative only
when that declaration adds a body. Larger sets precede covered subsets; rows and declarations
can move without changing the candidate count. Selection is a deterministic greedy cover;
changing literal values can change which overlapping declarations supply representatives.
Every input case must survive consolidation. Literal kinds,
property names, static module specifiers, type-level values and outside binding identities remain significant. Bodies with
no recorded behavior event, a local dependency on a matcher name containing InlineSnapshot,
or an unresolved computed member or destructuring key are excluded. Nonliteral import sources and
imports with options are also refused until their module identities are proved. This includes conventionally
named custom inline-snapshot matchers; arbitrary custom matcher semantics are not modeled.
Row binding uses the existing proof; unsupported row values and observed class names are refused.
The near-duplicate rule compares same-file tests under the same context whose behavior
events form an exact multiset and whose bodies differ. A body whose trace is incomplete, such as one
with a branch, is left out under incomplete-trace, as it is by parameterization and subsumption; the other rules still read it. A pair a
parameterization group already reports is not claimed twice. Tests with fewer than two events have
nothing to compare.
Baselines carry vitestDedupFingerprint/v3. Earlier versions used different title identities:
v1 paired and titled tests differently, and v2 could confuse lone JavaScript surrogates with
literal replacement-character text. Older files are refused with a prompt to regenerate them.
--baseline-from-ref uses v3 as well. Historical source files, project helpers,
re-exports, and resolver tsconfig/package metadata come from one pinned Git commit. Missing files
never fall back to the working tree. Historical symlinks and actual dependency/configuration read
failures are operational errors. An absent package-based tsconfig extension instead marks the
historical pass incomplete and withholds all of its allowance: unknown aliases cannot prove
historical equivalence. Missing workspace linkage to a committed project package is treated as
the same uncertainty. Project names are cached from at most 8 MiB of committed metadata; their
retained names and table capacity are included in the historical memory budget. Resolver caches
remain transient per lookup. #-mapped tsconfig extensions remain unsupported errors. The owned source index counts toward the base pass’s memory
budget; an index that exceeds the cap is refused before analysis. Current include/exclude globs and
resolved globals still configure both passes; historical Vitest configuration is not executed.
See revision baselines for shared admission limits.
The subsumed-test rule is opt-in. It compares complete same-file traces under
the same context and callback form for strict ordered subsequences, preserving repeated events.
It reports the smaller test first, charges every candidate pair to the shared budget, and never
compares rows within one declaration. Placeholder callbacks, unresolved table populations and tests expected to fail, directly or through a suite, are refused. Fixture providers,
registration conditions and unbound cells remain part of the comparison identity. Findings suggest review rather than safe deletion.
The hook rule compares proven synchronous, idempotent setup within one lifecycle
chain. It supports let bindings whose complete recorded write set assigns one primitive
literal value. Dynamic lexical evaluation refuses the proof. Calls and property writes
remain opaque until their effect and object-stability proofs are modeled. Opaque or conflicting
intervening hooks block a claim. Once-per-suite hooks are compared only within the same scope. Every registration scope
must be closed, including scopes off the anchoring test’s path. Conditional registrations, table
suites, indirect wrappers, erased type declarations and uncertain activation remain outside this proof. Configuration-level
concurrency is not modeled; the scheduling proof assumes sequential execution unless the source
explicitly requests concurrency, which is refused. npm run check:hooks-runtime executes the owned
hook outcome fixtures under Vitest; the collection oracle separately checks their registrations.
Writing documentation
Section titled “Writing documentation”The website syncs these pages, so how they are named shows up there.
- Titles are plain text. The first heading is the page title and its sidebar label. Give it no
section number and no inline code, and keep it short.
tests/docs_contract.rsfails on either. - Folders become groups. A folder’s name is displayed as a sidebar group, so name it as a
readable noun in kebab-case (
vitest-surface, notvsorpart-2). - Every folder has an index page next to it (
rules.mdforrules/) whose first heading names the group, and whose table lists the pages in reading order. The website derives the sidebar order from that table. - Cite pages by name. Link to “module mocking”, not to a section number. The numbers in the Vitest surface index exist for code comments; prose does not use them.
Local verification
Section titled “Local verification”npm run verify:quick # before a review: lints, duplication and the changed area's testsnpm run verify:fast # cheap checks, format, gate helper tests -- no compilationnpm run verify:full # adds strict Clippy, the Rust suite under coverage, and the npm gatesnpm run hooks:install # opt in for this checkout/worktreeverify:quick checks the working tree, untracked files included, against its merge base with
origin/main, selecting by the same surfaces as the hooks; an unknown path or a missing base
runs every quick check. To what pre-commit runs it adds duplication, unless only documentation
changed, JavaScript coverage where the push hook runs it, and, for Rust, Clippy, rustdoc, the unit
tests of each changed library module (the whole library suite for a module with none of its own,
or a file neither crate root declares), the binary’s tests for src/main.rs and the files it
declares (a #[path] module’s whole directory, running both suites where the library may also
hold the file), and each changed integration target. It does not run the tests of a changed
module’s dependents. When a changed Rust line names cfg or cfg_attr, filesystem calls or
paths, or a Cargo manifest changes, it also runs cargo check --target x86_64-pc-windows-gnu
(rustup target add x86_64-pc-windows-gnu once). A test step that ran no test fails. It never
builds the release binary or runs instrumented Rust coverage or the full Rust suite. Rust source
changes get a source-only advisory for files that may need a coverage floor. Changes to owned
fixtures or their exclusion pins run the existing exclusion assertion, and changes to recall inputs
also run the recall gate with the debug binary. The push hook still runs the full verification
selected for the proposed commit.
The full profile does not run the memory and scaling benchmarks, mutation campaigns, or the inline
CI self-check. Use npm run check:not-run and ci.yml to select those when a change needs them.
This workflow relaxes no gate threshold or corpus exclusion.
Probing and proving a change
Section titled “Probing and proving a change”npm run probe -- <test file or directory>... copies each input to a temporary project and prints
what Vitest collects beside what the analyzer reports, marking a run that failed or counted a
different number of tests. It reads
target/release/vitest-dedup unless --binary names another. Overlapping project collections
and files the runner did not probe are unread, so partial collection cannot report agreement.
npm run revert-proof -- <spec.json> is a macOS-only developer tool that proves a fix fails its
checks when undone. It refuses to start on other platforms before reading the spec, launching
commands or changing files. This restriction does not apply to the analyzer or probe. The spec lists
checks and mutants, as scripts/dev/revert-proof.mjs documents. The checks must pass untouched,
each mutant must match exactly once, and every file is restored and verified. A mutant that
applies but fails no check, or does not build, fails the run. Direct Cargo test commands, including
cargo +stable test, executable paths and global options, compile with --no-run under the same
arguments before running. For arbitrary command wrappers, build must compile the checks too.
Spawn errors, signals, timeouts and excessive output fail the proof rather than count as caught
mutants. Command output is retained in temporary logs (at most 8 MiB per command); failed commands
name their log. Each command has a 15-minute limit. Interruption stops its owned process tree
before restoring files; commands must not detach descendants into separate sessions.
The JavaScript coverage job runs on macOS and enforces both proof modules’ coverage floors.
On other hosts, the shared coverage command reports those native measurements as deferred to
macOS CI while enforcing all other module floors; pure proof and platform-refusal tests still run.
Docstring guard
Section titled “Docstring guard”Both verification profiles first check documentation on touched named functions with an 80%
minimum. npm run check:docstrings runs that check alone.
- Its scope is the diff from the branch’s merge base with
origin/main; commit and push hooks use the staged or proposed-commit snapshot. - It covers named Rust functions and methods, and JavaScript/TypeScript
functiondeclarations and named function expressions, including nested declarations. - Anonymous callbacks, arrow functions and JS method syntax are outside this named-function check; CodeRabbit’s separate docstring check remains required.
- JavaScript/TypeScript ranges come from the development-only Babel parser; Rust uses the existing comment/string masker. Source files that cannot be parsed fail the check.
- Use attached
///or/** ... */comments to explain what a function guarantees. - Stage new files before running the check; untracked and ignored files are outside its Git diff.
Clippy and formatting
Section titled “Clippy and formatting”Clippy runs --all-targets --all-features --locked with -D warnings, matching CI. Cargo.toml
also rejects debug macros, unfinished todo!/unimplemented! code, and undocumented unsafe blocks
through that strict invocation. Run cargo fmt --all to repair formatting before retrying a failed
check. JavaScript and TypeScript corpus files are allowed to contain invalid or awkward source;
these checks do not lint or reformat them.
Output equivalence
Section titled “Output equivalence”Refactors and performance changes must not change what the analyzer reports. npm run check:equivalence builds the newest v* tag reachable from HEAD (or --ref REF) and caches it
under target/equivalence. It then runs the corpus, recall and fixture-isolation gates and every
Rust test executable with a shim in place of the binary. For each invocation the shim runs both
binaries and compares exit status, stdout, stderr and each file the run writes: the report of every
file reporter and, under --update-baseline, the baseline file.
- Only three values are normalized, each in the output it occurs in: the terminal detection time
and
--debug-memorypeakRssByteson stdout, and the candidate’s version string on stdout (the banner and--versionline) and in a SARIF file. Any other difference fails the check. - A suite that made no invocation fails, and a gate or test that fails against the candidate is
reported apart from equivalence.
--suites corpus,recall,isolation,rustselects suites. - Build the release binary first (
npm run check:equivalencedoes). macOS and Linux only; a cold baseline build takes minutes. - A test that resolves the binary at compile time with
env!("CARGO_BIN_EXE_vitest-dedup")bypasses the shim;assert_cmd’scargo_binreads the variable at run time and does not. - It compares bytes, not expectations.
npm run evaluate:corpuswith--baseline-binaryanswers the different question of which labelled expectations a change gained or lost.
Git hooks
Section titled “Git hooks”The local hooks select checks from changed paths, running only what a change can affect. CI and
the explicit verify:fast and verify:full commands stay whole. Each hook prints its selected
scope.
| Changed surface | Pre-commit | Pre-push |
|---|---|---|
Root README/contributing/changelog/security Markdown, LICENSE, docs/**/*.md, skills/**/*.md |
Static checks | Static checks |
.github/ outside the Action, such as workflows, and codecov.yml |
Static checks, npm tests and developer tests | Same |
.github/actions/vitest-dedup/ and action.yml |
Static checks and Action tests | Same, plus duplication and JS coverage |
npm/ and scripts/release/ |
Static checks, npm tests, package validation and the check-helper tests | Same, plus duplication and JS coverage |
scripts/dev/, .githooks/pre-commit and .githooks/pre-push |
Static checks and developer/check-helper tests | Same, plus duplication and JS coverage |
scripts/check/ and scripts/vitest-harness/ |
Static checks and developer/check-helper tests | Same, plus the release build, corpus gates, duplication and JS coverage |
fixtures/ |
Static checks and developer/check-helper tests | Same, plus Rust tests, which read fixtures, the release build, corpus gates, duplication and JS coverage |
package.json, package-lock.json |
Static checks, npm tests and developer/check-helper tests | Static checks and the whole npm run check chain, whose corpus gates build the release binary; no Rust lint or test |
Rust sources, Cargo.toml, Cargo.lock, tests/fixtures/ |
Static checks and format | Same, plus Clippy, rustdoc, the Rust suite, the corpus gates and duplication; a source change runs the suite under Rust coverage |
.cargo/, other paths, or unknown push scope |
Compilation-free fast checks | Full checks, including Rust coverage |
The Rust suite runs once per push. When Rust coverage is selected it runs every test target, and
it fails when any tests/*.rs target did not run, so plain cargo test is not repeated beside it.
Static checks include touched-function docstrings, Action pins, release workflow/version consistency,
documentation accuracy, repository names and shipped skills. Pre-commit still scans the staged index
for secrets before running the verifier. A mixed change selects all its relevant checks; any path
requiring full verification takes precedence. Selection uses paths, not diff size: a small Rust edit
still selects Rust verification. Markdown documents consumed by runtime contract tests receive static
local checks; those runtime tests remain in CI and verify:full.
- Pre-commit classifies and checks the staged index, including deleted paths, both rename sides and type changes. Unstaged edits and local notes cannot change the selection or make it pass.
- Pre-push checks each distinct proposed commit from Git’s ref input. An existing branch uses the
delta from the remote head supplied by Git; a new branch uses its merge base with local
origin/main. Thus a docs-only update after already-pushed Rust work does not repeat that Rust work locally. When the remote head is not available locally, the delta from the merge base withorigin/mainis used instead. A push with no readable baseline at all, and non-branch destinations, require full checks. Multiple destinations for one commit combine their changed paths. - Deletion-only pushes have no source to check. Both hooks reject snapshot whitespace errors, load the verifier from the staged index or proposed commit, and stop at the first selected failure. The touched-function documentation gate keeps its cumulative PR scope independently of check selection.
Snapshots
Section titled “Snapshots”Snapshots include skip-worktree files omitted by sparse checkout, using their indexed bytes without changing the checkout’s sparse selection or index flags. Exported symlinks must resolve inside the snapshot; links that escape it, are dangling, or form cycles are rejected. Verification subprocesses clear source-repository Git paths and command-scoped configuration overrides.
Installing
Section titled “Installing”Hook installation uses worktree-specific Git configuration and preserves an existing hook manager. Install again in each worktree where you want the hooks.
They need a POSIX shell, awk, mktemp, a Node release devEngines admits, npm, Rust, and Git on PATH.
Full verification also needs cargo-llvm-cov and LLVM tools, as the coverage gate does, and the
checkout’s node_modules (npm ci), which the snapshot links in for the title harness. The hooks
are local safeguards; CI remains authoritative and Git can bypass them.
Logs, locks and caches
Section titled “Logs, locks and caches”- Commands run sequentially with complete output saved under the common Git directory’s
delivery-check-logs/; a failure prints at most the last 100 lines. Each run’ssummary.jsonrecords the selected scope, why it was chosen, and each step’s command, duration and exit status. Run directories older than 30 days are removed when the next run starts. - Each run sets
CARGO_BUILD_JOBSandRUST_TEST_THREADSto the host’s parallelism divided by the number of lanes, so lanes running at once do not oversubscribe the machine. Values already set in the environment are kept. - Four hook runs can verify at once, each in its own lane with its own export directory and Cargo
cache, so separate worktrees and sessions do not block each other. A further run queues for up to
30 minutes. The manual
verify:quick,verify:fastandverify:fullprofiles use lane 0 only, because they build in the checkout’s own cache. Other Cargo invocations are not coordinated. A killed process can leavedelivery-check.lockordelivery-check.lock.<lane>behind. Inspect its recorded PID and remove it only after confirming that process and the checks it spawned (Cargo, Node) have all exited: the next run in that lane clears its export directory, which a surviving check could still be reading. - By default, worktrees share the main checkout’s
target/andtarget/llvm-cov-target/, and explicit Cargo target environment variables are respected by the manual profiles. An existing target directory pointing elsewhere is rejected, and a cache nested inside the checkout’starget/is refused before any directory is created; choosetarget/itself or an external cache. - Hook snapshots build in
hook-snapshot/<repository>/beneath that cache, and each further lane inhook-snapshot/<repository>-<lane>/, never in the checkout’s own cache and never in a configured coverage or separate build directory: a test binary bakes the path it was built in, and Cargo would otherwise hand a binary built in a deleted snapshot to the next checkout run, or to another clone sharing the cache. The first run in a new lane builds from cold. Every snapshot in a lane is exported to the same private directory underXDG_RUNTIME_DIR, or the system temporary directory without one, so a reused artifact always points at the current export; the export stays outside the checkout because Cargo reads configuration files, and the discovery walker ignore files, from every ancestor directory (the walker’s.gitignorelookup stops at a repository root when there is one; other ignore files do not). On a host whose temporary directory is shared, another user could hold that name; the run then fails naming the directory, andTMPDIRorXDG_RUNTIME_DIRselects a private one. The first hook run after a fresh clone builds the dependency tree into that cache once; a temporary target link lets the corpus gates reuse it on later runs.
Rust coverage before merge
Section titled “Rust coverage before merge”CI must be green. The Rust coverage ratchet runs on pushes to main and on manual workflow
dispatches, not on pull requests, to avoid a second instrumented build on every one. So before
merging:
- Run
npm run verify:fullon the exact reviewed PR head. - Record the full commit SHA and the Rust coverage result in the PR description.
- Verify the main coverage job after merging as well.
The pre-push hook runs Rust coverage when its selected scope requires full checks. A scoped push does not establish full-head coverage; hooks are opt-in, so their existence alone is not evidence that a check ran. New commits invalidate the previous result and need another check before merge. Coverage floors and scope stay unchanged.
Back to the documentation index.