JavaScript / TypeScript · recorded local service runs · October 2026
Find the risk.
Challenge the tests.
PoopBags and codeMUTATOR now understand JavaScript and TypeScript through one shared syntax parser. First make a difficult function easier to inspect. Then find the mistake its passing tests still miss.
182 → 12Classifier CRAP after refactoring
11 / 14 → 12 / 14Mutants caught after one new assertion
2 survivorsRemaining gaps stay visible
01 / The same syntax facts
One parser. Two useful questions.
The pinned Babel parser identifies executable functions, branches and eligible mutation sites. PoopBags uses those facts to rank change risk. codeMUTATOR uses them to make small source changes and ask whether the tests notice.
PoopBags: where should I look?
Static function-level analysis for JavaScript, TypeScript, JSX and TSX, including module variants. Reports retain parser identity, coverage provenance and explicit exclusions. An incomplete parse cannot pass the CI gate.
codeMUTATOR: what did tests miss?
Explicit project opt-in, disposable workspaces, Node’s built-in tests and full TypeScript checking before the baseline and each mutant. Compiler-invalid mutations and infrastructure errors stay separate from test kills.
Shared parser: what actually changed?
Deterministic function identities, source hashes and UTF-8 byte spans tie each finding to source. Parsing does not import the subject or execute its configuration. Declaration files and unscored module scope are disclosed.
02 / Simplify the classifier
Less branching. A clearer place to look.
The fixture classifies an HTTP response as success, retry or error. Extracting status, body and retry helpers reduces the main function’s complexity from 13 to 3 and its CRAP score from 182 to 12. Every extracted helper remains in the scan; the highest helper CRAP is 20.
PoopBags comparison on the same project path| Finding | Before | After |
|---|
| Classifier complexity | 13 | 3 |
|---|
| Classifier CRAP | 182 | 12 |
|---|
| Coverage attribution | Assumed 0% | Assumed 0% |
|---|
This measures structural simplification of the classifier. No coverage report was supplied, so coverage remains explicitly assumed. Moving branches into visible helpers does not by itself make the tests stronger. The refactor was also checked over 18,090 input combinations; that bounded check is not a proof for all possible inputs.
03 / A green suite misses HTTP 200
The boundary was the missing test.
The initial suite checks successful responses at 201 and 204, but omits 200. codeMUTATOR changes the lower bound in isSuccess. The tests still pass, so the mutant survives.
Original boundary
return status >= 200 && status < 300;
Surviving mutation
return status > 200 && status < 300;
Add the missing assertion, leaving production code unchanged. The same source mutation now fails the tests and is counted as killed.
assert.deepEqual(
classifyResponse({status: 200, body: 'boundary'}),
{kind: 'ok', body: 'boundary'}
);
Canonical codeMUTATOR service outcomes| Outcome | Initial tests | With HTTP-200 assertion |
|---|
| Killed by tests | 11 | 12 |
|---|
| Survived | 3 | 2 |
|---|
| Compiler-invalid, unscored | 2 | 2 |
|---|
| Score: killed / (killed + survived) | 11/14 · 78.57% | 12/14 · 85.71% |
|---|
Each run has 16 terminal outcomes. Two compiler-invalid mutants are excluded from the score; two retry-delay mutants still survive the stronger suite. This is a recorded result on a small fixture, not a claim of complete test coverage. The subject files were preserved and worker copies removed after each service run.
04 / Support with its scope visible
Built to inspect. Clear about its limits.
Static analysis covers .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts and .cts. Mutation execution is qualified for Node 26.6–26.x, node:test, erasable TypeScript, explicit source/test selection and physical dependency files.
JSX/TSX runtime execution, Jest, Vitest, browser/DOM transforms and linked workspaces require separate qualification. Subjects opt in through .codemutator.json; the service does not infer or run arbitrary npm scripts. These tools are documented for local operation.
Factory checks include the shared parser and bridge tests, both service regression suites, seven real JavaScript/TypeScript service E2E cases, and agent integration contracts. Both GitHub consumer PRs passed Linux CI before merging. Linux CI exposed a process-group cleanup portability bug; the corrected signal arguments passed the same descendant-cleanup tests and a scoped Devin SWE2 Max review.
Public code · merged into the GitHub repositories
Follow the result back to the code.