Repository navigation
Replies: 1 comment
|
Update: before going further I compared mutprobe with StrykerJS on the same target, and Stryker is the better answer. I'm withdrawing mutprobe from this proposal. Same copy of the hook, same
Stryker found everything mutprobe found except two numeric constants, plus gaps mutprobe cannot see. The ones that matter here are the regexes that decide which commands get scanned and the Stryker runs fully under Bun with its command runner. I re-ran it with only {
"testRunner": "command",
"commandRunner": { "command": "bun test <file>" },
"mutate": ["<glob>"],
"coverageAnalysis": "off"
}Limits: the command runner has no per-test coverage, so every mutant runs the whole command. Point it at the one test file for the code under test. Numeric literals are not mutated. So the question becomes: would a Hardening This is one target, so treat the numbers as an example, not a benchmark. |
Uh oh!
There was an error while loading. Please reload this page.
skills/Hardening/SKILL.mdsays mutation testing was once planned and "none is built". I built one as a standalone tool and would like to know whether aMutateintent in Hardening fits the design before I propose any code.What it is
mutprobeis a Bun/TypeScript CLI with no runtime dependencies. It copies the project to a temp directory, checks that the test command is green on the unchanged code, then applies one small change per site (comparison and logical operators,+/-,*//, integers ±1,true/false), drops mutants that no longer parse, and runs the test command once per mutant. A green run means the mutant survived: that line is not really tested. The JSON report gives file, line, column and replacement for every survivor.Exit codes: 0 no survivors (or score at or above
--min-score), 1 survivors, 2 usage error or red baseline. The original tree is never written; that is one of its own acceptance tests.Code and literals are told apart by
Bun.Transpileritself, not by a hand-written lexer: a candidate site counts as code only if padding it with comments leaves the transpiled output unchanged and inserting${0}right after it breaks the parse (which it only does outside string text). Three review rounds of a lexer-based version each found a new regex-versus-division miss; this shape removed the class.One run on LifeOS code
On a small PostToolUse hook in my install (105 lines, 8 tests, all green): 45 mutants, 17 killed, 1 timeout, 27 survived, 40 % in 15 s. Survivors included the empty-input guard (
!command || !body→&&survives, so empty input is never tested) and the excerpt-window arithmetic. That hook is my own addition, not a shipped file; the shipped tree has almost no tests to run it against.Known limits
hooks/that imports../LIFEOS/TOOLS/...gets a red baseline, because only the project directory is copied.setsid,detached) are not stopped.node_moduleslink reach the originalnode_modules.Question
Would a Hardening
Mutateintent that runs a tool like this be welcome, and if so, as a vendored tool underskills/Hardening/Tools/or as an external command the intent calls? It also gives #2623 a concrete check: a test that kills its mutants has been seen failing.The tool is not public yet. I can publish it if this is of interest.
Context
LifeOS 8.761.0 · macOS 26.6.2 (arm64) · claude-code
All reactions