fix(review): catch loosened-input consumers and stale user-facing strings

The Enum & Value Completeness check fired only on newly added values, so a
diff that widens what a validator, parser or guard accepts, and breaks an
unchanged downstream consumer outside the diff, was a blind spot. Widen the
check's trigger (heading unchanged) and add a consumer-grep bullet. Teach
the maintainability specialist to flag user-facing strings whose guarding
condition changed while the text did not.

Adopts #2141 (rewritten on current main; the section heading is kept).

Co-authored-by: Arno V <38716+aversini@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
committed 2026-10-08 06:21:11 +00:00
1 parent f4ea24ed55
commit c25bcb2f16
3 files changed
+13 -1

No files matched your search

+10
View File
@@ -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