Expand description
The world codecs (docs/ONTOLOGY.md §2.5, §3): a home folder ⇄ [World].
folder is our own flavor and the Hermes flavor of the same file layout
(a profile folder IS a Hermes home); hermes writes a Hermes home back;
openclaw compiles and decompiles an OpenClaw state directory. The
decoders in decode are strict for O-records (unknown key = error) and
residue-keeping for H-records, exactly as docs/ORCHESTRATOR-IR.md §1
rule 1 states; canonical is the snapshot every “unchanged” decision
compares; sqlite opens stores read-only and writes fresh files.
Re-exports§
pub use canonical::canonical_json;pub use canonical::sort_keys;pub use decode::LoadError;pub use folder::carry_unmodeled;pub use folder::load_home;pub use folder::save_home;pub use folder::Flavor;pub use folder::LoadedHome;pub use folder::ProfileIo;pub use hermes::from_hermes;pub use hermes::to_hermes;pub use hermes::HermesReport;pub use hermes::Refusal;pub use openclaw::from_openclaw;pub use openclaw::to_openclaw;pub use openclaw::OpenclawLoaded;pub use openclaw::OpenclawReport;
Modules§
- canonical
- The canonical JSON every snapshot and “unchanged” decision compares:
keys sorted at every depth, two-space pretty print, trailing newline —
ir.mjs::canonicalJson. Sorting is explicit becauseserde_json’s own object order depends on a cargo feature another crate may enable. - decode
- Strict decoders and canonical encoders for every record’s FILE form
(
ir.mjs). O-records refuse an unknown key by file and key; H-records keep what they do not model inresidue. - dotenv
.envin a profile folder is the vault’s store:KEY=value, quotes stripped on read, JSON-quoted on write, sorted by key.- folder
- The folder codec: a home folder ⇄
World. The root is thedefaultprofile;profiles/<name>/are the named ones; a profile folder is a complete home (Hermes’s rule). Two flavors of the same layout: - hermes
- A Hermes home written from the world (
hermes.mjs::toHermes). Tiers per file: byte forcron/jobs.json,cron/executions.db,webhook_subscriptions.json(inline secrets re-inlined from the vault),config.yamlwhen unchanged, every unmodeled file, andstate.dbwhen bindings/obligations are UNCHANGED since import (copied). A FRESH destination gets a store born at the fixture’s schema (22) carrying the bindings assessionsrows and the obligations asdelivery_obligationsrows — Hermes migrates it on open; the transcripts live in the worker’s store and are not carried (semantic). A LIVE destination store is never written: that first write into a shared WAL single-writer store is UNI-18’s, refused by name.state.dbwith changed rows is REFUSED: the Hermes session-store write path is behind UNI-22. Semantic forSOUL.md⇄AGENTS.mdand a re-renderedconfig.yaml(the O-blocks ride as top-level keys — ORC-1 F5). - openclaw
- The OpenClaw codec (
openclaw.mjs): an OpenClaw state directory ⇄ the world.agents.*become profiles — the default agent IS thedefaultprofile, every other agent keeps its id — each rooted at its ownagents/<id>/. Channels, bindings and hooks are install-wide and land ondefault; jobs, fires and obligations land on the profile their agent id or session key names.openclaw.jsonis JSON5 (comments and trailing commas survive the read; a re-emit is JSON, which OpenClaw’s parser loads);state/openclaw.sqliteis the pinned v2026.7.1-2 schema, its rows written back column for column when their record is unchanged. - sqlite
- SQLite primitives (
sqlite.mjs): readers open read-only — the contract every supercode reader keeps over a live store — and writers create fresh files. Rows are read as JSON objects so the codecs see the same shapes the Node package saw.