Repository navigation
Count bare #NNNN issue references in the code-reference check (closes #2997) - #3133
Conversation
Pragmatic Code Review: PR #3133Review TypeINITIAL review. Single commit Requirements Check (issue #2997, plus the scope the user agreed)
I verified these locally. Regex audit. I ran the full pattern set over every scanned file.
Code Review Findings🔴 CriticalNone. 🟡 Improvements1. One real reference is still uncounted, so "no real references missed" is not quite true it('#2088: does not discard a genuinely queued second write when an earlier write fails …', async () => {The The quote exclusion only needs to apply when the number is quoted on both sides: /(?<![\w&#]|Invoice |['"](?=#\d{3,5}['"]))#\d{3,5}\b(?!;)/This keeps Because this PR's stated goal is an honest baseline, I recommend one of two things:
Either way, add 2. With a non-zero baseline, a failure does not say which line tripped it While the baseline was 0, any hit was by definition the new one. At 142, a developer who pushes one extra line gets "143 … up from the 142-reference baseline" and has to find the offender among 140+ lines themselves. This matters more here because the new pattern has known false-positive shapes that would block a push:
I confirmed each of these with a probe. The negative lookahead
🟢 Nits
Architecture / DesignThe change stays scoped to its purpose and follows the ratchet pattern that already exists. Exporting RecommendationAPPROVE, with two recommended follow-ups:
The change is a clear net positive: it turns a gate that silently read 0 into one that measures reality. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (80452f6)✅ 🟡 1: quoted test-title gap. Adopted the suggested lookbehind: a quote before ✅ 🟡 2: failures didn't say where. ⏭️ Nits skipped:
Tests: 21/21 in |
Pragmatic Code Review: Re-Review of PR #3133 (80452f6)Review Type: Re-Review (scope: Previous Review Summary
Verification of Previous Recommendations✅ 🟡 1: quoted test-title gap. The lookbehind is now
The new fixtures pin both directions: positive ✅ 🟡 2: failures didn't list offending lines. ⏭️ Nits skipped, and each skip is reasonable:
Code Review Findings🔴 CriticalNone. 🟡 ImprovementsNone. 🟢 Nits
Verification Run
RecommendationAPPROVE. Both earlier 🟡 findings are fixed correctly and covered by tests. The skipped nits are justified with evidence, and no new issues were introduced. The refactor to |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressedNo code changes; both re-review nits handled without a commit:
Re-review decision: NO RE-REVIEW NEEDED. No code changed since the approved re-review. |
…2997) The issue-number patterns missed the most common shape, a bare `#NNNN` in prose, so the check read 0 while 142 references sat in scanned code. Add a bare-#NNNN pattern (3-5 digits; lookarounds exclude hex colors, HTML entities, `r#` raw strings and `Invoice #1`-style fixture data), drop the two `see #990` citations in update-homebrew-cask.ts, and set the baseline to the real remaining count. Paydown tracked in #3132. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Qyoth54znpxzJGcyxZFSnH
- Exclude a quote before #NNNN only when the number is quoted on both
sides ('#333'), so a reference opening a string -- an it('#2088: ...')
test title -- counts. Baseline 142 -> 143.
- countReferences returns per-line `path:line: text` hits instead of file
sets; a shared baselineFailures() prints them from both the CLI and the
ratchet test, so a new reference can be found among the backlog.
Skipped nits: a CSS-scoped `(?<!:\s?)` lookbehind (tried; it drops the real
`stack: #1931` prose reference), generalizing the `Invoice ` exclusion
(one fixture noun today), and test.todo for CSS false positives (the hit
listing now names any such line directly).
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Qyoth54znpxzJGcyxZFSnH
80452f6 to
d38a089
Compare
Summary
The issue-number ratchet in
scripts/check-code-references.tsmissed the most common shape, a bare#NNNNin prose. It reported 0 while 142 references sat in scanned code, not the 2 the issue named.#NNNNpattern. It requires 3–5 digits: every 1–2 digit#Nin the repo is data (call #2,UAX #9,Finding #1), and 6-digit ones are hex colors. Lookarounds exclude'entities, quoted colors,r#raw strings,Invoice #001fixture titles andcolor: #888;CSS. I checked the matches against every#<digit>line in the scan roots: no false positives, and no real references missed.see #990citations inupdate-homebrew-cask.ts(and the test fixture that mirrors them). The constraint, "Metal GPU embeddings require Sonoma+", was already stated inline.SCAN_ROOTSdirectly instead of asserting a count of 0.Test plan
bun test scripts/check-code-references.test.ts scripts/update-homebrew-cask.test.ts: 30 passbun run scripts/check-code-references.ts: 142 (baseline 142)🤖 Generated with Claude Code
https://claude.ai/code/session_01Qyoth54znpxzJGcyxZFSnH