fix(ci): the invisible-character gate never matched anything - #743
fix(ci): the invisible-character gate never matched anything#743hyperpolymath wants to merge 3 commits into
Conversation
Replace the character-mode PCRE escapes (\xc2\xa0 asks for the two characters U+00C2 U+00A0, never present in any file) with the canonical byte-safe two-tier scanner from rsr-template-repo (rsr#49): scripts/check-invisible-characters.sh matches UTF-8 byte sequences under LC_ALL=C, so typographic invisibles (NBSP, soft hyphen, zero-width/bidi, BOM) warn while C0/NUL corruption blocks, and scanner failure refuses a partial pass instead of going green. tests/invisible-characters-test.sh proves the detector against fixtures that MUST trip it — including a leading BOM — and the workflow runs that proof before every scan. Also fixes the seven NBSP-bearing docs the old gate never saw. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (66)
🔇 Additional comments (10)
📝 SummarySummary by CodeRabbit
WalkthroughThe change adds an invisible-character scanner, tests its detection and failure modes, and integrates it into the dogfood gate. It also replaces non-breaking spaces with regular spaces in seven documentation entries. ChangesInvisible-character detection
Whitespace normalisation
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The scanner, tests, and CI integration correctly detect the intended invisible characters without an outstanding actionable risk. Sequence Diagram(s)sequenceDiagram
participant DogfoodGate as dogfood-gate.yml
participant Scanner as check-invisible-characters.sh
participant Results as result files
participant GitHub as GitHub annotations
DogfoodGate->>Scanner: Scan repository files
Scanner->>Results: Write findings and blocking findings
DogfoodGate->>GitHub: Publish escaped findings and counts
DogfoodGate->>DogfoodGate: Fail on blocking findings
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Supersedes #734 (unmergeable: DIRTY, and its inline Python scanner violates the estate language policy).
What
Replaces the broken character-mode PCRE escapes in
dogfood-gate.yml's empty-lint job (\xc2\xa0ingrep -Pasks for the two characters U+00C2 U+00A0 — present in no file, so the gate matched nothing for months) with the canonical byte-safe scanner that rsr-template-repo#49 hardened through four owner review rounds:scripts/check-invisible-characters.sh— ported verbatim from rsr-template-repomain. Matches UTF-8 byte sequences underLC_ALL=C(robust to invalid-UTF-8 files), NUL-delimited enumeration, fail-closed on find/grep errors.tests/invisible-characters-test.sh— the regression controls: NBSP, soft hyphen, zero-width/bidi, word-joiner, leading BOM, NUL, backspace, invalid UTF-8, permitted TAB/LF/CR, newline-bearing filenames, injected grep/find failures.::warning, C0/NUL corruption::error+ exit 1, scanner failure exit 2 (no partial pass). The job runs the regression proof before every scan.What this does NOT carry from #734
python3heredoc scanner (Python is deny-listed estate-wide).governance.ymlreusable-workflow SHA bump — already stale again (standards HEAD has moved past it); re-pins are their own sweep..hypatia-exemptions.adocwording fix — an equivalent fix already landed onmain.Verification (local, on this branch)
tests/invisible-characters-test.sh→ pass (10/10 fixtures detected, incl. leading BOM; blocking set exactly {NUL, backspace}; all three injected-failure controls fail closed).main→ all flagged in the warn tier (the port detects the real defects the old gate missed).Toolset integration map: hyperpolymath/empty-linter
docs/INTEGRATION.adoc(landing separately).🤖 Generated with Claude Code