diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index ff95a7910..f3519075f 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -554,10 +554,10 @@ Preserve the initial charters under **Charters** after that metadata, before fin Each proposed test carries a value card; propose it only when it passes this bar: -**Test value bar.** Before writing the test (the reproduced bug answers what it protects and what makes it fail): +**Test value bar.** Before writing or proposing a test, the reproduced bug already answers what it protects and what makes it fail; also answer: -3. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate. -4. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead. +1. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate. +2. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead. Value card: `Value: protects=<...>; fails_when=<...>; why_new=<...>; seam=none` (seam: `none` or its name); each field at most 160 UTF-8 bytes here (clamp to 157 plus `...`; JSON keeps full values). Put it in the 8e.5 record (/qa) or under each proposed test (/qa-only). A missing upstream card never blocks: derive it; ignore unknown fields. diff --git a/qa/SKILL.md b/qa/SKILL.md index ef409b146..82e992062 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -643,10 +643,10 @@ and unclear contracts never authorize repair. ### 8a.5. Regression test before repair -**Test value bar.** Before writing the test (the reproduced bug answers what it protects and what makes it fail): +**Test value bar.** Before writing or proposing a test, the reproduced bug already answers what it protects and what makes it fail; also answer: -3. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate. -4. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead. +1. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate. +2. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead. Value card: `Value: protects=<...>; fails_when=<...>; why_new=<...>; seam=none` (seam: `none` or its name); each field at most 160 UTF-8 bytes here (clamp to 157 plus `...`; JSON keeps full values). Put it in the 8e.5 record (/qa) or under each proposed test (/qa-only). A missing upstream card never blocks: derive it; ignore unknown fields. diff --git a/scripts/resolvers/test-value.ts b/scripts/resolvers/test-value.ts index b158b2578..4379ecbf3 100644 --- a/scripts/resolvers/test-value.ts +++ b/scripts/resolvers/test-value.ts @@ -118,8 +118,8 @@ const EXAMPLE_CARD = renderValueCard({ const EXAMPLE_REJECTED = 'Rejected (covered_elsewhere): "checkout renders"; checkout.e2e.ts:15 covers it, so extend that test.'; function questionList(mode: TestValueBarMode): string { - const numbered = QUESTIONS.map((question, index) => `${index + 1}. ${question}`); - return mode === 'qa' ? numbered.slice(2).join('\n') : numbered.join('\n'); + const questions = mode === 'qa' ? QUESTIONS.slice(2) : QUESTIONS; + return questions.map((question, index) => `${index + 1}. ${question}`).join('\n'); } function cardRules(mode: TestValueBarMode): string { @@ -154,7 +154,7 @@ export function generateTestValueBar(_ctx: TemplateContext, args?: string[]): st const mode = args?.[0] as TestValueBarMode; if (!TEST_VALUE_BAR_MODES.includes(mode)) throw new Error(MESSAGES.unknownMode.message.replace('', String(args?.[0]))); const parts = [ - `**Test value bar.** ${mode === 'qa' ? 'Before writing the test (the reproduced bug answers what it protects and what makes it fail):' : 'Propose or write a test only with all four answers; otherwise extend an existing test or drop it:'}`, + `**Test value bar.** ${mode === 'qa' ? 'Before writing or proposing a test, the reproduced bug already answers what it protects and what makes it fail; also answer:' : 'Propose or write a test only with all four answers; otherwise extend an existing test or drop it:'}`, questionList(mode), cardRules(mode), ];