Repository navigation
upload-types: a stricter text test, text types by extension, HEIF by brand; v0.14.0 - #54
Merged
Merged
Conversation
…pin-project-lite 0.2.19 - storage, postgres, and cmd/docproc require the base module at v0.13.0, through `mise run upgrade`. Their Unreleased bullet, which recorded the untagged move to v0.12.0, now reads v0.13.0, from v0.11.0, the version each module's last release required. - tools/mail and tools/onenote lock pin-project-lite 0.2.19, recorded under Unreleased in each tool's CHANGELOG. - Holds stay: tools/mail MimeKit 5.0.0 and MsgKit 3.1.0, tools/onenote typed-path 0.13.0. Nothing tagged.
… UTF-8 or windows-1252 Content of no routed signature, or that fails a claim's own check, is text only when its first HeadLen bytes hold no control byte (C0 but tab, LF, FF, CR; DEL) and are valid UTF-8 with no C1 code point, or windows-1252 without its five undefined bytes. The NUL-only test is gone from every fallback: no signature, the OLE2 and mbox claims, and the .eml or message-typed header. route.At and route.MediaType share it. A byte order mark still makes content text ahead of the test. Decisions: - A rune cut off at the head's end is valid when the content runs past the head (len(head) < size), whatever the head's length, not only at HeadLen. - A C1 code point in valid UTF-8 makes the head not text; the same bytes are not retried as windows-1252. - storedMedia's stored audio or video type routes content whose head isn't text by the new test, since its doc ties it to the fallback's refusal. Test changed: file_test's "escape and bell" is unrouted, not text.
…EIF by brand - Text of no signature (At's head-text fallback) takes its type from route's own extension table, by Ext: .md/.markdown, .csv, .tsv, .html/.htm, .xml, .json, .yaml/.yml, .css, .js/.mjs, .ics, .vcf; any other is text/plain. BOM and shebang kinds still type text/plain via kindTypes before At runs, so the table applies on the fallback path alone. No mime.TypeByExtension. - A HEIC's type comes from its ftyp major brand: image/heic, heic-sequence, heif, or heif-sequence. majorBrand is extracted from isISOBMFF and shared; HEIC leaves kindTypes since heifTypes covers every brand Identify maps to HEIC (heicBrands and structuralBrands). Routing is unchanged. - CHANGELOG Unreleased ### Changed, MediaType's doc comment, route/doc.go's inventory, and docs/api.md's route block state the table and the brands.
…runes in place of decoding them by hand
…0] - 2026-12-02 per release-and-ci.md, compare links extended, README's go get names v0.14.0
…code point is text The approved brief tests control bytes only (C0 besides tab, LF, CR, FF, and DEL); textual also refused a valid-UTF-8 head holding U+0080-U+009F, a rule the brief doesn't have. The rule is removed: a head such as 61 C2 85 62 0A is valid UTF-8 with no control byte, so it is text. utf8Whole becomes utf8Head, returning only whether the head is UTF-8, since no caller needs the trimmed slice any more. The 'utf-8 c1 control' case in route/test/at_test.go now expects route.Text and text/plain. The C1 mention is dropped from the Text constant's doc, route/doc.go, docs/limits.md, and the CHANGELOG [v0.14.0] Breaking entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
capstone.data-intelligence.mikoshi · task 29/39 · upload-types · brief 1 of 2: docproc
Summary
bytes hold no control byte other than tab, LF, CR, and FF (and no DEL), and are valid UTF-8 or
windows-1252 without its five undefined bytes. Before, any head without a NUL byte was text.
route.Atandroute.MediaTypeshare the test, and a byte order mark still comes first.route.MediaTypegives text its registered type by extension:.mdistext/markdown,.csvtext/csv,.jsonapplication/json,.yamlapplication/yaml, and so on. Text with anyother extension is
text/plain; content that isn't text isapplication/octet-stream.image/heic,image/heic-sequence,image/heif, orimage/heif-sequence. Routing is unchanged.build on the v0.14.0 tag after this SHIP, and come back as brief 2.
Core changes
route.At's fallback, mbox and message claims, and the storedaudio/video check). Why: a log of terminal escapes or a binary with no NUL in its head was
routed as text and decoded into mojibake.
route.MediaType. Why:sl-artifact-viewerrenderstext/markdownas Markdown andapplication/jsonas JSON. The root's dataset loader alreadytypes with docproc, so its
.mdand.jsonitems are stored astext/plaintoday.majorBrandhelper thatIdentifyshares. Why:mif1andmsf1files were calledimage/heic, which the registry reserves for HEVC-coded images.Verify
mise run check(docproc): ✓ check: ok ·mise run currency: ✓ only held items (MimeKit, MsgKit,typed-path)
upload-typescheckout, callroute.MediaTypeon aUTF-8 file named
notes.md:text/markdown. Name itnotes.txt:text/plain. Change one byteto 0x01 and name it
notes.md:application/octet-stream.build.logholding terminal escapes and no NUL:route.Atgivesunrouted, reason "norouted signature, not text". A windows-1252 file with smart quotes (0x93, 0x94):
text. Any of0x81, 0x8D, 0x8F, 0x90, or 0x9D:
unrouted.text, by its mark.heic→image/heic,hevc→image/heic-sequence,mif1andmiaf→image/heif,msf1→image/heif-sequence. Each still routesvision-converted.[v0.14.0] - 2026-12-02marks the text test Breaking and lists the new types;README's
go getnames v0.14.0.Decided without you
A partial rune where the file ends is invalid UTF-8, though it can still pass as windows-1252.
the new test (before: when it held a NUL). The release notes say so.
slice brief had asked for a rule rejecting it; the spec review caught it and it was removed.
[v0.14.0]changelog heading is cut in this pull request, as docproc's v0.13.0 was.is.
Redirects and escalations
none
Merge danger: one-way door: the tag docproc
v0.14.0, with a stricter text test that changeshow
route.Atroutes content holding control bytes · blast radius: docproc's consumers on upgrade(Mikoshi in this task; Bunrei and the root's loader at their next currency) · docproc: merge
waits on checks, tag waits on ci
Needs you: accept to publish, merge, and tag docproc
v0.14.0