Edge cases and divergences
The edge cases in the suite are where the contract’s exact wording gets earned. A sample:
Paths are bytes, so été.txt resolves without any Unicode normalization, and two names
that differ only in case are two different files even on a filesystem that would merge
them. A directory link resolves the same way through a commit and through the staged
index, which sounds obvious until you know the index stores no directory entries at all
and containment has to be proved from sorted path prefixes. guide.md/ with a trailing
slash fails as a type mismatch while guide.md resolves right next to it. %252F in a
link decodes once, to the literal text %2F, and never becomes a second path separator.
Hostile input gets the same rules with more suspicion. A document path carrying ANSI color
codes, a terminal bell, and a forged CI command prints harmlessly in the human output and
survives byte-for-byte in the JSON. A tree entry named with bytes that are not UTF-8 is a
scanned document whose path travels as hex, not a refusal and not a silent drop, while a
name the path grammar itself rejects, a backslash or a dot segment, is an
UNREPRESENTABLE_PATH refusal that disclosed those exact bytes. A five-thousand-byte path
is a reported limit crossing carrying both numbers. A tracked file whose object is missing
from the store refuses and names the document, instead of guessing about content it
cannot see.
The forge dialects pin the URL spellings the forges’ own browsers emit and nothing
looser. GitLab’s legacy pre-separator form still redirects in a browser and is foreign
here, as is /-/raw/; a GitLab project literally named - could never be told apart
from the separator, and GitLab reserves the name anyway. GitHub’s raw form and its
content host are this repository, since that is how a README links its logo when a package
registry renders the README somewhere else. Gitea’s untyped src/<ref>/
form, which some tooling still generates, is foreign because the typed src/branch/
spelling is what the forge emits. A gitea tag link is out of version scope even when its
segments spell the candidate branch exactly, because no tag is a trusted ref. The
Bitbucket Cloud source form gives the commitish exactly one segment, so a candidate branch
containing / is not guessed into its filepath. Bitbucket Data Center keeps the path before its
revision query, so only an exact full ref or object ID in at=, or its path-bound until history
pair, selects a version; abbreviated IDs and extra parameters remain version-scoped. A literal
installation context without a reserved projects or users segment may precede the route, but a
raw route is foreign. The
line-anchor grammars do not leak either: #L10-20 selects lines only under gitlab, #L10-L20
only under github and gitea, #file.rs-10 only under bitbucket-cloud when the basename agrees, and
#10-20 only under bitbucket-data-center.
The parser pin records its known differences instead of hiding them. Measured against the
CommonMark and GFM suites and against GitHub’s own rendering, four differences touch link
extraction, all under the Markdown profile. A footnote call inside a link or image label
([link[^1]](#), ![image[^1]](#)) is a link and an image on GitHub, and pulldown-cmark
builds neither once the footnote is defined, so a reference written that way goes unseen. A
www. literal with an unbalanced closing parenthesis in the middle of its path stops at that
parenthesis and publishes the shorter destination. An email address under a single-letter
top-level domain is not recognized at all. And the GFM
spec text says ftp:// should autolink where GitHub’s renderer does not; GitHub wins, as
before. Three of the four are under-reporting, the safer direction to fail, and every one is
written down in the corpus notes with its example number rather than waiting to be
discovered. Two upstream MDX test documents make markdown-rs panic; the engine catches both
as PARSER_PANIC, and both live in the corpus as regression tests.
One more, for flavor: the object store re-hashes everything with SHA-1 collision detection, and the suite proves that the public SHAttered and Shambles collision files cannot even be framed as Git objects without breaking the very property the detector checks. Reachable in code, unconstructible in practice, and tested as such.