Repository navigation
M3 G4 prep: register the laws layer; optional layer inputs - #70
Open
VirtualMachinist wants to merge 9 commits into
Open
VirtualMachinist wants to merge 9 commits into
VirtualMachinist wants to merge 9 commits into
Conversation
…laws layer A layer input marked optional no longer makes the layer not-run when its producer left no file: the runner passes it when it is there and the layer says what a missing one means. The registry now holds the laws layer in place of its stub, read from laws/W-NN.yaml. The hand-off test keeps the rule that a required input is declared by its producer, and the stub tests keep the laws layer off so they judge the build-output stub alone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rints do at their edges Registering the laws layer and the optional input put the runner, the plan, the registry, the finding fingerprints, the ratchet mode check and the tests layer launch message in the scope of the mutation run, and 39 of their mutants survived. Tests now pin each: what a layer entry holds when nothing ran, a layer that throws, the clock, the producer named in a missing input, an optional input present and absent, the laws layer after a stop, the report crap scope, a switch with no reason, layers that require each other, an id nothing registers, a fingerprint against an independent sha256, the order among repeats, and git as the only command for a diff the tests do not need. Where a mutant could not be told from the original, the code is simpler: no tie rule in the layer lookup, one anchored list instead of two parallel ones, no sort of a list already in gate order, no second clause that the problem list already says, and a file reader that can be handed in so the once-per-file cache can be counted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…make the diff coverage choice a function A changed test file brings every function it covers into the mutation scope, so the three cases added to the diff wiring, ratchet and tests-layer test files made the run exceed its budget. They now live in small files of their own that cover only what they pin, and the choice of coverage for a diff is a function with its own test, so the diff engine is not run for it. The diff engine option takes undefined, as its copy token option already does. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ver survivors The coverage choice for a diff is now the options a layer gets, in one tested function, so no line of the diff engine changes. The ratchet mode test only leaves a hard run alone, the line order of repeats has an ascending case, and the tool that is not installed has its own direct test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… that reaches no TypeScript file cannot be judged A project whose ESLint config has no block for TypeScript files gives the reader no configuration for them, so W-01 was not-evaluated with the reason that no TypeScript file was linted. That is the right verdict, and the reason now says why: the config reaches no TypeScript file, so no rule can be judged. The end to end test runs the layer in a child process over a real project with its own ESLint and TypeScript: W-01 and W-04 pass on the strict type-checked preset with every flag set, W-01 is refused at the config line of an override that sets no-explicit-any to off and of one that sets it to warn, and the config with no TypeScript block is not-evaluated with the new reason and its file refused. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ne without the canonical writer Repeats on the same line stay in the order the tool listed them because the sort is stable, so the index tie break said nothing the sort did not. The ratchet mode test writes its baseline as plain JSON so it covers no code of the baseline module. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…so it covers no in-process code The end to end test ran the whole gate in this process: 38 s of real git and real tools that covered 86 percent of the runner, so every mutant in the runner, the plan and the findings also ran it. It now starts bun src/cli/main.ts for check, gate and baseline, with the same assertions on exit codes, output and report, so it is still the check of the entry point and of the ratchet adoption, and the mutants of the code it ran are judged by the tests that stand beside that code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A changed test file brings the functions of its merge base copy into the mutation scope, and the in-process version of this test covered the whole gate, so editing it put every layer, the baseline code and the report code in scope: 2757 mutants and 248 survivors of old code instead of 570 and none. The test is back as it was. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the third of four PRs for M3's laws readers step. It registers the laws layer with the gate, and the gate's runner learns optional inputs. The report fields and the protocol text come in the step PR.
What it does
optionalis passed when its producer wrote it. When the producer didn't, the input doesn't count as missing.not-evaluatedreason: when a project's ESLint config reaches no TypeScript file, W-01's reason now says so: "no TypeScript file was linted: ESLint's config reaches no TypeScript file (no config block has files for **/*.ts and the TypeScript parser, or an ignore drops them), so no rule can be judged".The end-to-end test
src/laws/layer/real-e2e.test.tsruns the layer in a child process, through the production process runner and the default readers. It runs over a real git project, with real ESLint, typescript-eslint andtsc:strictTypeCheckedconfig, every W-04 flag setsrc/**that sets@typescript-eslint/no-explicit-anytooffrefuse, at that override's line ineslint.config.jswarnrefuse, at the same line**/*.tsnot-evaluated, with the reason above, andsrc/a.tsis refused as not lintedOld survivors killed
Registration brought old runner, plan, report and ratchet code into mutation scope. The 39 surviving mutants this exposed are killed by new test files:
runner-edges,plan-edges,registry-order,findings-edges,ratchet-modeandlaunch-label.Declared exceptions
src/laws/readers/eslint-judge.tsand its testnot-evaluatedreason text onlysrc/gate/plan.tsrequiresOfwritten withfilter/flatMap, removing an equivalent mutantsrc/report/findings.tssrc/gate/runner.tssourceReaderandoptionsFor, so tests can count the once-per-file cache and pin the coverage choice. It drops a clause that the problem list already sayssrc/gate/registry.tssrc/layers/tests,src/reportandsrc/gateNo behaviour changes outside the optional inputs and the registration.
Gate on this head
layers: 5 in range, 5 ran, 0 failed, 0 not-evaluated. The gate took 10 minutes on a 10-CPU machine.🤖 Generated with Claude Code