Files
RingBRP/tools
slaguru666andClaude Opus 5 0de463c470 check-cited: make the regex match its own error message, and name the right lines
Two residual defects in the marker check added at 4d7d93a, both found by the
peer session that found the original.

1. THE REGEX WAS LOOSER THAN ITS DOCUMENTATION. The failure text has always
   promised the comment must follow its figure "immediately, with nothing but
   markup between", but CITE's separators were \s*, which spans newlines — so
   a marker on the line after its number resolved and was checked, contrary to
   the stated rule. Tightened to [ \t] throughout.

   Verified safe before changing it: matched under the loose pattern 25, under
   the tight pattern 25, so no citation in CLEAN GROUND relies on crossing a
   newline. There is no finding in the document.

2. THE OFFENDER REPORT WAS RIGHT ABOUT THE COUNT AND WRONG ABOUT THE LINES.
   It filtered line by line, so a valid cross-line citation was printed as an
   offender whenever some other marker was genuinely unread — a maintainer
   told "line 15 is broken" would have edited a working citation. That is the
   headline defect fixed an hour ago one level down: correct verdict, wrong
   reason.

   Offenders are now located by position across the whole text, so the lines
   named are exactly the markers no CITE match covers. This is the fix that
   matters independently of the regex: a marker spanning lines would still be
   counted once by ANY_CITE and named nowhere, so tightening alone leaves a
   narrower version of the same bug, and position-based reporting stays
   correct if anyone ever loosens the separator again.

Placement battery, exit codes read directly: clean tree OK 25 no false
positive; one word between number and marker fails; bare marker alone fails;
two on a line with one attached fails naming only the unattached; cross-line
now fails rather than silently passing.

Three iterations of this guard, three variants of one defect — a marker or a
message that exists and is not read — and all three were found by the session
that did not write it.

npm run check: 16 guards, exit 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 10:29:45 +01:00
..
2026-08-30 21:34:37 +01:00