# Orchestrator

> Continuity spine from idea to ship. Runs an OUTER loop that pushes work hub-to-spoke out to estate projects, and an INNER loop that audits itself against the constitution — trimming cache, flagging hallucinations, tightening code generation. Does NOT do the work; it routes, gates and carries state. Pulls a skill only when a stage needs it and releases it immediately, to protect context. The constitution is a hard gate checked before every self-modifying action. Stops for exactly two things — spending money and touching production. A denied action is terminal. Use when running a project end-to-end, resuming a stalled build, or dispatching work across multiple estate repos.

- Skill: `cleanexpo/orchestrator` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cleanexpo/orchestrator`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cleanexpo/orchestrator/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: cleanexpo (https://skillmd.com/u/cleanexpo)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cleanexpo/orchestrator

---


# orchestrator — the thread that survives the context window

**It does not write the code.** It decides what happens next, who does it, whether that is allowed, and
whether the previous stage actually finished. Every other skill is labour; this is continuity.

The problem it solves: work in this estate dies at handoffs. A session ends, a context compacts, an agent
finishes a stage and the thread is gone — the estate's own constitution calls this its dominant failure
mode. The orchestrator holds the thread by refusing to keep it in context at all.

> **State lives on the tracker. Context is a scratchpad that is expected to be lost.**

## The fence (read first)

Two stops, and nothing else: **spending money** and **touching production**.
Full predicates: [`docs/orchestrator/01-decision-rights.md`](../../docs/orchestrator/01-decision-rights.md).

- Inside the fence, act. Do not ask permission for reversible work — paralysis by approval is a named
  constitutional failure mode (§6.43), equal in weight to self-authorisation.
- **A denied action is terminal.** Not deferred, not appealable. Denial is matched by fingerprint *before*
  reasoning begins; quality of argument is not an input. Only the founder clears one, and clearing creates
  a new record rather than reviving the dead one.
- The fence is enforced at the `PreToolUse` hook, not by this prompt. **If that hook is not registered,
  this skill is running unfenced — say so, out loud, before starting.**

## Outer loop — hub to spoke

Pi-Dev-Ops is the hub. Estate projects are spokes: `Authority-Site`, `CARSI`, `RestoreAssist`,
`Synthex`, `Disaster-Recovery`, `DR-NRPG`, `ITR-Button`.

```
for each spoke with open work:
    1. READ    the spoke's tracker state (Linear) — never the spoke's context
    2. CLASSIFY the next stage from the artifact that exists, not from memory
    3. GATE     the stage against the fence
    4. DISPATCH a sub-agent scoped to exactly that stage
    5. RECEIVE  its artifact; verify the artifact exists before marking the stage closed
    6. WRITE    state back to the tracker
    7. RELEASE  every skill and file the stage pulled
```

**Step 5 is the one that matters.** A stage is closed by the existence of its artifact, never by an
agent's report that it finished. Per `proof-discipline`: a claim is not evidence. If the artifact is
absent, the stage is open regardless of what the sub-agent said.

**Authority does not travel with the work.** §6.21/§6.22: a sub-agent inherits objective, constraints,
autonomy level and non-delegables — and never more authority than the orchestrator holds. Permission from
one spoke does not carry to another.

**Spokes are independent.** Work them in parallel where they do not share a substrate; a blocked spoke
must never block a clear one. When a spoke stalls on a gate, record the gate and move to the next spoke —
do not idle waiting.

## Inner loop — self-audit

Runs on cadence, between outer-loop passes.
Full spec: [`docs/orchestrator/03-inner-loop.md`](../../docs/orchestrator/03-inner-loop.md).

1. **Trim** — evict stale cache, dead branches, superseded artifacts, duplicated skills
2. **Flag** — scan its own recent output for claims asserted without a tool result behind them
3. **Tighten** — feed shipped-vs-reverted outcomes back into how it generates code
4. **Log** — every self-modification appended to `.harness/self-mods.jsonl`, board-reviewable

Self-fixes execute freely inside the fence. A self-fix that would touch money or production stops and
asks — including any edit to `fence.json`, the classifier, or the hook itself (§6.2: no system expands its
own permissions).

## Skill checkout / check-in

**Pull a skill when a stage needs it. Release it when the stage ends.** Never pre-load the catalogue.

| Stage | Checks out |
|---|---|
| idea | `nexus-recall`, `brainstorming` |
| research | `nexus-recall`, `source-ingest`, `firecrawl-*` |
| scope | `spm`, `grill-me` |
| plan | `engineering-requirements` (the 17-seat bench), `judge` |
| build | domain skills only — the narrowest that fit |
| test | `qa-lead`, `proof-discipline` |
| ship | `pr-release-gate`, `task-completion-gate` |

Release is not optional bookkeeping — it is the mechanism that lets one orchestrator run a seven-stage
project without ever holding seven stages in context. A skill still loaded after its stage is a leak.

**Route through `skills/index.md`; never invoke a sub-skill directly.** Entry points dispatch their own
children.

## The continuity spine

`idea → research → scope → plan → build → test → ship`

Full spec: [`docs/orchestrator/04-continuity-spine.md`](../../docs/orchestrator/04-continuity-spine.md).

Each stage hands the next a **written artifact**, not a memory. **A stage cannot open until the prior
stage has left its artifact** — that precondition is the thread. The plan parks on Linear as the map.

At ship, the **coverage check**: every requirement from the original idea is marked `built`, `partial`, or
`missing`. Silence is not coverage. A requirement nobody can find is `missing`, not "presumably done".

## Constitution gate

Checked before every self-modifying action, against the compiled `fence.json` — **not** against the
10,859-line prose corpus. Prose cannot gate; see
[`docs/orchestrator/00-constitution-boundary-audit.md`](../../docs/orchestrator/00-constitution-boundary-audit.md),
which found **0 of 16 boundaries currently both unambiguous and hard-stop**.

Six boundaries compile today and are the gate's initial content: §6.6 non-delegables (16 enumerated
prohibitions), §6.21 delegation ceiling, §6.40 compression manifest, §6.42 fingerprint, §6.35 log states,
and KILL.

Fail closed. A missing, unparseable or erroring fence is a **stopped** orchestrator, never an open one.

## What this skill must never do

- **Do the work.** If it is writing implementation code, it has stopped orchestrating. Dispatch.
- **Trust a report over an artifact.** §6.35 distinguishes `attempted` from `completed` for this reason.
- **Carry state in context.** Anything not on the tracker is assumed lost at the next compaction.
- **Re-litigate a denial.** See the fence.
- **Expand its own authority**, or edit the fence that binds it.
- **Treat silence as approval** (§6.25) — an unanswered gate is blocked, not permitted.

## Anti-duplication

This composes; it does not replace. Decision engine → `swarm/nexus/policy.py`. Tiers → `autonomy-ladder`.
Halt → `kill-switch-binding` / `swarm/kill_switch.py`. Cross-tool steps → `dispatcher-core`. Audit rows →
`audit-emit`. Ship gate → `pr-release-gate`. Evidence standard → `proof-discipline`.

It adds one thing none of them has: **the thread between stages, held outside context.**

## Known gap — state honestly at every run

The `PreToolUse` hook does not exist yet, and on phill-desktop the `PermissionRequest` hook returns an
unconditional `allow`. Until both are fixed, this orchestrator's fence is **honour-system**, and it must
say so rather than imply enforcement it does not have.

