fix(do): metric-buffer shipped as a binary file (raw NUL bytes) - #159
Conversation
The metric series key used a raw NUL byte as its separator, which made git classify packages/do/src/metric-buffer.ts as binary — invisible in diff, blame, and PR review (it shipped that way via #149). Switch to the unicode escape sequence: byte-identical at runtime, valid UTF-8 text on disk. Guard against recurrence: a new scripts/no-nul-bytes.mjs runs in vis.config.ts's staged pre-commit chain (before Prettier, which doesn't catch it) and rejects any staged source file containing a raw NUL byte. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019M6G6CAoLVrQMxDYg7BWq2
✅ Deploy Preview for lunorash ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. 💤 Files selected but had no reviewable changes (2)
⛔ Files ignored due to path filters (1)
⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Thank you for following the naming conventions! 🙏 |
|
Thank you for confirming the Contributor License Agreement! 🙏 |
Merging this PR will not alter performance
Comparing Footnotes
|
packages/do/src/metric-buffer.tsis currently a binary blob on alpha — its metric series key used a raw NUL byte (0x00) as the separator, so git classifies the whole ~170-line module as binary. It's invisible ingit diff,git blame, and PR review (it shipped that way via #149).Fix
scripts/no-nul-bytes.mjsruns invis.config.ts'sstagedpre-commit chain (before Prettier, which doesn't catch NUL bytes) and rejects any staged source file containing a raw NUL — with a message pointing at the escape. Tested: rejects a NUL file (exit 1), passes clean files, robust to deleted paths.Verified:
@lunora/dotypechecks; the file reads asUTF-8 textwith 0 NUL bytes; the fixing commit itself passed the new guard.(The same fix also rides in #158's rebase, but this isolates it so alpha stops carrying a binary source file independently of that PR's review.)
🤖 Generated with Claude Code
https://claude.ai/code/session_019M6G6CAoLVrQMxDYg7BWq2