chore: mutation-testing skill source + pre-hook + role docs - #55
Conversation
🤖 CodeAnt AI — Review Status
|
✅ Deploy Preview for moderaty ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a mutation-testing engineering skill, supporting references, a prompt-submit hook, and repository instructions for installation, activation, execution, triage, and CI use. ChangesMutation testing skill
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
Sequence DiagramThis PR adds a prompt hook that detects mutation-testing requests, loads the repository skill, and injects its guidance into the agent context while preserving a successful hook exit. sequenceDiagram
participant User
participant Harness
participant Prehook
participant Skill file
participant Agent
User->>Harness: Submit prompt
Harness->>Prehook: Run with prompt
Prehook->>Prehook: Match mutation testing terms
Prehook->>Skill file: Load mutation testing skill
Skill file-->>Prehook: Return skill guidance
Prehook-->>Harness: Inject guidance into context
Harness-->>Agent: Provide enriched prompt context
Prehook-->>Harness: Exit successfully
Generated by CodeAnt AI |
Not up to standards ⛔🟢 Issues
|
| Category | Results |
|---|---|
| Documentation | 1 minor |
🔴 Metrics 13 complexity · 2 duplication
Metric Results Complexity ✅ 13 (≤ 100 complexity) Duplication ⚠️ 2 (≤ 1 duplication)
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
PR Summary by QodoAdd mutation-testing skill source, prehook, and role documentation
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
There was a problem hiding this comment.
This PR adds well-structured mutation testing documentation and a pre-hook system. The skill documentation is comprehensive and follows repository conventions. I identified one critical issue that blocks merge:
Critical Issue:
The Python hook silently catches and suppresses OSError without logging, violating the repository's "Always fail loudly" rule. This makes debugging impossible when the skill file is missing or unreadable.
Verification Confirmation:
Per the PR description, all validation checks pass (codacy-analysis, npm run check/build/test). Hook trigger tests confirm proper behavior.
Note:
No mutation runner is installed per the PR scope - tool adoption is correctly deferred to a separate, maintainer-approved step.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
| except OSError: | ||
| pass # fall through to path directive |
There was a problem hiding this comment.
🛑 Silent Failure Violation: OSError is caught and suppressed without logging. This violates the repository's "Always fail loudly" rule (AGENTS.md lines 9-11). When the skill file cannot be read, users receive the path directive without knowing the file is actually missing or unreadable, making debugging impossible.
| except OSError: | |
| pass # fall through to path directive | |
| except OSError as file_error: | |
| msg = f"mutation-testing prehook: skill file not readable: {skill_path} ({file_error})\n" | |
| sys.stderr.write(msg) |
There was a problem hiding this comment.
Pull Request Overview
The pull request is currently not up to standards. While it provides comprehensive documentation for the mutation-testing skill, the implementation of the skill_prehook.py script has critical issues that should prevent merging. Specifically, the logic for parsing prompts from stdin fails to handle JSON string literals, which will cause valid user inputs to be ignored in certain environments.
Furthermore, the script is flagged as complex and lacks any automated unit tests to verify its keyword matching, environment variable toggles, or error handling. There is also significant code duplication between this hook and other existing skill hooks, which should be addressed by refactoring shared logic into a common utility to ensure maintainability.
About this PR
- Despite the complexity of the
skill_prehook.pyscript (handling regex triggers, JSON parsing, and environment variables), no automated unit tests have been provided. Automated verification is required to ensure keyword matching is precise and that the hook behaves correctly under different environment configurations.
Test suggestions
- Verify keyword matching: triggers on specific terms (e.g., 'mutation score', 'mutmut', 'weak assertion') and remains silent on generic ones (e.g., 'test', 'coverage').
- Verify stdin parsing: correctly extracts the prompt from multiple possible JSON keys ('prompt', 'user_prompt', 'message', 'text') and handles raw text fallback.
- Verify toggle behavior: injects the full SKILL.md when MUTATION_TESTING_HOOK_FULL=1 (default) and only the path-based directive when set to 0.
- Verify error handling: confirms the hook exits with 0 and prints to stderr if the skill file is missing or if JSON parsing fails on valid-but-incorrectly-shaped input.
- Verify path resolution: confirms the hook correctly resolves the relative path to SKILL.md based on its installation directory.
- Automated unit test coverage for logic in .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify keyword matching: triggers on specific terms (e.g., 'mutation score', 'mutmut', 'weak assertion') and remains silent on generic ones (e.g., 'test', 'coverage').
2. Verify stdin parsing: correctly extracts the prompt from multiple possible JSON keys ('prompt', 'user_prompt', 'message', 'text') and handles raw text fallback.
3. Verify toggle behavior: injects the full SKILL.md when MUTATION_TESTING_HOOK_FULL=1 (default) and only the path-based directive when set to 0.
4. Verify error handling: confirms the hook exits with 0 and prints to stderr if the skill file is missing or if JSON parsing fails on valid-but-incorrectly-shaped input.
5. Verify path resolution: confirms the hook correctly resolves the relative path to SKILL.md based on its installation directory.
6. Automated unit test coverage for logic in .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| if isinstance(data, dict): | ||
| for key in ("prompt", "user_prompt", "message", "text"): | ||
| val = data.get(key) | ||
| if isinstance(val, str) and val.strip(): | ||
| return val | ||
| return "" |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The function ignores inputs that are valid JSON string literals. While it catches raw text via JSONDecodeError, a prompt passed as a quoted JSON string would result in data being a string literal, failing the current dictionary check and returning an empty string. Try running the following prompt in your coding agent: > Update the read_prompt function in .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py to return data if it is a string after JSON parsing.
| ) | ||
|
|
||
|
|
||
| def read_prompt() -> str: | ||
| raw = sys.stdin.read() | ||
| if not raw.strip(): | ||
| return "" | ||
| try: | ||
| data = json.loads(raw) | ||
| except json.JSONDecodeError: | ||
| return raw | ||
| if isinstance(data, dict): | ||
| for key in ("prompt", "user_prompt", "message", "text"): | ||
| val = data.get(key) | ||
| if isinstance(val, str) and val.strip(): | ||
| return val | ||
| return "" | ||
|
|
||
|
|
||
| def main() -> None: | ||
| prompt = read_prompt() | ||
| if not prompt or not TRIGGER_RE.search(prompt): | ||
| return | ||
|
|
||
| skill_path = os.environ.get( | ||
| "MUTATION_TESTING_SKILL_PATH", | ||
| os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "SKILL.md")), | ||
| ) | ||
|
|
||
| full = os.environ.get("MUTATION_TESTING_HOOK_FULL", "1") != "0" | ||
| if full: | ||
| try: | ||
| with open(skill_path, "r", encoding="utf-8") as fh: | ||
| body = fh.read() | ||
| sys.stdout.write(DIRECTIVE + body + "\n") | ||
| return | ||
| except OSError: | ||
| pass # fall through to path directive | ||
|
|
||
| refs_dir = os.path.join(os.path.dirname(skill_path), "references") | ||
| sys.stdout.write( |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: This logic for reading prompts and resolving skill paths is duplicated across several engineering skills. Maintaining multiple copies of this boilerplate makes it harder to update the agent hook protocol or fix bugs in environment handling. Consider moving these utilities to a shared helper module or using a template to generate these hooks.
Try running the following prompt in your IDE agent:
Refactor the
skill_prehook.pyfiles in the.agents/skills-src/directory to use a shared logic module forread_promptand environment variable resolution, reducing duplication across the mutation-testing, drizzle-engineering, and sqlite-engineering skills.
| r"\bsurviving (mutant|mutation)s?\b", r"\bkilled mutant", | ||
| r"\bequivalent mutant", r"\btest(-| )suite quality\b", |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: Try running the following prompt in your coding agent: > In .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py, add optional pluralization and trailing word boundaries (\b) to the 'killed mutant' and 'equivalent mutant' trigger regexes.
| @@ -0,0 +1,117 @@ | |||
| #!/usr/bin/env python3 | |||
| """ | |||
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: The multi-line docstring summary should start on the same line as the opening triple quotes to comply with standard Python documentation conventions.
This might be a simple fix:
| """ | |
| """UserPromptSubmit prehook: inject the mutation-testing skill. |
Code Review by Qodo
Context used✅ Compliance rules (platform):
74 rules 1.
|
| --- | ||
| name: mutation-testing | ||
| description: 'Mutation testing engineering — verify that a test suite actually catches bugs, not just executes lines. Use when auditing or hardening test-suite quality, reviewing test coverage claims ("we have 90% coverage"), hunting surviving mutants, writing tests that kill specific mutants, setting up or configuring mutation tools (Stryker/StrykerJS/Stryker.NET, mutmut, Cosmic Ray, PIT/pitest, Infection, cargo-mutants, go-mutesting/Gremlins, mutant, muter, Mull), wiring mutation testing into CI (incremental PR runs, thresholds, --since/--in-diff), interpreting mutation scores, handling equivalent/timeout/no-coverage mutants, or closing the mutation-feedback loop on AI-generated tests. Triggers on: mutation testing, mutation score, surviving mutants, killed mutants, equivalent mutants, are my tests actually good, test suite quality, weak assertions, mutation coverage, mutant.' | ||
| --- |
There was a problem hiding this comment.
1. Mutation-testing files missing agpl header 📘 Rule violation § Compliance
Newly added .md and .py files begin with content (front matter, headings, or a docstring) and do not include an AGPL license header as the first non-empty, non-shebang line. This can cause license/audit noncompliance for newly introduced source and documentation files.
Agent Prompt
## Issue description
Newly added comment-capable files are missing the required AGPL license header at the top of the file.
## Issue Context
Compliance requires an AGPL header notice in each newly added file that supports comments (including `.md` and `.py`). These new files currently start with front matter/headings or a docstring instead.
## Fix Focus Areas
- .agents/skills-src/mutation-testing/SKILL.md[1-5]
- .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py[1-10]
- .agents/skills-src/mutation-testing/references/agent-mutation-loop.md[1-8]
- .agents/skills-src/mutation-testing/references/surviving-mutant-triage.md[1-8]
- .agents/skills-src/mutation-testing/references/tools-by-language.md[1-8]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Update: review triage + fixes (commits
|
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 11
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py:
- Around line 103-129: Update both exception handlers in skill_prehook.py’s main
flow to retain stderr logging and also write a concise failure directive to
stdout so injected-output harnesses show the error while exiting successfully.
Update AGENTS.md at the documented hook behavior section to describe both
server-side stderr logging and the user-visible stdout error directive; apply
the change at .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py
lines 103-129 and document it at AGENTS.md lines 36-37.
- Around line 48-50: Restrict the trigger pattern in the prehook’s
mutation-testing prompt detection to requests containing an explicit
mutation-testing term; remove or revise the broad r"\bare my tests\b" pattern
while preserving the existing mutation-testing and weak-assertion triggers.
In @.agents/skills-src/mutation-testing/references/agent-mutation-loop.md:
- Around line 26-37: Update the prompt code fence in the mutation-testing
reference content to use the text language tag after the opening backticks,
preserving the prompt wording and all existing test instructions.
In @.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md:
- Around line 50-59: Update the ordered lists in the mutation-testing triage
guidance so numbering restarts at 1 under each heading: use 1–3 for both “Kill
when practical” and “Accept or exclude,” preserving all existing list items and
wording.
In @.agents/skills-src/mutation-testing/references/tools-by-language.md:
- Line 13: Update the Java/JVM PIT entry in tools-by-language.md to remove the
obsolete scmMutationCoverage Maven goal; reference Arcmutate’s Git integration
instead, or explicitly pin and label a PIT version older than 1.18.0 wherever
this guidance is referenced.
- Line 46: Update the StrykerJS cache references in the mutation-testing
documentation to use the actual default incremental results file,
reports/stryker-incremental.json, instead of temporary .stryker-tmp paths;
alternatively, configure the shown StrykerJS setup with an explicit
incrementalFile value and keep all references consistent.
- Around line 97-115: Update the mutmut workflow commands in the
tools-by-language reference to use mutants/ for mutation state and mutmut browse
for inspection and retesting. Replace the deprecated mutmut results and mutmut
result-ids commands, including the survivor re-test flow, with the supported CLI
equivalents; alternatively pin a mutmut version that supports the existing
commands.
- Around line 9-10: Update both mutmut configuration examples in
tools-by-language.md to use the current 3.x schema: replace paths_to_mutate with
source_paths and tests_dir with pytest_add_cli_args_test_selection, using arrays
for pyproject.toml and strings for setup.cfg. Do not leave examples using the
legacy keys unless the mutmut dependency is explicitly pinned to a compatible
legacy version.
In @.agents/skills-src/mutation-testing/SKILL.md:
- Around line 12-18: Update the mutation-testing status definitions and
mutation-score formula in the documentation around the listed statuses to be
explicitly scoped to the supported mutation-testing tool(s). Either define
repository-wide policy or provide per-tool mappings, including Stryker’s
NoCoverage, Timeout, CompileError, and RuntimeError treatment, and ensure the
score calculation matches each tool’s semantics.
- Around line 1-4: Add the approved license header using Markdown comment syntax
to .agents/skills-src/mutation-testing/SKILL.md at lines 1-4, placing it before
the YAML frontmatter, and add the same header to
.agents/skills-src/mutation-testing/references/tools-by-language.md at lines
1-3, .agents/skills-src/mutation-testing/references/agent-mutation-loop.md at
lines 1-3, and
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md at
lines 1-3.
- Line 18: Update .agents/skills-src/mutation-testing/SKILL.md:18 and :48 to
cite Yao, Harman, and Jia for the ~23% equivalent-mutant estimate, including its
basis of 18 programs and 4,181 mutants, and correct the ~50-point claim to
AdverTest’s 50% FDR drop for the w/o Iter ablation on Defects4J rather than
MuTAP. Update
.agents/skills-src/mutation-testing/references/agent-mutation-loop.md:7-9 and
:50 to scope ~89.5% MUTGEN to HumanEval-Java and 73% ACH to its reported
acceptance study, and remove or qualify the unsupported ~7× token-use claim.
Update
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md:24 to
describe 15–25% as a context-dependent estimate, not an established rate for
survivors in mature triage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 78095534-81d8-4373-bcb3-c291ebeaccb7
📒 Files selected for processing (6)
.agents/skills-src/mutation-testing/SKILL.md.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py.agents/skills-src/mutation-testing/references/agent-mutation-loop.md.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md.agents/skills-src/mutation-testing/references/tools-by-language.mdAGENTS.md
| r"\bare my tests\b", r"\bweak assertion", | ||
| r"\bdo(es)? (my|the|these) tests? (actually )?(catch|fail)", | ||
| ] |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Restrict this trigger to mutation-testing prompts.
r"\bare my tests\b" matches ordinary prompts such as “Are my tests passing?”. It injects the full skill without a mutation-testing request. Remove this trigger or require an explicit mutation-testing term.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py around
lines 48 - 50, Restrict the trigger pattern in the prehook’s mutation-testing
prompt detection to requests containing an explicit mutation-testing term;
remove or revise the broad r"\bare my tests\b" pattern while preserving the
existing mutation-testing and weak-assertion triggers.
| except OSError as file_error: | ||
| # Fallback must be loud (repo rule): the path directive below | ||
| # degrades gracefully, but the read failure itself is logged. | ||
| sys.stderr.write( | ||
| f"mutation-testing prehook: skill file not readable: " | ||
| f"{skill_path} ({type(file_error).__name__}: {file_error})\n" | ||
| ) | ||
|
|
||
| refs_dir = os.path.join(os.path.dirname(skill_path), "references") | ||
| sys.stdout.write( | ||
| "MUTATION TESTING WORK DETECTED. Before proceeding, read the " | ||
| f"mutation-testing skill at {skill_path} and follow it. For survivor " | ||
| "triage, also read " | ||
| f"{os.path.join(refs_dir, 'surviving-mutant-triage.md')}; for tool " | ||
| "setup, " | ||
| f"{os.path.join(refs_dir, 'tools-by-language.md')}.\n" | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| try: | ||
| main() | ||
| except Exception as exc: | ||
| # Hooks must never break the prompt flow, but silent failure is not | ||
| # acceptable either — log to stderr and still exit 0. | ||
| sys.stderr.write(f"mutation-testing prehook failed: {type(exc).__name__}: {exc}\n") | ||
| sys.exit(0) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Make hook failures visible in the injected output.
The hook logs failures only to stderr, and AGENTS.md documents that behavior. This does not reliably show an error to the user in stdout-injecting harnesses.
.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py#L103-L129: Write a concise failure directive to stdout in both exception handlers.AGENTS.md#L36-L37: Document both stderr logging and the stdout user-visible error behavior.
As per coding guidelines, fallbacks must log server-side and show an error to the user.
🧰 Tools
🪛 Ruff (0.16.0)
[warning] 125-125: Do not catch blind exception: Exception
(BLE001)
📍 Affects 2 files
.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py#L103-L129(this comment)AGENTS.md#L36-L37
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py around
lines 103 - 129, Update both exception handlers in skill_prehook.py’s main flow
to retain stderr logging and also write a concise failure directive to stdout so
injected-output harnesses show the error while exiting successfully. Update
AGENTS.md at the documented hook behavior section to describe both server-side
stderr logging and the user-visible stdout error directive; apply the change at
.agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py lines 103-129
and document it at AGENTS.md lines 36-37.
Source: Coding guidelines
| ``` | ||
| The test suite misses this behavioral fault: | ||
|
|
||
| File: src/billing/credits.ts:42 | ||
| Original: if (balance < cost) throw new InsufficientCredits(); | ||
| Mutant: if (balance <= cost) throw new InsufficientCredits(); | ||
| Mutation operator: ConditionalBoundary | ||
|
|
||
| Write a test that FAILS against the mutant and PASSES against the | ||
| original. Use the existing test conventions in tests/billing/. Do not | ||
| weaken or edit any existing test. Return only the new test code. | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add a language tag to the prompt fence.
Use text after the opening fence. This resolves the MD040 warning.
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)
[warning] 26-26: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/references/agent-mutation-loop.md around
lines 26 - 37, Update the prompt code fence in the mutation-testing reference
content to use the text language tag after the opening backticks, preserving the
prompt wording and all existing test instructions.
Source: Linters/SAST tools
| Kill when practical: | ||
|
|
||
| 5. Data transformations for API responses — mapping, aggregation, rounding. | ||
| 6. Conditional routing — feature flags, tenant/partner-specific logic. | ||
|
|
||
| Accept or exclude (don't write tests): | ||
|
|
||
| 7. Logging format, dashboard cosmetics, metric labels. | ||
| 8. Configuration defaults (ports, timeouts, buffer sizes) — cover at integration level if at all. | ||
| 9. Equivalent mutants (after flagging). |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Restart ordered-list numbering under each heading.
Use 1., 2., and 3. under Kill when practical and Accept or exclude, or use unordered lists. This resolves the MD029 warnings.
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)
[warning] 52-52: Ordered list item prefix
Expected: 1; Actual: 5; Style: 1/2/3
(MD029, ol-prefix)
[warning] 53-53: Ordered list item prefix
Expected: 2; Actual: 6; Style: 1/2/3
(MD029, ol-prefix)
[warning] 57-57: Ordered list item prefix
Expected: 1; Actual: 7; Style: 1/2/3
(MD029, ol-prefix)
[warning] 58-58: Ordered list item prefix
Expected: 2; Actual: 8; Style: 1/2/3
(MD029, ol-prefix)
[warning] 59-59: Ordered list item prefix
Expected: 3; Actual: 9; Style: 1/2/3
(MD029, ol-prefix)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md
around lines 50 - 59, Update the ordered lists in the mutation-testing triage
guidance so numbering restarts at 1 under each heading: use 1–3 for both “Kill
when practical” and “Accept or exclude,” preserving all existing list items and
wording.
Source: Linters/SAST tools
| | JS / TS | StrykerJS | `npm i -D @stryker-mutator/core` + runner plugin | De facto standard; Jest/Vitest/Mocha/Karma; `--since`, `--incremental` | | ||
| | Python | mutmut | `pip install mutmut` | Runner-agnostic (exit code); `.mutmut-cache` incremental; `apply` edits files in place | |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- target file ---'
cat -n .agents/skills-src/mutation-testing/references/tools-by-language.md | sed -n '1,120p'
printf '%s\n' '--- mutmut references ---'
rg -n -C 3 'mutmut|paths_to_mutate|tests_dir|source_paths|pytest_add_cli_args_test_selection' .agents . 2>/dev/null | head -n 240Repository: Bonobo791/Moderaty
Length of output: 21176
🌐 Web query:
mutmut current documentation configuration source_paths pytest_add_cli_args_test_selection pyproject.toml version 3
💡 Result:
In mutmut version 3, you can configure the mutation testing system using a pyproject.toml file by defining a [tool.mutmut] section [1][2]. For configuring source paths and pytest arguments in pyproject.toml, you must specify them as arrays [1][3]. The relevant configuration keys are: - source_paths: Defines the directories or files that mutmut should mutate [1][2]. - pytest_add_cli_args_test_selection: Used for passing pytest command-line arguments that are specifically responsible for selecting or deselecting tests (e.g., -m, -k) [4][5]. - pytest_add_cli_args: Used for passing other pytest command-line arguments, such as disabling plugins or overriding pytest configuration settings [4][6]. Example configuration in pyproject.toml: [tool.mutmut] source_paths = [ "src/" ] pytest_add_cli_args_test_selection = [ "-m", "not fail", "-k", "test_include" ] pytest_add_cli_args = [ "-p", "no:some_plugin" ] Changes to these configuration settings, as well as others like type_check_command or timeout settings, are automatically detected by mutmut, which will then invalidate the affected cached results [4][6]. Alternative configuration files such as setup.cfg are also supported, where these values are provided as strings rather than arrays [1][2][4].
Citations:
- 1: https://github.com/boxed/mutmut/
- 2: https://mutmut.readthedocs.io/en/latest/
- 3: https://pypi.org/project/mutmut/
- 4: https://github.com/boxed/mutmut
- 5: https://mutmut.readthedocs.io/
- 6: https://github.com/boxed/mutmut/blob/main/README.rst
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
import json
import urllib.request
for url in (
"https://pypi.org/pypi/mutmut/json",
"https://raw.githubusercontent.com/boxed/mutmut/main/README.rst",
):
print(f"--- {url} ---")
with urllib.request.urlopen(url, timeout=15) as response:
data = response.read().decode()
if url.endswith("/json"):
payload = json.loads(data)
print("latest:", payload["info"]["version"])
print("requires_python:", payload["info"].get("requires_python"))
else:
lines = data.splitlines()
needles = (
"source_paths",
"paths_to_mutate",
"pytest_add_cli_args_test_selection",
"tests_dir",
"runner",
"[tool.mutmut]",
"[mutmut]",
)
for i, line in enumerate(lines):
if any(needle in line for needle in needles):
lo, hi = max(0, i - 4), min(len(lines), i + 5)
print(f"{lo + 1}-{hi}:")
print("\n".join(f"{j + 1}: {lines[j]}" for j in range(lo, hi)))
PYRepository: Bonobo791/Moderaty
Length of output: 2484
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- PyPI metadata ---'
curl -fsSLk https://pypi.org/pypi/mutmut/json | python3 -c '
import json,sys
p=json.load(sys.stdin)
print("latest:", p["info"]["version"])
print("requires_python:", p["info"].get("requires_python"))
'
printf '%s\n' '--- upstream configuration references ---'
curl -fsSLk https://raw.githubusercontent.com/boxed/mutmut/main/README.rst |
rg -n -C 5 'source_paths|paths_to_mutate|pytest_add_cli_args_test_selection|tests_dir|runner|\[tool\.mutmut\]|\[mutmut\]'Repository: Bonobo791/Moderaty
Length of output: 2837
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
import re
import tomllib
from pathlib import Path
local = Path(".agents/skills-src/mutation-testing/references/tools-by-language.md").read_text()
toml_block = re.search(r"```toml\n(.*?)\n```", local, re.S).group(1)
config = tomllib.loads(toml_block)["tool"]["mutmut"]
current_keys = {"source_paths", "pytest_add_cli_args_test_selection"}
legacy_keys = {"paths_to_mutate", "tests_dir"}
print("local TOML keys:", sorted(config))
print("legacy keys present:", sorted(set(config) & legacy_keys))
print("current keys present:", sorted(set(config) & current_keys))
print("TOML values are arrays for current path-selection keys:",
all(isinstance(config[k], list) for k in current_keys if k in config))
setup_block = re.search(r"```ini\n(.*?)\n```", local, re.S).group(1)
setup_keys = {
line.split("=", 1)[0].strip()
for line in setup_block.splitlines()
if "=" in line and not line.lstrip().startswith("#")
}
print("local setup.cfg keys:", sorted(setup_keys))
print("legacy keys present in setup.cfg:", sorted(set(setup_keys) & legacy_keys))
PYRepository: Bonobo791/Moderaty
Length of output: 276
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
import re
from pathlib import Path
local = Path(".agents/skills-src/mutation-testing/references/tools-by-language.md").read_text()
toml_block = re.search(r"```toml\n(.*?)\n```", local, re.S).group(1)
toml_keys = {
line.split("=", 1)[0].strip()
for line in toml_block.splitlines()
if "=" in line and not line.lstrip().startswith("#")
}
current_keys = {"source_paths", "pytest_add_cli_args_test_selection"}
legacy_keys = {"paths_to_mutate", "tests_dir"}
print("local TOML keys:", sorted(toml_keys))
print("legacy keys present:", sorted(toml_keys & legacy_keys))
print("current keys present:", sorted(toml_keys & current_keys))
print("TOML current-key values use arrays:",
all(re.search(r"=\s*\[", line)
for line in toml_block.splitlines()
if line.split("=", 1)[0].strip() in current_keys))
setup_block = re.search(r"```ini\n(.*?)\n```", local, re.S).group(1)
setup_keys = {
line.split("=", 1)[0].strip()
for line in setup_block.splitlines()
if "=" in line and not line.lstrip().startswith("#")
}
print("local setup.cfg keys:", sorted(setup_keys))
print("legacy keys present in setup.cfg:", sorted(setup_keys & legacy_keys))
PYRepository: Bonobo791/Moderaty
Length of output: 478
Update both mutmut configuration examples.
With an unpinned install, mutmut uses the current 3.x schema. Replace paths_to_mutate and tests_dir with source_paths and pytest_add_cli_args_test_selection. Use arrays in pyproject.toml and strings in setup.cfg, or pin a legacy mutmut version.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/references/tools-by-language.md around
lines 9 - 10, Update both mutmut configuration examples in tools-by-language.md
to use the current 3.x schema: replace paths_to_mutate with source_paths and
tests_dir with pytest_add_cli_args_test_selection, using arrays for
pyproject.toml and strings for setup.cfg. Do not leave examples using the legacy
keys unless the mutmut dependency is explicitly pinned to a compatible legacy
version.
| "concurrency": 4, | ||
| "timeoutMS": 10000, | ||
| "timeoutFactor": 1.5, | ||
| "incremental": true |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- target excerpts ---'
for range in '40,60p' '196,208p'; do
sed -n "${range}" .agents/skills-src/mutation-testing/references/tools-by-language.md
done
printf '%s\n' '--- relevant identifiers and cache paths ---'
rg -n -C 3 'incremental(File)?|stryker-incremental|\.stryker-tmp|cache|Stryker' \
.agents .github 2>/dev/null || true
printf '%s\n' '--- repository files mentioning the target examples ---'
git ls-files | rg 'stryker|mutation-testing|tools-by-language'Repository: Bonobo791/Moderaty
Length of output: 24778
🌐 Web query:
StrykerJS current configuration incrementalFile default reports/stryker-incremental.json .stryker-tmp
💡 Result:
In StrykerJS, the default value for the incrementalFile configuration option is "reports/stryker-incremental.json" [1][2]. This file is used to store results when incremental mode is enabled (via --incremental or "incremental": true) [3][4]. It is important to note that.stryker-tmp is a default directory used by StrykerJS for temporary files (such as the sandbox where tests are executed), but it is distinct from the incremental report file [1][3]. The incremental report file should be treated as an artifact rather than source code [4]. If you wish to change the location of the incremental file, you can do so using the --incrementalFile command-line flag or by setting the incrementalFile property in your configuration file [1][2].
Citations:
- 1: https://stryker-mutator.io/docs/stryker-js/configuration/
- 2: https://github.com/stryker-mutator/stryker-js/blob/master/docs/configuration.md
- 3: https://stryker-mutator.io/docs/stryker-js/incremental/
- 4: https://stryker-mutator.io/blog/announcing-incremental-mode/
Use the actual StrykerJS incremental file.
StrykerJS stores incremental results in reports/stryker-incremental.json by default. .stryker-tmp/ contains temporary files. Update the cache references at lines 55 and 202, or set incrementalFile explicitly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/references/tools-by-language.md at line
46, Update the StrykerJS cache references in the mutation-testing documentation
to use the actual default incremental results file,
reports/stryker-incremental.json, instead of temporary .stryker-tmp paths;
alternatively, configure the shown StrykerJS setup with an explicit
incrementalFile value and keep all references consistent.
| mutmut run # resumable; caches in .mutmut-cache (delete for a clean full run) | ||
| mutmut results # killed / survived / no-tests summary | ||
| mutmut show 7 # diff of one mutant | ||
| mutmut show path/to/file.py | ||
| mutmut apply 7 # writes mutant to disk — file MUST be committed first | ||
| # write a test that fails on the mutant, then: | ||
| git checkout -- src/file.py # revert immediately — never leave applied mutants on disk | ||
| mutmut run 7 # re-test one mutant | ||
| for id in $(mutmut result-ids survived); do mutmut run $id; done # re-test all survivors | ||
| ``` | ||
|
|
||
| Quirks and controls: | ||
|
|
||
| - `# pragma: no mutate` — whitelist a line (version strings, logging, intentional perf trade-offs like `break`→`continue`). | ||
| - `mutmut_config.py` with `pre_mutation(context)` — skip mutants programmatically (e.g. skip all `log.*` lines, skip a file) or change the test command per mutant. | ||
| - `--disable-mutation-types=string,decorator` / `--enable-mutation-types=...` — operator-level scope (exclusive flags). | ||
| - Only needs an exit code from the runner, so any test command works; `hammett` runner is dramatically faster than pytest if adoptable. | ||
| - `mutmut html` for a browsable report. | ||
| - WARNING for agents: `mutmut apply` physically corrupts the working tree. Always verify `git status` is clean before applying, and revert in the same session. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
file=$(git ls-files '.agents/skills-src/mutation-testing/references/tools-by-language.md' | head -n 1)
printf '%s\n' "FILE=$file"
sed -n '80,130p' "$file"
printf '%s\n' '--- repository references ---'
rg -n --hidden -g '!node_modules' -g '!dist' -g '!build' \
'mutmut(\s|[-_.]|$)|\.mutmut-cache|mutants/|mutmut (results|html|browse|result-ids)' \
.agents/skills-src/mutation-testing . 2>/dev/null | head -n 200Repository: Bonobo791/Moderaty
Length of output: 9711
🌐 Web query:
mutmut documentation current CLI mutants directory mutmut browse mutmut results mutmut html mutmut result-ids cache
💡 Result:
Mutmut is a mutation testing system for Python that uses a file-based workflow for storing results and caches [1][2]. Key CLI components and directories: Mutants Directory: Mutmut stores data about completed mutations and the mutants themselves in a mutants/ directory [3][2]. To perform a full run from scratch, you can delete this directory [2]. Cache: Mutmut maintains a result cache, typically named.mutmut-cache [4][5]. If you need to ensure a full fresh run or if changes to the configuration file (mutmut_config.py) are not taking effect, you should manually delete this file [4][5]. CLI Commands: - mutmut run: Executes the mutation testing suite [1][6]. It automatically attempts to locate code and tests within your project [1][3]. - mutmut browse: Opens an interactive text-based user interface (TUI) where you can view mutants, retest specific functions (press f) or modules (press m), and rerun tests for selected mutants (press r) [1][2]. - mutmut html: Generates an HTML report containing the results of the mutation testing [7]. - mutmut apply: Allows you to write a specific mutant to disk [1][6]. - mutmut status: Provides a list of mutants, optionally filtered by a specific file [7]. - mutmut show : Displays the diff for a specific mutant ID [7]. The general workflow involves running mutmut, browsing the results to identify surviving mutants, and then updating your test suite to kill those mutants [1][2]. Always ensure your files are under version control before applying any mutants to your disk [1][6].
Citations:
- 1: https://mutmut.readthedocs.io/en/latest/index.html
- 2: https://github.com/boxed/mutmut/
- 3: https://github.com/boxed/mutmut/blob/main/README.rst
- 4: https://pypi.org/project/mutmut/2.5.0/
- 5: https://pypi.org/project/mutmut/2.4.3/
- 6: https://pypi.org/project/mutmut/
- 7: [QUESTION] Option to Only Show Files with Surviving Mutants In HTML Report boxed/mutmut#214
🏁 Script executed:
#!/bin/bash
set -eu
for url in \
'https://mutmut.readthedocs.io/en/latest/index.html' \
'https://raw.githubusercontent.com/boxed/mutmut/main/README.rst' \
'https://raw.githubusercontent.com/boxed/mutmut/main/mutmut/__main__.py'
do
printf '\n--- %s ---\n' "$url"
curl -L --fail --silent --show-error "$url" | \
rg -n -i -C 3 'mutants/|\.mutmut-cache|mutmut (browse|results|html|status|show|run)|result-ids|version' | head -n 180 || true
done
printf '\n--- release metadata ---\n'
curl -L --fail --silent --show-error \
'https://api.github.com/repos/boxed/mutmut/releases?per_page=10' |
jq -r '.[] | [.tag_name, .published_at, .name] | `@tsv`'Repository: Bonobo791/Moderaty
Length of output: 7056
🌐 Web query:
site:mutmut.readthedocs.io/en/latest mutmut mutants/ .mutmut-cache result-ids
💡 Result:
Mutmut uses a directory named mutants/ to store information about the mutants it has generated and the results of its mutation testing process [1][2][3]. While official documentation explicitly mentions the mutants/ directory for storing the data of its operations, it does not provide specific technical documentation regarding a.mutmut-cache file or a result-ids component within its file structure [1][2][3]. To perform a clean, full run of mutmut and clear existing state, you can delete the mutants/ directory [1][2][3]. Changes to your project code or configuration—such as dependency upgrades or changes to mutmut settings—are handled by mutmut's internal tracking mechanisms, which may trigger warnings or automatic cache invalidation for relevant results to ensure they reflect the current state of your code [1][2][3].
Citations:
- 1: https://mutmut.readthedocs.io/en/latest/
- 2: https://mutmut.readthedocs.io/en/latest/index.html
- 3: https://mutmut.readthedocs.io/en/latest/?badge=latest
Update the mutmut workflow for the supported CLI.
Use mutants/ for state and mutmut browse for inspection and retesting. Replace mutmut results and mutmut result-ids, or pin the mutmut version that supports them.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/references/tools-by-language.md around
lines 97 - 115, Update the mutmut workflow commands in the tools-by-language
reference to use mutants/ for mutation state and mutmut browse for inspection
and retesting. Replace the deprecated mutmut results and mutmut result-ids
commands, including the survivor re-test flow, with the supported CLI
equivalents; alternatively pin a mutmut version that supports the existing
commands.
| --- | ||
| name: mutation-testing | ||
| description: 'Mutation testing engineering — verify that a test suite actually catches bugs, not just executes lines. Use when auditing or hardening test-suite quality, reviewing test coverage claims ("we have 90% coverage"), hunting surviving mutants, writing tests that kill specific mutants, setting up or configuring mutation tools (Stryker/StrykerJS/Stryker.NET, mutmut, Cosmic Ray, PIT/pitest, Infection, cargo-mutants, go-mutesting/Gremlins, mutant, muter, Mull), wiring mutation testing into CI (incremental PR runs, thresholds, --since/--in-diff), interpreting mutation scores, handling equivalent/timeout/no-coverage mutants, or closing the mutation-feedback loop on AI-generated tests. Triggers on: mutation testing, mutation score, surviving mutants, killed mutants, equivalent mutants, are my tests actually good, test suite quality, weak assertions, mutation coverage, mutant.' | ||
| --- |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- candidate files ---'
git ls-files '.agents/skills-src/mutation-testing/*.md' '.agents/skills-src/mutation-testing/references/*.md'
printf '%s\n' '--- repository guidance files ---'
find .. -maxdepth 2 -type f \( -iname '*license*' -o -iname '*contribut*' -o -iname '*guideline*' -o -name 'AGENTS.md' -o -name 'CLAUDE.md' \) -print
printf '%s\n' '--- license/header references ---'
rg -n -i --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
'AGPL|commercial|license header|copyright|SPDX|header' .
printf '%s\n' '--- target file starts ---'
for f in \
.agents/skills-src/mutation-testing/SKILL.md \
.agents/skills-src/mutation-testing/references/tools-by-language.md \
.agents/skills-src/mutation-testing/references/agent-mutation-loop.md \
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md
do
echo "### $f"
sed -n '1,35p' "$f"
doneRepository: Bonobo791/Moderaty
Length of output: 50374
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- AGENTS.md license policy ---'
sed -n '270,320p' AGENTS.md
printf '%s\n' '--- target file prefixes ---'
for f in \
.agents/skills-src/mutation-testing/SKILL.md \
.agents/skills-src/mutation-testing/references/tools-by-language.md \
.agents/skills-src/mutation-testing/references/agent-mutation-loop.md \
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md
do
echo "### $f"
sed -n '1,25p' "$f"
done
printf '%s\n' '--- representative Markdown headers ---'
for f in DEPLOY.md DESIGN.md docs/e2e-verification.md README.md; do
echo "### $f"
sed -n '1,22p' "$f"
done
printf '%s\n' '--- Markdown files under .agents with header references ---'
rg -l -U '^---\n|Copyright \(C\) 2026 Andrew Philip Weilbacher' .agents --glob '*.md' | head -80Repository: Bonobo791/Moderaty
Length of output: 15658
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
targets = [
Path(".agents/skills-src/mutation-testing/SKILL.md"),
Path(".agents/skills-src/mutation-testing/references/tools-by-language.md"),
Path(".agents/skills-src/mutation-testing/references/agent-mutation-loop.md"),
Path(".agents/skills-src/mutation-testing/references/surviving-mutant-triage.md"),
]
required_markers = [
"# Moderaty — YouTube Comment Auto-Moderation Tool",
"# Copyright (C) 2026 Andrew Philip Weilbacher",
"GNU Affero General Public License",
"Commercial licensing: contact@marketingprowess.simplelogin.com — see COMMERCIAL.md",
]
for path in targets:
text = path.read_text()
missing = [marker for marker in required_markers if marker not in text]
first = next((line for line in text.splitlines() if line.strip()), "")
print(f"{path}: first_nonempty={first!r}; missing_header_markers={missing}")
skill = targets[0].read_text()
print(f"SKILL.md frontmatter_starts_at_first_line={skill.startswith('---\\n')}")
print(f"SKILL.md frontmatter_closes_before_heading={'\\n---\\n' in skill}")
PYRepository: Bonobo791/Moderaty
Length of output: 417
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
targets = [
Path(".agents/skills-src/mutation-testing/SKILL.md"),
Path(".agents/skills-src/mutation-testing/references/tools-by-language.md"),
Path(".agents/skills-src/mutation-testing/references/agent-mutation-loop.md"),
Path(".agents/skills-src/mutation-testing/references/surviving-mutant-triage.md"),
]
required_markers = [
"# Moderaty — YouTube Comment Auto-Moderation Tool",
"# Copyright (C) 2026 Andrew Philip Weilbacher",
"GNU Affero General Public License",
"Commercial licensing: contact@marketingprowess.simplelogin.com — see COMMERCIAL.md",
]
for path in targets:
text = path.read_text()
missing = [marker for marker in required_markers if marker not in text]
first = next((line for line in text.splitlines() if line.strip()), "")
print(f"{path}: first_nonempty={first!r}; missing_header_markers={missing}")
skill = targets[0].read_text()
starts = skill.startswith("---\n")
closes = "\n---\n" in skill
print(f"SKILL.md frontmatter_starts_at_first_line={starts}")
print(f"SKILL.md frontmatter_closes_before_heading={closes}")
PYRepository: Bonobo791/Moderaty
Length of output: 1678
Add the approved license header to all four Markdown files.
Use Markdown comment syntax. Place the header before the YAML frontmatter in SKILL.md.
📍 Affects 4 files
.agents/skills-src/mutation-testing/SKILL.md#L1-L4(this comment).agents/skills-src/mutation-testing/references/tools-by-language.md#L1-L3.agents/skills-src/mutation-testing/references/agent-mutation-loop.md#L1-L3.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md#L1-L3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/SKILL.md around lines 1 - 4, Add the
approved license header using Markdown comment syntax to
.agents/skills-src/mutation-testing/SKILL.md at lines 1-4, placing it before the
YAML frontmatter, and add the same header to
.agents/skills-src/mutation-testing/references/tools-by-language.md at lines
1-3, .agents/skills-src/mutation-testing/references/agent-mutation-loop.md at
lines 1-3, and
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md at
lines 1-3.
Source: Coding guidelines
| - **Killed** — at least one test fails. The suite would catch this bug. Good. | ||
| - **Survived** — all tests pass despite the change. A genuine test gap or an equivalent mutant. Act on it. | ||
| - **Timed out** — mutant caused an infinite loop. Counts as killed in most tools; investigate if frequent (flaky timing or real performance sensitivity). | ||
| - **No coverage** — no test executes the mutated line. Counts as undetected; add a behavior test or exclude the file. | ||
| - **Error/unviable** — mutant does not compile or crashes setup. Excluded from the score. | ||
|
|
||
| Mutation score = killed / (total − equivalent). Equivalent mutants change syntax but not behavior (`i <= n-1` vs `i < n`); they can never be killed and detecting them automatically is undecidable — expect to flag them by hand. Research puts ~23% of mutants as equivalent, so 100% is a mathematical ceiling, not a target. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- target file ---'
cat -n .agents/skills-src/mutation-testing/SKILL.md | sed -n '1,80p'
printf '%s\n' '--- mutation-related files and references ---'
git ls-files | rg -i 'mutation|stryker|pitest|mutant|coverage' | head -200
printf '%s\n' '--- references to status terms and score ---'
rg -n -i 'NoCoverage|no coverage|Timed out|timed out|Error/unviable|mutation score|equivalent mutant|Stryker|mutation.testing' . --glob '!node_modules' --glob '!dist' --glob '!build' | head -300Repository: Bonobo791/Moderaty
Length of output: 7980
🌐 Web query:
Stryker mutation testing documentation mutant statuses NoCoverage Timeout RuntimeError CompileError score formula denominator
💡 Result:
In Stryker mutation testing, mutants are categorized by specific statuses that reflect the outcome of running tests against the mutated code [1][2]. Mutant Statuses: - Killed: At least one test failed while the mutant was active [1][2]. - Survived: All tests passed while the mutant was active, indicating a gap in test coverage [1][2]. - No Coverage: The original code is not covered by any tests, so the mutant survived by default [1][2]. - Timeout: The tests took too long to complete, likely due to an infinite loop caused by the mutant [1][2]. These are treated as detected (similar to "Killed") [1][2]. - RuntimeError: An error occurred while running the tests (e.g., a crash or unparsable code) [1][2]. These are typically excluded from the mutation score calculation because they do not reliably indicate test quality [1][2]. - CompileError: The mutant resulted in code that failed to compile [1]. These are excluded from the mutation score [1]. - Pending: The mutant has been generated but not yet tested [1]. - Ignored: The mutant was explicitly excluded by the user [1][3]. These are excluded from the score [1][3]. Mutation Score Formula: The standard mutation score is calculated by dividing the number of detected mutants by the total number of valid (non-ignored/non-errored) mutants [2][4]. Formula: Mutation Score = (Killed + Timeout) / (Killed + Timeout + Survived + NoCoverage) * 100 [2][5][6] Denominator: The denominator consists of all valid mutants, which includes "Total Detected" (#Killed + #Timeout) and "Total Undetected" (#Survived + #NoCoverage) [2][5]. Mutants categorized as RuntimeError, CompileError, or Ignored are excluded from the denominator as they are not considered representative of the test suite's effectiveness [1][2][4]. Note that some stricter reporting variations may include "No Coverage" mutants in the denominator, punishing the score for untested code [7].
Citations:
- 1: https://stryker-mutator.io/docs/mutation-testing-elements/mutant-states-and-metrics/
- 2: https://stryker-mutator.io/docs/General/faq/
- 3: https://stryker-mutator.io/docs/stryker-js/disable-mutants/
- 4: stryker-mutator/stryker-js@b9231fe
- 5: https://www.augmentcode.com/guides/mutation-testing-ai-generated-code
- 6: https://oneuptime.com/blog/post/2026-01-25-mutation-testing-with-stryker/view
- 7: https://qaskills.sh/blog/mutation-testing-stryker-guide-2026
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- tool guidance ---'
cat -n .agents/skills-src/mutation-testing/references/tools-by-language.md | sed -n '1,240p'
printf '%s\n' '--- triage guidance ---'
cat -n .agents/skills-src/mutation-testing/references/surviving-mutant-triage.md | sed -n '1,180p'
printf '%s\n' '--- repository policy context ---'
cat -n AGENTS.md | sed -n '1,60p'Repository: Bonobo791/Moderaty
Length of output: 20173
🌐 Web query:
site:stryker-mutator.io/docs/mutation-testing-elements/mutant-states-and-metrics Stryker Timeout NoCoverage mutation score
💡 Result:
In Stryker mutation testing, NoCoverage is a state for a mutant that is not reached by any of your tests, meaning it effectively survives because no test ever executes the code where the mutation was applied [1]. Regarding its impact on the mutation score: 1. Mutation Score: Stryker calculates the standard mutation score as the number of detected mutants divided by the total number of valid mutants [1]. Because NoCoverage mutants are considered undetected (grouped with survived mutants), they negatively impact this score [1]. 2. Mutation Score Based on Covered Code: Stryker also provides a secondary metric called the mutation score based on covered code, which is calculated as the number of detected mutants divided by the number of covered mutants [1]. NoCoverage mutants are excluded from this specific calculation, meaning they do not lower the score in this context [1]. In summary, while NoCoverage mutants reduce your primary mutation score, they are ignored when calculating the mutation score based on covered code, allowing you to measure the effectiveness of your tests specifically on the code they currently cover [1].
Citations:
Scope mutant-status semantics by tool.
Status handling and mutation-score formulas vary by tool. For example, Stryker reports NoCoverage separately from Survived, counts Timeout as detected, and excludes CompileError and RuntimeError from the score. Rewrite these rules as repository policy or define them for each supported tool.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/SKILL.md around lines 12 - 18, Update
the mutation-testing status definitions and mutation-score formula in the
documentation around the listed statuses to be explicitly scoped to the
supported mutation-testing tool(s). Either define repository-wide policy or
provide per-tool mappings, including Stryker’s NoCoverage, Timeout,
CompileError, and RuntimeError treatment, and ensure the score calculation
matches each tool’s semantics.
| - **No coverage** — no test executes the mutated line. Counts as undetected; add a behavior test or exclude the file. | ||
| - **Error/unviable** — mutant does not compile or crashes setup. Excluded from the score. | ||
|
|
||
| Mutation score = killed / (total − equivalent). Equivalent mutants change syntax but not behavior (`i <= n-1` vs `i < n`); they can never be killed and detecting them automatically is undecidable — expect to flag them by hand. Research puts ~23% of mutants as equivalent, so 100% is a mathematical ceiling, not a target. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- target files ---'
for f in .agents/skills-src/mutation-testing/SKILL.md \
.agents/skills-src/mutation-testing/references/agent-mutation-loop.md \
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md; do
if [ -f "$f" ]; then
printf '\n--- %s (%s lines) ---\n' "$f" "$(wc -l < "$f")"
cat -n "$f"
fi
done
printf '\n--- repository citation files and references ---\n'
git ls-files | rg -i '(^|/)(readme|citation|references?|bibliography|sources?|docs?)([^/]*)$|mutation|mutant|mutgen|mutap|evosuite|stryker|pit|ach' | head -200
printf '\n--- claim-related text ---\n'
rg -n -i '23%|15.?25%|7.?x|50 points|89\.5|73%|MuTAP|MUTGEN|ACH|equivalent mutant|mutation.feedback' .agents README* 2>/dev/null || trueRepository: Bonobo791/Moderaty
Length of output: 31962
🌐 Web query:
MuTAP mutation feedback loop removing mutation feedback largest drop 50 points study
💡 Result:
MuTAP (Mutation Test case generation using Augmented Prompt) is a technique that uses Large Language Models (LLMs) to generate effective unit tests by leveraging mutation testing [1][2]. In the MuTAP framework, a mutation-guided feedback loop is employed where surviving mutants—those that the existing test suite fails to detect—are used to augment the prompt, instructing the LLM to generate new, targeted test cases to kill those mutants [1][3]. Regarding the specific mention of a "50 points" drop and removing mutation feedback, technical documentation and implementation guidelines for systems similar to or extending MuTAP (such as the qa-test-mutate skill) include iterative feedback loops designed to stop when diminishing returns are reached [4]. These guidelines often define stopping criteria based on the improvement delta (e.g., if the improvement in mutation score is below a certain threshold, such as 5 points) rather than a 50-point drop [4]. There is no widely cited authoritative study or standard MuTAP documentation that describes a "50 points drop" as a recognized phenomenon or a specific trigger for "removing" mutation feedback [1][2]. It is possible that the "50 points" figure originates from a specific implementation or heuristic-based threshold in an automated testing agent, where a significant drop in mutation score might trigger a fallback mechanism or a reconfiguration of the test generation process [4]. In evolutionary or iterative test generation, large drops in mutation score are typically indicators of instability or issues in the test generation process, rather than a planned removal of the feedback mechanism [5][6].
Citations:
- 1: https://github.com/ExpertiseModel/MuTAP
- 2: https://arxiv.gg/abs/2308.16557
- 3: https://github.com/plasma-umass/MuTAP
- 4: https://www.claudepluginhub.com/skills/parhumm-jaan-to/qa-test-mutate
- 5: https://www.doria.fi/bitstream/handle/10024/194889/tabassum_radia.pdf?isAllowed=y&sequence=3
- 6: https://essay.utwente.nl/fileshare/file/111098/Final%20Project%20Everard%20de%20Vree.pdf
🌐 Web query:
MUTGEN 89.5% mutation score HumanEval-Java mutation feedback prompting
💡 Result:
MUTGEN is a mutation-guided, Large Language Model (LLM)-based unit test generation approach that significantly improves the fault-detection capability of generated test suites by incorporating mutation feedback directly into the LLM prompts [1][2][3]. In a study evaluating the approach, MUTGEN was tested against the HumanEval-Java dataset (using 104 subjects after excluding those where both EvoSuite and MutGen achieved a 100% mutation score) and a LeetCode-Java corpus [4][5][3]. The results demonstrated that MUTGEN achieved a mutation score of 89.5% on HumanEval-Java (across 1,144 mutants) and 89.1% on the LeetCode-Java dataset [4][6][3]. This performance significantly outperformed both the state-of-the-art search-based tool EvoSuite and a vanilla LLM-based prompting strategy [4][1][3]. The effectiveness of the approach is attributed to its iterative generation mechanism and the use of mutation feedback, which directs the LLM to identify and kill surviving mutants [1][2]. The approach also includes steps for test summarization, generation, and fixing of failed tests, with ablation studies confirming that each component—including the mutation feedback—is essential for achieving these high mutation scores [7][3]. The replication package and further technical details are available in the associated project repository [8].
Citations:
- 1: https://www.computer.org/csdl/journal/ts/2026/05/11478734/2fzptwnimcw
- 2: https://pubdb.com/paper/2506.02954
- 3: https://doi.org/10.1109/tse.2026.3682975
- 4: https://arxiv.org/html/2506.02954v5
- 5: https://arxiv.org/html/2506.02954v6
- 6: https://arxiv.org/html/2506.02954v1
- 7: https://pith.science/paper/2506.02954
- 8: https://github.com/Amocy-Wang/MUTGEN
🌐 Web query:
Meta ACH equivalent mutant filter 73% generated tests accepted engineers production scale
💡 Result:
At Meta, the Automated Compliance Hardening (ACH) system is an industrial-scale framework that uses mutation-guided, LLM-based test generation to improve software quality and compliance [1][2][3]. A central component of ACH is an LLM-based equivalent mutant detection agent, which filters out mutants that are semantically identical to the original code to prevent developer noise [1][4][2]. This filtering agent achieves a precision and recall of 0.79 and 0.47, which improves significantly to 0.95 and 0.96 when combined with simple preprocessing [2][3]. During deployments across platforms such as Facebook, Instagram, WhatsApp, and wearables, ACH generated 9,095 targeted mutants and produced 571 high-quality hardening tests [1][2]. Meta engineers accepted 73% of these generated tests into production code [1][5][3]. While 36% of these accepted tests were judged as directly relevant to privacy or compliance concerns, engineers frequently accepted the remaining tests for their broader benefits, such as improving code coverage and catching edge cases [4][5][2][3]. This 73% acceptance rate reflects the efficacy of the system in providing an automated safety net at scale [5][6].
Citations:
- 1: https://doi.org/10.36227/techrxiv.175624516.68019515/v1
- 2: https://conf.researchr.org/details/fse-2025/fse-2025-industry-papers/16/Mutation-Guided-LLM-based-Test-Generation-at-Meta
- 3: https://doi.org/10.48550/arxiv.2501.12862
- 4: https://medium.com/@rajneeshkaggarwal/from-bebugging-to-ai-powered-mutation-testing-metas-breakthrough-in-automated-compliance-93d1adb4488c
- 5: https://engineering.fb.com/2025/09/30/security/llms-are-the-key-to-mutation-testing-and-better-compliance/
- 6: https://ar5iv.labs.arxiv.org/html/2402.09171
🌐 Web query:
mutation testing equivalent mutants 23% estimate study 15 25 percent survivors equivalent mutants
💡 Result:
The 23% figure commonly cited in mutation testing refers to a notable study by Yao, Harman, and Jia (2014) titled A Study of Equivalent and Stubborn Mutation Operators using Human Analysis of Equivalence [1][2]. In this study, the researchers manually analyzed 1,230 unkilled mutants across 18 programs and found that approximately 23% were equivalent mutants [1][2]. The estimate that 15% to 25% of mutants are equivalent is frequently referenced in literature as a practical range for developers to expect [3]. However, research indicates that the proportion of equivalent mutants varies widely depending on the codebase, programming language, and the specific mutation operators employed [4][5][3]. Key takeaways from the research include: 1. Significant Variability: Estimates of equivalent mutants in the literature span a broad range, from as low as 2% to as high as 50% [4][5]. 2. Context Matters: The specific "equivalent mutant rate" is highly dependent on the subject program and the test suite's quality [4][5][6]. For example, studies have shown that more robust test suites may appear to have a higher percentage of equivalent mutants among their remaining unkilled mutants because they have already successfully caught most non-equivalent ones [7][6]. 3. Impact on Mutation Testing: Because identifying equivalent mutants is an undecidable problem, this "equivalent mutant problem" is a primary obstacle to achieving a 100% mutation score [8][4][9][3]. Consequently, many practitioners consider a 100% score neither necessary nor practically achievable, often targeting lower, realistic coverage goals instead [3].
Citations:
- 1: http://www0.cs.ucl.ac.uk/staff/M.Harman/icse14-xy.pdf
- 2: https://doi.org/10.1145/2568225.2568265
- 3: https://medium.com/insiderengineering/why-100-mutation-score-is-neither-necessary-nor-achievable-and-why-thats-perfectly-fine-f28463c3b61e
- 4: https://stairs.ics.uci.edu/papers/2015/How_hard_does_mutation_analysis_have_to_be_anyway.pdf
- 5: https://agroce.github.io/issre15.pdf
- 6: https://www.st.cs.uni-saarland.de/publications/files/schuler-stvrbis-2013.pdf
- 7: https://madeyski.e-informatyka.pl/download/Madeyski13TSE.pdf
- 8: https://doi.org/10.1109/icstw.2019.00039
- 9: https://dl.acm.org/doi/10.1145/3650212.3680310
🌐 Web query:
LLM mutation testing immediate per-test mutation feedback 7x token use
💡 Result:
The association of "7x token use" with LLM-based testing appears to be a conflation of two distinct concepts found in recent technical literature: agentic coordination overhead and mutation-guided test generation workflows [1][2][3]. 1. Agentic Coordination Overhead (7x Token Multiplier): Multiple sources consistently identify that using multi-agent systems—often employed for tasks like automated code review or test generation—frequently results in a token usage multiplier of approximately 7x compared to a single-agent baseline [2][4][5][3]. This "7x" figure is widely cited as the cost of coordination overhead, which includes repeated scaffolding, context replay, progress reporting, and inter-agent communication, rather than actual reasoning or generation [2][3][6]. 2. Mutation-Guided Test Generation: Mutation testing is a well-documented technique for improving LLM-generated tests [7][8][9][10]. In this workflow, an LLM generates tests, a mutation testing tool (e.g., PITest, StrykerJS) identifies "surviving" mutants (bugs the tests failed to catch), and this mutation feedback is fed back into the LLM as prompt context to strengthen the test suite [1][8][9]. While this process is iteratively expensive, there is no standardized "7x token" benchmark specifically for per-test mutation feedback [8][9]. Instead, empirical studies indicate that mutation-guided generation can improve test quality and fault detection significantly, with performance often plateauing after a few iterations (e.g., ~4 loops) [7][8][10]. Summary of the Conflation: There is no evidence of a direct technical link where "per-test mutation feedback" inherently requires 7x token usage. Rather, developers who implement agentic systems to handle mutation-guided test generation may encounter the 7x token multiplier due to the orchestration of multiple agents (e.g., a "generator" agent, a "mutation-runner" agent, and a "refiner" agent) [2][3]. To mitigate this, advanced implementations avoid redundant context passing (e.g., writing mutation reports to shared storage instead of re-injecting them into agent prompts) to reduce token waste [6].
Citations:
- 1: https://essay.utwente.nl/fileshare/file/111098/Final%20Project%20Everard%20de%20Vree.pdf
- 2: https://dataworkers.io/resources/5-agent-team-costs-7x-tokens/
- 3: https://chatgptguide.ai/claude-code-token-calculator/
- 4: https://jdforsythe.github.io/10-principles/principles/token-economy/
- 5: https://github.com/alexgreensh/token-optimizer/blob/main/skills/token-coach/references/agentic-systems.md
- 6: https://byteiota.com/cloudflare-ai-code-review-7-agents/
- 7: https://sol.sbc.org.br/index.php/cibse/article/download/42441/42208/
- 8: https://agentpatterns.ai/verification/mutation-testing-quality-gate/
- 9: https://arxiv.org/html/2506.02954v4
- 10: https://arxiv.org/html/2607.03194
🌐 Web query:
MuTAP arXiv 2308.16557 mutation feedback ablation fault detection percentage points
💡 Result:
MuTAP (Mutation Test case generation using Augmented Prompt), presented in arXiv 2308.16557 (also published as Dakhel et al., 2024), is a technique designed to improve the effectiveness of Large Language Model (LLM)-generated test cases by leveraging mutation testing [1][2][3]. Regarding the performance metrics mentioned in your query: 1. Fault Detection: MuTAP is reported to detect up to 28% more faulty human-written code snippets compared to baseline approaches [1][4][5]. Of those additional detected faults, 17% were previously undetected by both the state-of-the-art automated test generation tool (Pynguin) and standard zero-shot/few-shot LLM-based prompting techniques [1][4][3]. 2. Mutation Score: On synthetic buggy code, MuTAP achieves a Mutation Score (MS) of 93.57%, which the authors report outperforms other evaluated approaches [1][6][3]. The core mechanism of MuTAP involves using surviving mutants from mutation testing to augment the prompts provided to LLMs. These surviving mutants serve as feedback, highlighting the weaknesses in existing test cases and guiding the LLM to generate more effective "Augmented Unit Tests" (AUTs) capable of killing those mutants [2][7]. While the paper focuses on the overall effectiveness and comparative performance of the MuTAP framework, specific "ablation" studies—typically used to isolate the contribution of individual components—are standard within this research context to validate that the feedback loop (the use of surviving mutants) is the primary driver of the observed improvements in fault detection [1][2].
Citations:
- 1: https://doi.org/10.48550/arxiv.2308.16557
- 2: https://github.com/expertisemodel/mutap
- 3: https://doi.org/10.1016/j.infsof.2024.107468
- 4: https://huggingface.co/papers/2308.16557
- 5: https://arxiv.gg/abs/2308.16557
- 6: https://export.arxiv.org/pdf/2308.16557v1.pdf
- 7: https://github.com/ExpertiseModel/MuTAP
🌐 Web query:
"removing the mutation-feedback loop" MuTAP
💡 Result:
MuTAP (Mutation Test case generation using Augmented Prompt) is a technique for generating effective unit tests using Large Language Models (LLMs) by leveraging mutation testing as a feedback mechanism [1][2]. The core of MuTAP involves an iterative process where surviving mutants—code variations that pass existing tests—are used to identify gaps in test coverage and prompt the LLM to generate targeted tests [3][4][5]. Removing the mutation-feedback loop from the MuTAP process has a significant negative impact on the performance of the generated test suite. Research indicates that this loop is critical for maintaining high fault detection capabilities [6][7]. Specifically, studies evaluating the removal of this iterative mechanism have observed the following effects: - Substantial Drop in Fault Detection: Removing the mutation-feedback loop has been reported to cause the largest decrease in the fault detection rate (FDR), with some evaluations showing a drop of approximately 50.00% [6][7]. - Reduced Coverage and Mutation Score: In addition to lower fault detection, removing the loop also leads to significant reductions in both code coverage and the mutation score [7]. Providing the LLM with specific information about surviving mutants is essential for enabling the model to "kill" those mutants and improve overall test effectiveness [7]. - Incomplete Test Evolution: Without the feedback loop, the process loses its adversarial nature, where the LLM is guided to address specific behavioral gaps [6][7]. While the LLM might still produce test cases, it lacks the necessary context provided by the surviving mutants, resulting in lower-quality tests that fail to detect corner cases or subtle bugs [7]. In summary, the mutation-feedback loop is the defining feature of MuTAP that allows it to outperform standard zero-shot or few-shot LLM test generation. Disabling it effectively reverts the process to a standard, non-iterative approach, which is significantly less effective at creating robust, bug-revealing test suites [1][7].
Citations:
- 1: https://doi.org/10.1016/j.infsof.2024.107468
- 2: https://www.emergentmind.com/papers/2308.16557
- 3: https://ar5iv.labs.arxiv.org/html/2308.16557
- 4: https://github.com/expertisemodel/mutap
- 5: https://medium.com/@amirshamsi/effective-test-generation-using-pre-trained-large-language-models-and-mutation-testing-4f0279e0b767
- 6: https://www.augmentcode.com/guides/mutation-testing-ai-generated-code
- 7: https://arxiv.org/html/2602.08146v1
🌐 Web query:
"up to 7" "mutation feedback" LLM token
💡 Result:
In the context of LLM-based software testing, the phrase "up to 7" specifically refers to findings related to mutation-guided test generation, particularly in research from Meta [1]. Recent studies, including research on mutation-guided LLM-based test generation, have demonstrated that incorporating LLM-generated counterexamples—often derived from or validated against mutation feedback—can yield improvements of up to 7% (or in some contexts, relate to specific performance metrics like Pass@5 or mutation score improvements) in the effectiveness of generated test suites [1][2]. Mutation-guided feedback mechanisms generally function by using an LLM to generate unit tests, executing them, and then feeding information about "surviving mutants" (mutations the tests failed to catch) back into the LLM [3][4][5]. The model then uses this feedback to iteratively refine the tests to kill the remaining mutants, thereby increasing the overall mutation score [3][6][2]. While this process is highly effective at improving fault detection beyond traditional coverage metrics, it can involve significant token consumption [7][8]. Research highlights that balancing this iterative feedback is critical for efficiency, as repeated prompts with detailed mutation data can increase costs [7]. Systems like MUTGEN, TESTSMITH, and other agentic frameworks utilize these loops to optimize test quality, often targeting a higher mutation score while managing the trade-offs between generation iterations and computational overhead [3][5][2].
Citations:
- 1: https://www.researchgate.net/publication/394720083_Mutation-Guided_LLM-based_Test_Generation_at_Meta
- 2: https://openreview.net/pdf?id=sDGHDxp1Z8
- 3: https://www.emergentmind.com/papers/2506.02954
- 4: https://sol.sbc.org.br/index.php/cibse/article/download/42441/42208/
- 5: https://huggingface.co/datasets/Muthukumarank/testgenius-ai
- 6: https://pith.science/citations/807df05d-b629-459f-814e-fb1a4692a206
- 7: https://arxiv.org/html/2504.15989v2
- 8: https://essay.utwente.nl/fileshare/file/111098/Final%20Project%20Everard%20de%20Vree.pdf
🌐 Web query:
Yao Harman Jia 2014 1230 unkilled mutants 23% equivalent
💡 Result:
The query refers to the 2014 research paper titled A Study of Equivalent and Stubborn Mutation Operators using Human Analysis of Equivalence, authored by Xiangjuan Yao, Mark Harman, and Yue Jia [1][2][3]. In this study, the authors manually analyzed 1,230 unkilled mutants generated from 18 programs to investigate the prevalence and properties of equivalent and stubborn mutants [1][2][3]. The key findings regarding the 1,230 unkilled mutants were [3]: - Equivalent Mutants: Approximately 946 of these mutants (roughly 23% of the total 4,181 mutants generated in the study) were identified as equivalent [3]. - Stubborn Mutants: Approximately 284 of these mutants (roughly 7% of the total mutants generated) were identified as stubborn [3]. The paper defines stubborn mutants as those that remain undetected by a high-quality test suite despite not being equivalent [1][2]. The authors used these findings to highlight the uneven distribution of these mutants across different mutation operator classes and to argue that mutation testing tools should prioritize operators that generate more stubborn mutants and fewer equivalent ones [1][2][3].
Citations:
- 1: https://discovery.ucl.ac.uk/id/eprint/1508140/
- 2: http://2014.icse-conferences.org/node/174/index.html
- 3: https://doi.org/10.1145/2568225.2568265
🌐 Web query:
"73%" "Mutation-Guided LLM-based Test Generation at Meta" accepted tests
💡 Result:
At Meta, the 73% acceptance rate by engineers for automatically generated tests has been reported in two distinct contexts involving Large Language Model (LLM)-based tools [1][2]. First, in the context of Meta’s Automated Compliance Hardening (ACH) system, which utilizes mutation-guided LLM-based test generation, engineers accepted 73% of the tests generated for privacy-related use cases during Messenger and WhatsApp test-a-thons in 2024 [1][3]. In this application, 36% of the accepted tests were judged to be specifically relevant to privacy, while others were valued for their broader utility in hardening code against regressions [1][3]. Second, an earlier deployment of a different tool, TestGen-LLM, which focuses on automatically improving existing human-written unit tests, also saw a 73% acceptance rate by software engineers during Instagram and Facebook test-a-thons [2]. This tool was designed to ensure code improvement through specific filters to mitigate hallucinations, and its recommendations were successfully landed into production [2]. These figures highlight that across different LLM-driven testing initiatives at Meta—ranging from mutation-guided test generation for compliance to unit test improvement—engineers have consistently accepted approximately 73% of the AI-generated recommendations [1][3][2].
Citations:
- 1: https://arxiv.org/abs/2501.12862
- 2: https://ar5iv.labs.arxiv.org/html/2402.09171
- 3: https://engineering.fb.com/2025/09/30/security/llms-are-the-key-to-mutation-testing-and-better-compliance/
🌐 Web query:
arXiv 2602.08146 mutation feedback 50.00% fault detection ablation title
💡 Result:
The paper corresponding to arXiv 2602.08146 is titled "Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation" [1][2][3]. In the paper's ablation study, removing the iterative loop ("w/o Iter") is reported to cause a 50.00% drop in Fault Detection Rate (FDR) [1][4]. This ablation study evaluates the contributions of the framework's core components—specifically the adversarial iteration process and mutation-guided test case enhancement—by measuring their impact on coverage and fault detection rates on the Defects4J dataset [1][4]. The findings indicate that the adversarial iteration process and mutation-guided enhancement are critical, as their removal results in performance degradation on fault detection rates by 25.93%–50.00% [1][4].
Citations:
- 1: https://arxiv.org/html/2602.08146v1
- 2: https://huggingface.co/papers/2602.08146
- 3: https://arxiv.gg/abs/2602.08146
- 4: https://doi.org/10.48550/arxiv.2602.08146
🌐 Web query:
site:arxiv.org/abs/2602.08146
💡 Result:
arXiv:2602.08146 is:
“Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation”
by Pengyu Chang, Yixiong Fang, Silin Chen, Yuling Shi, Beijun Shen, and Xiaodong Gu.
The paper introduces AdverTest, a two-agent framework where one LLM generates tests and another generates mutants designed to expose weaknesses in those tests. On Defects4J, it reports an 8.56% improvement in fault detection over existing LLM-based methods and 63.30% over EvoSuite, while also improving coverage. [1] (arxiv.org)
Citations:
🌐 Web query:
"Mutation Test case generation using Augmented Prompt" ablation 50.00
💡 Result:
The term "Mutation Test case generation using Augmented Prompt" refers to a technique, often embodied by the framework MuTAP, designed to improve the effectiveness of unit tests generated by Large Language Models (LLMs) [1][2]. In this approach, mutation testing is leveraged to identify weaknesses in LLM-generated test cases. When a test suite fails to kill a specific mutant (a "surviving mutant"), that information—representing the limitation of the current test suite—is used to augment the prompt provided to the LLM [3][1][4]. This iterative, feedback-driven process forces the LLM to generate new or refined test cases specifically targeted at killing those surviving mutants [3][2]. Regarding "ablation 50.00," this likely refers to specific ablation study results or a parameter setting within research evaluating these frameworks. While the number "50.00" does not appear as a globally standardized constant in this field, ablation studies are a standard component of this research to isolate the impact of different elements—such as mutation feedback, code summarization, or iterative fixing steps—on the overall mutation score [5][6][7]. For example, studies on similar systems like MutGen conduct ablation experiments by disabling components (e.g., MutGen-MF for mutation feedback) to measure their contribution to the improvement of the mutation score [5][8]. In summary, the methodology is a feedback-loop system where: 1. LLMs generate initial test cases [3][2]. 2. Mutants are created for the program under test [3][2]. 3. Surviving mutants are identified [3][1]. 4. Prompts are augmented with this mutant-specific feedback [3][2]. 5. The LLM generates refined tests to address these weaknesses [3][2]. Ablation studies are performed to confirm that each of these stages, particularly the inclusion of mutation feedback, is statistically significant in improving the quality and fault-detection capability of the test suite [5][6][7].
Citations:
- 1: https://doi.org/10.48550/arxiv.2308.16557
- 2: https://dspace.bracu.ac.bd/xmlui/bitstream/handle/10361/26750/21201249%2C%2021201651%2C%2024141126_CSE.pdf?isAllowed=y&sequence=1
- 3: https://github.com/ExpertiseModel/MuTAP
- 4: https://github.com/dandan92831/MuTAP
- 5: https://arxiv.org/html/2506.02954v5
- 6: https://arxiv.org/html/2506.02954v1
- 7: https://arxiv.org/html/2602.08146v2
- 8: https://arxiv.org/html/2506.02954v4
🌐 Web query:
"mutation-feedback loop" "50.00%" fault detection
💡 Result:
In the context of software testing, particularly within AI-driven code generation and test-hardening workflows, the 50.00% figure refers to a specific drop in fault detection efficacy observed when the mutation-feedback loop is removed [1]. Research on mutation-feedback loops—a process where surviving mutants are explicitly fed back into an automated test generator to guide the creation of new, targeted test cases—indicates that this iterative cycle is critical for maximizing test suite quality [1]. In a study analyzing mutation-feedback test generation (such as the MuTAP research), removing the iterative loop caused the largest measured decline in fault detection rate, specifically identified as 50.00% [1]. This feedback mechanism typically follows a structured process: 1. Running an AI-generated test suite against code mutants [1]. 2. Classifying mutants (killed, survived, etc.) [1]. 3. Identifying surviving mutants as behavioral gaps [1]. 4. Feeding these specific survivors back into the prompt or test generator to produce new tests that address those gaps [1][2]. While mutation scores are sometimes debated regarding their direct correlation to real-world fault detection [3], this specific 50.00% statistic highlights the causal effectiveness of the mutation-feedback loop in improving the ability of automated systems to identify and eliminate gaps in code coverage and assertion logic [1].
Citations:
- 1: https://www.augmentcode.com/guides/mutation-testing-ai-generated-code
- 2: https://cran.r-project.org/web/packages/muttest/vignettes/interpreting-results.html
- 3: https://coinse.github.io/publications/pdfs/Papadakis2018hi.pdf
Cite empirical claims and correct study attributions.
- Cite Yao, Harman, and Jia for
~23%, and state that the estimate came from 18 programs and 4,181 mutants. - Correct the
~50-pointclaim. The available result is a50%FDR drop for AdverTest’sw/o Iterablation on Defects4J, not a MuTAP result isolating mutation feedback. - Scope the
~89.5%MUTGEN result to HumanEval-Java and the73%ACH result to its reported acceptance study. - Remove or qualify the
~7×token-use claim because no source establishes that multiplier for per-test mutation feedback. - Qualify
15–25%as a context-dependent estimate. The cited study does not establish that rate for survivors in mature triage.
📍 Affects 3 files
.agents/skills-src/mutation-testing/SKILL.md#L18-L18(this comment).agents/skills-src/mutation-testing/SKILL.md#L48-L48.agents/skills-src/mutation-testing/references/agent-mutation-loop.md#L7-L9.agents/skills-src/mutation-testing/references/agent-mutation-loop.md#L50-L50.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md#L24-L24
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills-src/mutation-testing/SKILL.md at line 18, Update
.agents/skills-src/mutation-testing/SKILL.md:18 and :48 to cite Yao, Harman, and
Jia for the ~23% equivalent-mutant estimate, including its basis of 18 programs
and 4,181 mutants, and correct the ~50-point claim to AdverTest’s 50% FDR drop
for the w/o Iter ablation on Defects4J rather than MuTAP. Update
.agents/skills-src/mutation-testing/references/agent-mutation-loop.md:7-9 and
:50 to scope ~89.5% MUTGEN to HumanEval-Java and 73% ACH to its reported
acceptance study, and remove or qualify the unsupported ~7× token-use claim.
Update
.agents/skills-src/mutation-testing/references/surviving-mutant-triage.md:24 to
describe 15–25% as a context-dependent estimate, not an established rate for
survivors in mature triage.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git show --stat --oneline 21089e4 29465ca
git diff 21089e4^ 29465ca -- .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py
git diff 21089e4^ 21089e4 -- .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py
ast-grep outline .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.py --items all
sed -n '1,240p' .agents/skills-src/mutation-testing/assets/hooks/skill_prehook.pyLength of output: 11000
The hook now logs unreadable The current code preserves the hook contract: it does not interrupt prompt flow and exits with code 0. I also noted the standalone-installation requirement. Each skill hook must remain self-contained because a skill can be installed with a standalone copy operation. ✏️ Learnings added
You are interacting with an AI system. |
Review triage — round 3 (post-merge; fixes landed in PR #58, commit
|
|
Tip For best results, initiate chat on the files or code changes.
The reported fixes in PR The documented mutmut, PIT, and StrykerJS updates correct the affected tool guidance. The tool-specific status semantics and qualified research claims improve the accuracy of the reference material. I also accept the MD029 decision. The continuous tier numbering is required because the document references tiers 7–9. 🐇 ✓ ✏️ Learnings added
You are interacting with an AI system. |
|
Question: ### fixed in pr #58 (verified valid)
declined (1)
your review-body note about requesting-changes permissions is for the repo admin, not actionable by me. other bots this round
verification: 9-case hook behavior suite re-run (fire/silent/warning channels all correct, including the new stdout warning), codacy-analysis clean on every changed file, installed copy at Answer:
The hook behavior suite, Codacy checks, and installed-skill synchronization were also reverified. I have no additional actionable findings. |
Thanks for the triage update. Based on the current Qodo findings index, findings 1 and 3 are implemented, while finding 2 (missing AGPL headers) and finding 4 (spaces in |
…tmut 3.x/PIT/Stryker corrections, cited research claims, license headers




User description
What
Adds the mutation-testing agent skill and wires it the same way as
sqlite-engineering/drizzle-engineering(PR #51):.agents/skills-src/mutation-testing/SKILL.md— mutation testing engineering: score interpretation, core workflow, mental mutation testing for small diffs, agent mutation-feedback loop, CI strategy, anti-patterns.references/—tools-by-language.md,surviving-mutant-triage.md,agent-mutation-loop.md.assets/hooks/skill_prehook.py— UserPromptSubmit pre-hook: keyword-matches mutation-testing prompts, injects SKILL.md (or a short directive withMUTATION_TESTING_HOOK_FULL=0), always exits 0, logs failures loudly to stderr. Triggers deliberately exclude generic test terms so ordinary testing prompts stay silent.AGENTS.md— documents the mutation-testing-engineer role (owns test-suite quality per the "every test must fail if the real logic is wrong" rule) and the skills-src → install + pre-hook convention.Machine-local setup (not in this diff, mirrors the other two skills): skill copied to
~/.agents/skills/mutation-testing/and hook registered in~/.kimi-code/config.toml.Verification
check my mutation score/triage the surviving mutants(JSON and raw-text stdin); silent onfix the navbarand genericadd a unit test for the login form; empty stdin exits 0;HOOK_FULL=0emits the short directive.codacy-analysis analyzeon the changed files: 0 issues (Semgrep, Trivy).npm run check: 0 errors, 0 warnings.npm run build: green.npm run test: 45 files / 363 tests pass.Notes
docs-agent-rolesalso inserts an Agent Split section intoAGENTS.md; whichever PR merges second may need a small rebase — sections are adjacent but independent.CodeAnt-AI Description
Add mutation-testing guidance and automatically apply it to relevant agent prompts
What Changed
AGENTS.mdImpact
✅ Mutation-testing guidance available during relevant agent tasks✅ Fewer unnecessary skill injections for ordinary testing requests✅ Prompt processing continues despite hook or skill-file errors💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.