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.
- package/README.md +147 -402
- package/docs/agent-loop.md +66 -124
- package/docs/cli.md +74 -87
- package/docs/coverage-model.md +79 -129
- package/docs/evidence.md +60 -91
- package/docs/getting-started.md +71 -97
- package/docs/performance.md +57 -106
- package/docs/supported-suites.md +82 -103
- package/docs/verification.md +49 -83
- package/docs/workspace-isolation.md +67 -115
- package/package.json +7 -7
- package/runtime/javascript/capability.js +19 -0
- package/runtime/javascript/register.mjs +5 -1
package/docs/coverage-model.md
CHANGED
|
@@ -1,134 +1,84 @@
|
|
|
1
1
|
# Coverage model
|
|
2
2
|
|
|
3
|
-
Supercov
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
##
|
|
7
|
+
## What Supercov measures
|
|
8
8
|
|
|
9
|
-
|
|
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
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
##
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
4
|
-
comparisons are derived from
|
|
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
|
|
6
|
+
## What a run contains
|
|
7
7
|
|
|
8
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
##
|
|
22
|
+
## Read a run
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
-
##
|
|
38
|
+
## Filter attempts
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
The same run can answer different questions without rerunning the suite:
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
50
|
-
|
|
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
|
-
|
|
53
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
##
|
|
65
|
+
## Combine shards
|
|
69
66
|
|
|
70
67
|
```sh
|
|
71
|
-
npx supercov merge <
|
|
68
|
+
npx supercov merge <shard-a> <shard-b> [...]
|
|
72
69
|
```
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
75
|
+
## Integrity and incomplete evidence
|
|
88
76
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
101
|
-
|
|
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
|
|
112
|
-
|
|
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.
|
package/docs/getting-started.md
CHANGED
|
@@ -1,147 +1,121 @@
|
|
|
1
1
|
# Getting started
|
|
2
2
|
|
|
3
|
-
Supercov
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
11
|
+
No account, config file, import, custom reporter, or hosted service is required.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Language support
|
|
14
14
|
|
|
15
|
-
|
|
|
16
|
-
| --- | --- |
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
##
|
|
28
|
+
## Requirements
|
|
27
29
|
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
50
|
+
|
|
51
|
+
# Rust
|
|
52
|
+
npx supercov -- cargo test
|
|
53
|
+
npx supercov -- cargo nextest run
|
|
46
54
|
```
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
##
|
|
59
|
+
## Find the next test
|
|
53
60
|
|
|
54
|
-
Start
|
|
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
|
-
|
|
72
|
-
|
|
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
|
|
73
|
+
## Add a test and prove the gain
|
|
76
74
|
|
|
77
|
-
Write
|
|
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
|
-
|
|
85
|
-
|
|
83
|
+
For Rust, rerun the same `cargo test` or `cargo nextest run` command you used
|
|
84
|
+
for the baseline.
|
|
86
85
|
|
|
87
|
-
|
|
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
|
-
|
|
88
|
+
Paste this into any coding agent that can run terminal commands:
|
|
94
89
|
|
|
95
90
|
```text
|
|
96
|
-
.
|
|
97
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
103
|
+
## Local files and cleanup
|
|
116
104
|
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
##
|
|
116
|
+
## Next
|
|
141
117
|
|
|
142
|
-
- [Agent loop](/docs/agent-loop) —
|
|
143
|
-
- [CLI reference](/docs/cli) —
|
|
144
|
-
- [Coverage model](/docs/coverage-model) — what
|
|
145
|
-
|
|
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.
|