Skip to content

Releases

ontos v0.17.1

Choose a tag to compare

@github-actions github-actions released this 12 Nov 02:13
156ff02

ontos v0.17.1

A patch release. It fixes a regression and two related gaps in the TypeScript core that
shipped in v0.17.0, adds one Rust API, and brings the four command-line tools into line
with each other. The value model, structural identity, the ontos-codec-v1 bytes,
decoding and its limits are unchanged, and so are Rust's allocation counts for the
v0.17.0 fast path.

TypeScript: copyBytes and Atom keep their contract

v0.17.0 made copyBytes, and with it new Atom(...), read the caller's bytes once and
store exactly what it validated. Three gaps remained:

  • A claimed length was allocated before anything was validated. A sparse array, or
    a Proxy, claiming 2³²−1 elements made v0.17.0 reserve 4 GiB before reading index 0.
    Under a memory limit that surfaced as "Array buffer allocation failed" instead of the
    element error. Now at most 64 KiB is allocated up front. The result then grows only
    after the element that needs the room has been validated, and ends at exactly the
    input's length.
  • The copy used built-ins looked up at call time. A redefined
    Uint8Array.prototype.set could change the stored bytes. Every built-in the copy uses
    is now captured when the module loads and called without a lookup.
  • An Atom's own methods did too. length, bytes(), toString/toJSON and
    equals handed the Atom's private bytes to built-ins looked up at call time, so a
    redefined built-in could change an existing Atom. They now use only the captured ones.

The guarantee starts when ontos-core loads: code that runs before it can still replace
built-ins, as with any library.

Supported runtimes. The six TypeScript packages now declare
"engines": { "node": ">=18.3.0" }. The fast path for a genuine Uint8Array runs no
caller code only on engines that implement ecma262#2719, first in V8 10.2.85 and so in
Node 18.3.0. On older engines, copying reads the source buffer's constructor. See
distribution, "TypeScript runtimes". Node 18 is past its end of
life; every supported Node line meets the floor.

Rust: unbounded decimals at the byte level

ontos_data gains encode_decimal_bytes and read_decimal_bytes. They take and return
the mantissa and exponent as IntBytes (a sign and a big-endian minimal magnitude), like
encode_int_bytes/read_int_bytes, so a canonical decimal of any size can be built and
read without i128. The canonical rule now lives in one place, shared with
recognize_decimal. encode_decimal and read_decimal are unchanged. The addition is
compatible: a 0.17 requirement picks it up.

The command-line tools read input the same way

The four ontos CLIs (go, rs, ts, py) now read --from-json and hex input
identically, as the new "Reading the text" section of ontos-cli
specifies. A new reading mode in the conformance harness checks them case by case, through
both argv and stdin.

Inputs that are now refused (they were accepted by one or more CLIs):

  • in --from-json: a duplicate member name (compared after escape decoding), anything
    after the value such as a stray ], whitespace other than space, tab, LF and CR, a BOM,
    and a lone surrogate escape;
  • around hex input: any character other than space, tab, LF and CR (before, the CLIs
    variously stripped a BOM, NBSP, form feed, vertical tab, NEL or U+001C);
  • a --from-json text nested deeper than 1024 value levels, which is now
    limit_exceeded (exit 1), the codec's default depth.

Bytes that are not UTF-8 are read as U+FFFD, so they are always refused.

Fixed: crashes on deep input (Python, TypeScript, Rust), and on rendering a valid
1024-deep value (Python); a Rust panic on non-UTF-8 arguments; a TypeScript crash reading
a large stdin from a slow pipe; TypeScript output cut short on a pipe while still exiting
0; and quadratic string reading in Rust.

Also in this release

  • Go: codec.Measure gets its memo key from core through a module-internal package,
    checked by the compiler, instead of reading an unexported field through reflect. The
    public API is unchanged.
  • Generated tests: generated limit-policy tests check that every face reports the
    same limit kind inside an agreement zone, and a metamorphic relation over valid values
    (#13).
  • 32-bit coverage: the Rust core, data and data-json crates now also run on a 32-bit
    target in CI, not only the codec.
  • JSON projections: design record 0010 decides
    ontos's two JSON projections, after consultation 0001.
    They are not in this release.

Upgrade

Every published package carries version 0.17.1. A Rust graph on 0.17 and npm ranges
like ^0.17.0 pick it up with no change. The root Go tag v0.17.1 and the nested tags
projection/deixis/go/v0.17.1 and wire/go/v0.17.1 name the same release commit.

ontos v0.17.0

Choose a tag to compare

@github-actions github-actions released this 11 Nov 03:12
afdec1f

ontos v0.17.0

The codec gains measure, which bounds what a shared value would cost to encode without
expanding it. The Rust core allocates less for shallow values, and TypeScript copyBytes
stores exactly the bytes it validated. The value model, structural identity, the
ontos-codec-v1 bytes, decoding and its limits are unchanged.

Codec: measure a value without expanding it

A value held as a DAG can denote a tree whose encoding is exponentially larger than the
nodes in memory. measure reports three measures of the expanded tree: its canonical
encoded length (encoded_bytes), the number of values in it (occurrences) and how deep it
is nested (height, counted as the decoder's depth limit counts it). It visits each
distinct node once, keyed on the node's identity in memory, and keeps an explicit stack, so
a value of any height can be measured.

The caller states a bound for each measure; none has a default. Each measure saturates at
its bound, so the arithmetic never wraps. If a measure exceeds its bound, the outcome is
over limit and names every exceeded measure in ascending order of the identifiers, with no
numbers. That set depends only on the value and the bounds.

face call over limit
Go codec.Measure(v, codec.MeasureBounds{MaxEncodedBytes, MaxOccurrences, MaxHeight}) *codec.MeasureError
Rust ontos_codec::measure(&value, MeasureBounds { max_encoded_bytes, max_occurrences, max_height }) Err(MeasureError)
TypeScript measure(value, { maxEncodedBytes, maxOccurrences, maxHeight }) throws MeasureError
Python measure(value, *, max_encoded_bytes, max_occurrences, max_height) raises MeasureError

A Rust Value owns its children and cannot share a subtree, so its measure is a plain
walk with the same saturation and results. The definition is
codec §10, the decision is
design record 0008, and
vectors/codec-measure.json pins 31 cases for every face,
including a doubling chain whose encoding is 5·2^64 − 2 bytes.

Rust: no work stack for atoms and atom-only tuples

Value's Clone, PartialEq and Hash handle an atom, or a tuple whose items are all
atoms, directly instead of allocating a heap work stack. The codec's encode_into writes
such values directly too. Deeper values keep the iterative walk, so stack safety is
unchanged, and bytes, equality and the Hash write sequence are identical. Cloning two
atoms and encoding a tuple of them now takes 7 allocations instead of 13.

TypeScript: copyBytes reads the caller's bytes once

copyBytes, and with it new Atom(...), stores exactly the bytes that passed validation.
A caller's getter, iterator or redefined view geometry can no longer change them. A
number[] is read once, index by index. Binary inputs are brand-checked and their geometry
is read through the built-in accessors, which run no caller code. A genuine Uint8Array
keeps a fast path, so decoding is as fast as before. The deliberate behaviour changes:

  • a cross-realm ArrayBuffer is accepted;
  • a detached or out-of-bounds view is a TypeError for every input kind;
  • a result never shares memory with a SharedArrayBuffer;
  • a Proxy reporting a non-array length gets a RangeError;
  • error messages no longer run caller code.

Upgrade together

Every published package carries version 0.17.0. Keep all ontos dependencies in one Rust
graph on the same compatible crates.io version: a 0.16 core and a 0.17 core define
different Rust Value types. See distribution for the package names
and installation examples.

The root Go tag v0.17.0 and the nested tags projection/deixis/go/v0.17.0 and
wire/go/v0.17.0 name the same release commit. The deixis projection and the Wire profile
still pin deixis 0.6.0; consumers of core, codec, data or data-json gain no deixis
dependency.

The release workflow now binds npm provenance to the certified dispatch and keeps the
checked-out release source as its own dependency, so a rehearsal can qualify the exact
archives a later publish signs.

ontos v0.16.0

Choose a tag to compare

@github-actions github-actions released this 04 Nov 05:48
b4d910f

ontos v0.16.0

The optional Wire profile now has Go and TypeScript implementations. TypeScript
consumers import @bitspark/ontos-wire; the Go module is
github.com/bitspark/ontos/wire/go. The ground packages retain their frozen
value model, identity and ontos-codec-v1 bytes.

The optional profile supplies bounded deixis construction/admission, ground
embedding and exact ground recovery. Opaque handles are retained unchanged;
recovery refuses live leaves and performs no export or hydration.

Both languages also provide a compact native realization.
Caller-owned factories qualify opaque leaves while ontos owns immutable tuple
capture and ground collapse. Private factory identities prevent foreign tuple
construction from bypassing a runtime's recognition policy. Explicit conversion
to and from the deixis representation retains independent structural budgets.

All published packages use version 0.16.0. Root tag v0.16.0 and nested tags
projection/deixis/go/v0.16.0 and wire/go/v0.16.0 identify the same commit.
The release pipeline verifies installed consumers of both optional modules.
Rust retains the ground/deixis projection; no Rust Wire profile is claimed.

Runtime consumer migration is delivered separately in bitwire, bitruntime and
bitnode. This release neither changes their deployed versions nor implements
Function, Stream or Cell protocols.

ontos v0.15.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 10:02
a3f1d08

ontos v0.15.0

Two additive host APIs let consumers transfer owned tuple children and assemble
canonical tuple bytes from separately encoded children. The value model,
structural identity, codec bytes, and decoding limits are unchanged.

Rust: consume a tuple without cloning its children

Tuple::into_items(self) -> Vec<Value> transfers the existing child vector in
order. The tuple is consumed; its children keep their original storage and
stack-safe drop behavior, including when the returned iterator is only partly
consumed.

use ontos_core::{Tuple, Value};

let tuple = Tuple::new([Value::atom([0x61]), Value::atom([0x62])]);
for child in tuple.into_items() {
    // Each child is owned independently and can be released after use.
    assert!(child.is_atom());
}

TypeScript: encode the canonical tuple header

encodeTupleHeader(arity) returns the tuple tag and shortest-form arity bytes,
using the same framing implementation as encode. It accepts the same
non-negative safe integers as encodeUvarint and throws RangeError otherwise.
It allocates only the header, with no placeholder children.

Append exactly arity complete canonical child encodings in order to obtain the
same bytes as encoding the whole tuple. The helper does not inspect children or
validate the assembled value; ordinary decoding still checks the complete value
and applies its existing limits.

Upgrade together

Every published package carries version 0.15.0. Keep all ontos dependencies in
one Rust graph on the same compatible crates.io version: a 0.13 or 0.14 core
and a 0.15 core define different Rust Value types. The TypeScript packages are
published to npmjs. See distribution for the package names
and installation examples.

The root Go tag v0.15.0 and nested tag projection/deixis/go/v0.15.0 name the
same release commit. The optional deixis projection still pins deixis 0.6.0;
consumers of core, codec, data, or data-json gain no deixis dependency.

The Rust ownership and TypeScript framing APIs are language-specific
conveniences. All four implementations retain the same frozen
ontos-codec-v1 byte mapping and shared conformance corpus.

ontos v0.14.0

Choose a tag to compare

@github-actions github-actions released this 05 Oct 13:06
a44df59

ontos v0.14.0

The deixis projection in all three languages. ontos-over-deixis-v1, the bridge between ontos
values and deixis trees, now publishes its TypeScript package and its Rust crate. Its Go face has
shipped since v0.13.0. The two new faces waited only for deixis to reach npmjs and crates.io.
Nothing else changes: every other package has the same API and the same bytes as in v0.13.0.

What is new

ecosystem package install
npm @bitspark/ontos-deixis-projection npm install @bitspark/ontos-deixis-projection
crates.io bitspark-ontos-deixis-projection cargo add bitspark-ontos-deixis-projection
import { project, recognize } from "@bitspark/ontos-deixis-projection";
const node = project(value);   // P: total
const back = recognize(node);  // R: partial, throws an Unrecognized refusal
ontos-deixis-projection = { package = "bitspark-ontos-deixis-projection", version = "0.14.0" }

Every face pins deixis at exactly 0.6.0: κ, the key of a tuple's i-th child, must come from
the same deixis code in every face. All three faces pass the same vectors,
projection/deixis/vectors/ontos-projection.json. See projection/deixis/README.md.

Also in this release

  • npm packages record their release commit (gitHead). v0.13.0's did not, because the
    release publishes the packed tarball, and npm records a gitHead only from the manifest it
    publishes. The release workflow now writes it into each package before packing.

What is published

ecosystem packages
npm @bitspark/ontos-core, -codec, -data, -data-json, -deixis-projection
crates.io bitspark-ontos-core, -codec, -data, -data-json, -deixis-projection
Go github.com/bitspark/ontos and github.com/bitspark/ontos/projection/deixis/go, by the tags v0.14.0 and projection/deixis/go/v0.14.0

The npm packages carry provenance from this repository's release workflow.

What holds

  • The byte format is ontos-codec-v1, frozen. No encoding changes between releases.
  • The projection is additive. ontos/core has no deixis dependency. A consumer that imports
    core, codec, data or data-json gets none.

ontos v0.13.0

Choose a tag to compare

@github-actions github-actions released this 05 Oct 10:21

ontos v0.13.0

The first public release. ontos was developed privately up to v0.12.0. This repository
starts its public history at v0.13.0, whose interface is that of the last private release, so
nothing a consumer calls changes. The one difference consumers will see is speed: the
TypeScript encoder now sizes its output once and writes a single buffer, about three times
faster on records made of many small values, with byte-for-byte the same output.

What is published

ecosystem packages install
npm @bitspark/ontos-core, @bitspark/ontos-codec, @bitspark/ontos-data, @bitspark/ontos-data-json npm install @bitspark/ontos-codec
crates.io bitspark-ontos-core, bitspark-ontos-codec, bitspark-ontos-data, bitspark-ontos-data-json cargo add bitspark-ontos-codec
Go github.com/bitspark/ontos (core, codec, data, data/json) and github.com/bitspark/ontos/projection/deixis/go go get github.com/bitspark/ontos@v0.13.0

The npm packages carry provenance from this repository's release workflow.

The Rust crates are published under bitspark- names, but their library names are the short
ones, so code reads use ontos_core::Value;. To keep that spelling in a manifest, name the
dependency by its library and point package at the crate:

ontos-core = { package = "bitspark-ontos-core", version = "0.13.0" }

Go modules are released by tag: v0.13.0 for the root module, and
projection/deixis/go/v0.13.0 for the projection module, both at the same commit.

Not published yet

The ontos-over-deixis projection ships its Go face in this release. Its Rust crate is in the
repository but not on crates.io, and its TypeScript face is not in the repository yet. Both depend
on deixis packages that are not on crates.io and npm yet, and they follow once those are.

The Python implementations (core/py, codec/py, data/py, cli/py) are source-only, and the
command-line tools are built from source.

What holds

  • The byte format is ontos-codec-v1, and it is frozen. Every encoding produced by an earlier
    version is produced identically by this one, and any future change to the byte mapping ships as
    a new codec version, never as an edit to v1.
  • Four implementations, one set of bytes. Go, Rust, TypeScript and Python are checked against
    the same conformance vectors (vectors/), and a differential harness runs all four
    command-line tools over them on every change. See docs/spec/ontos-conformance.md.
  • Limits are reported, not guessed. A decoder stopped by an operational bound reports which
    bound, as limit_kind (docs/spec/ontos-codec.md §4.2).

The specifications are in docs/spec/.