feat(std): std.mutation — adopt aeocha's mutation-testing driver - #1588
Merged
Conversation
Adopts contrib/mutate from the sunsetting aeocha repo — the last piece of real technology there with no stdlib home, and the blocker to archiving that repo. - std/mutation/module.ae: the Tier-1 text-based driver as a library with one entry point, mutation.run(sut, test, lib_dir). Padded operator swaps + string-literal mutants, string-boundary aware; killed/survived/no-compile verdicts read from std.spec's structured report (AE_SPEC_FORMAT/AE_SPEC_REPORT env-file contract) so a non-compiling mutant never counts as a kill; SUT restored byte-identical. Per-mutant sub-builds honour AE_BIN (harnesses point it at build/ae) and use os.system/os.getenv via std.os. - examples/mutation-testing/: runnable front-end (mutate.ae) plus the worked calc example (lib/calc.ae + lib/calc_test.ae, ported from aeocha's README demo to std.spec). - tests/integration/mutation_testing/: both deterministic aeocha regression fixtures ported — operator fixture pins 1/2 - 50% with a MUL->DIV survivor at sut.ae:11 and md5-identical restore; strings fixture pins 1/3 - 33% and that an operator inside a string literal is never mutated as code. Fixture dirs added to the .ae sweep prune list (they are driven by their own test_*.sh). - docs/mutation-testing.md: usage, operator set, honest Tier-1 limits, and the AST-level upgrade path that is the reason the tool now lives in-tree. Both harnesses pass locally against build/ae; the examples-target compile+link of mutate.ae verified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 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.
Lands the
asks/aeocha-mutate-in-std-mutation-testing.mdask: adoptscontrib/mutatefrom the sunsetting aeocha repo — the one piece of realtechnology left there with no stdlib home, and the stated blocker to
archiving that repo. Once this merges and releases, aeocha can delete
contrib/mutateand grow its tombstone README.Shape
std/mutation(import std.mutation) — the naming note in the askresolved to the plain segment: no hyphen (lexes as minus), and no
mutation/testingtail that would collide withstd.os.testingforco-importers. Library with one entry point,
mutation.run(sut, test, lib_dir) -> int(survivor count,-1onabort), so a build script can gate on it.
examples/mutation-testing/mutate.ae— the runnable front-end(
ae run … -- <sut.ae> <test.ae> [lib_dir]), with the worked calcexample in
lib/(ported from aeocha's README demo tostd.spec).A future
ae mutatesubcommand remains the natural evolution, per theask explicitly not required here.
docs/mutation-testing.md— usage, operator table, honest Tier-1limits, and the AST-level upgrade path (the reason in-tree is the
right home).
What carried over unchanged
Outer-loop text mutation (padded-operator + string-literal mutants,
string-boundary aware), the three-way verdict via the structured report
(
AE_SPEC_FORMAT=aeocha+AE_SPEC_REPORT, readingfailed=N— anon-compiling mutant never masquerades as a kill), the
error[-grepno-compile gate (#953 workaround; fixing #953 in-tree later simplifies
it), and byte-identical SUT restore.
What changed in the port
std.specdirectly (aeocha was already a pure forwarder).
AE_BIN(defaults toaeon PATH) so thein-tree harnesses can point at
build/ae.os.system/os.getenvviastd.osinstead of a raw extern; probebinary is pid-suffixed so concurrent runs can't clobber each other;
sentinel renamed
AE_MUTANT.Acceptance (the ask's bar)
Both deterministic aeocha fixtures ported to
tests/integration/mutation_testing/and passing locally againstbuild/ae:1/2 mutants killed — 50%,SURVIVED sut.ae:11 MUL->DIV,killed sut.ae:9 ADD->SUB, md5-identicalSUT restore
1/3 … 33%, STR->EMPTY killed atsut.ae:10/survived at
sut.ae:12, and no ADD->SUB mutant from the+inside a string literal
Fixture dirs are in
tests/ae_sweep_prune.txt(driven by their owntest_*.sh; the main-less SUT modules would otherwise break the bulksweep). The examples-target compile+link of
mutate.aeis verified(calc SUT/test live under
lib/, which the examples build skips byconvention).
🤖 Generated with Claude Code