%unimsg 0 corpus/cases/v0 -- Torture corpus. See README.md for the expectation vocabulary. -- Cases marked `expect :open` have no agreed answer and exist to force a decision. -- As of 2026-08-23 there are none: the last twelve were settled in one pass. -- Authored in draft syntax; expect :rewriting if the syntax changes in weeks 5-8. cases { -- ===================================================================== -- NUMBERS -- ===================================================================== num-001 { what "integer 2^53 + 1", input 9007199254740993 why "JSON silently corrupts this; the canonical failure of the incumbent" expect :exact-roundtrip } num-002 { what "unsigned 64-bit maximum", input 18446744073709551615 why "boundary of CBOR major type 0" expect :exact-roundtrip } num-003 { what "negative 64-bit boundary", input -18446744073709551616 why "boundary of CBOR major type 1; asymmetric with type 0" expect :exact-roundtrip } num-004 { what "bignum beyond 64 bits", input "2^128" why "requires tag 2/3; must be mandatory per docs/02, not optional" expect :exact-roundtrip } num-005 { what "integer 1 and float 1.0" why "D1 declares these distinct; verify no implementation collapses them" expect :distinct } num-006 { what "exact decimal 19.99", input usd 19.99 why "must not become a binary float; money correctness" expect :preserve } num-007 { what "0.1 + 0.2 as exact decimals" why "must equal 0.3 exactly, unlike IEEE-754" expect :preserve } num-008 { what "NaN", input nan why "JSON cannot represent this at all" expect :exact-roundtrip } num-009 { what "positive and negative infinity", input [ inf, -inf ] why "JSON cannot represent these" expect :exact-roundtrip } num-010 { what "negative zero", input -0.0 why "distinct from 0.0 in IEEE-754; canonical form must not fold them" expect :distinct } num-011 { what "1.0 encodable as half, single or double" why "D3 shortest-form float; the historical CBOR interop sore point" expect :stable-order, src "RFC 8949 sec 4.2" } num-012 { what "float requiring full double precision", input 1.1 why "shortest-form must not lose precision" expect :exact-roundtrip } num-013 { what "NaN with a non-canonical payload" why "multiple NaN bit patterns exist, and D3 picks one: canonicalisation shortens every NaN to f97e00 and the payload is gone. That is F7, already recorded, and it is determinism working rather than a defect — a payload that survived would make two NaNs that mean the same thing hash differently. Settled 2026-08-23" expect :canonicalises-to } -- ===================================================================== -- TEXT AND UNICODE -- ===================================================================== txt-001 { what "e-acute as NFC vs NFD" why "D5 says no normalisation; these must remain distinct and hash differently" expect :distinct, src "UAX #15" } txt-002 { what "unpaired UTF-16 surrogate from a Windows path" why "ill-formed UTF-16 is real data; must be representable as tagged bytes" expect :preserve } txt-003 { what "invalid UTF-8 byte sequence from a Linux filename" why "filenames are bytes, not strings; core to the anything claim" expect :preserve } txt-004 { what "Arabic string inside an LTR document", input "كِتَاب" why "known syntax hazard; docs/05 open question on directional isolates" expect :render } txt-005 { what "bidi override characters (Trojan Source)" why "ACCEPTED, and the reasoning matters more than the ruling. D5 says text is preserved byte for byte and never normalised, so refusing U+202E would be the format editing content — and the same characters are ordinary, necessary content in the Arabic and Hebrew documents this repository carries. A format that cannot hold text it disapproves of is not carrying what the document says. WHERE THE VULNERABILITY ACTUALLY LIVES is a renderer that displays trusted and untrusted text in one run without marking the boundary. That is a real hazard and it is not one the encoding can fix; a checker or a viewer may warn, and this format does not silently alter the bytes to make a display safe. Settled 2026-08-23" expect :exact-roundtrip, src "Trojan Source, Boucher & Anderson" } txt-006 { what "Arabic pointed vs unpointed form" why "docs/09 - the distinction IS the data for a linguistic corpus" expect :distinct } txt-007 { what "emoji family with zero-width joiners" why "one grapheme, many code points; naive length and truncation both break" expect :exact-roundtrip } txt-008 { what "string with 200 combining marks on one base" why "rendering blow-up; bounded work required" expect :bounded } txt-009 { what "empty string and null", input [ "", null ] why "must remain distinct; JSON conflates in many mappings" expect :distinct } txt-010 { what "text containing U+0000" why "legal in CBOR text; breaks C-string-based implementations" expect :exact-roundtrip } txt-011 { what "Turkish dotless i under case folding" why "any case-insensitive comparison anywhere in the stack is a defect" expect :preserve } txt-012 { what "text 10 MB in one string" why "no implicit chunking; must not be silently split" expect :exact-roundtrip } -- ===================================================================== -- BYTES -- ===================================================================== byt-001 { what "empty byte string and empty text string" why "distinct kernel types; must never be conflated" expect :distinct } byt-002 { what "byte string whose content is valid UTF-8" why "must NOT be promoted to text; the type is the author's assertion" expect :preserve } byt-003 { what "byte string containing 0xFF 0xFE BOM-like prefix" why "no encoding sniffing anywhere, ever" expect :preserve } -- ===================================================================== -- MAP KEYS AND EQUALITY -- ===================================================================== key-001 { what "map with both 1 and 1.0 as keys" why "legal under D1 in the KERNEL, where they are two keys because 01 and f93c00 are two byte strings. Refused by the v0 profile, which allows text and integer keys and no floats. Settled 2026-08-23" expect :reject } key-002 { what "NaN as a map key" why "D1 resolves it after all: a key is its canonical bytes, and f97e00 equals f97e00, so NaN is a perfectly ordinary key and two of them are a duplicate. Refused here only because the v0 profile has no float keys at all — which is a narrower and more checkable reason than arguing about NaN. Settled 2026-08-23" expect :reject } key-008 { what "two NaN keys in the same map" why "F6 mirror of key-007. Canonical forms are byte-identical, so this MUST be a duplicate - but native float equality says NaN != NaN and it is accepted. Produces a canonical map with two identical keys, which is unorderable. Refused twice over now: as a duplicate, and as a float key the v0 profile does not admit" expect :reject } key-003 { what "duplicate keys in one map" why "JSON leaves this undefined - a real interop hazard we must not repeat. F4: fxamacker accepts silently by default (last wins); needs DupMapKey:DupMapKeyEnforcedAPF. Spec must make this a decode error" expect :reject, status :conformance-critical } key-004 { what "text key and byte key with identical content" why "must be distinct keys; follows from byt-001" expect :distinct } key-009 { what "an integer key, of the kind COSE and CWT are full of" why "the kernel admits any canonical key and the v0 profile admits text and integers, so this decodes and re-encodes unchanged. It has NO TEXT FORM: the text syntax spells a key as a word or a quoted string. Added 2026-08-23" expect :exact-roundtrip } key-005 { what "a map used as a key" why "CBOR permits it and the v0 profile does not: D10 admits text and integer keys, so a composite key is refused. Verified against the reference, which reports an invalid map key type. Settled 2026-08-23" expect :reject } key-006 { what "keys differing only by Unicode normalisation" why "follows from D5; two visually identical keys in one map" expect :distinct } key-007 { what "-0.0 and 0.0 as keys in one map" why "F6, and the case that forced the ruling. Canonical forms f90000 and f98000 are distinct, so under D1 these are TWO keys and the kernel admits them. NO HOST WHOSE MAP IS A HASH TABLE CAN HOLD BOTH: every language's float comparison says -0.0 == 0.0, so one pair is lost on the way in. The v0 profile therefore has no float keys, and this is refused for that reason rather than for the reason the reference used to give, which was that it looked like a duplicate. Settled 2026-08-23" expect :reject } -- ===================================================================== -- ORDERING AND DETERMINISM -- ===================================================================== det-001 { what "canonical key order for keys of differing length" why "RFC 8949 sec 4.2.1 sorts by encoded bytes, not by string collation" expect :stable-order } det-002 { what "same value encoded by two implementations" why "the entire content-addressing story depends on this" expect :stable-order } det-003 { what "indefinite-length and definite-length encodings of one value" why "canonical form must select definite; both must decode identically" expect :canonicalises-to } det-006 { what "float 1.0 encoded as fb3ff0000000000000 (non-canonical double)" why "F1: canonical form is f93c00, NOT integer 01. JS produces 01 and is wrong" expect :canonicalises-to, status :conformance-critical } det-004 { what "map with 24 entries (CBOR length-encoding boundary)" why "off-by-one boundary in the additional-information encoding" expect :exact-roundtrip } det-005 { what "nested maps where inner ordering differs from outer" why "canonicalisation must be recursive, not shallow" expect :stable-order } det-007 { what "a table's authored column order through a text round trip" why "the order lives beside the value rather than in it, and the go formatter sorted regardless for a fortnight while three implementations honoured it. Nothing here would have caught that, in either direction — see issues/001" expect :exact-roundtrip } det-008 { what "a table's authored column order through encode and decode" why "it does NOT survive, deliberately: the record is out of band so that two documents which decode identically encode identically. This case pins the loss as intended rather than leaving it undocumented, and would catch a change that started smuggling authored order into the bytes" expect :stable-order } -- ===================================================================== -- STRUCTURE -- ===================================================================== str-001 { what "500-deep nested arrays" why "recursive-descent stack exhaustion; must be bounded or rejected cleanly" expect :bounded } str-002 { what "shared subtree referenced twice" why "DAG support; must not silently duplicate on round-trip" expect :exact-roundtrip } str-003 { what "cyclic reference" why "Expressible, and harmless, because a reference is INERT. Two documents pointing at each other are two documents each holding a name; nothing follows either, decoding is total, and there is no cycle to fall into — S1 and `references-are-still-inert` between them make this a non-event. The claim in docs/03 stands. Settled 2026-08-23" expect :exact-roundtrip } str-004 { what "empty array, empty map, empty string, empty bytes" why "four distinct values that many implementations conflate with null" expect :distinct } str-005 { what "array of 10,000 identical maps" why "symbol-table dedup; also the tabular-render case from docs/05" expect :render } str-006 { what "map with zero entries used as a key" why "combines key-005 with str-004, and key-005 answers it: the v0 profile admits text and integer keys, so an empty map is refused like any other composite. Settled 2026-08-23" expect :reject } -- ===================================================================== -- TAGS AND DEGRADATION (the thesis under test) -- ===================================================================== tag-001 { what "unknown tag, round-trip" why "R4. The single most important property in the project" expect :exact-roundtrip } tag-002 { what "unknown tag, rendered with no type-specific code" why "the week 3-4 spike gate; if this fails the thesis fails" expect :render } tag-003 { what "unknown tag, canonical sort position" why "ordering must derive from the descriptor, not from hardcoded knowledge" expect :stable-order } tag-004 { what "unknown tag, structural diff against a variant" why "generic diff must work without understanding the type" expect :render } tag-005 { what "unknown tag whose descriptor is absent entirely" why "degradation when even the descriptor is missing - the true worst case" expect :exact-roundtrip } tag-006 { what "tag applied to a tagged value (nested annotation)" why "Accepted and round-tripped. R4 says degrade legibly rather than opaquely, and an unknown tag wrapping another unknown tag is two unknown tags — nesting is not a special case, and refusing it would make a decoder's tolerance depend on how deep the future went. Settled 2026-08-23" expect :exact-roundtrip } tag-007 { what "annotation list of length 0" why "Refused, and the reference already refuses it. An annotated value with no annotations is a wrapper asserting nothing, distinct in bytes from the bare value and identical in meaning — which is exactly the two-encodings-one-value hazard D2 exists to remove. No encoder here produces one. Settled 2026-08-23" expect :reject } tag-008 { what "self-describe tag 55799 nested inside itself" why "legal CBOR; must not confuse the header-detection logic" expect :bounded } -- ===================================================================== -- TIME -- ===================================================================== tim-001 { what "date with no time", input 2026-08-03 why "CBOR tag 0/1 cannot express this without RFC 8943" expect :preserve } tim-002 { what "year-month precision only", input 2026-08 why "precision is information; must not be widened to a full instant" expect :preserve } tim-003 { what "leap second 23:59:60" why "Accepted, as a SHAPE. The temporal forms check their shape and not the clock — 2026-13-45 has always been accepted, and D13's time of day follows the same rule — so a leap second lexes, stores verbatim and round-trips. Most libraries reject it or silently shift it to 00:00:00, and silently shifting is the one answer this format will not give. Settled 2026-08-23" expect :exact-roundtrip } tim-004 { what "instant with nanosecond precision" why "float epoch loses this; needs exact decimal" expect :exact-roundtrip } tim-005 { what "same instant with offset +10:00 and with Z" why "offset is information about the observer, not just the instant" expect :distinct } tim-006 { what "date before year 1 and year > 9999" why "The four-digit year in the production is a shape and not a range, so 9999-12-31 is expressible and 10000-01-01 is not. Historical data beyond it needs a vocabulary rather than a wider literal — a Mayan long count and a geological epoch are not RFC 3339 dates with more digits. Recorded rather than widened. Settled 2026-08-23" expect :reject } -- ===================================================================== -- ADVERSARIAL -- ===================================================================== adv-001 { what "billion-laughs equivalent" why "S3. Must be impossible by construction, not merely mitigated" expect :reject } adv-002 { what "declared length 4 GB with 10 bytes of data" why "must not preallocate; classic decoder memory-exhaustion" expect :reject } adv-003 { what "indefinite-length string that never terminates" why "streaming decoders must bound their buffering" expect :reject } adv-004 { what "external reference pointing at a local file path" why "S2. The parser must represent this and never follow it" expect :preserve } adv-005 { what "value tagged as an executable artifact" why "S1/S4. Decoding must not invoke, resolve, or instantiate anything" expect :preserve } adv-006 { what "descriptor that declares itself as its own fallback" why "bootstrap recursion (D8); must terminate or reject" expect :reject } adv-007 { what "10,000 distinct tags in one document" why "descriptor lookup must not be quadratic" expect :bounded } -- ===================================================================== -- SIZE AND STREAMING -- ===================================================================== siz-001 { what "byte string larger than available memory" why "A LIMITS QUESTION AND NOT A FORMAT ONE. profiles/v0 carries `limits` beside max-depth, and what a decoder does when a declared length exceeds what it can hold belongs there — adv-002 already pins the behaviour that matters, which is that a length claim is not a promise. Streaming decode stays possible and stays unspecified. Settled 2026-08-23" expect :profile-matter } siz-002 { what "stream of 1M framed values" why "framing must not require reading the whole stream" expect :bounded } siz-003 { what "value requiring the footer index to locate" why "container layer is deferred from v0 by the roadmap, explicitly and with the cost named, so this is OUT OF SCOPE rather than undecided. The case stays to prevent foreclosing it. Settled 2026-08-23" expect :out-of-scope } }