supercov 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,134 +1,84 @@
1
1
  # Coverage model
2
2
 
3
- Supercov derives coverage obligations from code structure. It reports which
4
- obligations ran and the quality of the available evidence, including line,
5
- branch, value-path, control-flow, and MC/DC coverage.
3
+ Supercov turns source structure into a fixed set of obligations before the test
4
+ run. Tests can cover those obligations, but they cannot silently change what
5
+ 100% means.
6
6
 
7
- ## Obligations
7
+ ## What Supercov measures
8
8
 
9
- An obligation is one thing the code structure requires a test to demonstrate.
10
- The denominator is fixed before the run from the source itself, so a percentage
11
- cannot drift when tests are added or removed.
12
-
13
- | Family | Obligation |
14
- | --- | --- |
15
- | Lines | Each executable line executes |
16
- | Statements | Each statement executes |
17
- | Functions | Each function is entered |
18
- | Branches | Each alternative is taken: `true`, `false`, switch fallthrough, and the implicit no-match arm |
19
- | MC/DC | Each atomic condition is shown to independently determine its decision |
20
- | Value selection | Optional-chain short-circuits, logical assignments, and parameter or destructuring defaults each resolve both ways |
21
- | Control flow | `try` versus `catch`, and zero-iteration versus entered `for-in` / `for-of` |
22
-
23
- The value-selection and control-flow families are the ones most tools omit.
24
- `a?.b`, `x ??= y` and `function f(a = 1)` each hide a decision that never
25
- appears as a branch in a conventional report, and a `for-of` that never runs
26
- with an empty collection is an untested path even though every line inside it
27
- is green.
28
-
29
- ## MC/DC in one example
30
-
31
- Modified condition/decision coverage asks more than "was this condition true and
32
- false at some point". It asks whether each condition was shown to *independently
33
- change the outcome*, which requires a pair of executions differing in that one
34
- condition and producing different decisions.
35
-
36
- For `isAdmin || (total > limit && !locked)`:
37
-
38
- | Vector | `isAdmin` | `total > limit` | `!locked` | Decision |
39
- | --- | --- | --- | --- | --- |
40
- | v1 | F | T | T | true |
41
- | v2 | F | F | T | false |
42
- | v3 | F | T | F | false |
43
- | v4 | T | F | T | true |
44
-
45
- - v1 and v2 differ only in `total > limit` and disagree, so that condition is
46
- proven.
47
- - v1 and v3 do the same for `!locked`.
48
- - v4 and v2 do the same for `isAdmin`.
49
-
50
- Remove v2 and two of the three proofs collapse, even though every condition has
51
- still been observed both true and false, and every line is still green. That is
52
- the gap MC/DC exists to catch, and it is why the criterion is required for the
53
- highest software assurance levels in avionics.
54
-
55
- Supercov stores **vector-level provenance**: which test produced each observed
56
- vector, not just which tests touched the decision. A filtered query therefore
57
- recomputes valid witness pairs for the tests it selected, rather than filtering
58
- a percentage computed for a different set. A witness assembled from one unit
59
- vector and one end-to-end vector counts for the combined suite and for neither
60
- level alone — and Supercov reports it that way.
61
-
62
- ## Quality of evidence
63
-
64
- Not all coverage is equally convincing. Each line, branch alternative, vector
65
- and condition records how it was reached:
66
-
67
- | Level | Meaning |
9
+ | Obligation | Question |
68
10
  | --- | --- |
69
- | Unexecuted | No evidence |
70
- | Executed | Reached during a test, with no explicit causal link |
71
- | Action-linked | Reached inside a recognised browser action such as `locator.click()` |
72
- | Assertion-linked | Reached inside an `expect()` matcher, or in the code path an assertion depends on |
73
-
74
- Only an explicit browser or server event can raise confidence to
75
- assertion-linked. Where Supercov has to fall back on timing correlation an
76
- early cross-origin iframe probe, for example — the evidence stays
77
- execution-only and is labelled as such. Code reached outside a recognised
78
- action, such as setup work or a helper making its own HTTP requests, still has
79
- exact test attribution but may carry no action phase at all.
80
-
81
- In Playwright, the phase travels with the request: an action opened in the
82
- browser is still the active phase inside the server route it triggers, so a
83
- chain of `click → application decision → visible assertion` is queryable.
84
-
85
- ## Provenance
86
-
87
- Every test carries two independent labels.
88
-
89
- **Runner** is the process that executed it — `playwright`, `vitest`, `jest`,
90
- `node`.
91
-
92
- **Kind** is its semantic level — `e2e`, `integration`, `component`, `unit`.
93
- Kind is resolved in descending confidence from an explicit `SUPERCOV_TEST_KIND`,
94
- then the Playwright project name, then the test path, then the runner default
95
- (Playwright is end-to-end, Vitest is unit). Queries preserve how the label was
96
- established, so an inferred kind is never presented as a declared one.
97
-
98
- Vitest module-import and setup execution is retained as a separate setup scope
99
- rather than being attributed to whichever test happened to run first.
100
-
101
- ## Attempts and filters
102
-
103
- Evidence records attempt status, so a test is classified as passed, failed,
104
- flaky, skipped, timed out, interrupted, unknown, or selected but unstarted
105
- after fail-fast. `--filter` selects which attempts contribute to a view:
106
-
107
- - `all` — every executed attempt, including attempts that later failed. This is
108
- the default and matches conventional coverage tools.
109
- - `passed` successful attempts of tests that ultimately passed.
110
- - `failed` failed attempts only, including failed retries of a flaky test.
111
-
112
- Passed and failed views are derived from the same immutable archive rather than
113
- duplicated into separate report files, so they cannot disagree.
114
-
115
- ## When completeness is blocked
116
-
117
- A verdict is only useful if it refuses to be complete when it cannot be:
118
-
119
- - **Ambiguous scope.** Every candidate source file is retained as included,
120
- excluded, or ambiguous. Ambiguity blocks a complete verdict and is
121
- inspectable with `coverage scope`. Set `SUPERCOV_SOURCE_ROOTS` to declare the
122
- authoritative scope.
123
- - **Semantic-safety blockers.** When application code coerces or observes a
124
- function's own source, Supercov leaves that body uninstrumented and records
125
- the blocker rather than transforming code whose text is being read.
126
- - **Unknowable denominators.** Direct `eval` and `Function` source cannot
127
- receive a stable pre-run denominator. Their exact locations are recorded as
128
- completeness blockers instead of being silently excluded.
129
- - **Unattributed evidence.** Execution that arrives without a carrier is stored
130
- under a first-class background scope, visible in the all-attempt view and
131
- excluded from per-test passed-only coverage.
132
-
133
- None of these are rounded away. A blocked verdict is more useful than a
134
- comfortable 100%.
11
+ | Line | Did execution reach this source line? |
12
+ | Statement | Did this executable statement run? |
13
+ | Function | Was this function entered? |
14
+ | Branch | Did each alternative execute? |
15
+ | Decision vector | Which combinations of conditions were observed? |
16
+ | MC/DC witness | Was each condition shown to affect its decision independently? |
17
+ | Value path | Did language constructs such as defaults, optional chains, and logical assignments take each meaningful path? |
18
+
19
+ The exact obligations depend on the language and source construct. Query one
20
+ file or decision to see the concrete missing behavior:
21
+
22
+ ```sh
23
+ npx supercov runs latest file app/checkout/session.ts
24
+ npx supercov runs latest decision app/checkout/session.ts:64
25
+ ```
26
+
27
+ ## Why a line percentage is not enough
28
+
29
+ A line can execute while an important outcome remains untested. For example,
30
+ this decision has two conditions:
31
+
32
+ ```js
33
+ if (user.isAdmin || user.ownsDocument) allowEdit();
34
+ ```
35
+
36
+ Executing the line proves very little by itself. Useful tests should show the
37
+ admin condition matters, the ownership condition matters, and the denied path
38
+ still works. Decision-vector and MC/DC queries expose the missing cases directly.
39
+
40
+ The same principle applies to Rust boolean expressions and control flow.
41
+
42
+ ## Evidence confidence
43
+
44
+ Where the runner exposes exact test boundaries, Supercov can show which test and
45
+ attempt covered an obligation. Where it does not, execution is recorded as
46
+ aggregate background evidence rather than assigned to a guessed test.
47
+
48
+ Use attempt filters to choose the evidence included in a view:
49
+
50
+ ```sh
51
+ npx supercov runs latest --filter all
52
+ npx supercov runs latest --filter passed
53
+ npx supercov runs latest --filter failed
54
+ ```
55
+
56
+ Use `--kind` when the project distinguishes test levels:
57
+
58
+ ```sh
59
+ npx supercov runs latest gaps --kind e2e
60
+ ```
61
+
62
+ A filtered view recomputes obligations from the selected evidence. It does not
63
+ filter a percentage that was already calculated from something else.
64
+
65
+ ## Complete, uncovered, and blocked
66
+
67
+ An ordinary uncovered obligation can be closed by a test. A completeness
68
+ blocker means Supercov cannot honestly claim the source was fully measured.
69
+ Common blockers are:
70
+
71
+ - ambiguous first-party source scope;
72
+ - source that must remain uninstrumented because code observes its own text;
73
+ - dynamically created source without a stable pre-run denominator; and
74
+ - execution that crossed an unsupported or unattributed runner boundary.
75
+
76
+ Inspect source scope with:
77
+
78
+ ```sh
79
+ npx supercov runs latest scope
80
+ ```
81
+
82
+ If automatic scope is ambiguous, declare the authoritative roots with
83
+ `SUPERCOV_SOURCE_ROOTS`. Other blockers remain visible with their location and
84
+ reason. Supercov does not round them away to produce a comfortable 100%.
package/docs/evidence.md CHANGED
@@ -1,127 +1,96 @@
1
1
  # Evidence and runs
2
2
 
3
- Each run stores one evidence artifact and its metadata. Reports, queries, and
4
- comparisons are derived from those files on demand.
3
+ Every completed Supercov run is an immutable local record of what the suite
4
+ executed. Queries, comparisons, and filtered views are derived from that record.
5
5
 
6
- ## What a run is
6
+ ## What a run contains
7
7
 
8
- ```text
9
- .supercov/runs/2026-08-24T01-25-11Z/
10
- evidence.raw.gz exact denominator manifest + raw per-worker and background evidence
11
- run.json fingerprints, phase timings, schema version, integrity state
12
- ```
8
+ A run records:
13
9
 
14
- Two durable source-of-truth files. No HTML or derived report is stored in the
15
- published run. Loose evidence written during the run is removed only after the
16
- whole run directory is atomically visible, so a run is either complete or
17
- absent.
10
+ - the fixed coverage denominator for the measured source;
11
+ - observed lines, statements, functions, branches, and decision vectors;
12
+ - test, attempt, runner, outcome, and phase identity where the runner exposes it;
13
+ - source, test, dependency, configuration, toolchain, and schema fingerprints;
14
+ - completeness blockers and unattributed background execution; and
15
+ - phase timings and integrity information.
18
16
 
19
- Run ids are UTC timestamps, which makes them sort chronologically and makes
20
- retention deterministic.
17
+ Completed runs live under `.supercov/runs/<run-id>/`. The original evidence is
18
+ not rewritten when you query it. Supercov may build a disposable local index to
19
+ answer later queries faster; that index is derived data and can always be
20
+ recreated from the immutable run.
21
21
 
22
- ## Derived views and their disposable cache
22
+ ## Read a run
23
23
 
24
- Every coverage view — the summary, per-file rankings, gap lists, decision
25
- detail, per-test contribution, the minimizer, and the passed and failed filters
26
- is derived from the archive. The first query may write a disposable,
27
- integrity-bound query index beside the two durable files; later queries reuse
28
- it while the run identity remains valid. Delete that index at any time and
29
- Supercov reconstructs it from `evidence.raw.gz` without losing coverage data.
24
+ ```sh
25
+ npx supercov runs --limit 10
26
+ npx supercov runs latest
27
+ npx supercov runs latest gaps --limit 10
28
+ npx supercov runs latest file app/checkout/session.ts
29
+ ```
30
30
 
31
- This is why `--filter passed` and `--filter all` can never contradict each
32
- other, and why a query added in a future version can answer questions about a
33
- run recorded today: raw evidence remains the source of truth, while the query
34
- index is only a rebuildable acceleration structure.
31
+ Use `latest` while working interactively. Use the run id printed by `runs` for
32
+ automation, review notes, and work that spans sessions.
35
33
 
36
- Fresh-process summary, files and gaps queries take roughly two tenths of a
37
- second on the reference run described in [Performance](/docs/performance).
34
+ Queries compare the stored fingerprint with the current workspace. A stale run
35
+ remains valid history, but it is no longer presented as a description of the
36
+ current source.
38
37
 
39
- ## Integrity and staleness
38
+ ## Filter attempts
40
39
 
41
- Each run stores SHA-256 fingerprints for:
40
+ The same run can answer different questions without rerunning the suite:
42
41
 
43
- - first-party source
44
- - test files
45
- - dependency lockfiles
46
- - test and build configuration
47
- - the instrumenter itself
42
+ ```sh
43
+ npx supercov runs latest --filter all
44
+ npx supercov runs latest --filter passed
45
+ npx supercov runs latest --filter failed
46
+ ```
48
47
 
49
- plus the evidence schema version and the Git revision and dirty state at the
50
- time of the run.
48
+ - `all` includes every executed attempt and matches conventional coverage tools.
49
+ - `passed` includes successful attempts of tests that ultimately passed.
50
+ - `failed` isolates failed attempts, including failed retries of flaky tests.
51
51
 
52
- Queries compare the stored fingerprint against the current workspace and
53
- visibly mark a stale run. Evidence carrying a different run scope is rejected
54
- outright rather than merged in.
52
+ Filtered views are recomputed from the stored evidence. They are not separate
53
+ report files that can drift apart.
55
54
 
56
- ## Comparing two runs
55
+ ## Compare two runs
57
56
 
58
57
  ```sh
59
58
  npx supercov diff <older-run> <newer-run>
60
- npx supercov diff <older-run> <newer-run> --json
61
59
  ```
62
60
 
63
- `diff` reports what the newer run covers that the older one did not, and what
64
- it lost. Both inputs are immutable and untouched, which is what makes the
65
- comparison meaningful: neither side can have been rewritten by the act of
66
- comparing them.
61
+ The diff shows newly covered and newly uncovered obligations. It is the easiest
62
+ way to prove that a focused test changed coverage without losing behavior
63
+ elsewhere.
67
64
 
68
- ## Merging shards
65
+ ## Combine shards
69
66
 
70
67
  ```sh
71
- npx supercov merge <first-run-id> <second-run-id> [...]
68
+ npx supercov merge <shard-a> <shard-b> [...]
72
69
  ```
73
70
 
74
- `merge` accepts only runs whose source, test, dependency, configuration,
75
- instrumenter, schema and denominator fingerprints are identical. It rewrites
76
- the run scope inside every evidence record, namespaces shard paths, and
77
- publishes a new immutable run atomically. Input runs are never modified or
78
- deleted.
79
-
80
- This is the distributed and multi-host primitive. Incompatible shards fail with
81
- the exact differing fingerprint domains rather than producing a plausible but
82
- invalid aggregate — two shards built from different source trees do not have a
83
- common denominator, and no amount of arithmetic creates one.
84
-
85
- ## Durability
71
+ Merge creates a new immutable run. Shards must have matching source,
72
+ configuration, toolchain, schema, and denominator fingerprints. Input runs are
73
+ never changed.
86
74
 
87
- Everything that can be interrupted is written to survive it.
75
+ ## Integrity and incomplete evidence
88
76
 
89
- - Evidence archive, metadata and state writes use sibling temporary files,
90
- `fsync`, and atomic rename.
91
- - Lock acquisition uses exclusive creation followed by `fsync`.
92
- - Run state is written durably through the preparing, building, testing and
93
- publishing phases.
94
- - `SIGINT`, `SIGTERM` and `SIGHUP` are forwarded to the entire child process
95
- group.
96
- - If the process is killed without a cleanup opportunity, the next invocation
97
- marks the dead PID's run abandoned and refreshes the isolated namespace
98
- before reusing it.
77
+ Supercov validates evidence before publishing a run. Corrupt, truncated,
78
+ duplicated, or contradictory input is rejected or surfaced as an explicit
79
+ measurement limit. It is never silently converted into a clean percentage.
99
80
 
100
- The published `run.json` is the durable terminal record, so terminal work state
101
- is not retained after publication.
81
+ Likewise, ambiguous source scope, uninstrumented code, and execution without a
82
+ reliable test identity remain visible. See [Coverage model](/docs/coverage-model)
83
+ for how these states affect completeness.
102
84
 
103
85
  ## Retention
104
86
 
87
+ Runs remain until you remove them:
88
+
105
89
  ```sh
106
- npx supercov clean
107
- npx supercov clean --keep 20 --dry-run
90
+ npx supercov clean --dry-run
108
91
  npx supercov clean --keep 20
92
+ npx supercov clean
109
93
  ```
110
94
 
111
- Cleanup never runs automatically. `clean` removes explicit history, orphaned
112
- and terminal transient data, and the marker-owned build workspace; `--keep N`
113
- preserves the N newest runs. It acquires the same lock as a coverage run,
114
- refuses to race an active run, and never touches unowned paths.
115
-
116
- ## Phase timings
117
-
118
- Every run records monotonic durations for initialization, workspace
119
- preparation, adapter setup, the instrumented build, your unchanged test command,
120
- and evidence publication. They are stored in `run.json` and returned by
121
- `supercov runs --json`.
122
-
123
- These are timings, not an overhead claim. A test script that performs its own
124
- build may overlap work with the instrumented-build phase, and true end-to-end
125
- overhead requires an explicit control run — which Supercov never performs
126
- automatically, because an arbitrary test command can write data or cost money.
127
- [Performance](/docs/performance) documents the comparison methodology.
95
+ Cleanup takes the same project lock as a coverage run and removes only
96
+ marker-owned Supercov data.
@@ -1,147 +1,121 @@
1
1
  # Getting started
2
2
 
3
- Supercov measures coverage for JavaScript, TypeScript, and Rust test suites.
4
- Prefix the command you already run; no config file, import, or reporter is
5
- required.
3
+ Supercov gives a coding agent the next test to write. Run the test command you
4
+ already use, ask which useful paths remain uncovered, add a focused test, and
5
+ repeat.
6
6
 
7
7
  ```sh
8
8
  npx supercov -- npm test
9
9
  ```
10
10
 
11
- Everything after `--` is your command, executed exactly as written.
11
+ No account, config file, import, custom reporter, or hosted service is required.
12
12
 
13
- ## Requirements
13
+ ## Language support
14
14
 
15
- | Requirement | Detail |
16
- | --- | --- |
17
- | Node.js | 22 or newer |
18
- | Project | JavaScript or TypeScript, with a runnable test command |
19
- | Disk | A `.supercov/` directory in the project root, which Supercov creates |
15
+ | Language | Status | Start with |
16
+ | --- | --- | --- |
17
+ | JavaScript | Available | `npx supercov -- npm test` |
18
+ | TypeScript | Available | `npx supercov -- npm test` |
19
+ | Rust | Available | `npx supercov -- cargo test` |
20
+ | Python | Coming soon | — |
21
+ | Zig | Coming soon | — |
22
+ | PHP | Coming soon | — |
23
+ | C | Coming soon | — |
20
24
 
21
- No Supercov account or hosted service is required. During a coverage run, the
22
- Supercov CLI does not contact a Supercov service and no part of your source or
23
- evidence leaves the machine. Package tools such as `npx` may still contact the
24
- npm registry to resolve or download Supercov when it is not already cached.
25
+ More languages are planned. See [Supported suites](/docs/supported-suites) for
26
+ the runners and attribution available today.
25
27
 
26
- ## Your first run
28
+ ## Requirements
27
29
 
28
- From the project root:
30
+ - Node.js 22 or newer. The current CLI is distributed through npm, including
31
+ when it measures a Rust project.
32
+ - A working test command for the project.
33
+ - For Rust, the Rust 1.95 toolchain. `cargo test` is supported directly;
34
+ `cargo nextest run` is supported with cargo-nextest 0.9.138 or 0.9.140.
29
35
 
30
- ```sh
31
- npx supercov -- npm test
32
- ```
36
+ Package tools such as `npx` may contact the npm registry to download Supercov
37
+ when it is not cached. The Supercov CLI does not contact a Supercov service
38
+ during a coverage run, and your source and evidence stay on your machine.
33
39
 
34
- The run prints its phases as it goes — initialization, workspace preparation,
35
- adapter setup, the instrumented build, your unchanged test command, and
36
- evidence publication — and finishes by publishing one immutable run under
37
- `.supercov/runs/<run-id>/`. The run id is a UTC timestamp, so run ids sort
38
- chronologically.
40
+ ## Run the complete suite
39
41
 
40
- If the command you normally use is not `npm test`, use that instead:
42
+ Everything after `--` is your test command. Use the same command you trust
43
+ before merging or deploying:
41
44
 
42
45
  ```sh
46
+ # JavaScript or TypeScript
47
+ npx supercov -- npm test
43
48
  npx supercov -- npx playwright test
44
49
  npx supercov -- pnpm test:e2e
45
- npx supercov -- npm run test:unit && npx supercov -- npm run test:e2e
50
+
51
+ # Rust
52
+ npx supercov -- cargo test
53
+ npx supercov -- cargo nextest run
46
54
  ```
47
55
 
48
- A single Supercov run can collect several runners. Coverage from a command that
49
- launches Vitest and Playwright ends up in one run, with each test labelled by
50
- the runner that executed it.
56
+ If one command launches several supported runners, Supercov combines their
57
+ evidence into one run.
51
58
 
52
- ## Read the result
59
+ ## Find the next test
53
60
 
54
- Start with the summary, then narrow. Every query names one run; `latest`
55
- selects the newest local run.
61
+ Start broad, then open one useful target:
56
62
 
57
63
  ```sh
58
- # What runs exist?
59
- npx supercov runs --limit 5
60
-
61
- # How complete is the newest one?
62
64
  npx supercov runs latest
63
-
64
- # Which files hold the most open obligations?
65
65
  npx supercov runs latest gaps --limit 10
66
-
67
- # What exactly is open in one file?
68
66
  npx supercov runs latest file app/checkout/session.ts
67
+ npx supercov runs latest decision app/checkout/session.ts:64
69
68
  ```
70
69
 
71
- Output is written for an agent reading a terminal: short, paginated, and
72
- carrying a copyable next-page command. Add `--json` to any query for the stable
73
- machine format.
70
+ The output is short and paginated so a coding agent can use it directly. Add
71
+ `--json` only when a tool specifically needs machine-readable output.
74
72
 
75
- ## Add a test and prove it landed
73
+ ## Add a test and prove the gain
76
74
 
77
- Write a test the normal way, then re-run and compare:
75
+ Write one focused test, rerun the same complete command, and compare the two
76
+ runs:
78
77
 
79
78
  ```sh
80
79
  npx supercov -- npm test
81
80
  npx supercov diff <previous-run-id> latest
82
81
  ```
83
82
 
84
- `diff` reports what the newer run covers that the older one did not. To check
85
- one specific test's contribution rather than the whole run:
83
+ For Rust, rerun the same `cargo test` or `cargo nextest run` command you used
84
+ for the baseline.
86
85
 
87
- ```sh
88
- npx supercov runs latest test "rejects a locked order"
89
- ```
90
-
91
- ## What Supercov writes
86
+ ## Give the loop to an agent
92
87
 
93
- Supercov owns two marker-protected locations inside your project:
88
+ Paste this into any coding agent that can run terminal commands:
94
89
 
95
90
  ```text
96
- .supercov/
97
- runs/<run-id>/evidence.raw.gz exact denominator manifest + raw evidence
98
- runs/<run-id>/run.json fingerprints, phase timings, integrity
99
- supercov/
100
- workspace/<project>/ isolated build namespace, reused between runs
101
- ```
91
+ Use `npx supercov` to improve coverage. Only write tests. Keep going while
92
+ useful gaps remain.
102
93
 
103
- Your source files, test files, runner configuration and ordinary build output
104
- are never modified, overwritten or rebuilt. Both owned locations carry their
105
- own gitignore; an existing user `supercov/` directory is never adopted.
94
+ Run the repository's complete test command through Supercov. Use
95
+ `npx supercov runs latest gaps --limit 5` to choose one useful target. Write
96
+ one focused test, rerun the complete suite, and verify the gain with
97
+ `npx supercov diff <previous-run-id> latest`.
106
98
 
107
- Storage is bounded by you, not by a background process:
108
-
109
- ```sh
110
- npx supercov clean # remove every stored run and build cache
111
- npx supercov clean --keep 20 # retain the 20 newest runs
112
- npx supercov clean --keep 20 --dry-run # show what would be removed
99
+ Never weaken assertions or change application code to make coverage easier.
100
+ Stop when no useful gaps remain.
113
101
  ```
114
102
 
115
- ## Choosing what counts
103
+ ## Local files and cleanup
116
104
 
117
- Two options change the meaning of a number rather than its presentation, so
118
- they are worth knowing early.
105
+ Completed runs live under `.supercov/runs/`. Supercov also maintains a
106
+ marker-protected isolated workspace for instrumented builds. It does not rewrite
107
+ your source, tests, imports, runner configuration, dependency tree, or ordinary
108
+ build output.
119
109
 
120
- `--filter` selects which attempts contribute:
121
-
122
- - `all` (default) counts every executed attempt, including attempts that later
123
- failed. This matches what conventional coverage tools report.
124
- - `passed` counts only successful attempts of tests that ultimately passed —
125
- verified coverage.
126
- - `failed` counts only failed attempts, which is useful when diagnosing a flaky
127
- test's real execution path.
128
-
129
- `--kind` selects a semantic test level such as `e2e`, `integration`,
130
- `component` or `unit`. Kind is resolved from an explicit `SUPERCOV_TEST_KIND`,
131
- then the Playwright project name, then the test path, then the runner default.
132
- Queries record how the label was established, so an inferred kind is never
133
- presented as one you declared.
134
-
135
- Filtered queries recompute every obligation from the selected tests instead of
136
- filtering an already-computed percentage. This matters most for MC/DC, where a
137
- witness pair assembled from one unit vector and one end-to-end vector counts for
138
- the combined suite but not for either level alone.
110
+ ```sh
111
+ npx supercov clean --dry-run # preview a full cleanup
112
+ npx supercov clean --keep 20 # retain the 20 newest runs
113
+ npx supercov clean # remove all runs and the build cache
114
+ ```
139
115
 
140
- ## Where to go next
116
+ ## Next
141
117
 
142
- - [Agent loop](/docs/agent-loop) — the unattended workflow this is designed for.
143
- - [CLI reference](/docs/cli) — every command and flag.
144
- - [Coverage model](/docs/coverage-model) — what an obligation is, and why the
145
- denominator is larger than lines and branches.
146
- - [Supported suites](/docs/supported-suites) — where attribution is exact and
147
- where it is aggregate.
118
+ - [Agent loop](/docs/agent-loop) — a repeatable coverage workflow for coding agents.
119
+ - [CLI reference](/docs/cli) — commands and filters.
120
+ - [Coverage model](/docs/coverage-model) — what Supercov measures.
121
+ - [Supported suites](/docs/supported-suites) languages, runners, and current limits.