ATMOSYNTH Groove: a desktop DAW whose instruments and effects are ATMOSYNTH patches, on ATproto.

One script applies a mutant, runs the tests under a limit, and puts the file back #28

Closed opened by center.for.cybernetic.beauty

Part of #26

Workers mutate code to prove a test can go red, and each wrote its own harness in a scratch folder. Since 29 October one of those lied seven times: a perl s/// whose old text held (, . or + matched nothing and read as a survivor; a \| inside s|…|…| was alternation and spliced gear: None, into a doc comment; a line cargo fmt had reflowed was never found; a test filter that matched nothing ran zero tests and said exit 0 for a whole batch; a mutant that does not compile printed nothing through a grep; an alarm put on cargo test killed cargo and left the test binary running; a python heredoc raised halfway and the shell line after it ran the old mutant list again, 22 mutants against source that could then not be touched for ten minutes. Mutants in a batch also hid one another: three looked like survivors until run alone. The helper that runs a test binary under an alarm exists today only untracked, per clone.

Done when scripts/mutate.sh <file> <old> <new> -- <test command…> is tracked here: it copies the file aside; replaces the exact text once, passed through the environment and matched literally (\Q…\E), never as a regex; refuses, with an exit code and a line, when the file is byte-identical afterwards or the text occurs more than once; runs the test command under an alarm on the test process itself, building first with --no-run where the command is cargo test; refuses a run that reports zero tests; prints which test went red, or "survived"; and restores the file whatever happens, a signal included. The run-under-an-alarm half moves beside it, tracked, so a fresh clone has both. CLAUDE.md's Working section names it where it says a test is seen red first.

Done in c77332c. scripts/mutate.sh <file> <old> <new> -- <test command…> and scripts/time-limit.pl are tracked, and CLAUDE.md's Working section names them.

  • The text. It comes through the environment and is applied by index, so it is never read as a pattern. A mutant whose text is not there, is there twice, or leaves the file byte-identical is refused before any test runs.
  • Building. cargo test is built first with --no-run, and a build that fails says so and runs nothing.
  • The time limit. The tests run under MUTATE_LIMIT seconds (300 unless set). time-limit.pl stops the command's whole process group, TERM and then KILL, so no test binary is left running.
  • Counting. A run that reports zero tests, or no count that cargo, Vitest or Playwright would print, is refused.
  • The result. It prints each test that went red, or "survived", and the exit code says which outcome it was.
  • Putting the file back. The file is written back in place however the run ends, a signal included, so its mtime is new and cargo rebuilds. The script's body is one function, so a mutant in a running script can't be met halfway.

frontend/test/mutate.test.js was red before either script existed. A run against cargo test -p atmosynth-groove --lib room_link:: built, counted 48 tests and named the red ones. That run also showed that removing actions.extend(self.new_offset()); from Link::due in src-tauri/src/room_link.rs survives all 48, which is worth a ticket of its own.

Sign up or Sign in to add to the discussion.