diff --git a/review/checklist.md b/review/checklist.md index 7692f35ec..df8df99ba 100644 --- a/review/checklist.md +++ b/review/checklist.md @@ -61,10 +61,11 @@ Be terse. For each issue: one line describing the problem, one line with the fix - `eval()` / `exec()` on LLM-generated code without sandboxing #### Enum & Value Completeness -When the diff introduces a new enum value, status string, tier name, or type constant: +When the diff introduces a new enum value, status string, tier name, or type constant, or loosens what an input accepts (a new MIME type, extension or flag, or a widened validator/parser/guard): - **Trace it through every consumer.** Read (don't just grep — READ) each file that switches on, filters by, or displays that value. If any consumer doesn't handle the new value, flag it. Common miss: adding a value to the frontend dropdown but the backend model/compute method doesn't persist it. - **Check allowlists/filter arrays.** Search for arrays or `%w[]` lists containing sibling values (e.g., if adding "revise" to tiers, find every `%w[quick lfg mega]` and verify "revise" is included where needed). - **Check `case`/`if-elsif` chains.** If existing code branches on the enum, does the new value fall through to a wrong default? +- **Loosened acceptance breaks unchanged consumers.** Grep every consumer of the same field and confirm each handles the newly accepted shape; the broken code is usually outside the diff. To do this: use Grep to find all references to the sibling values (e.g., grep for "lfg" or "mega" to find all tier consumers). Read each match. This step requires reading code OUTSIDE the diff. ### Pass 2 — INFORMATIONAL diff --git a/review/specialists/maintainability.md b/review/specialists/maintainability.md index 15e927017..285ff916c 100644 --- a/review/specialists/maintainability.md +++ b/review/specialists/maintainability.md @@ -27,6 +27,7 @@ If no findings: output `NO FINDINGS` and nothing else. - TODO/FIXME comments that reference completed work - Docstrings with parameter lists that don't match the current function signature - ASCII diagrams in comments that no longer match the code flow +- User-facing strings (errors, toasts, labels) whose guarding condition changed in this diff while the text did not ### Duplicated Behavior with Defects - Divergent copies that produce a demonstrated incorrect result, miss required error handling, or violate the same contract diff --git a/test/skill-validation.test.ts b/test/skill-validation.test.ts index de760dee6..06e8f9d08 100644 --- a/test/skill-validation.test.ts +++ b/test/skill-validation.test.ts @@ -939,6 +939,16 @@ describe('Enum & Value Completeness in review checklist', () => { expect(checklist).toContain('allowlist'); }); + test('Enum & Value Completeness covers loosened input acceptance and stale user-facing strings', () => { + const start = checklist.indexOf('#### Enum & Value Completeness'); + const section = checklist.slice(start, checklist.indexOf('### Pass 2', start)); + expect(section).toContain('loosens what an input accepts'); + expect(section).toContain('Loosened acceptance breaks unchanged consumers'); + const maintainability = fs.readFileSync(path.join(ROOT, 'review', 'specialists', 'maintainability.md'), 'utf-8'); + const stale = maintainability.slice(maintainability.indexOf('### Stale Comments & Docstrings')); + expect(stale.slice(0, stale.indexOf('\n### ', 5))).toContain('User-facing strings (errors, toasts, labels) whose guarding condition changed'); + }); + test('Enum & Value Completeness is in the severity classification as CRITICAL', () => { const gateSection = checklist.slice(checklist.indexOf('## Severity Classification')); // The ASCII art has CRITICAL on the left and INFORMATIONAL on the right