diff --git a/qa/SKILL.md.tmpl b/qa/SKILL.md.tmpl index 391102800..b2451924c 100644 --- a/qa/SKILL.md.tmpl +++ b/qa/SKILL.md.tmpl @@ -238,19 +238,12 @@ Healthy-contract commits use `test(qa): regression test for {contract}`. ### 8f. Self-Regulation (STOP AND EVALUATE) -Every 5 fixes (or after any revert), compute the WTF-likelihood: +Every 5 fixes (or after any revert), judge the WTF-likelihood: is the loop now doing +more harm than good? Reverts, edits to unrelated files, fixes spanning many files, a +long run of fixes, and a queue of only Low issues all raise it. -``` -WTF-LIKELIHOOD: - Start at 0% - Each revert: +15% - Each fix touching >3 files: +5% - After fix 15: +1% per additional fix - All remaining Low severity: +10% - Touching unrelated files: +20% -``` - -**If WTF > 20%:** STOP immediately. Show the user what you've done so far. Ask whether to continue. +**If it is high** (two reverts or one unrelated-file edit is enough): STOP immediately. +Show the user what you've done so far. Ask whether to continue. **Hard cap: 50 fixes.** After 50 fixes, stop regardless of remaining issues. diff --git a/test/helpers/carve-guards.ts b/test/helpers/carve-guards.ts index 0a1febe8e..a27fbed59 100644 --- a/test/helpers/carve-guards.ts +++ b/test/helpers/carve-guards.ts @@ -649,7 +649,7 @@ do not launch the downstream skill or open a browser.`, '## Phase 7: Triage', '## Phase 8: Fix Loop', '8e.5. Regression Test', - 'WTF-LIKELIHOOD', + '### 8f. Self-Regulation', '## Additional Rules (qa-specific)', '## Output Structure', ], diff --git a/test/qa-browser-preservation.test.ts b/test/qa-browser-preservation.test.ts index 0cd24f262..3d1599ecd 100644 --- a/test/qa-browser-preservation.test.ts +++ b/test/qa-browser-preservation.test.ts @@ -217,7 +217,8 @@ describe('compact QA browser recipes retain native operations', () => { const classification = section('### 8e.', '### 8e.5.'); for (const rule of ['passed 8c', 'native regression when available', 'disclose missing test coverage', "undo only this run's repair", 'revert its commit if already committed', 'retain the valid regression/evidence', '"deferred"', 'Never discard user changes']) expect(classification).toContain(rule); const regulation = section('### 8f.', '## Phase 9:'); - for (const rule of ['Every 5 fixes (or after any revert)', 'WTF > 20%', 'STOP immediately', 'Ask whether to continue', 'Hard cap: 50 fixes']) expect(regulation).toContain(rule); + for (const rule of ['Every 5 fixes (or after any revert)', 'STOP immediately', 'Ask whether to continue', 'Hard cap: 50 fixes']) expect(regulation).toContain(rule); + for (const signal of [/WTF-likelihood/i, /revert/i, /unrelated/i]) expect(regulation).toMatch(signal); expect(source).toContain('When in doubt, stop and ask'); const rules = source.slice(source.indexOf('## Additional Rules')); for (const rule of ['Outside an explicitly approved browser bootstrap', 'Only create tests through authorized codification in Phase 8a.5', 'Never modify CI configuration or weaken existing tests', 'use new native test files']) expect(rules).toContain(rule); diff --git a/test/skill-validation.test.ts b/test/skill-validation.test.ts index 1401a5d43..ff1faccc7 100644 --- a/test/skill-validation.test.ts +++ b/test/skill-validation.test.ts @@ -1247,7 +1247,7 @@ describe('Phase 8e.5 regression test generation', () => { const content = fs.readFileSync(path.join(ROOT, 'qa', 'SKILL.md'), 'utf-8'); expect(content).toContain('8e.5. Regression Test'); expect(content).toContain('test(qa): regression test'); - expect(content).toContain('WTF-likelihood exclusion'); + expect(content).toMatch(/test-only commits do not count/i); }); test('qa/SKILL.md Rule 13 is amended for regression tests', () => {