Skip to content

Releases

v0.18.0

v0.18.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Oct 18:04
6884acb

Adopts omnist-spec v0.36.0-beta (vendor/omnist-spec moves from v0.35.0-beta;
the suite grows from 731 to 793 vectors, 28 OSD-OML vectors skipped, nothing
else). One behaviour change a caller can observe.

  • Breaking: JSON text with a bare NaN, Infinity or -Infinity token is
    parse.codec-syntax (C-19, DIV-45).
    CPython's json module reads the three
    tokens as non-finite floats, so read_json('{"a": NaN}') used to succeed.
    JSON has no such token. YAML (.nan, .inf), TOML and OML (nan, inf)
    still spell them, and a number literal beyond binary64 (1e999) still reads
    as an infinity (D-29). The error path is 1:1: the decoder does not report
    where the token is. Migration: write the value as a string, or as a
    literal in a format that spells it.
  • Runner: two NaN leaves compare equal (E-33, DIV-47). tools/conformance
    compared the parsed Document with the library's equality, in which a NaN is
    not equal to itself, so the three nan-is-a-number vectors failed whatever
    the reader returned. The referee now walks the two nodes and treats two NaNs
    as equal; the library equality is untouched.
  • Checked and clean: XML pretyping (C-18, D-28, D-29). The integer and
    number forms already follow C-18, an integer over 4300 digits is
    document.limit.int-digits at the leaf, and a number reads past binary64 as
    an infinity. The grammar check runs before any big-integer or float parse, so
    1 to 8 MB leaves of 99...9x, -99...9x, 99...9. and 99...9e are
    refused in linear time (8 MB: 0.3 s for an integer leaf, 1.2 s for a
    number leaf). Pinned by tests/test_spec_v036.py.
  • Vectors. Track 1 (fixtures) 19 of 19; Track 2 (vector suite) 759 passed
    and 6 failed before the fix, 765 passed and 28 skipped after.

v0.17.1

v0.17.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Oct 14:13
645cd26

Bug-fix release; vendor/omnist-spec stays at v0.35.0-beta. One behaviour
change a caller can observe.

  • A YAML or TOML time or datetime fraction past six digits fails (#366).
    PyYAML and tomllib cut the fraction to six digits without a word:
    00:32:00.9999999 read as .999999 and
    2024-01-15T12:00:00.000000001+01:00 as 12:00:00. The Document holds
    microseconds at most, so a non-zero digit past the sixth is now
    parse.codec-syntax at the literal (line:col, like the readers' other
    syntax errors); zeros past the sixth are dropped; an offset is kept, never
    converted. Migration: shorten the literal or quote it to read it as a
    string.
  • Checked and clean. JSON and XML keep the text verbatim; OML refuses a
    seventh digit as a syntax error. No writer can emit a fraction its reader
    refuses: a Python time/datetime holds microseconds, so .999999 is the
    widest value a writer is handed (round trips pinned for OML, YAML and TOML;
    the check_* paths report no format.temporal-stringified). Hostile input,
    timed and linear, nothing to fix: a 4 MB hex, octal or binary integer
    literal is refused as document.limit.int-digits (TOML 0.5 to 1.0 s, YAML
    about 2.2 s; 8 MB about 2 to 5 s), an 8 MB XML attribute reads in 0.1 s, XML
    depth 1k to 100k is document.limit.depth in under 0.1 s, and OML with
    100,000 " fails in 0.04 s.
  • docs/design/cli-spec.md: broken §1a anchor (#339). The link used
    #1a-json-machine-mode-shared; mkdocs slugifies the heading
    ## 1a. \ (machine mode, shared) to 1a---json-machine-mode-shared.
    mkdocs build --strict no longer reports it.
  • #350 needs no code change. All five items already shipped: coded
    --json errors and the documented residual uncoded cases (0.13.0), the
    runner identity check (0.13.0), success-path diagnostics comparison
    (0.13.0), the lone-surrogate writer refusal (C-9, 0.14.0) and the XML
    re-check comment.

v0.17.0

v0.17.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 12 Oct 19:53
549da99

A minor bump under the beta rule. vendor/omnist-spec moves from
v0.34.0-beta to v0.35.0-beta (237ef00).

Conformance, before any fix (from the pin bump alone): Track 1 19/19; Track 2
666 passed, 37 failed, 28 skipped of 731. After: Track 1 19/19; Track 2 703
passed, 0 failed, 28 skipped of 731 (the 28 OSD-OML skips, nothing else).

  • E-36: a Document path quotes a label that needs it. A label that is
    empty or holds ., [, ], ", \, a control character, U+007F, U+0085,
    U+2028 or U+2029 prints as ["label"] with the pinned escapes (lowercase
    \uXXXX); every other label stays .label. This applies to every path in a
    report, error or Doc.path. Migration: a label that is not a plain
    identifier but is otherwise safe (a b) used to print as $["a b"] for a
    Doc built from a Python mapping and now prints $.a b.
  • E-37: temporal writers. TOML writes a datetime with the T separator
    and a time with an offset as a double-quoted ISO-8601 string with
    format.temporal-stringified (it used to raise ValueError). YAML writes a
    datetime with T and a time as a double-quoted string
    (format.temporal-stringified).
  • C-14: YAML escapes are lowercase (\x1f, \x7f, \x80, �,
    �).
  • Fixed the read_yaml docstring, which gave 0o7777 as a four-digit YAML
    octal (PyYAML reads 0o17 as a string; the spelling is 07777).
  • Performance: reading 100,000 flat keys, median of 7 alternating runs against
    v0.16.0 on a noisy shared machine: JSON 514 ms (v0.16.0) vs 515 ms, XML
    616 ms vs 606 ms, so no measurable cost. An ASCII-identifier fast path in the
    label-quoting check keeps the common label to one isidentifier call. (The
    slowdown reported against v0.15.x was not reproducible against v0.16.0.)

v0.16.0

v0.16.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 11 Oct 15:29
78487c1

A minor bump under the beta rule: inputs that used to be accepted are now
refused (a repeated YAML key, !!pairs/!!omap/!!set), and the safety
limits become options. vendor/omnist-spec moves from v0.33.0-beta to
v0.34.0-beta (3346b50). Closes omnist#359 and omnist#360.

Conformance, before any fix (from the pin bump alone): Track 1 19/19; Track 2
429 passed, 17 failed, 76 skipped of 522. After: Track 1 19/19; Track 2 494
passed, 0 failed, 28 skipped of 522 (the 28 OSD-OML E-20/E-21 skips, nothing
else).

  • C-12: a YAML mapping that repeats a key is parse.codec-syntax, at the
    line and column of the second occurrence (it used to read last-wins). A key a
    merge key supplies is not a repeat. TOML already refused; JSON keeps the last
    value at the first position (C-11, now pinned by tests).
  • C-13: !!pairs, !!omap and !!set are refused with the new code
    format.tag-forbidden at path $ (they surfaced as
    document.unlabeled-element, or were accepted).
  • Configurable safety limits (DIV-28, omnist#360). Every reader and
    Doc.from_* takes max_depth (ceiling 200), max_nodes (ceiling
    10 000 000) and max_int_digits (ceiling 4300) per call, like
    max_input_bytes; Doc.from_format passes them when given. The Track 2
    runner honours declared_max_*, so the 48 limit vectors no longer skip.
  • Integer-digit refusals carry the literal's Document path (DIV-29, E-4a).
    JSON, YAML, TOML and OML reported $ for a literal past CPython's own
    conversion guard; they now report e.g. $.o.a[1]. D-28: the digits of the
    value are counted, so 0xFFF and 1_000 have four. The XML pretyping of an
    over-limit integer is document.limit.int-digits at the leaf path instead of
    an uncaught ValueError.
  • Behaviour changes to note. The JSON/YAML/TOML integer-digit refusal is a
    DocumentError (as every other build-time limit), where a literal past 4300
    digits was a ParseError; OML stays ParseError. Migration: catch
    OmnistError (the base of both), or both classes; the spec fixes the code and
    path, not the exception class. format.tag-forbidden is a ParseError, like
    format.dtd-forbidden. A scalar now counts as a level in OML and XML, as in
    the builder (D-12): a document nested exactly 200 levels still reads; only a
    leaf at depth 201 in OML or XML is newly refused (JSON, YAML and TOML are
    unchanged). XML counts nodes as
    every other format does (the root and elements with children, not leaf
    elements). A YAML timestamp that is not a date (2001-13-45) is
    parse.codec-syntax, no longer mislabelled document.limit.int-digits.
  • D-29 (a literal beyond binary64 reads as an infinity, underflow as 0.0)
    already held in JSON, YAML, TOML and OML; now pinned by tests.
  • Runners. Track 1 compares a lint finding's code exactly (omnist#359,
    spec section 8.3 is mandatory); stale runner comments updated. Track 2 passes
    compact to the OML writer (E-35).

v0.15.0

v0.15.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 05 Oct 22:53
b175ea8

A minor bump under the beta rule: the XML writer now rejects an input it
used to accept (see "Behaviour changes"). vendor/omnist-spec moves from
v0.32.0-beta to v0.33.0-beta (64cbb68). Conformance: Track 1 19/19;
Track 2 333 passed, 0 failed, 34 skipped of 367 (28 OSD-OML, 6 limits E-20,
unchanged); from the bump alone 4 vectors failed (the formats-xml/nulls
write vectors; the fifth, the read-side neighbour, already passed).

  • C-10: an XML null leaf fails the write. write_xml, check_xml,
    Doc.to_xml and omnist convert --to xml raise WriteError
    (write.unsupported-value), unconditionally and regardless of strict, at
    the Document path of the null leaf, with the E-10 index when its label
    repeats ($.root.item[1]). XML has no null token and <a/> reads back as
    the empty string, so the old output was indistinguishable from the different
    Document holding "". The null.omitted adjustment for XML, its docs and
    its tests are gone. Closes the Python row of ledger DIV-21.
  • E-10 on the XML reader's drop paths (omnist#357).
    format.attribute-dropped and format.namespace-dropped now carry the index
    on every occurrence of a repeated element (<r><a x="1"/><a x="2"/></r>
    reports $.r.a[0] and $.r.a[1], not $.r.a twice); built with the shared
    edge_paths helper. A lone element is unchanged.
  • Docs: docs/formats/toml.md still described a TOML null as dropped with
    null.omitted; it has failed unconditionally since #324. Corrected.

Behaviour changes

  • Writing a Document with a null leaf to XML used to succeed with a
    null.omitted warning (an empty element) and now fails. Callers that relied
    on it must remove or replace the null before writing.

v0.14.0

v0.14.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 05 Oct 04:10
96ba4a4

A minor bump under the beta rule: new behaviour, a new default limit and
new rejections (see "Behaviour changes" below). vendor/omnist-spec moves from
v0.28.0-beta to v0.32.0-beta (634ff12). Conformance: Track 1 19/19;
Track 2 328 passed, 0 failed, 34 skipped of 362 (28 OSD-OML, 6 limits E-20,
unchanged); from the bump alone 22 vectors failed (5 repeated-label paths, 7
OML-29, 10 input-size). Divergence-ledger entries closed: DIV-14, DIV-17,
DIV-18; the C-9 row of DIV-5 is met by this release too.

  • E-10: the index is on every occurrence of a repeated label (v0.30). A
    Document path carries [i] on every edge whose label occurs more than once
    in its node, the first included ($.item[0]), and none on a label that
    occurs once. One builder (omnist/_paths.py) now serves Doc.edges,
    validate, materialize and every writer path; the five copies of the old
    if i == 0 branch are gone.
  • D-23/D-24: a maximum input size (v0.30). Every reader (read_oml,
    read_json, read_yaml, read_toml, read_xml), Doc.from_* and the CLI
    refuse an input of more than max_input_bytes bytes with
    document.limit.input-size at $, before decoding and before any parsing;
    an input of exactly the maximum is accepted, bytes (not characters) are
    counted, a leading BOM included. The default is 64 MiB
    (67_108_864): D-24 gives no reference default, and this one is large
    enough for any real document while keeping the worst case of the slowest
    codec (PyYAML, seconds per megabyte) from becoming unbounded. The CLI takes
    --max-input-bytes N (a file or stdin is read at most one byte past the
    maximum); OSD schema files are not Documents and are not
    bounded. The option is validated like the other limits: 0, a negative
    number, a bool or a non-int raise ValueError/TypeError (no ceiling).
  • OML-29: a gap after the colon (v0.31). a: newline 1, a: ;1,
    a: # c newline 1 and a: newline {b: 1} are valid, at top level and
    inside braces. A missing separator between edges is still an error
    (a: newline 1 b: 2 is parse.trailing-content at 2:3).
  • C-9: no writer writes a string with no UTF-8 encoding (v0.32). JSON,
    YAML, TOML, XML and OML fail with write.unsupported-value,
    unconditionally, on a string value or an edge label that is a lone surrogate
    or a surrogate-escape artefact (U+DC80..U+DCFF), from write_*, check_*
    and Doc.to_*; never as an escape. The path is the node holding the string:
    the leaf for a value (indexed per E-10), the node holding the edge for a
    label (XML included: it no longer reports the label's edge path). Readers are
    untouched. The omnist#350 repro, write_json of read_json of a document
    whose one string is the escape for U+D800, now fails
    at $.a; this was the "Not done" item of 0.13.0.
  • omnist#354: a top-level braced node is rejected. {a: 1} as a whole
    document was accepted although §4.6's three legal shapes exclude it. It now
    fails with parse.unexpected-token at the { (1:1), the code and
    position Go and Java report. Braces are unchanged below the root
    (x: {a: 1}).
  • CLI --max-input-bytes N on every subcommand that reads a Document
    (format, convert, check, validate, infer): the same limit as the
    library option, validated the same way (an integer of at least 1, else a usage
    error); the refusal says "use --max-input-bytes to raise it". Additive.
  • Conformance runner. Understands declared_max_input_bytes (library path,
    option max_input_bytes); any other unknown declared_* key still fails the
    vector (E-20a), and so does a known one on an operation that does not honour
    it (only parse does).
  • Behaviour changes. (1) An input above 64 MiB is now refused, not parsed;
    raise max_input_bytes to keep reading one. (2) Paths of a repeated label's
    first occurrence changed ($.a to $.a[0]) in diagnostics, WriteError.path
    and report entries. (3) A top-level {...} OML document is now a parse
    error. (4) A string with no UTF-8 encoding now fails every writer (JSON,
    TOML and OML used to emit it raw, YAML an escape). (5) Public signatures
    gained the keyword-only max_input_bytes (additive).
  • Pin. vendor/omnist-spec is a gitlink to 634ff12 (tag
    v0.32.0-beta); .gitmodules is unchanged. Version strings in
    tests/test_canonical.py, tests/test_docs.py, docs/api.md and
    docs/cli.md moved to 0.14.0.

v0.13.0

v0.13.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Oct 21:40
c74dec6

A minor bump under the beta rule: public error codes appear on failures
that used to carry none, so omnist --json fills errors for them. Follow-ups
from the review of #349. No spec change: vendor/omnist-spec stays at
v0.28.0-beta. Conformance is unchanged: Track 1 19/19, Track 2 304 passed,
0 failed, 34 skipped of 338.

  • document.limit.depth on every depth refusal. A nesting-depth refusal
    from a writer or check_*, Doc.to_data/to_grouped, infer and
    Schema.validate was an uncoded WriteError/DocumentError; it now carries
    code="document.limit.depth", path="$" (the readers already did).
  • write.unsupported-value for a bare scalar root written as TOML (the
    spec says a bare scalar Document cannot be written as TOML), path $.
  • Verified, no change needed. A self-referential YAML anchor already gives
    document.limit.alias-expansion (D-20, since #352); the JSON NaN/Infinity
    refusal already gives write.unsupported-value. #344 was fixed in 0.12.0.
  • Still uncoded, on purpose (the spec registers no code): a self-referential
    Python value (cycle detected), a non-Document value type, Doc API misuse,
    and a strict=True refusal. Their --json payload has errors: [] and a
    message, which is always present; documented in docs/api.md and
    docs/cli.md.
  • Conformance runner. check_version() now also compares the module file the
    CLI's own interpreter imports with this checkout's (the same version number
    from another install is refused). Success-path diagnostics are compared for
    every ok: true operation (validate, materialize, OML parse/write,
    parse_schema, extract, as the codecs already were): where the CLI has no
    channel the reported set is empty, so an expected diagnostic fails instead of
    passing unchecked. materialize now passes --report.
  • Docs. A comment on _xml_well_formed records why its handler-less
    re-check parser is unreachable with a DTD today.
  • Not done: a lone surrogate in a string value written through the str
    API (write_json(read_json('{"a":"\ud800"}'))) still yields text that does
    not encode to UTF-8. The spec leaves it open (D-14 puts it out of scope);
    waiting on a spec ruling.
  • Version strings in tests/test_canonical.py and tests/test_docs.py moved to
    0.13.0.

v0.12.0

v0.12.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Oct 11:27
597864b

A minor bump under the beta rule, and all five ports take a minor for this
spec version: new public error codes (schema.invalid-label,
schema.invalid-name at $), inputs that used to be accepted are now rejected
(bad names and labels, [0,0] in the writer), and infer derives record names
differently. vendor/omnist-spec moves from
v0.27.0-beta to v0.28.0-beta. No conformance vector pins these rules
(divergence ledger DIV-5), so tests/test_schema_programmatic.py is the only
pin. Conformance is unchanged: Track 1 19/19, Track 2 304 passed, 0 failed,
34 skipped of 338.

  • schema.invalid-label (S-22). A field label that does not encode to
    UTF-8 (a lone surrogate such as "a\udc80") raises SchemaError when the
    Schema is built, at the record path (never the label), also for OSD text
    decoded from a string holding one. to_osd() re-checks every label it
    writes, so a Field appended to a record after the Schema was built is
    caught there too. Field and Record do not check: the record name, hence
    the path, is unknown to them. to_osd() used to emit such a label.
  • schema.invalid-name (S-8), programmatic. A record name or Ref target
    that does not match [A-Za-z_][A-Za-z0-9_]* (for example "bad name")
    raises SchemaError at $, with the name in the message only. Ref(...)
    checks its own name; Schema(...) checks every env key.
  • [0,0] is refused by the OSD writer (S-15, OSD-16, S-24). to_osd
    raises WriteError (write.unsupported-value, path the record) for a field
    with max = 0; it used to write "a" [0]: string, which no reader accepts.
    The model still accepts [0,0]. prune() drops such fields except from an
    unsatisfiable root, so no algebra operation produces one; prune before
    writing.
  • S-23 cannot arise. There is no caller-supplied record ordering in the
    API (to_osd takes only indent), so schema.unknown-record is never
    raised. There is no OSD-OML schema writer in this port.
  • infer record names are valid names. Labels with accented letters,
    non-ASCII digits or only digits ("\u00e9", "123") used to give a record
    name S-8 rejects; names are now ASCII-only and fall back to Rec.
  • Tests and fixtures needing a change: none; no existing test built a name or
    label these rules forbid. The 0.11.0 version asserts in
    tests/test_canonical.py and tests/test_docs.py moved to 0.12.0.

v0.11.0

v0.11.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Oct 13:43
0133f89

A minor bump under the beta rule: a new public option, a denial-of-service
fix and new error codes. vendor/omnist-spec moves from v0.22.0-beta to
v0.27.0-beta (v0.23 to v0.27). Python was the last port without the spec's
alias rules; the divergence ledger's DIV-3 closes with this release.

  • read_yaml / Doc.from_yaml take max_alias_expansion (default 50, at
    most 10 000) and max_expanded_slots (default 1 000 000, at most
    10 000 000).
    The anchor/alias graph is composed, measured in one iterative
    pass and only then constructed, so a "billion laughs" input is refused in
    milliseconds before any alias is expanded. Every mapping and sequence,
    anchored or not, the root and inline merge sources included, is a candidate
    (D-18); a merge sequence is a carrier, anchored or not (D-18a); an input with
    an alias or merge key whose total expansion is over the size cap is refused
    (D-22), an alias-free input never is (the cliff is deliberate). New codes
    document.limit.alias-expansion and document.limit.expanded-size, path
    $, raised as DocumentError. Options are validated: a non-int is a
    TypeError, a value outside 1 .. ceiling a ValueError (so 0 raises, as in omnist-j; the TypeScript, Go and Rust
    ports read 0 as "use the default"). The CLI, the
    registry and Doc.from_format use the defaults. See docs/formats/yaml.md.
  • Behaviour changes to documents that used to read. Input with an
    expansion factor over 50 (for example a mapping that merges a block of more
    than 148 keys and writes one key of its own, or a 100-key block aliased 100
    times at the root) is now refused; raise max_alias_expansion for such a
    file. A self-referential anchor is document.limit.alias-expansion (it was an
    uncoded "cycle detected", or silently accepted for a: &a {<<: *a}).
  • Malformed merges are parse.codec-syntax at the node's line and column
    (<<: 1, <<: [1], <<: [[{a: 1}]], <<: *s over scalars), before any
    limit is counted. <<: [] (and <<: *s over an
    empty sequence) is a well-formed carrier that merges nothing and is accepted
    (v0.27.0-beta). A container used as a mapping key is counted like a value (the
    spec is silent; PyYAML refuses the unhashable key later, so only the reported
    error differs).
  • A redefined anchor now reads (the latest definition applies, as in
    YAML 1.2); PyYAML alone refused it as parse.codec-syntax.
  • Runner: E-32's line:col placeholder, the alias vectors run with their
    declared maxima through the library, and normalize/prune/extract/
    parse_schema compare canonical text byte for byte, trailing newline
    included. The vendored suite is 338 vectors; the pin changes were otherwise already satisfied (BOM and invalid
    UTF-8, E-27, codec positions, OML-26/27/28, canonical comparison).

v0.10.1

v0.10.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Sep 18:08
e72ba20

A patch bump under the beta rule: one narrow parse-error-code change and
runner hardening, nothing else. vendor/omnist-spec moves from v0.21.0-beta
to v0.22.0-beta. Codec (JSON/YAML/TOML/XML) syntax positions are untouched
(omnist-spec#114) and unterminated arrays are untouched (omnist-spec#115).

  • OML-26 / OML-25 / OML-27. After a complete top-level edge (or scalar
    document), any leftover token that cannot continue the edge list is
    parse.trailing-content at that token, with or without a separator before it.
    The list continues only if a separator is followed by a STRING or IDENT
    (which then is the next edge and reports its own error, e.g. null: 2 is
    parse.reserved-word-label). Before, a: 1 LF ], ,, :, {, [2],
    5, nan and the like were parse.unexpected-token. Inside {...} and
    [...] nothing changes (OML-27).
  • E-28 / E-29. OML and OSD columns already counted code points and a line
    ended at LF (CRLF one break); tests now pin a combining mark, a tab, BMP
    non-ASCII, an astral character and CRLF.
  • Runner: the CLI runners now fail loudly (exit 2) when omnist --version
    does not match omnist.__version__ (omnist#350 item 2), so a stale omnist
    on PATH can no longer be measured by mistake.

Conformance, before and after (track 1 stays 19 / 0 / 0, referee self-test
10 / 10):

step pass fail skip
new pin (287 vectors), library untouched 240 7 40
+ OML-26 with a separator 247 0 40

The 40 skips are unchanged (28 OSD-OML omnist#341, 6 limits, 6 alias-expansion
DIV-3).