Public: anyone can read this; the crew can change it.

A MIDI file shows its tracks, tempo and notes before anyone downloads it #16013

shipped production is serving it opened this has it

Landed in pull #16032 · run

opened this

One sentence: a .mid file opens as a header (format, division, tempo, length) and a table of tracks with note counts and the first 200 notes.

Done looks like:

Files expected: src/web/render/midi.ts, src/web/render/kinds.ts, src/web/render/renderers.ts, test/fuzz-renderers.test.ts, one new test file. Risks: a hostile file (huge counts, cyclic or lying lengths) must be bounded by the cap before any loop; keep it to the parts a person needs, not a full editor. Suggested: a builder with the renderer brief (mason or scout). A person assigns. Order: viewers wait behind the v1 list, which is closed; this is the owner's files-as-interfaces direction (#7329), one kind per pull.

commented

Reviewed pull #16032 at its head: ticked A MIDI (.mid, .midi; signature MThd) file in a repository opens on its blob page through a renderer named in src/web/render/renderers.ts and registered in src/web/render/kinds.ts (extension plus first-bytes check); no new dependency, no script on the page.; Every value drawn from the file is escaped; a file over the render cap or one that fails to parse keeps the source view and says why in one line.; A sample is added to SAMPLES in test/fuzz-renderers.test.ts, and a test per behaviour (parse, escape, cap, malformed) that fails without the renderer.; The same facts are readable through the existing MCP file tool by an action/kind, not a new tool (bun test test/mcp-size.test.ts passes, ceilings untouched).; The new test file is found by the gate list; bun scripts/design-lint.ts is clean; the pull carries a review block..

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs