supercov 0.0.10-arm64-darwin
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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +401 -0
- data/exe/supercov +11 -0
- data/lib/supercov.rb +5 -0
- data/libexec/supercov +0 -0
- metadata +48 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 95ab0d15a3d599acf1e2f4e226018cc651d930816591227e5001133826dab230
|
|
4
|
+
data.tar.gz: 32fd35917831264b2898aed233de03f3dd6b5c8bc54ef0ce9d8bfee18df35a85
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5a807a8b96eda89d86407d8ce43f3487fd8a48fc75a24523379870f1cb20ffdf37daf6b34b3d0c2bd423d401e19f0bf7e899a311fba016314034c84a045bc920
|
|
7
|
+
data.tar.gz: 7fefaf7efaab33451a27a73b2b864804c8687a0d6aafb4aa256d0540ed91d423590a76feb0202f194647136002c0c30aa47fe54184be82161f704aff2d82cc36
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Supercov contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
# supercov
|
|
2
|
+
|
|
3
|
+
Zero-edit, runner-aware coverage-completeness command for JavaScript test
|
|
4
|
+
suites.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npx supercov -- npm test
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
For local development before publication, a Supercov contributor can expose
|
|
11
|
+
the checkout globally. Consumer repositories still remain untouched:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
# In the supercov repository.
|
|
15
|
+
npm install
|
|
16
|
+
npm link
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Verifying the instrumenter
|
|
20
|
+
|
|
21
|
+
The coverage engine has seven independent release gates:
|
|
22
|
+
|
|
23
|
+
- semantic differential fixtures execute original and instrumented programs
|
|
24
|
+
in isolated scopes and compare return values, thrown errors, and observable
|
|
25
|
+
side-effect order;
|
|
26
|
+
- a deterministic generated corpus exercises 160 nested combinations of
|
|
27
|
+
short-circuiting, ternaries, coercion, and thrown expressions on every run;
|
|
28
|
+
- seeded `fast-check` properties exercise another 500 generated nested
|
|
29
|
+
expressions and 300 generated control-flow executions, with shrinking and a
|
|
30
|
+
reproducible seed on failure;
|
|
31
|
+
- coverage oracles assert exact decision vectors, MC/DC witnesses, and branch
|
|
32
|
+
alternatives independently of program behavior;
|
|
33
|
+
- the same three-condition masking-MC/DC golden cases must report 100% for a
|
|
34
|
+
complete witness set and 33.33% for an incomplete one under both Supercov
|
|
35
|
+
and Clang/LLVM source-based MC/DC;
|
|
36
|
+
- release CI shards the pinned TC39 Test262 corpus across 16 workers, runs the
|
|
37
|
+
official Test262 harness on original and instrumented sources, and rejects
|
|
38
|
+
any scenario that passes originally but fails after transformation; and
|
|
39
|
+
- checked performance budgets cover transform latency, transactional workspace
|
|
40
|
+
preparation, output expansion, and runtime probe overhead.
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npm test
|
|
44
|
+
npm run test:clang-mcdc
|
|
45
|
+
npm run benchmark:check
|
|
46
|
+
|
|
47
|
+
# One-time contributor setup. The corpus stays inside this checkout and is
|
|
48
|
+
# ignored by Git because it is a large, reproducible test dependency.
|
|
49
|
+
git clone --depth 1 https://github.com/tc39/test262.git .cache/test262
|
|
50
|
+
|
|
51
|
+
# Uses .cache/test262 by default.
|
|
52
|
+
npm run test:test262
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Test262 is TC39's conformance suite for ECMA-262, the JavaScript language
|
|
56
|
+
specification. Supercov executes eligible tests both before and after
|
|
57
|
+
instrumentation and rejects any semantic difference. The local clone is not
|
|
58
|
+
part of the npm package or a coverage run and can be deleted and cloned again
|
|
59
|
+
at any time. Contributors who already keep Test262 elsewhere can override the
|
|
60
|
+
default with `TEST262_DIR=/path/to/test262` or `--test262 <path>`.
|
|
61
|
+
|
|
62
|
+
The differential suite includes getters, proxies, optional calls and `this`,
|
|
63
|
+
computed logical assignments, defaults, `try`/`catch`/`finally`, iterator
|
|
64
|
+
closing, switch fallthrough, labeled loops, async functions, and generators.
|
|
65
|
+
The compatibility workflow additionally runs Node 22/24/25, Playwright
|
|
66
|
+
1.55/current, Vite 5/current, Vitest 2/current, Chromium, Firefox, WebKit, and
|
|
67
|
+
modern JavaScript/JSX/TypeScript/TSX syntax fixtures. Filesystem publication,
|
|
68
|
+
symlink, copy fallback, ENOSPC, failed rename, and forced-termination recovery
|
|
69
|
+
also run on Ubuntu, macOS, and Windows. Test262's module, async,
|
|
70
|
+
raw, parse/resolution-negative, Annex B sloppy-script extension, and explicit
|
|
71
|
+
`Function.prototype.toString`/function-source-coercion tests are intentionally
|
|
72
|
+
excluded from the source-rewrite comparison, with reason counts printed for
|
|
73
|
+
every shard. Annex B does not apply to the Vite application modules Supercov
|
|
74
|
+
instruments; exact source reflection necessarily observes a source transform.
|
|
75
|
+
When application code directly coerces or observes a function's source,
|
|
76
|
+
Supercov leaves that function body uninstrumented and records a visible
|
|
77
|
+
`semantic-safety` completeness blocker. The release corpus covers every other eligible synchronous
|
|
78
|
+
script and runtime-negative scenario, while dedicated differential fixtures
|
|
79
|
+
cover async functions and generators. Every semantic-equivalence failure
|
|
80
|
+
blocks the trusted-publishing workflow.
|
|
81
|
+
|
|
82
|
+
## Agent query workflow
|
|
83
|
+
|
|
84
|
+
Each run is stored locally under `.supercov/runs/<run-id>/`. Its immutable
|
|
85
|
+
`evidence.raw.gz` archive and `run.json` metadata are the source of truth. The archive
|
|
86
|
+
contains the exact coverage denominator manifest plus raw per-worker and
|
|
87
|
+
background evidence. The first query lazily reconstructs the complete coverage
|
|
88
|
+
model and atomically writes a disposable, integrity-checked `query-index.v1.json.gz`;
|
|
89
|
+
later queries reuse it. A changed archive, incompatible Supercov/schema version,
|
|
90
|
+
or corrupt index causes automatic reconstruction, so the index can be deleted at
|
|
91
|
+
any time without losing coverage data.
|
|
92
|
+
Loose evidence is removed only after the whole run directory is atomically
|
|
93
|
+
visible. HTML is not generated during a test run; agents should use bounded
|
|
94
|
+
CLI queries instead of loading the complete derived model into context.
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
# Orient using only a few lines.
|
|
98
|
+
npx supercov runs --limit 5
|
|
99
|
+
npx supercov runs latest coverage
|
|
100
|
+
npx supercov runs latest coverage --filter passed
|
|
101
|
+
npx supercov runs latest coverage --filter failed
|
|
102
|
+
npx supercov runs latest coverage kinds
|
|
103
|
+
npx supercov runs latest coverage runners
|
|
104
|
+
npx supercov runs latest coverage scope
|
|
105
|
+
npx supercov runs latest coverage --kind e2e
|
|
106
|
+
npx supercov runs latest coverage files
|
|
107
|
+
npx supercov runs latest coverage gaps
|
|
108
|
+
npx supercov runs latest coverage gaps --metric mcdc
|
|
109
|
+
npx supercov runs latest coverage gaps --kind e2e
|
|
110
|
+
|
|
111
|
+
# Drill into one target selected from the gap list.
|
|
112
|
+
npx supercov runs latest coverage file app/routes/example.ts
|
|
113
|
+
npx supercov runs latest coverage file app/routes/example.ts --metric mcdc
|
|
114
|
+
npx supercov runs latest coverage decision app/routes/example.ts:42
|
|
115
|
+
npx supercov runs latest coverage covers app/routes/example.ts:57
|
|
116
|
+
|
|
117
|
+
# Understand redundancy/contribution and validate a newly written test. Replace
|
|
118
|
+
# "latest" with the immutable run ID when an agent continues work later.
|
|
119
|
+
npx supercov runs latest coverage test "test title fragment"
|
|
120
|
+
npx supercov runs latest coverage minimize --filter passed
|
|
121
|
+
npx supercov runs latest coverage minimize --filter passed --metric mcdc --target 80
|
|
122
|
+
npx supercov diff <older-run> <newer-run>
|
|
123
|
+
|
|
124
|
+
# Combine compatible shards without deleting their immutable source runs.
|
|
125
|
+
npx supercov merge <first-run-id> <second-run-id>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`supercov runs` is metadata-only for uncached history and never reconstructs
|
|
129
|
+
coverage for twenty runs merely to list them. Runs whose disposable query index
|
|
130
|
+
already exists include their metrics; other rows say `coverage not indexed`.
|
|
131
|
+
Selecting a run with `runs <run-id> coverage` materializes its index lazily.
|
|
132
|
+
|
|
133
|
+
Coverage queries use `--filter all` by default, matching conventional coverage
|
|
134
|
+
tools: every executed attempt contributes, including attempts that later fail.
|
|
135
|
+
Use `--filter passed` for verified coverage from successful attempts of
|
|
136
|
+
ultimately passing tests, or `--filter failed` to inspect only execution from
|
|
137
|
+
failed attempts (including failed retries of flaky tests). Evidence records
|
|
138
|
+
attempt status and classify each test as passed, failed, flaky, skipped, timed
|
|
139
|
+
out, interrupted, or unknown. Passed and failed views are derived from the
|
|
140
|
+
same immutable archive rather than duplicated into presentation files.
|
|
141
|
+
|
|
142
|
+
The run ID is positional because all coverage queries operate on one immutable
|
|
143
|
+
run. `latest` is a convenience selector for interactive use. Every query
|
|
144
|
+
accepts `--json` and—where the result can be long—`--limit` and `--offset`.
|
|
145
|
+
Every collection is paginated at 20 items by default and prints its range plus
|
|
146
|
+
a copyable next-page command; generated commands omit the default limit.
|
|
147
|
+
Agents targeting one coverage dimension can pass `--metric` to `coverage
|
|
148
|
+
files`, `coverage gaps`, or `coverage file`; this ranks and narrows the existing
|
|
149
|
+
resource instead of requiring a separate MC/DC-specific command.
|
|
150
|
+
Measurement limitations use the same drill-down commands as ordinary gaps.
|
|
151
|
+
The coverage summary reports whether the measured denominator is complete,
|
|
152
|
+
`coverage files` and `coverage gaps` include per-file limitation counts and
|
|
153
|
+
kinds, and `coverage file <path>` returns the bounded source locations, reasons,
|
|
154
|
+
and denominator effect. `coverage scope` attaches the same counts to included,
|
|
155
|
+
excluded, and ambiguous source entries. A 100% metric with a blocking limitation
|
|
156
|
+
is therefore never reported as structurally complete.
|
|
157
|
+
The summary also exposes provider-neutral transport counters. If Supercov
|
|
158
|
+
supervises remote launches but receives no server records, it emits a
|
|
159
|
+
`REMOTE_SERVER_EVIDENCE_MISSING` diagnostic instead of letting an agent assume
|
|
160
|
+
that browser-only evidence describes the whole application.
|
|
161
|
+
Malformed JSONL transport records do not make the entire run unreadable.
|
|
162
|
+
Supercov retains valid records, emits a `CORRUPT_EVIDENCE_RECORDS` error
|
|
163
|
+
diagnostic, and marks measurement completeness false until a clean run is
|
|
164
|
+
available.
|
|
165
|
+
Text output is concise for an interactive agent; JSON is the stable machine
|
|
166
|
+
interface that can later back hosted coverage tools without changing the
|
|
167
|
+
stored evidence schema. Every JSON response uses contract version 1:
|
|
168
|
+
successful responses contain `schemaVersion`, `ok: true`, `command`, `data`,
|
|
169
|
+
and, for every bounded collection, one `pagination` object with `offset`,
|
|
170
|
+
`limit`, `returned`, `total`, `hasMore`, and `nextOffset`. Failures exit with
|
|
171
|
+
status 2 and emit only a parseable `ok: false` envelope containing a stable
|
|
172
|
+
error `code`, message, retryability, and bounded details. JSON stdout has a
|
|
173
|
+
hard 64 KiB limit; an oversized request returns `RESPONSE_TOO_LARGE` so the
|
|
174
|
+
caller can paginate or narrow it instead of flooding an agent context.
|
|
175
|
+
`coverage minimize` is an exact branch-and-bound
|
|
176
|
+
solver: line, statement, function, and branch obligations use per-test
|
|
177
|
+
provenance, while MC/DC obligations retain complete independence-witness pairs
|
|
178
|
+
and are recomputed for every candidate subset. Its result is therefore a
|
|
179
|
+
proved minimum, not a greedy approximation.
|
|
180
|
+
It intentionally refuses a view containing background/unattributed evidence:
|
|
181
|
+
there is no honest way to claim an exact test subset when the runner did not
|
|
182
|
+
expose test boundaries.
|
|
183
|
+
|
|
184
|
+
`merge` accepts only runs with identical source, test, dependency,
|
|
185
|
+
configuration, instrumenter, schema, and denominator fingerprints. It rewrites
|
|
186
|
+
the run scope inside every evidence record, namespaces shard paths, publishes a
|
|
187
|
+
new immutable run atomically, and leaves all input runs untouched. This is the
|
|
188
|
+
distributed/multi-host primitive; incompatible shards fail clearly instead of
|
|
189
|
+
producing a plausible but invalid aggregate.
|
|
190
|
+
|
|
191
|
+
For a JavaScript or TypeScript project, the CLI:
|
|
192
|
+
|
|
193
|
+
1. refreshes a stable isolated source namespace under
|
|
194
|
+
`.supercov/cache/instrumented-workspace/<project>/`, links the existing
|
|
195
|
+
dependency tree, and creates generated runner configuration and build output
|
|
196
|
+
only there; file data uses copy-on-write reflinks where the filesystem
|
|
197
|
+
supports them, and falls back to copying where it does not; the stable path
|
|
198
|
+
lets VM/container snapshot systems reuse a coverage build without touching
|
|
199
|
+
the application's ordinary build; when the complete source/config/toolchain
|
|
200
|
+
fingerprint is unchanged, the prior instrumented output and manifest are
|
|
201
|
+
carried into the refreshed source snapshot and the build is skipped;
|
|
202
|
+
2. inventories first-party source from package entry points, workspaces,
|
|
203
|
+
conventional source directories, and TypeScript roots. Every candidate is
|
|
204
|
+
retained as included, excluded, or ambiguous; ambiguity blocks a complete
|
|
205
|
+
verdict and is inspectable with `coverage scope`. Set
|
|
206
|
+
`SUPERCOV_SOURCE_ROOTS` for an explicit authoritative scope;
|
|
207
|
+
3. instruments through the existing Vite graph when available, or instruments
|
|
208
|
+
only the disposable source copy before the project's unchanged
|
|
209
|
+
Next/Turbopack, Webpack, esbuild, SWC, or other build command. No-build ESM
|
|
210
|
+
and CommonJS projects use the same disposable direct path;
|
|
211
|
+
4. runs the exact command following `--`, propagating coverage through every
|
|
212
|
+
Node child process it launches. Generated adapters provide exact test,
|
|
213
|
+
worker, retry, and outcome scopes for Playwright, Vitest, Jest, and
|
|
214
|
+
`node:test` without changing test imports or configs;
|
|
215
|
+
5. attributes source hits and decision vectors to individual tests where an
|
|
216
|
+
exact adapter is active,
|
|
217
|
+
automatically wraps Playwright actions and assertions, and records the
|
|
218
|
+
action/assertion phase responsible for each correlated hit; and
|
|
219
|
+
6. atomically publishes the exact denominator and raw evidence into one gzip
|
|
220
|
+
archive under `.supercov/`, then
|
|
221
|
+
removes loose evidence and terminal per-run work state, retaining only the
|
|
222
|
+
immutable run and disposable isolated build namespace. The
|
|
223
|
+
ordinary application build is never read as an input, overwritten, or
|
|
224
|
+
rebuilt afterward.
|
|
225
|
+
|
|
226
|
+
Only `.supercov/` is modified in the user's checkout. A per-project lock
|
|
227
|
+
rejects overlapping runs before either can build. Run state is durably written
|
|
228
|
+
through preparing/building/testing/publishing phases; SIGINT, SIGTERM,
|
|
229
|
+
and SIGHUP are forwarded to the entire child process group. If the process is
|
|
230
|
+
killed without a cleanup opportunity, the next invocation marks the dead PID's
|
|
231
|
+
run abandoned and refreshes the isolated namespace before using it. Cache
|
|
232
|
+
refresh is transactional: a new sibling generation is prepared completely,
|
|
233
|
+
the stable name is switched only at publication, and the prior complete
|
|
234
|
+
generation is retained until that switch succeeds. The next invocation
|
|
235
|
+
discards orphan staging trees or restores the prior generation if a host crash
|
|
236
|
+
landed between the two same-filesystem renames. Evidence archive, metadata, and
|
|
237
|
+
state writes use sibling-temp files, fsync, and atomic rename; lock acquisition
|
|
238
|
+
uses exclusive creation and fsync. Published `run.json` is the durable terminal
|
|
239
|
+
record, so terminal work state is not retained.
|
|
240
|
+
|
|
241
|
+
Retention is deterministic because UTC run IDs sort chronologically:
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
npx supercov prune --keep 20
|
|
245
|
+
npx supercov prune --keep 20 --dry-run
|
|
246
|
+
npx supercov clean --keep 20 # also removes the shared build cache
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Neither operation runs automatically. `prune` removes explicit history beyond
|
|
250
|
+
the requested retention and orphan/terminal transient data while preserving
|
|
251
|
+
the shared cache. `clean` also removes that cache. Both acquire the same lock
|
|
252
|
+
as a coverage run, refuse to race an active run, and never touch files outside
|
|
253
|
+
`.supercov/`.
|
|
254
|
+
|
|
255
|
+
The complete ownership, crash-recovery, symlink, and future copy-free design is
|
|
256
|
+
documented in [Workspace isolation](docs/workspace-isolation.md).
|
|
257
|
+
|
|
258
|
+
Every run prints and stores monotonic phase timings for initialization,
|
|
259
|
+
workspace preparation, adapter setup, the instrumented build, the unchanged
|
|
260
|
+
test command, and evidence publication. They are available in
|
|
261
|
+
`.supercov/runs/<run-id>/run.json` and in the JSON form of `supercov runs`.
|
|
262
|
+
These phase timings do not pretend to be end-to-end overhead: that percentage
|
|
263
|
+
requires an explicit comparison with the same command run without Supercov,
|
|
264
|
+
which Supercov never executes automatically because an arbitrary test command
|
|
265
|
+
may have side effects or external cost. See
|
|
266
|
+
[Performance and storage](docs/performance.md) for the comparison methodology,
|
|
267
|
+
strategy trade-offs, and a measured real-suite reference.
|
|
268
|
+
|
|
269
|
+
The automatic exact-attribution adapters support standard Playwright suites
|
|
270
|
+
(ESM and CommonJS specs in arbitrary project directories), project-owned
|
|
271
|
+
Playwright fixture packages, Vitest, Jest—including concurrent and
|
|
272
|
+
parameterized tests—and `node:test`. A single command can collect several
|
|
273
|
+
runners into one run. Unsupported runners such as AVA or Mocha still receive
|
|
274
|
+
aggregate first-party structural coverage through inherited process
|
|
275
|
+
instrumentation, but their hits remain background/unattributed rather than
|
|
276
|
+
being guessed onto tests. Browser component runners without a recognized
|
|
277
|
+
adapter have the same explicit boundary.
|
|
278
|
+
|
|
279
|
+
Remote execution discovery is structural rather than provider-specific. The
|
|
280
|
+
preload and narrowly gated ESM transform observe exports for a static
|
|
281
|
+
`build(options)` capability,
|
|
282
|
+
activate only when those options contain a host-to-guest mount that includes
|
|
283
|
+
the isolated project, scopes an existing cache/snapshot identity to the run's
|
|
284
|
+
source fingerprint, and follows the opaque returned object graph. A method
|
|
285
|
+
whose options contain `argv`, `cmd`, or `command` receives guest-translated
|
|
286
|
+
Supercov paths and a guest-valid Node preload. The execution log records this
|
|
287
|
+
process/capability graph but hashes long or multiline arguments so embedded
|
|
288
|
+
shell bodies and credentials are never persisted.
|
|
289
|
+
|
|
290
|
+
This zero-edit mechanism has explicit boundaries. It follows Node child
|
|
291
|
+
processes, not arbitrary non-Node supervisors or a remote control plane that
|
|
292
|
+
never exposes launches to the local process. CommonJS and pure-ESM executor
|
|
293
|
+
SDKs, object-shaped and positional execution APIs, and opaque returned object
|
|
294
|
+
graphs are covered when a discoverable build capability exposes the workspace
|
|
295
|
+
mount and an execution capability accepts an environment. Providers that hide
|
|
296
|
+
all launch state behind an out-of-process RPC still need an adapter. Supercov
|
|
297
|
+
reports missing evidence rather than claiming those paths are covered.
|
|
298
|
+
|
|
299
|
+
The public regression suite includes provider-neutral CommonJS and pure-ESM
|
|
300
|
+
opaque executors. Each exposes only a static build capability, a host-to-guest mount,
|
|
301
|
+
an existing snapshot key, an opaque image/pool/machine chain, and an
|
|
302
|
+
argv-shaped execution method. CI requires Supercov to discover that structure,
|
|
303
|
+
scope the cache identity, translate paths and the Node preload into the guest,
|
|
304
|
+
run nested Vitest and Playwright commands, parse every concurrent trace shard,
|
|
305
|
+
and produce 100% fixture coverage. A separate clean-room gate packs the npm
|
|
306
|
+
tarball and invokes it through `npx` in a project with no build step, asserting
|
|
307
|
+
that no source or configuration file changes.
|
|
308
|
+
|
|
309
|
+
Before the isolated build, Supercov also compares the invoked npm/pnpm/yarn/bun
|
|
310
|
+
script with explicit string-valued `process.env` mode checks in the project's
|
|
311
|
+
build config. A semantic match such as `test:preview` and
|
|
312
|
+
`process.env.TEST_PREVIEW === "true"` activates that build-only flag and is
|
|
313
|
+
printed before the build. It never guesses values for unrelated environment
|
|
314
|
+
variables.
|
|
315
|
+
|
|
316
|
+
Each test carries two independent provenance fields:
|
|
317
|
+
|
|
318
|
+
- `runner`: the process that executed it, such as `playwright` or `vitest`;
|
|
319
|
+
- `kind`: its semantic level, such as `e2e`, `integration`, `component`, or
|
|
320
|
+
`unit`.
|
|
321
|
+
|
|
322
|
+
Kind is resolved in descending confidence from an explicit
|
|
323
|
+
`SUPERCOV_TEST_KIND`, Playwright project name, test path, then runner
|
|
324
|
+
default (Playwright is E2E; Vitest is unit). The report preserves how the label
|
|
325
|
+
was established, so an inferred kind is never presented as user-declared.
|
|
326
|
+
Vitest module-import/setup execution is retained as a separate setup scope,
|
|
327
|
+
not mislabeled as a test case.
|
|
328
|
+
|
|
329
|
+
Filtered queries recompute every obligation from the selected tests. MC/DC is
|
|
330
|
+
especially important: the command recomputes independence witness pairs rather
|
|
331
|
+
than filtering an already-computed percentage. Therefore a witness assembled
|
|
332
|
+
from one unit vector and one E2E vector counts for the combined suite but not
|
|
333
|
+
for either filtered subset. With `--kind e2e`, gap and file queries also
|
|
334
|
+
distinguish obligations covered only by other test levels from obligations
|
|
335
|
+
uncovered everywhere.
|
|
336
|
+
|
|
337
|
+
The query model reconstructed from the archive contains both per-test and
|
|
338
|
+
per-test-file coverage data. MC/DC stores vector-level provenance rather than
|
|
339
|
+
only a decision-level test list, so the exact minimizer recomputes valid
|
|
340
|
+
independence pairs for every proposed subset. This matters because the two
|
|
341
|
+
vectors in a witness pair may come from different tests.
|
|
342
|
+
|
|
343
|
+
The reconstructed query model also contains an action/assertion trace without requiring spec
|
|
344
|
+
changes. Calls such as `page.goto()`, `locator.click()`, and `locator.fill()`
|
|
345
|
+
open action phases; Playwright `expect()` matchers open assertion phases. The
|
|
346
|
+
phase travels on browser requests into automatically wrapped Remix loaders,
|
|
347
|
+
actions, and the server document renderer. Node async context preserves that
|
|
348
|
+
ID through awaited helpers. An assertion also retains the preceding action ID,
|
|
349
|
+
making chains such as “click -> application lines/decisions -> visible
|
|
350
|
+
assertion” queryable in JSON.
|
|
351
|
+
|
|
352
|
+
Server evidence is safe when Playwright uses multiple workers against one
|
|
353
|
+
application server. Every routed request carries a run/worker/test/retry scope;
|
|
354
|
+
Node async context retains that scope and its current phase across awaited
|
|
355
|
+
work. The server writes to a distinct attempt path, and the collecting fixture
|
|
356
|
+
accepts only records bearing that attempt ID. No worker deletes, reads, or
|
|
357
|
+
attributes another worker's live evidence file.
|
|
358
|
+
|
|
359
|
+
Detached work is never silently dropped or guessed onto the currently active
|
|
360
|
+
test. HTTP callbacks inherit the carrier automatically; child processes inherit
|
|
361
|
+
it through their environment; and exported queue helpers support BullMQ,
|
|
362
|
+
Bee-Queue, pg-boss, Agenda, and in-process schedulers. Evidence that arrives
|
|
363
|
+
without a carrier is persisted under a first-class `background/unattributed`
|
|
364
|
+
scope. It is visible in the all-attempt view and excluded from passed-only
|
|
365
|
+
per-test coverage.
|
|
366
|
+
|
|
367
|
+
The Playwright adapter covers the page and request fixtures, API request
|
|
368
|
+
contexts, user-created browser contexts/pages, popups and all their frames,
|
|
369
|
+
dedicated/service workers, WebSocket handshake headers, and test-spawned child
|
|
370
|
+
processes. A two-worker generic fixture exercises these surfaces without
|
|
371
|
+
changing its test imports or Playwright config.
|
|
372
|
+
|
|
373
|
+
Every run stores SHA-256 fingerprints for source, tests, dependency lockfiles,
|
|
374
|
+
test/build configuration, and the instrumenter, plus its evidence schema and Git
|
|
375
|
+
revision/dirty state. Queries compare the stored fingerprint with the current
|
|
376
|
+
workspace, visibly mark stale runs, and reject evidence carrying a different
|
|
377
|
+
run scope.
|
|
378
|
+
|
|
379
|
+
For Chromium documents exposed through the page target, a pre-document probe
|
|
380
|
+
also installs the phase before application JavaScript starts. Chromium may run
|
|
381
|
+
a newly created cross-origin iframe in a separate target that cannot be safely
|
|
382
|
+
paused and attached during navigation; its earliest browser probes use the
|
|
383
|
+
timing fallback until the frame is live. This affects only action-level causal
|
|
384
|
+
precision, not structural coverage or exact test-case provenance.
|
|
385
|
+
|
|
386
|
+
Code reached outside a recognized Playwright action, such as setup work or a
|
|
387
|
+
project-specific helper that performs HTTP requests directly, still has exact
|
|
388
|
+
test-case attribution but may not have an explicit action-phase ID. The report
|
|
389
|
+
labels explicit browser/server events separately from events assigned by the
|
|
390
|
+
isolated VM's timing fallback. Only explicit phases can raise confidence to
|
|
391
|
+
`asserted`; a timing-correlated event remains execution-only. Each line, point,
|
|
392
|
+
branch alternative, vector, and MC/DC condition therefore distinguishes
|
|
393
|
+
unexecuted, executed, action-linked, and assertion-linked evidence, as well as
|
|
394
|
+
unit-only versus E2E coverage.
|
|
395
|
+
|
|
396
|
+
The v2 denominator additionally measures optional-chain short-circuiting,
|
|
397
|
+
logical assignments, parameter/destructuring defaults, try versus catch,
|
|
398
|
+
zero versus entered `for-in`/`for-of`, and implicit switch no-match. Direct
|
|
399
|
+
`eval`/`Function` source cannot receive a stable pre-run denominator; when such
|
|
400
|
+
code is discovered the evidence records its exact location as a completeness
|
|
401
|
+
blocker instead of allowing a misleading 100% verdict.
|
data/exe/supercov
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
binary = File.expand_path("../libexec/supercov", __dir__)
|
|
5
|
+
|
|
6
|
+
unless File.file?(binary) && File.executable?(binary)
|
|
7
|
+
warn "supercov: packaged Rust executable is missing or not executable: #{binary}"
|
|
8
|
+
exit 126
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
exec(binary, *ARGV)
|
data/lib/supercov.rb
ADDED
data/libexec/supercov
ADDED
|
Binary file
|
metadata
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: supercov
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.10
|
|
5
|
+
platform: arm64-darwin
|
|
6
|
+
authors:
|
|
7
|
+
- Supercorp
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: The platform-native Supercov CLI, powered by the single Rust engine.
|
|
13
|
+
email:
|
|
14
|
+
- hello@supercorp.ai
|
|
15
|
+
executables:
|
|
16
|
+
- supercov
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- LICENSE
|
|
21
|
+
- README.md
|
|
22
|
+
- exe/supercov
|
|
23
|
+
- lib/supercov.rb
|
|
24
|
+
- libexec/supercov
|
|
25
|
+
homepage: https://github.com/supercorp-ai/supercov
|
|
26
|
+
licenses:
|
|
27
|
+
- MIT
|
|
28
|
+
metadata:
|
|
29
|
+
bug_tracker_uri: https://github.com/supercorp-ai/supercov/issues
|
|
30
|
+
source_code_uri: https://github.com/supercorp-ai/supercov
|
|
31
|
+
rdoc_options: []
|
|
32
|
+
require_paths:
|
|
33
|
+
- lib
|
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '2.6'
|
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '0'
|
|
44
|
+
requirements: []
|
|
45
|
+
rubygems_version: 3.6.9
|
|
46
|
+
specification_version: 4
|
|
47
|
+
summary: Zero-configuration, runner-aware structural and MC/DC coverage
|
|
48
|
+
test_files: []
|