Expand description
The orchestrator’s home, its daemon lease, and the service unit the operator verbs print (ORC-7).
supercode does not perform orchestration; the supercode-orchestrator
package does (docs/ORCHESTRATOR-IR.md §0.1). This module holds the three
facts supercode’s own surfaces need about it:
- where its state lives —
SUPERCODE_ORCHESTRATOR_HOME, default~/.supercode/orchestrator, resolved once incrate::HarnessHomes::orchestrator; the root folder IS thedefaultprofile andprofiles/<name>/are the named ones (docs/ORCHESTRATOR-IR.md§6). - whether the daemon is up — the lease file
<home>/orchestrator.lock, plus a liveness signal on the pid it names. A lock whose process is gone is stale, never “up”. - what a service unit for it would say, and whether it is installed —
service_unitrenders the launchd plist / systemd unitsetupwrites under<home>/service/;install_service,uninstall_serviceandservice_statusdrivelaunchctl/systemctl --userover it.
The lease FILE is written by the daemon itself (bin/orchestrator.mjs), not
by this crate: one writer means a service-managed daemon reports the same
lease a foreground one does, and a lock left by a process that is gone is
the daemon’s own signal to replay (§4.7).
Reading the folder is every existing ORCH reader’s job: jobs, runs,
routes, channels, triggers, profiles and session discovery point
their Hermes-shaped code paths at these same profile folders.
Structs§
- Lease
- The lease
<home>/orchestrator.lockholds: which process is serving this home, and since when. - Service
State - What the platform’s service manager says about the orchestrator unit.
- Service
Unit - A rendered service unit: what
setupprints and writes.
Enums§
- Orchestrator
Error - Why an operator verb could not do its work.
Constants§
- DAEMON_
ENTRY - The daemon entry inside the
sdk/orchestratorpackage. - LOCK_
FILE - Lease file the daemon writes while it serves a home, relative to the home.
- SERVICE_
DIR - Directory
setupwrites the rendered service unit into. - SERVICE_
NAME - launchd label / systemd unit name for the orchestrator daemon.
Functions§
- absolute_
program - launchd and systemd start a unit with a minimal
PATH, so the unit names the interpreter absolutely wherever one can be resolved. - clear_
lease - Remove the lease file. A missing file is not an error —
stopis idempotent by design. - daemon_
entry - Locate the Node daemon entry (
sdk/orchestrator/bin/orchestrator.mjs). - install_
service - Render the unit, hand it to the platform’s service manager, and start it.
- live_
lease - The lease of a daemon that is actually alive right now.
- lock_
path - The lease path for one home.
- pid_
is_ live - Whether
pidis a live process this user can signal. - read_
lease - Read the lease, whether or not its process is still alive.
- service_
status - Ask the platform’s service manager about the orchestrator unit.
- service_
unit - Render the per-platform service unit for one home.
- stop
- Ask the daemon to stop: SIGTERM to the leased pid, then clear the lease.
- uninstall_
service - Stop and unregister the unit, and remove the rendered file
setupwrote. - write_
lease - Write the lease for a running daemon.
- write_
unit - Write a rendered unit under
<home>/service/.