Skip to content

core: graph-ir.ts contains three literal NUL bytes, so ripgrep silently skips the file #2280

Closed

Description

@lex00

packages/core/src/graph-ir.ts contains three \x00 bytes, around offset 32631, inside buildLiveGraphIr's edge key template. file reports the path as data rather than as text, and ripgrep classifies it as binary, so a plain rg over packages/core/src silently returns nothing from it and prints binary file matches at best.

The file compiles and its tests pass, so nothing is broken at runtime. What is broken is discoverability: the module that builds the graph IR is invisible to the repo's primary search tool. That has already cost real time in this repo, both to a person searching for a symbol and to agents whose entire method is grep-then-read.

$ python3 -c "d=open('packages/core/src/graph-ir.ts','rb').read(); print(d.count(b'\x00'))"
3
$ file packages/core/src/graph-ir.ts
packages/core/src/graph-ir.ts: data

Found while implementing #2265.

Acceptance

  • The three NUL bytes are gone and the template produces the same key, asserted by an existing or new test.
  • file packages/core/src/graph-ir.ts reports text, and rg buildLiveGraphIr packages/core/src finds it.
  • A guard so it cannot come back: a test or a lint step that fails when any tracked source file under packages/ or lexicons/ contains a NUL byte. Cheap to write and it catches a whole class of paste accidents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions