From ee2754a9917599553400ae7ce232b1c17994bbdd Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Thu, 20 Aug 2026 18:55:27 +0800 Subject: [PATCH 1/3] fix(autofix): mutation-probe new guards before a round commits Provenance analysis of six multi-round takeover PRs found roughly a third of post-initial review findings were introduced by the immediately preceding fix round, and the dominant shape was guards and branches added with no test of their own: the deterministic gate re-runs only the tests that exist, so an unwitnessed guard passes every gate and its hole resurfaces as a new finding in a later round. Require the agent to prove each newly added guard or branch kills a test (mutation probe) before committing, and record the probe in the round summary. --- .qwen/skills/autofix/SKILL.md | 10 ++++++++++ scripts/tests/qwen-autofix-workflow.test.js | 1 + 2 files changed, 11 insertions(+) diff --git a/.qwen/skills/autofix/SKILL.md b/.qwen/skills/autofix/SKILL.md index 8adb08d5e4f..4bc5b4a537b 100644 --- a/.qwen/skills/autofix/SKILL.md +++ b/.qwen/skills/autofix/SKILL.md @@ -138,6 +138,16 @@ dispositions, changed files, checks actually run, and remaining blocker. just moves the rejection later and wastes the round. Record the exact commands you ran and their results in your summary (see the per-mode outcomes); a bare "verified" without them is not acceptable. +- Every guard, branch, or behavior a round's commits add needs its OWN witness + in the tests the round commits. Verify with a mutation probe before + committing: temporarily remove or negate the new guard or branch, re-run the + focused tests that should catch it, and confirm they FAIL; then restore it + and re-run to green. If the suite stays green with your guard deleted, the + guard has no coverage — write a test that pins it (or drop the guard) + instead of shipping it: the deterministic gate re-runs only the tests that + exist, so an unwitnessed guard passes every gate and its hole resurfaces as + a new finding in a later round. Record each probe and its result in your + summary alongside the verification commands. - Regenerate committed generated artifacts when you change their source. If you edit `packages/cli/src/config/settingsSchema.ts` (or `settings.ts`), run `npm run generate:settings-schema` and commit the regenerated diff --git a/scripts/tests/qwen-autofix-workflow.test.js b/scripts/tests/qwen-autofix-workflow.test.js index 44d883b9671..164a56f26fe 100644 --- a/scripts/tests/qwen-autofix-workflow.test.js +++ b/scripts/tests/qwen-autofix-workflow.test.js @@ -10287,6 +10287,7 @@ exit 1 'Do not push, comment, create pull requests', 'Operate only in the workflow', 'Run required verification commands before committing', + 'Verify with a mutation probe before', '.qwen/skills/prepare-pr/SKILL.md', '.qwen/skills/bugfix/SKILL.md', '.qwen/skills/e2e-testing/SKILL.md', From 6f9d9a648a56c2803cece59c56d6702fb0f3dddc Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Thu, 20 Aug 2026 19:54:21 +0800 Subject: [PATCH 2/3] fix(autofix): pin the mutation-probe mandate, not just its intro The original pin stopped at the preposition "before", so a future edit that kept the intro phrase but gutted the remove/confirm-FAIL/ restore procedure would leave the contract test green. Pin both halves of the mandate. Mutation-verified: gutting the mandate in SKILL.md now fails the skill contract test. --- scripts/tests/qwen-autofix-workflow.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tests/qwen-autofix-workflow.test.js b/scripts/tests/qwen-autofix-workflow.test.js index 164a56f26fe..841522ecc7f 100644 --- a/scripts/tests/qwen-autofix-workflow.test.js +++ b/scripts/tests/qwen-autofix-workflow.test.js @@ -10288,6 +10288,8 @@ exit 1 'Operate only in the workflow', 'Run required verification commands before committing', 'Verify with a mutation probe before', + 'temporarily remove or negate the new guard or branch', + 'and confirm they FAIL; then restore it', '.qwen/skills/prepare-pr/SKILL.md', '.qwen/skills/bugfix/SKILL.md', '.qwen/skills/e2e-testing/SKILL.md', From 7353fb5df2088a6b40d3664cdf040fe9b1a965a2 Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Thu, 20 Aug 2026 21:22:06 +0800 Subject: [PATCH 3/3] fix(autofix): also pin the mutation-probe remediation clause The procedure pins cover what the probe does, but not what to do when it exposes an unwitnessed guard: dropping the remediation sentence ("write a test that pins it (or drop the guard)") left the whole suite green while the rule told the agent to probe without a verdict path. Pin the remediation clause too; mutation-verified. --- scripts/tests/qwen-autofix-workflow.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/tests/qwen-autofix-workflow.test.js b/scripts/tests/qwen-autofix-workflow.test.js index 841522ecc7f..664589d12b5 100644 --- a/scripts/tests/qwen-autofix-workflow.test.js +++ b/scripts/tests/qwen-autofix-workflow.test.js @@ -10290,6 +10290,7 @@ exit 1 'Verify with a mutation probe before', 'temporarily remove or negate the new guard or branch', 'and confirm they FAIL; then restore it', + 'write a test that pins it (or drop the guard)', '.qwen/skills/prepare-pr/SKILL.md', '.qwen/skills/bugfix/SKILL.md', '.qwen/skills/e2e-testing/SKILL.md',