Repository navigation
feat(oracle-gaps): write a partial report when the run's process dies in its mutant phase - #300
schiller-manuel wants to merge 1 commit into
Conversation
… in its mutant phase A native crash of a worker thread under --pool threads (or any signal or exit that skips the run's own ending) used to lose every mutant already judged. The first line of results.jsonl now records the run's pid, the ids of every mutant in report order and the report's other fields; when the run's process ends without its ending and without a stop, the supervisor writes results.json with status "partial", the cause, the judged results and the unjudged ids, and a summary.md with a Partial report line. The done line names that summary. Law 12 is extended (partialBreach) with seven calibrations on the native-crash history, which now has three owned functions before the stop witness. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 4a66032 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
CI on 4a66032: 56 pass, 2 fail. Neither failure is caused by this PR:
That is a random-seed counterexample in the mid-run edit law (law 9), and it belongs in its own issue with a constructed history. 🤖 Generated with Claude Code |
Stacked on #252.
This PR is stacked on #252 (
fix/gap-done-error-remedy), because both PRs change the same done line. Review #252 first. After it merges, this PR's diff is only the partial report.When the run's own process dies in the mutant phase, the run no longer loses the mutants it had already judged. Before this PR, a worker thread's native crash under
--pool threadsended the run with exit 3 and nosummary.mdand noresults.json. The judged mutants were kept only in<out>/results.jsonl, which is undocumented and which no line of the stream names.What changed
check.mjs: the first line ofresults.jsonl, written when the mutant phase starts, records what a report needs:Results are still appended per mutant, as before. The shared fields are now built once (
reportFields,renderFields), and the completedresults.jsonandsummary.mduse them, so neither changes.ending.mjs: newpartialEnding(out, pid, cause). Whenresults.jsonlexists and starts with the header of this pid, it writesresults.jsonwith:status: "partial";cause(for examplethe run's process exited with SIGTRAP);results, in report order;unjudged, the ids of every mutant it did not judge.It also writes
summary.md(viarenderReport). A torn last row is ignored.report.mjs:renderReport({ …, partial })adds one line under the inputs. The counts that follow are of the judged mutants only:**Partial report**: the run's process exited with SIGTRAP after 4 of 7 mutants were judged. Not judged: sut.ts:M5, sut.ts:M6, sut.ts:M7.index.mjs(supervisor): when the run's process ends without writing its own ending and without being stopped, it callspartialEnding. If a report was written, the done line ends with; partial report <out>/summary.md.Unchanged:
results.jsonlheader does not exist, or belongs to another pid.Docs: the setup skill's list of done lines, and the native-crash entry in the explore skill's problems list.
A stopped run has no partial report either. The issue suggested reusing one for stops, but none exists today, so this PR adds none for them. I can extend it to stops if you want; that would change law 13's stopped done line.
How the oracle sees it (oracle first)
report-shaped ending) is extended.partialBreachchecks, for a stopped run whose process ended by itself on POSIX:partialOwed, acrash),results.jsonhas statuspartialand the done line's cause.killedis judged. That is the copy that crashed.unjudgedis exactly the run's other ids, in the completed report's order.summary.md's lines that say the report is partial are exactly[partialNote(...)]. The driver keeps only those lines in the trace: the rest of the summary holds the run id and baseline times, which made the determinism unit differ between two runs of the history.crashLine(signal, pool, report), with the summary's path for a crash.a native crash under each pool(from fix(oracle-gaps): name the step that avoids a native crash in the done error line #252) now has three owned functions before the stop witness. Its crash runs go without--only, so the run judges mutants before the witness's copy crashes.a partial report held a judged mutant. It was reached on the fixed seed, with 4 judged mutants in the scratch probe below.a crashed run writes no partial report(12)a partial report drops a judged mutant(12)a partial report gives a judged mutant another outcome(12)a partial report counts a crashed copy's mutant as killed(12)a partial report's summary has no partial line(12)a crashed run's done line does not name its partial report(15)an abort before the baseline writes a partial report(12)Evidence
Probe on the base (#252's head;
mainbehaves the same apart from the step text). It uses a scratch package whose test runsprocess.kill(process.pid, 'SIGTRAP')under the last function's mutants, with--pool threads --contexts 1:The same probe on this branch:
RED: the extended oracle on #252's production code (
check.mjs,ending.mjs,index.mjsandreport.mjschecked out fromorigin/fix/gap-done-error-remedy, cbbb029; this branch's oracle files):GREEN on this branch (4a66032 before the push), in three runs:
The ten calibrations on the crash history are its three from #252 and the seven above; each was rejected under its named law.
Also run, all passing:
node scripts/pr-shards.mjs check(7 partitions split their tests exactly)node scripts/e2e-shards.mjs check(5 shards partition the e2e tests)tests/gap-report-history-fingerprint.test.ts(4 passed; no drawn field and no constructed history was added, so neitherhistory-fingerprint.jsonnorconstructed-order.jsonchanges)build,lint:check,format:checkandtypecheckDesign grammar: no trigger fired. The check adds one function for one law, and the model adds two small rules (
partialOwed,partialNote).Overlap
fix(oracle-gaps): name the step that avoids a native crash in the done error line #252: the base of this PR.
fix(oracle-gaps): report a full disk as out of disk space, not as a bug #296 (ENOSPC message) and feat(oracle-gaps): keep the newest 10 default run directories #297 (run directory retention) change
ending.mjsand the supervisor's ending inindex.mjs, next to the done line this PR extends. Whichever lands second rebases onto the other.feat(oracle-gaps): --baseline-only runs every test file's baseline and judges no mutant #221, feat(oracle-gaps): results.json keeps every failing test of a baseline file #237 and fix(oracle-gaps): no wall-clock cut decides an outcome #99 also change
check.mjs's ending:--baseline-only, which writes its report from the baseline alone;results.json's baseline;Each will conflict textually with the
reportFieldsandrenderFieldsrefactor. feat(oracle-gaps): results.json keeps every failing test of a baseline file #237's new baseline fields would also flow into the partial report throughreportFields.Many open PRs (feat(oracle-gaps): --only accepts a mutant's stable key beside its id #299, feat(oracle-gaps): --diff-base judges only the mutants on changed lines #292, feat(oracle-gaps): --refactor-base lists every oracle test whose trace differs #283, feat(oracle-gaps): --compare prints a refactor's evidence by mutant key #267, feat(oracle-gaps): mark a gap that an ordinary test kills #262, fix(oracle-gaps): --only refuses a selection that judges nothing #236, fix(oracle-gaps): every read is a daemon input #133 and others) touch
check.mjs,report.mjsor the e2e oracle file elsewhere, and append to the calibration and shard lists. The conflicts are textual.Limits
--daemon: the daemon's process dies, the CLI starts a new daemon, which reruns the check and resetsresults.jsonl. After three deaths the run still ends as an internal error, whose ending overwritesresults.json. No partial report is written there.<out>/run-<pid>-<n>.jsonl, stays, as it did before this PR.Design note: retrying a crashed unit (not in this PR)
The feedback also asked to retry a crashed worker once before giving up. This PR does not do that:
results.jsonl. It cannot tell which mutant crashed: a context runs up to four mutants per batch, and any of them could be the one. A resume would have to rerun that batch's mutants one at a time, or skip them all.setup-error, whose directive (a driver's import) is misleading for a native crash. Whether that should become acrashedclass of its own is for you to decide.Laws for approval
A delta to law 12 (
report-shaped ending):error.log).results.json, withstatus: "partial", the cause its done line names, each judged mutant with the outcome a completed run gives it, andunjudged.unjudgedlists exactly the other mutants, in the order of the completed report, and includes every mutant whose copy crashed.summary.md, holding the**Partial report**: <cause> after <n> of <m> mutants were judged. Not judged: <ids>.line.; partial report <summary.md>.🤖 Generated with Claude Code