Expand description
The orchestration codecs (docs/ONTOLOGY.md §2.5, §3): a home folder ⇄ [Orchestration].
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.
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 ⇄
Orchestration. 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 orchestration (
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 orchestration.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.
Structs§
- Hermes
Report - What a Hermes decompile did.
- Load
Error - A load refusal naming the file and the key (
ir.mjs::LoadError). - Loaded
Home - A loaded home.
- Openclaw
Loaded - A loaded OpenClaw state directory.
- Openclaw
Report - What an OpenClaw decompile did.
- Profile
Io - Per-profile bookkeeping: what a decompile needs to reuse bytes and to know what “unchanged” means. Never part of the orchestration.
- Refusal
- A write the codec would not guess at.
Enums§
- Flavor
- Which harness’s layout a folder was read as.
Functions§
- canonical_
json - Stable, secret-free JSON of a value.
- carry_
unmodeled - Copy the named unmodeled files from
srcintodest, byte for byte, answering the relative paths carried. A file the source no longer holds is skipped: the list is what was seen at load, the copy is what is there now. - from_
hermes - Load a Hermes home into the orchestration.
- from_
openclaw - Compile an OpenClaw state directory into the orchestration.
- load_
home - Load a home folder.
- save_
home - Save OUR folder. Never deletes a file it does not own; never writes a secret outside
.env. - sort_
keys - Every object’s keys sorted, at every depth.
- to_
hermes - Write a Hermes home. Byte-tier files whose records are unchanged since a Hermes import are copied from the import source; everything else is emitted canonically.
- to_
openclaw - Write an OpenClaw state directory from the orchestration.