Skip to content

v0.11.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Oct 13:43
· 11 commits to master since this release
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).