Skip to content

fix(do): metric-buffer shipped as a binary file (raw NUL bytes) - #159

Merged
prisis merged 1 commit into
alphafrom
fix/metric-buffer-nul
Jul 21, 2026
Merged

fix(do): metric-buffer shipped as a binary file (raw NUL bytes)#159
prisis merged 1 commit into
alphafrom
fix/metric-buffer-nul

Conversation

@prisis

@prisis prisis commented Jul 21, 2026

Copy link
Copy Markdown
Member

packages/do/src/metric-buffer.ts is 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 in git diff, git blame, and PR review (it shipped that way via #149).

Fix

  • Convert the raw NUL separators to the unicode escape sequence — byte-identical at runtime, valid UTF-8 text on disk. The module is now reviewable again.
  • Guard against recurrence: scripts/no-nul-bytes.mjs runs in vis.config.ts's staged pre-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/do typechecks; the file reads as UTF-8 text with 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

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
@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for lunorash ready!

Name Link
🔨 Latest commit 2bcb413
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a5fb5d58e6e9100084b85aa
😎 Deploy Preview https://deploy-preview-159--lunorash.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (2)
  • packages/do/src/metric-buffer.ts
  • scripts/no-nul-bytes.mjs
⛔ Files ignored due to path filters (1)
  • vis.config.ts is excluded by none and included by none
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 17f18f5b-8c22-4620-b94c-6c19b328765b

📥 Commits

Reviewing files that changed from the base of the PR and between f073c2a and 2bcb413.

⛔ Files ignored due to path filters (1)
  • vis.config.ts is excluded by none and included by none
📒 Files selected for processing (2)
  • packages/do/src/metric-buffer.ts
  • scripts/no-nul-bytes.mjs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/metric-buffer-nul

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@codspeed-hq

codspeed-hq Bot commented Jul 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 160 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing fix/metric-buffer-nul (2bcb413) with alpha (d1ebb51)2

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

  2. No successful run was found on alpha (f073c2a) during the generation of this report, so d1ebb51 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@prisis
prisis merged commit 49d7a9e into alpha Jul 21, 2026
41 checks passed
@prisis
prisis deleted the fix/metric-buffer-nul branch July 21, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant