Skip to main content

Module orchestrator_door

Module orchestrator_door 

Source
Expand description

ORC-13 — the orchestrator’s WRITE door, the one every controlled-tier noun goes through when --harness orchestrator names it.

Hermes’s write door is hermes cron …; OpenClaw’s is openclaw cron … through its Gateway. The orchestrator’s is its own package: the only writer that keeps the folder’s byte-stability and its residue rules is save() inside sdk/orchestrator (docs/ORCHESTRATOR-IR.md §1 rule 2, §6). This module is the uniform client of that writer, and it never touches the folder itself — no file here is opened for writing, ever.

Two doors, one protocol, one answer (docs/ORCHESTRATOR-IR.md §4.6):

  • live — when <root>/orchestrator.lock names a process that is alive AND <root>/orchestrator.sock accepts a connection, one JSON line goes over that socket:

    {"op":"jobs.create","args":{…},"profile":"coder"}
    {"ok":true,"result":{"ran":"created cron job …","job":{…}}}

    The daemon dispatches the matching operator event on its own queue, so the write is ordered against inbound messages and ticks and the running loop’s in-memory state and the folder can never disagree.

  • cold — otherwise the package’s own CLI runs the identical verb through the identical applyOperator:

    node <entry> jobs.create --root <home> --profile coder --json '{…}'

    The entry is resolved exactly the way supercode orchestrator start resolves it (crate::orchestrator::daemon_entry), so the cold path and the daemon are always the same build of the same package.

Writing through a LIVE daemon’s socket rather than its folder is not a nicety: a daemon holds the loaded state in memory and re-saves it on every save effect, so a folder edited behind its back would be silently overwritten on the next tick. The lease is what makes that choice mechanical instead of a guess.

The answer is the PACKAGE’s, never supercode’s: {ok:false, error} is surfaced verbatim (it carries the reducer’s own refusal line), and each caller re-reads its row through the ORCH readers afterwards.

Structs§

DoorAnswer
One answered operator call.

Enums§

Door
Which door answered.
DoorError
Why an operator call could not be answered.

Constants§

NODE_BIN_ENV
Environment variable overriding the node used for the cold path (tests).
SOCKET_FILE
The daemon’s local socket inside one orchestrator home.

Functions§

call
Perform one operator verb through whichever door this home publishes.
daemon_is_live
Whether a LIVE daemon is serving this home right now.
socket_path
The daemon socket path for one home.