probatio 0.3.0 → 0.5.0

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.
Files changed (74) hide show
  1. package/README.md +10 -198
  2. package/bin/probatio.js +52 -0
  3. package/package.json +21 -29
  4. package/LICENSE +0 -21
  5. package/dist/cli.js +0 -721
  6. package/dist/contract.js +0 -32
  7. package/dist/flags.js +0 -87
  8. package/dist/golden/check.js +0 -188
  9. package/dist/golden/record.js +0 -395
  10. package/dist/golden/recorder.mjs +0 -78
  11. package/dist/ledger/build.js +0 -348
  12. package/dist/ledger/check.js +0 -133
  13. package/dist/matrix/report.js +0 -256
  14. package/dist/mcp.js +0 -188
  15. package/dist/memory/state.js +0 -222
  16. package/dist/mutate/affected.js +0 -173
  17. package/dist/mutate/child-lines.mjs +0 -39
  18. package/dist/mutate/coverage-map.js +0 -229
  19. package/dist/mutate/csharp-coverage.js +0 -161
  20. package/dist/mutate/fail-reporter.mjs +0 -65
  21. package/dist/mutate/find.js +0 -13
  22. package/dist/mutate/generate.js +0 -156
  23. package/dist/mutate/go-coverage.js +0 -100
  24. package/dist/mutate/ids.js +0 -22
  25. package/dist/mutate/java-coverage.js +0 -217
  26. package/dist/mutate/kill-label.js +0 -34
  27. package/dist/mutate/load-failure.mjs +0 -40
  28. package/dist/mutate/mocha-coverage.cjs +0 -77
  29. package/dist/mutate/node-batch-loader.mjs +0 -99
  30. package/dist/mutate/node-batch.mjs +0 -167
  31. package/dist/mutate/node-coverage.mjs +0 -77
  32. package/dist/mutate/operators.js +0 -181
  33. package/dist/mutate/patch.js +0 -136
  34. package/dist/mutate/precise-lines.mjs +0 -304
  35. package/dist/mutate/probatio-jacoco-run.java +0 -516
  36. package/dist/mutate/project-config.js +0 -58
  37. package/dist/mutate/py-pytest-reporter.py +0 -145
  38. package/dist/mutate/py-reporter.py +0 -79
  39. package/dist/mutate/run.js +0 -1335
  40. package/dist/mutate/rust-coverage.js +0 -144
  41. package/dist/mutate/sealed.js +0 -118
  42. package/dist/mutate/suite-decision.js +0 -130
  43. package/dist/mutate/suites.js +0 -1524
  44. package/dist/mutate/tally.js +0 -240
  45. package/dist/mutate/text-operators.js +0 -637
  46. package/dist/mutate/titles.js +0 -23
  47. package/dist/node-version.js +0 -13
  48. package/dist/swarm/check-kill.js +0 -114
  49. package/dist/swarm/queue.js +0 -68
  50. package/dist/verify/change.js +0 -340
  51. package/schemas/check-kill.schema.json +0 -93
  52. package/schemas/findings.add.schema.json +0 -53
  53. package/schemas/gap.fix.schema.json +0 -53
  54. package/schemas/gap.revert.schema.json +0 -53
  55. package/schemas/golden.check.schema.json +0 -89
  56. package/schemas/golden.compare.schema.json +0 -151
  57. package/schemas/golden.record.schema.json +0 -126
  58. package/schemas/guard.check.schema.json +0 -53
  59. package/schemas/ledger.build.schema.json +0 -132
  60. package/schemas/ledger.check.schema.json +0 -143
  61. package/schemas/matrix.report.schema.json +0 -129
  62. package/schemas/mcp.schema.json +0 -53
  63. package/schemas/mutate.generate.schema.json +0 -127
  64. package/schemas/mutate.help.schema.json +0 -53
  65. package/schemas/mutate.run.schema.json +0 -272
  66. package/schemas/mutate.sealed.schema.json +0 -53
  67. package/schemas/mutate.tally.schema.json +0 -137
  68. package/schemas/queue.claim.schema.json +0 -53
  69. package/schemas/queue.reap.schema.json +0 -71
  70. package/schemas/queue.seed.schema.json +0 -71
  71. package/schemas/schema.schema.json +0 -74
  72. package/schemas/seal.schema.json +0 -69
  73. package/schemas/status.schema.json +0 -103
  74. package/schemas/verify-change.schema.json +0 -222
package/README.md CHANGED
@@ -1,205 +1,17 @@
1
- # Probatio
1
+ # probatio
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/probatio)](https://www.npmjs.com/package/probatio)
3
+ Version 0.5.0 installs the Rust binary. The `probatio` command is a small Node launcher. npm installs one platform package next to it and the launcher runs that binary.
4
4
 
5
- Probatio scores a test suite by the bugs it already catches. A kill is an assertion the suite had. The kill count is not a merge gate.
6
-
7
- Node 22.6 or newer:
5
+ | Package | Machine |
6
+ | --- | --- |
7
+ | `probatio-linux-x64` | Linux x64, musl build |
8
+ | `probatio-darwin-arm64` | macOS Apple silicon |
9
+ | `probatio-darwin-x64` | macOS Intel |
10
+ | `@iron_adamant/probatio-win32-x64` | Windows x64 |
8
11
 
9
12
  ```bash
10
13
  npm install probatio
14
+ probatio --version
11
15
  ```
12
16
 
13
- ```bash
14
- npx probatio mutate generate --package . --out .probatio/generate
15
- npx probatio mutate run --package . --patches .probatio/generate/mutants --out .probatio/runs
16
- npx probatio mutate tally --out .probatio/runs
17
- ```
18
-
19
- Each command prints one JSON object and exits 0 only when `ok` is true.
20
-
21
- ```json
22
- {
23
- "schemaVersion": 2,
24
- "ok": true,
25
- "summary": "0 no coverage, 0 survived, 1 killed, 0 flaky, 0 timed out, 0 errored, of 1 finished.",
26
- "next": "No survivor in this batch.",
27
- "nextCall": null
28
- }
29
- ```
30
-
31
- Every command's output has a JSON Schema in [schemas/](schemas/), and `probatio schema <command>` prints it. `schemaVersion` is 2. It changes when a field is renamed, removed, or changes meaning, and a new field does not change it.
32
-
33
- Agents changing this repo should read [AGENTS.md](AGENTS.md). The MCP server is `probatio mcp`. Snippets are in the MCP section below. People building Probatio should read [docs/builders.md](docs/builders.md). Small suites live in [examples/](examples/).
34
-
35
- ## Status
36
-
37
- What a result means:
38
-
39
- - **killed**: a test the suite already had failed an assertion on the mutant. It is not proof the change is safe, and the count is not a merge gate.
40
- - **survived**: a test ran the line and did not notice. That is a gap. Add a test that fails on the mutant, then rerun.
41
- - **no coverage**: no test executed that line, so the suite was not started. It is not a pass and not a gap.
42
- - **did not build** (`unviable`): the compiler rejected the mutant, or on Node a test file no longer links (a removed export, a missing module, a file that does not parse). No test code ran, so it is not a kill and not a gap. Java, Rust, Go, and C# reject the same change at compile time, so every language gets the same verdict. For a ledger fix it means the reverted commit cannot be a regression check as it stands: write a hand-made mutant (`source=hand`) that keeps the API and puts the old behaviour back.
43
- - **timed out**: the baseline clock ran out. It is not a kill.
44
- - A red baseline, or a baseline with no test report, stops before the first mutant.
45
-
46
- What runs today:
47
-
48
- - Discovery finds the project's own suite: `run_tests.sh`, Cargo, Go, Swift, Maven, dotnet, pytest, unittest, node:test, Mocha, and `make test` for COBOL. An unknown layout asks for `--suite-command`.
49
- - Node, pytest, Go, Maven/Java, Rust, C#, Mocha, and C with LLVM coverage collect a line map on the baseline. A mutant runs only the tests that hit its line.
50
- - A Node child process started by a test is mapped under that test, with no import in the child and even when it ends with `process.exit`. A child started with a cleared environment cannot be seen and stays `no coverage`.
51
- - A slow suite with no line map (baseline 5 seconds or more, more than 30 mutants pending) stops before the first mutant.
52
- - A project that needs its own environment or test-line format says so in `.probatio.json` (below). Probatio does not patch a project's files or environment to make one repository pass.
53
-
54
- Sealed runs. A sealed run hides the test that came with a fix, puts the bug back, and asks whether the rest of the suite notices. Seven subjects are recorded (2026-10-05 and 10-06):
55
-
56
- | Subject | Result |
57
- |---|---|
58
- | QuixBugs, Python program | no coverage: the planted line was not executed |
59
- | QuixBugs, Java program | survived |
60
- | Commons CSV, one bug | survived |
61
- | tqdm, one bug | survived |
62
- | First one-command `mutate sealed` run | survived, both runs |
63
- | Commons CSV `c15a06ee` (CSV-288) | the suite stayed green with the test hidden |
64
- | Commons CSV `2c83a308` (CSV-271) | killed on 10-06 with no line map; survived on 10-08 with the map; see below |
65
-
66
- The CSV-271 kill came from `CSVFormatTest.testFormatThrowsNullPointerException`. The fix commit itself edited that test: it changed the asserted stack-frame class from `CSVFormat` to `java.util.Objects`. With the test as it was before the fix, all 92 `CSVFormatTest` tests pass on the reverted code, and no other test fails because of the bug. So no older test caught it. The honest record is that these suites did not notice a hidden real bug, which is what a sealed run is for. A kill that pins an internal detail, such as which class threw, is not the same as a test that checks behaviour.
67
-
68
- A blind run of the whole loop (gaps, new tests, then a hidden real bug) on Commons CSV is written up in [docs/demo-commons-csv.md](docs/demo-commons-csv.md). The new tests closed real gaps, and they did not catch the hidden bug. The page says why.
69
-
70
- Known limits:
71
-
72
- - The sealed list (`seal`) is a plain id list in the state dir. An agent that can read that directory can see it. Keep the state dir and every `mutate sealed` label file outside the workspace of the agents being scored.
73
- - `mutate sealed` checks whether the fix commit edited the killing test (`fixEdited`, `olderTestCatch`). The fix commit is the scored commit, or `--fix <commit>` when later work sits on top of it. It matches a kill to a file by path, class name, or a test name written in that file. A test renamed by the fix can slip past that match.
74
- - The Java line map comes from JaCoCo, which does not count a line as executed when a call on that line throws. A test that reaches a line only through an exception is not selected for it, so a mutant there can survive a test that would fail. On Commons CSV-271 the map leaves out `testFormatThrowsNullPointerException` at `CSVPrinter.java:284`, and the sealed run reports survived.
75
- - The default operator set (`core`) is small: condition swaps, relational swaps, booleans, a dropped `!`. `--operators wide` adds arithmetic, integer constants, and (TypeScript only) a dropped call statement, so a clean batch means more. A summary says which set ran.
76
-
77
- The package version in this repository is in `package.json`. The npm badge above is the published version.
78
-
79
- ## mutate
80
-
81
- One JSON object on stdout. `schemaVersion`, `ok`, `summary`, `next`, `nextCall`. Exit 0 only when `ok` is true. Human text is `--human`. A run checks the suite out in a throwaway worktree, so the checkout you are in stays as it is.
82
-
83
- ```bash
84
- npx probatio mutate generate --package . --out .probatio/generate
85
- npx probatio mutate run --package . --patches .probatio/generate/mutants --out .probatio/runs
86
- npx probatio mutate tally --out .probatio/runs
87
- ```
88
-
89
- `--operators wide` (on `generate`, `verify-change`, and `golden compare`) adds arithmetic swaps (`+`/`-`, `*`/`/`, `%`), integer constants (`0`→`1`, `1`→`0`, `n`→`n+1`), and a dropped statement. In TypeScript a call statement becomes `void 0`. In Java, C, C++, C#, JavaScript, and Rust, a call, an assignment, or an increment that is a whole statement on its own line becomes `;`. Text languages need the operator spaced on both sides, so `++`, `+=`, `->`, `//`, `**`, unary minus, and pointer stars are left alone. A `+` beside a string literal is concatenation and is left alone. Hex, float, and suffixed literals are not constants. COBOL and assembly get no wide operators, and Python gets no dropped statement. `core` is the default, so ids and counts from earlier runs do not move. `mutants.json` records the set.
90
-
91
- `generate` writes operator mutants (conditions, `&&`/`||`, `===`/`!==`, boundaries, booleans, a dropped `!`). The same class is written for COBOL (`.cob`, `.cbl`), Rust, C, C++, Java, Go, Python, JavaScript, and C#. Strings and comments are not mutated. A COBOL `*>` comment and a fixed-format line whose column 7 is `*` or `/` are comments. Each patch is forward: apply it to introduce the bug, and the file says so. When mutants were written, `next` states the count, the suite command if one was discovered, and whether the first run collects a line map.
92
-
93
- `run` discovers the suite: `run_tests.sh`, Cargo, Go, Swift, Maven, dotnet, pytest, unittest, node:test, Mocha, then `make test` when COBOL tests sit under that Makefile. An unknown layout stops and asks for `--suite-command`. It does not compile one file and call that the suite. `make test` that would curl or wget a missing file stops, and nothing is fetched. A worktree that has no `node_modules` uses the main checkout's. Omitting `--build` runs no build. Pass `--build` with a command when the suite needs one first.
94
-
95
- Discovery reads the package root. An example project inside it, such as a directory with its own `go.mod` or `pytest.ini`, is a different project and is not collected. Go needs a `go.mod` at or above the package.
96
-
97
- Node, pytest, Go, Maven/Java, Rust, C#, and Mocha collect a line map on the baseline. C collects one when LLVM coverage was instrumented. Mocha writes its own `{ files }` record from root hooks, keyed by the Mocha title. The node:test collector is a different file and does not name Mocha tests. The map stores the file, the line, and the test names that hit that line. A later mutant runs only those tests (`go test -run`, Maven `-Dtest`, `cargo test`, `dotnet test --filter`, Mocha `--grep`). A line no test executed is `no coverage`, and the suite is not started. A Node child process started by a mapped test loads a small collector through `NODE_OPTIONS`. It writes the lines it ran when it exits, including after `process.exit`, and the parent test stores them under its own name. Each test process has its own dump directory, so parallel test files do not take each other's children. A child started with a cleared environment stays `no coverage`. On Node, a test filter that matches nothing is an error, not a survivor, and only the requested tests can be credited with a kill. A test file that fails before any test runs is one of two things. If it does not link or parse (a removed export, a missing module), no code ran, and the mutant is `unviable` unless some other test failed. If its own top-level code ran the mutated program and threw, that is a kill by that file, and confirm reruns the whole file. Covered mutants of one Node file are applied one after another in the suite process already running, and the line map is reset between them. `--workers` stays 1. A crash or a process left dirty ends that process. The next mutant starts clean. A baseline of 5 seconds or more, with no line map and more than 30 mutants still pending, stops before the first mutant. `next` names that baseline and tells you to narrow `--src` or pass a smaller patch directory. A one-file C, C++, Java, COBOL, or assembly launcher is not a suite discovery returns.
98
-
99
- The mutant timeout is the baseline duration times 5, and at least 20 seconds, capped by `--suite-timeout-ms`. A timeout is not a kill. `--budget-ms` stops mutant work after the baseline. The first mutant still runs, except for that no-line-map stop. A kill is the test that failed. A mutant the compiler rejects is `unviable`: the summary says `N did not build`, `unviable` and `unviableIds` list them, and they are neither kills nor gaps. Confirm is on by default and reruns the failing names. Pytest names that `-k` cannot express are passed as node ids. A usage error, including pytest exit 4, is not a kill. `verify-change` does not confirm a second time. Add `--affected` to limit the file list to tests that can see the change. The default, once a line map exists, runs the tests on the changed line.
100
-
101
- `tally` reads that run directory. The summary leads with the no-coverage count, then the survivors. `keep` names each test that killed a mutant, once, as an id `--only-test` can run. `noKillsYet` names tests that saw no mutant die in this batch. That is not a reason to delete them: one batch is not evidence, and the Auspex experiment caught 10 of 18 sealed bugs after pruning by kill evidence. `pruning.advice` stays empty and `deletedTests` is 0. A gap is a survivor. An unseen line is not a gap and not a pass. A timeout is neither a kill nor a gap.
102
-
103
- `nextCall` writes to a fresh out dir next to the old one, because the old out dir would skip every finished mutant and repeat the old result. With a gap, it reruns the batch on `HEAD` (`<out>.after-gaps`) once the new test is committed. With no gap, it rescores the keep ids at the same commit with `--only-test` (`<out>.rescore`).
104
-
105
- ## .probatio.json
106
-
107
- A project can say how its suite runs. The file sits at the package root and is read even when it is not committed.
108
-
109
- ```json
110
- {
111
- "env": { "ARCH_NATIVE": "1" },
112
- "testLine": "^(Testing .+|Running .+)$",
113
- "passLine": "All done, tests as expected"
114
- }
115
- ```
116
-
117
- `env` is added to the suite's environment, for a flag the project's own CI sets. `testLine` names the tests of a `run_tests.sh` suite: each matching line is a test, and the first capture group is the name when there is one. When the suite exits non-zero, the last test line is the one that failed, unless `passLine` was printed. Without `testLine`, a shell suite that prints TAP (`ok 1 - name`, `not ok 2 - name`) is read as TAP. Otherwise it is one command: exit 0 passes, and a failure is `::command`, not an invented test name. An invalid file stops the run and names the field.
118
-
119
- ## ledger
120
-
121
- ```bash
122
- npx probatio ledger build --package . --commit HEAD --out .probatio/ledger
123
- ```
124
-
125
- A fix commit has a `Fixes-bug:` trailer, or it changes both `src` and a test. A commit that changes the version in `package.json`, `Cargo.toml`, `pyproject.toml`, or `setup.cfg` is a release, and it is not a fix unless it has the trailer: reverting it would put back several changes, not one bug. `ledger build` reverts that commit's src diff onto the tree you name. A diff that applies is written as a forward patch (`source=history`): apply it to put the bug back. A diff that does not apply is reported, and left for a hand-made patch in the same directory (`source=hand`, `fix=<commit>`). A rebuild keeps those hand-made files. Nothing is fuzzy-applied. A src diff over `--max-lines` (default 300) is skipped. `--max-commits N` reads only the newest N non-merge commits and says when older history was not scanned. The default reads the whole history. A tree is checked out only when a fix inside that cap has to be applied.
126
-
127
- ### ledger check
128
-
129
- ```bash
130
- npx probatio ledger check --package . --ledger ledger --out .probatio/ledger-check
131
- ```
132
-
133
- Runs every ledger bug that applies (history reverts and hand-made mutants) against the suite, with confirm on, and compares each outcome with `ledger/<id>.golden.json`. A bug that was caught and is not caught now is a regression: `ok` is false and `next` says to find the test that stopped guarding it. Any other change (a survivor now caught, a patch that no longer applies) also fails until it is re-recorded with `--update`, and a changed row needs `Golden-Change: <id>: <why>` in `--message`. A bug with no golden yet is recorded by `--update`. A hand-made mutant whose header says `source=hand fix=<commit>` replaces that fix's history revert, which is how a revert that does not build still guards its bug. Run it where the toolchain is complete: a test that skips for a missing tool can turn a kill into a survivor. This repository's goldens are the outcomes on the CI toolchain job's tools. This repository runs it on every push to `main` and nightly (`.github/workflows/self-score.yml`).
134
-
135
- ## matrix
136
-
137
- ```bash
138
- npx probatio matrix report --scores round2-union-scores.tsv --direct round2-direct-scores.txt --patches mutants/holdout --patches mutants/train --out .probatio/matrix
139
- ```
140
-
141
- Reads those recorded tables. It does not rerun the mutants. The headline is the gap list: `file:line`, the top 10, how many are left, and the path to the full JSON. A test that killed nothing can be named. The file is not deleted.
142
-
143
- ## golden
144
-
145
- ```bash
146
- npx probatio golden check --recorded table.json --actual now.json --update wording
147
- ```
148
-
149
- `next` and `nextLead` are wording. `ok`, `reason`, `status`, `hostChanged`, and `nextCall` are the contract. `--update wording` re-records a changed `next` or `nextLead` and leaves the contract fields alone. A file whose case names are the top-level keys is written back in that shape. A changed `ok` or `reason` also needs `Golden-Change: <row>: <why>` in `--message`. A home path, or `ok` without a reason, fails and nothing is written.
150
-
151
- ### golden record and golden compare
152
-
153
- ```bash
154
- npx probatio golden record --package . --module src/text.ts --tests tests/text.test.ts
155
- npx probatio golden compare --package . --module src/text.ts --tests tests/text.test.ts --golden tests/golden/text.golden.test.ts --out .probatio/golden-compare --operators wide
156
- ```
157
-
158
- `golden record` runs those unit tests once, in a throwaway worktree, with every exported function of the module wrapped. Each call whose arguments and result are plain data becomes a row in `tests/golden/<module>.golden.json`: the function, the arguments, and what it returned, resolved, or threw. A module that reads the clock gets the recorded instant on each row, and the replay pins it. A call with a callback, a class instance, or another hidden input is counted and left out: the tests built on it stay as code. A call that answered two ways for the same arguments is left out as unstable. Recording from a red run is refused. It also writes `tests/golden/<module>.golden.test.ts`, a node:test file that replays every row and does not import Probatio. A changed row fails. That is a behaviour change: fix the code, or re-record and review the JSON diff.
159
-
160
- `golden compare` mutates the module and scores the same mutants twice, once with only the unit tests and once with only the replay, with confirm on. It reports how many of the unit tests' kills the table also makes, and lists the mutants only the unit tests kill. When that list is empty, the table catches what those tests catch on these mutants. Replacing them is still a decision: keep any test with hidden inputs, run a sealed or ledger check, and give the reason in the commit. Nothing is deleted. Node and TypeScript ESM modules only for now.
161
-
162
- ## status
163
-
164
- ```bash
165
- npx probatio status --state .probatio --page PROBATIO.md
166
- ```
167
-
168
- Rewrites `PROBATIO.md` from the same JSON: open gaps, recent fixes and their guards, protected guards, decisions. A sealed id is left out of the page, the JSON, and `queue seed`. If visible kills rise and sealed kills do not, the summary is `these tests fit the yardstick, not the code.`
169
-
170
- ## verify-change
171
-
172
- ```bash
173
- npx probatio verify-change --package . --base HEAD~1 --out .probatio/verify
174
- ```
175
-
176
- Lists the tests that can see the diff, runs mutants on the changed lines, and reports caught, missed, mutants that were not run, lines with no coverage, and any golden contract change. The mutants are the same operator class `mutate generate` would write, including a non-TypeScript diff. A string or a comment is not a mutant. `ran` is still the direct-importer list. The tests that execute are chosen by the line map, the same way `mutate run` chooses them, including when that importer list is empty. No discovered suite leaves those mutants in `notRun` and does not start a run. The suite timeout is 10 minutes. `--max-tests` only shortens the reported importer list. `--max-mutants` (default 4) caps how many changed lines are run.
177
-
178
- ## queue
179
-
180
- An item is `.probatio/queue/<id>.json`. `queue claim` renames it to `claimed/<agent>-<id>.json` with a lease. `queue reap` moves an expired lease back. `check-kill <id>` runs the tests that directly import the mutated file and confirms the killing test again. It is done only when that mutant dies and that suite is still green. `verify-change` is the edit-sized run: it uses the line map and does not confirm a second time.
181
-
182
- ## MCP
183
-
184
- `probatio mcp` and the `probatio-mcp` bin speak stdio JSON-RPC, one JSON object per line. The tool name is `probatio`. `argv` is the CLI words. `ping` returns `{}`. An unknown method returns JSON-RPC `-32601` with the same id. A tool call runs in the background, so `ping` and other calls are answered while a long `mutate run` works. `notifications/cancelled` with that call's `requestId` stops the command and its suite, removes its worktrees, and sends no reply. The server answers with the client's `protocolVersion` when it is `2024-11-05`, `2025-03-26`, or `2025-06-18`.
185
-
186
- ```json
187
- {
188
- "mcpServers": {
189
- "probatio": {
190
- "command": "probatio",
191
- "args": ["mcp"]
192
- }
193
- }
194
- }
195
- ```
196
-
197
- That block is the Claude, Cursor, and Grok shape. The tool runs the CLI and returns that command's JSON. `nextCall.argv` keeps absolute paths so a later spawn does not have to expand `~`.
198
-
199
- `mutate generate` reads the commit (`HEAD` unless you pass `--commit`). `--working-tree` reads the checkout on disk and says so. `mutate run` scores the commit either way.
200
-
201
- `verify-change` does not score uncommitted edits when `--base` and `--commit` are the same. A clean empty diff says `No diff-scoped mutant.`
202
-
203
- ## Releases
204
-
205
- [docs/releasing.md](docs/releasing.md): green `test` and `self-score` on the version commit, a pushed `v<version>` tag, then `npm publish`. `prepublishOnly` refuses anything else.
17
+ The command prints one JSON object. `summary` is the crate version. A `v*` tag on [IronAdamant/Probatio](https://github.com/IronAdamant/Probatio) publishes the GitHub release and these packages.
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const childProcess = require("child_process");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+
8
+ const PACKAGES = {
9
+ "darwin-arm64": "probatio-darwin-arm64",
10
+ "darwin-x64": "probatio-darwin-x64",
11
+ "linux-x64": "probatio-linux-x64",
12
+ "win32-x64": "@iron_adamant/probatio-win32-x64",
13
+ };
14
+
15
+ function fail(message) {
16
+ process.stderr.write("probatio: " + message + "\n");
17
+ process.exit(1);
18
+ }
19
+
20
+ function binaryPath(platform, arch) {
21
+ const hostPlatform = platform || process.platform;
22
+ const hostArch = arch || process.arch;
23
+ const key = hostPlatform + "-" + hostArch;
24
+ const name = PACKAGES[key];
25
+ if (!name) {
26
+ fail("no binary for " + key + ". This install ships darwin-arm64, darwin-x64, linux-x64, and win32-x64.");
27
+ }
28
+ const file = hostPlatform === "win32" ? "probatio.exe" : "probatio";
29
+ let root;
30
+ try {
31
+ root = path.dirname(require.resolve(name + "/package.json"));
32
+ } catch (_error) {
33
+ fail("optional package " + name + " is not installed.");
34
+ }
35
+ const binary = path.join(root, "bin", file);
36
+ if (!fs.existsSync(binary)) {
37
+ fail("missing binary " + binary);
38
+ }
39
+ return binary;
40
+ }
41
+
42
+ if (require.main === module) {
43
+ const child = childProcess.spawn(binaryPath(), process.argv.slice(2), { stdio: "inherit" });
44
+ child.on("error", function (error) {
45
+ fail("could not start the binary: " + error.message);
46
+ });
47
+ child.on("exit", function (code) {
48
+ process.exit(code === null ? 1 : code);
49
+ });
50
+ }
51
+
52
+ module.exports = { PACKAGES: PACKAGES, binaryPath: binaryPath };
package/package.json CHANGED
@@ -1,42 +1,34 @@
1
1
  {
2
2
  "name": "probatio",
3
- "version": "0.3.0",
4
- "description": "Mutation runner for AI agents. Scores a test suite by the bugs it catches.",
5
- "type": "module",
6
- "bin": {
7
- "probatio": "dist/cli.js",
8
- "probatio-mcp": "dist/mcp.js"
9
- },
10
- "files": [
11
- "dist",
12
- "schemas"
13
- ],
3
+ "version": "0.5.0",
4
+ "description": "Mutation runner. Scores a test suite by the bugs it catches. Installs the Rust binary.",
5
+ "license": "MIT",
14
6
  "repository": {
15
7
  "type": "git",
16
- "url": "git+https://github.com/IronAdamant/Probatio.git"
8
+ "url": "git+https://github.com/IronAdamant/Probatio.git",
9
+ "directory": "npm"
17
10
  },
18
- "homepage": "https://github.com/IronAdamant/Probatio#readme",
19
- "license": "MIT",
11
+ "homepage": "https://github.com/IronAdamant/Probatio",
20
12
  "bugs": {
21
13
  "url": "https://github.com/IronAdamant/Probatio/issues"
22
14
  },
23
- "scripts": {
24
- "build": "tsc -p tsconfig.json && mkdir -p dist/mutate && cp src/mutate/fail-reporter.mjs src/mutate/node-coverage.mjs src/mutate/precise-lines.mjs src/mutate/child-lines.mjs src/mutate/mocha-coverage.cjs src/mutate/node-batch.mjs src/mutate/node-batch-loader.mjs src/mutate/load-failure.mjs src/mutate/py-reporter.py src/mutate/py-pytest-reporter.py src/mutate/probatio-jacoco-run.java dist/mutate/ && mkdir -p dist/golden && cp src/golden/recorder.mjs dist/golden/",
25
- "prepack": "npm run build",
26
- "test": "tsx --test tests/*.test.ts",
27
- "probatio": "tsx src/cli.ts",
28
- "prepublishOnly": "node scripts/release-check.mjs",
29
- "release:check": "node scripts/release-check.mjs"
15
+ "bin": {
16
+ "probatio": "bin/probatio.js"
30
17
  },
31
- "engines": {
32
- "node": ">=22.6"
18
+ "files": [
19
+ "bin/probatio.js",
20
+ "README.md"
21
+ ],
22
+ "optionalDependencies": {
23
+ "probatio-linux-x64": "0.5.0",
24
+ "probatio-darwin-arm64": "0.5.0",
25
+ "probatio-darwin-x64": "0.5.0",
26
+ "@iron_adamant/probatio-win32-x64": "0.5.0"
33
27
  },
34
- "dependencies": {
35
- "typescript": "^5.7.2"
28
+ "engines": {
29
+ "node": ">=18"
36
30
  },
37
- "devDependencies": {
38
- "@types/node": "^22.10.2",
39
- "ajv": "^8.17.1",
40
- "tsx": "^4.19.2"
31
+ "publishConfig": {
32
+ "access": "public"
41
33
  }
42
34
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Aron Amos
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.