Skip to main content

Module profiles_control

Module profiles_control 

Source
Expand description

ORCH-21 — the profile noun at the CONTROLLED tier: create and delete a routed config home through the HARNESS’S OWN verb, with supercode as the uniform client.

Charter (docs/plans/orchestration-domain-11-2026-09-02.md §0.4): supercode never owns a harness’s config plane. It makes no directory, writes no config file, and removes nothing itself. Each verb below is a subprocess of the harness’s own CLI, run in the harness’s own home:

  • Hermeshermes profile create <name> / hermes profile delete --yes <name> with HERMES_HOME pointing at the ROOT home the caller addressed (HERMES_HOME/profiles/<name> is what the verb makes; upstream hermes_constants.get_default_hermes_root derives the profiles root from that variable). --clone-from carries the uniform from.
  • OpenClawopenclaw agents add <id> --workspace <dir> --non-interactive --json / openclaw agents delete <id> --force --json, pointed at the caller’s state dir through openclaw’s own environment contract. At the pin these edit openclaw.json directly (agents.list); agents delete additionally offers the change to a RUNNING gateway when one is reachable, resolving that endpoint itself — neither verb takes a --url/--token flag, so supercode passes no credential here.
  • The orchestrator — its own package (ORC-13). A profile IS a folder whose files are the model’s serialization (docs/ORCHESTRATOR-IR.md §6), so create is a new folder record followed by the package’s own save(), and delete removes the record and has the daemon RENAME the folder into profiles/.trash/<name>-<stamp>/ — nothing is ever unlinked. Both go through crate::orchestrator_door: the daemon’s socket while it is up, node bin/orchestrator.mjs profiles.create|delete when it is down. supercode still writes no file of that folder itself.
  • Codex — refused. A Codex profile is a [profiles.<name>] TABLE that a human (or a tool) authors in $CODEX_HOME/config.toml; Codex publishes no codex profile create|delete verb, so supercode names that door rather than editing another harness’s config file behind its back.
  • supercode presets — refused. A preset is compiled-in CODE (crate::presets::RESERVED_PRESET_NAMES), not a directory a verb can make.

The three tier rules inherited from ORCH-18 hold here unchanged:

  1. The harness’s answer is the answer. After the verb exits 0 the row is re-read through the ORCH-10 loader (crate::profiles) and returned. A non-zero exit surfaces the harness’s own stderr as the error — never a silent success, never a supercode-invented row.
  2. The command is narrated. Every outcome carries ran: the exact argv that was executed, credentials redacted.
  3. A verb the harness does not publish is refused (ProfileControlError::UnsupportedUnsupportedAction), never faked.

One deliberate flag supercode does NOT let the harness default: nothing here writes outside the home the caller addressed. hermes profile create also drops a wrapper script into ~/.local/bin/<name> (upstream profiles.py::_get_wrapper_dir, which ignores HERMES_HOME), so the non-interactive client form passes --no-alias — a programmatic profiles.create against an isolated home must not install an executable on the caller’s PATH. The flag is in ran, so the choice is visible.

Structs§

ProfileMutation
One mutating request, in the uniform Domain 11 vocabulary.
ProfileMutationOutcome
What one mutation did, with the harness’s own row read back afterwards.

Enums§

ProfileControlError
Why a profile mutation could not be performed.
ProfileVerb
One uniform mutating verb over the profile noun.

Constants§

CODEX_REFUSAL
Why Codex refuses profiles.create / profiles.delete.
CONTROLLED_PROFILE_HARNESSES
Harnesses whose profiles supercode can MUTATE through their own CLI verb. Strictly narrower than crate::profiles::PROFILE_HARNESSES: Codex profiles and supercode presets are readable but not controllable.
PRESET_REFUSAL
Why supercode’s own presets refuse the same two verbs.

Functions§

mutate
Perform one mutation: translate to the harness’s own verb, run it, then re-read the row through the ORCH-10 loader.
supports_profile_control
Whether harness can have its profiles mutated at all.