openworldformat (crates.io)
The Open World Format's Rust reference: the world document (types and
edits), the session fold (log, branches, state), and the ext-physics
extension's executable half — one serde-only crate, no Bevy, no async,
no sockets. The same code that implemented the format in LocalGPT since
its origin, extracted into the format's own home.
use ;
let manifest: WorldManifest = from_str?;
let entries: = log_text.lines
.filter
.map.?;
let doc = fold_log?; // the world at head
let = fold_path?; // or at any tip
openworldformat::state::fold_state folds the game state over
state.json (save games are base + declaration + a player's log);
openworldformat::physics carries the extension's deterministic
reference solver, trajectory write/fold, and the conformance outcome
runner; the schema feature generates world.schema.json.
Provenance and the plan
Extracted from LocalGPT's world-types, world-sync and
world-physics — not rewritten: in one language, two hand-written type
layers would only be drift risk. LocalGPT remains the app-side consumer
with its own copies until it's quiet enough to flip them to re-export
shims over this crate; until then, both sides generate the same
world.schema.json, and the snapshot test in each repository fails
when they disagree. The schema's generation_tool default is a pinned
literal for the same reason: a published schema must not churn with a
generating crate's version.
Two cross-implementation fixes landed with the extraction, applied on
both sides: entries may omit author (the spec's own example logs do;
the JS fold always read them), and the folded schema is
version-independent.
Test
CI runs both, alongside the js and python jobs — three references,
one set of worlds and outcome assertions.
Apache-2.0.