baksohyeon/mogui-ADE-orchestrator
About
Run one AI agent as the orchestrator of your whole workspace, inside the Orca ADE, on the CLI subscription you already pay for. No API key, no model endpoint. Orca hosts and places every session; the harness dispatches workers under contract, verifies their output before accepting it, and hands the role to a fresh session when context runs out.
AI & Machine LearningMeasured star growth
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +4
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalmogui-ADE-orchestrator
I have agents running in tmux sessions. Can I still drive each one manually when I want, and at the same time orchestrate all of those sessions from above? Is tmux-based agent orchestration a thing?
Yes. That is what this is.
Anyone running more than two agents at once hits this; Dorito hit it, got tired of it, and did not want solving it to mean being tied to one vendor's tool.
For a reader who wants the ideas before the install, mogui harness, explained walks through twenty-seven mechanisms, three walkthroughs, and eight concept notes in five-minute pages, with every link pinned to a tagged release.
Watch the three-minute walkthrough. Five animated scenes, each proving one sentence: a pane and a worktree are different places; a contract travels and a read token comes back; a report is not approval; every dispatch leaves rows, and the seat survives its own memory; and what is Orca and what is the harness. Blue is what Orca provides, orange is what the harness adds. Concept view, not a screen recording; the release page has the file, the captions, and the credits.
The player below shows in a web browser. In the GitHub mobile app, tap the picture; the release page has the film.
https://github.com/user-attachments/assets/6740ff43-636d-4929-b03e-9b261ea596f0
Short on time? The harness in one picture, 67 seconds. The system diagram, part by part: the owner, the master, the contract and its read token, the workers in their own checkouts, the Orca mailbox, one pull request, the memory loop, and the template. Same concept view; the release page has the file and the credits.
https://github.com/user-attachments/assets/657a1571-be9a-456d-a866-97d1bc85da1a
Clone it, open it in Orca, start an agent inside the clone, and tell it to wake up. The agent runs the install interview and explains as it goes.
What it does differently
- One master runs the whole workspace. It writes a contract for each worker, dispatches it through a gate that records the contract's hash, and checks the result itself before accepting it.
- "Done" is a claim, not a fact. Acceptance checks are written before dispatch. After a worker reports, the master re-runs or verifies them itself before accepting the result.
- The master outlives its context. When context runs low, the owner can have the master hand the seat to a fresh session, which retires the old one by handshake. The lineage records every generation.
- No API key. It runs on the agent CLI subscriptions you already pay for.
- Vendor-neutral workers. Codex, Claude, Cursor and Grok workers run under the same gate.
Quickstart
- Clone the repository and add it to Orca as a folder.
git clone https://github.com/baksohyeon/mogui-ADE-orchestrator
cd mogui-ADE-orchestrator
- Open a terminal in that folder and start your agent CLI.
- Say
일어나라 마스터여/Wake the master.The agent will ask a session-mode question to route onboarding.

When the three steps are done, or if one fails, continue with Getting Started.
For container setup and its coverage boundary, see .devcontainer/README.md.
Which document do you want?
| You are | Start here |
|---|---|
| Reading about the system for the first time | docs/public/overview.md |
| Installing it on your own machine | docs/public/getting-started.md |
| Agent-executed onboarding steps after wake-up | master-ops/ONBOARDING.md |
| Looking for a specific document | docs/README.md |
| Confused by Orca projects, workspaces, or an "Unavailable worktree" label | docs/public/orca-concepts.md |
| Reading the code | Architecture, then src/master_runtime/core/ |
Documentation in this repository is English. master-ops/ is a template copied and substituted during onboarding. See the index for why the two are separate.
Why these tools
The workspace layer addresses three failures in long-lived coordination. Sessions end while work continues. A master that can spawn workers can waste them. Context loss after compaction can look like continuity. This runtime turns them into checks: guarded succession, append-only lineage, contract-gated dispatch, and boot probes. The probes hold back state after compaction so recall can be measured.
The harness accepts any agent behind a master that can reason. AGENTS.md and CLAUDE.md ship byte-identical, and a repository test asserts it on every change. claude is one example CLI; Claude Code is the exercised host.
The template depends on Orca by design as the required execution substrate for live operation. Orca supplies session lifetime that outlasts a window, stable terminal handles, worktree-scoped placement, and a durable Run (an orchestration context that carries tasks, dispatches, and mailbox messages across restarts). It also supplies a background receiver, supervised dispatch, and pane identity tied to a worktree. Step 0 preflight refuses to proceed until orca status reports a usable runtime. It extracts the connected runtime version from orca status --json and compares it with the minimum declared in master-ops/scripts/orca-surface-baseline.json.
The Orca decision is also a labelled preference. It came from running this harness against other agent development environments. What they offered read as a subset of what Orca offers. That is a preference and it is recorded as one.
For replaceable stack components, five questions decide what belongs in the stack:
- Does it require an API key?
- Does it force telemetry or collect more than the job needs?
- Does it add a management point?
- Does it still work if the operation grows past one person?
- Every tool claims to help with agent context. What else does this one resolve?
Failing the first three usually means a subscription is being presented as a dependency. A tool that passes them but answers nothing for the fifth is a preference. Preferences are allowed, labelled, and kept out of gates. The maintainer-facing version is in CONTRIBUTING.md. The installer-facing version is in master-ops/onboarding/08-settings-and-skills.md, routed from master-ops/ONBOARDING.md.
This project is for people who already pay for coding-agent CLIs and want a workspace orchestrator with no API key and no per-token bill. If you want an API-key process graph, LangChain deepagents is the adjacent project to inspect.
| Tool | What it does here | Replaceable |
|---|---|---|
| Orca | Execution substrate: terminal sessions that outlive windows, worktree placement, dispatch, and retirement. | No |
bd |
Work ledger: issues, dependencies, active tracks, and boot-time task context through master-bootstrap-live. |
Yes, through an adapter |
| ctx | Cross-provider agent history index: one local query surface for prior session text, decisions, commands, and summaries. | Wired to ctx; alternatives exist but have not been evaluated here |
| Git | Source of truth: charters, decisions, runbooks, lineage, and worktree isolation. | No |
The optional skill layer is raised during onboarding. Declining all of it is normal because every script here runs with the base environment. The recommended set has four roles: method guidance, lifecycle hooks, task commands, and durable state. Some Claude Code plugins in that set edit user configuration during install. Onboarding prints commands for the human to run.
If you adopt a context monitor, its warning thresholds can fire before this project's succession threshold. Record in your charter that the warning is advisory. If you patch the monitor instead, its updates can undo the patch.
Agents: ground Orca claims in the Orca docs snapshot agent index before improvising; the link hash may change with snapshot updates.
What one dispatch looks like
- A contract file becomes the dispatch brief. The work lives in a file. The file is hashed, recorded with the gate decision, and carried with the task so the claim can be checked later.
- The dispatch gate checks the request against policy.
scripts/dispatch-gate checkchecks the runtime, model, contract, and estimate against policy. A deny stops the dispatch and is written to the JSONL ledger. - Task creation makes work into state.
orca orchestration task-create --spec <text>creates a task id inside Orca's state machine. - A worktree and terminal isolate the worker.
orca worktree create --name <name>creates a separate checkout.orca terminal create --worktree <selector>opens the worker shell there. - Dispatch binds task to terminal.
orca orchestration dispatch --task <id> --to <handle> --injectattaches the task to the terminal and delivers the worker preamble. The dispatch record stays separate from the shell effect. - Registration measures the running worker.
scripts/dispatch-gate registerprobes the worker session and compares the measured model with the declared model. - Completion arrives through the mailbox. The coordinator waits on
orca orchestration check --wait. The worker sendsworker_done, and the Run mailbox wakes the coordinator. - Acceptance comes from re-verification. The worker report is a claim. The coordinator re-runs gates, reads diffs, examines artifacts, and checks redaction scans.
The dispatch record and the shell effect stay separate, so the two can be compared before the record is trusted.
What is standing guard
The expanded guard inventory is docs/public/defense-inventory.md.
- Dispatch gate and tier fan-out.
scripts/dispatch-gateapplies configured fan-out caps to workers by model tier over a policy window and records each decision in the ledger, except checks run with--no-record. The shipped policy leavesfanout_capsempty, so no tier cap is active by default. - Model identity from transcripts.
scripts/model-identity-probereads recent assistant model fields and compares them with an expected model when supplied. - Placement before master spawn.
scripts/master-succeedverifies the requested worktree placement before spawning a master. - Kickoff boot-card reference.
scripts/master-succeedrequires the succession boot card in the master kickoff. - Empty seat and duplicate masters.
master-ops/onboarding/09-spawn.mdrequires an empty founding seat, whilescripts/master-succeed check-duplicatesdetects duplicate masters at runtime. - Redaction scope.
scripts/redaction-scan.shnames the files and rules covered by the redaction scan. - Revival of frozen sessions.
scripts/master-succeedverifies process, pane, and tty disappearance during retirement. - Progressive onboarding.
master-ops/ONBOARDING.mdroutes one onboarding step per turn and waits for Verify before the next.
Try the core without setup
The core is stdlib-only. These commands exercise pure functions without creating a master session.
$ scripts/master-succeed detect "routine status update" --context-ratio 0.7 --json
$ scripts/dispatch-gate --ledger /tmp/gate.jsonl check \
--runtime codex --model grok-4.5 --contract README.md --agents 1 --est-chars 1000 \
--completion-channel orchestration
$ scripts/adapter doctor
How it fits together
flowchart TB
You(["you"])
subgraph Orca["Orca"]
M["master session<br/>plan, dispatch, verify, retire"]
W1["worker pane<br/>Codex"]
W2["worker pane<br/>Claude"]
W3["worker pane<br/>Cursor, Grok, Gemini"]
M2["successor master"]
end
You -->|"one instruction"| M
You -.->|"open any pane and type"| W1
You -.-> W2
M -->|"contract"| W1
M -->|"contract"| W2
M -->|"contract"| W3
W1 -->|"artifact and evidence"| M
W2 -->|"artifact and evidence"| M
W3 -->|"artifact and evidence"| M
M --> T[("tracker<br/>execution state")]
M --> G[("git<br/>charter, decisions, lineage")]
M ==>|"verified handoff"| M2
G -.->|"boot"| M2
Solid arrows are orchestration. Dotted arrows are direct human control. The panes are real terminals, and you can take over any of them.
Sibling project
Two layers split by unit of operation. This repository owns the workspace. mogui-agent-harness owns one repository.
flowchart LR
subgraph WS["workspace layer"]
A["mogui-ADE-orchestrator<br/>roles, succession, dispatch, lineage"]
end
subgraph RP["repository layer"]
B["mogui-agent-harness<br/>repo rules, hooks, wiki, runbooks"]
end
A -->|"contract, never source coupling"| B
| mogui-agent-harness | mogui-ADE-orchestrator | |
|---|---|---|
| Layer | Repository Harness | Workspace Master Runtime |
| Unit of operation | one repository | a workspace of many repositories |
| Owns | repo-local rules, hooks, wiki, runbooks | orchestration state, roles, succession, lineage |
Either runs alone. Use both when a track crosses repositories and each repository still needs its own rules.
Status
Working and exercised. CI runs the repository test gate for every pull request and every push to main; see the gates workflow. Succession, dispatch-gate, acceptance, compaction, and onboarding paths have run against real workspaces.
The current release is in CHANGELOG.md, which records every version since 0.1.0. CI runs the test gate and committed-rule redaction scan. The local pre-push redaction scan can add organization rules absent from the repository. While the major version is 0, interfaces, CLI flags, and file formats can change in a minor release. Pin a version if you build on it.
The template that onboarding copies is versioned separately at master-ops/TEMPLATE-VERSION. master-ops/CHANGELOG.md records each version. A generated operations repository keeps the template version it copied until you apply an upgrade.
Existing installations: compare the template_version field in your operations repository MANIFEST.json against master-ops/TEMPLATE-VERSION in the current template. If the ops repository is behind, start master-ops/ONBOARDING.md and use its mode router for Reverify or Upgrade.
Core concepts
The orchestrating session is called the master in the docs. That is a role label. During install you pick a callsign for the live session, such as 자비스 / Jarvis, Friday, Alfred, HAL-but-nice, or another short name you will say out loud.
Succession
src/master_runtime/core/succession.py implements master-to-master handoff as an explicit guarded procedure. detect_trigger() classifies signals into IMMEDIATE, ADVISORY, or NONE. Advisory triggers include context usage ratio at or above the 0.60 default and natural milestones. They only propose succession.
The flow builds a handoff, spawns the successor, verifies inherited state, checks for duplicate master instances, and retires the predecessor. Hard safety violations raise SuccessionError.
Lineage
src/master_runtime/core/lineage.py keeps an append-only markdown ledger of every succession: generation number, parent and successor session ids, inherited role and open tracks, verification result, repeated-question count, reopened-decision count, and context-loss summary.
The schema has 13 required fields. Duplicate generations are rejected, and every write is re-verified as append-only. Lineage is observability metadata; it never feeds runtime decisions.
Contract-gated dispatch
src/master_runtime/core/dispatch_gate.py sits between the master and any worker dispatch. Every decision carries a stable reason code; see the ReasonCode definition for the available codes and the Reference for command behavior.
Repeated contract hashes are allowed and recorded with attempt ordinals. register verifies the job id against an artifact probe and measures the worker's actual model. Dry-run callers use check --no-record.
Acceptance loop
src/master_runtime/core/acceptance/ runs candidate changes against a casebook and produces a scorecard. Raw case results and aggregate scores are separate. The casebook owns each case's split. Candidates that change nothing still produce a decision record.
Compaction-resilience probe
scripts/master-bootstrap-live emits a small dynamic bootstrap block. It degrades to a fallback line with exit code 0 on internal error. When the incoming session event reports source == "compact", the hook suppresses Role State and active-track sections. The next session has to recall that state from its own context before the ledger comparison.
Architecture
src/master_runtime/core/
├── bootstrap.py # session boot: charter + handoff + role state, char-budgeted
├── bootstrap_live.py # live boot block for session-start hooks
├── succession.py # trigger detection, handoff, spawn, verify, retire
├── lineage.py # append-only succession ledger
├── dispatch_gate.py # contract-gated worker dispatch decisions
├── recovery.py # recovery flow after abnormal termination
├── watchdog.py # stall detection for dispatched work
├── digest_loop.py # read-only L1 digest loop
├── work_ledger.py # workspace track ledger and session cache
├── context/ # pure filesystem context resolver
├── approval/ # approval gates and registry
├── acceptance/ # casebook-driven acceptance loop
└── adapter/ # adapter layer: doctor, sync CLI profiles
Two principles shape the layout:
- Core / adapter split.
core/modules avoid depending on any specific agent product. Process spawning, ledgers, and tool CLIs go through injected callables andadapter/, so core logic is testable with in-memory fakes. - Vendor neutrality as a direction. The master should run under different agent hosts. The spawn path defaults to
claude. Onboarding asks for the agent CLI and can use a measured runtime as its fallback.core/succession.pystill treats the Claude CLI family specially, and Claude Code remains the most exercised host. The worker side is further along:adapter/profile.pyships synchronous CLI profiles forcodexandcursor-agent.adapter doctorprobes a fixed local tool set, and some Korean-language operator strings are embedded.
Working on the harness
To use the system, follow Getting Started. This section is for changing the harness itself.
Prerequisites: Python 3.11 or newer for the test suite. The Python test job runs on ubuntu-latest, macos-latest, and windows-latest with Python 3.13.17. Branch rules require all three tests contexts, including tests (windows-latest); the Windows matrix leg is measurement-only and continue-on-error allows a Windows failure without failing the job. Keep the root .python-version in sync with .github/workflows/gates.yml by hand because CI does not read it. The runtime is stdlib-only. A tool that needs a newer interpreter locates one at runtime. The Reference table states each tool's behavior in its own row. Contributors can select Python through uv, pyenv, or the system developer tools.
All CLI entry points live in scripts/ and are self-contained:
$ scripts/master-bootstrap --charter path/to/charter.md --json
The core commands are in Try the core without setup.
scripts/master-succeed provides handoff, verify-successor, check-duplicates, retire, and spawn. scripts/master-recover runs recovery from a charter and handoff after abnormal termination. scripts/master-bootstrap-live is a session-start hook. scripts/l1-digest tick advances the read-only digest loop. scripts/acceptance-loop runs the acceptance casebook. Run any of them with --help for current flags.
Tests are the agent's job. Ask the agent working on the harness to run them and report.
Scope
Local only.
- Repository code makes no direct network calls. Every import in
src/andscripts/is standard library, and none are networking imports.git grep -nE "^[[:space:]]*(import|from)[[:space:]]+(urllib|http|socket|ssl|requests)" -- src scriptsreturns nothing. - No API key, model endpoint, or telemetry.
- Reads the folder you point it at and paths you name in config. Redaction scanners read one repository's tracked files through
git ls-files. - The CLIs it drives may reach their own providers. This project adds no provider traffic.
- Master starts with approval prompts off, to run unattended. Shift-Tab cycles the mode.
Limitations
- Master defaults to Claude Code out of the box. The spawn path in
core/succession.pyaccepts an agent parameter and defaults it toclaude. It handles the Claude CLI family specially. Onboarding asks for the agent CLI and records the confirmed runtime. Claude Code is the most exercised host, so it is recommended. - Workers can be any CLI. A worker is a terminal session in an Orca pane. It is whatever binary starts there. Claude, Codex, Cursor, Grok, and Gemini have all run this way under contract. No plugin is required for any of them.
- Codex as master is untried. It should work by design. If you run it, a report or patch is useful.
- Platform evidence is mixed. The test gate runs on Linux, macOS, and Windows. The Windows job runs the Windows-compatible subset in measurement-only mode. Branch rules require the
tests (windows-latest)context, whilecontinue-on-errorallows a Windows failure without failing the job. Tests that require the Unix script execution surface are skipped. Separately, user reports said Linux and Windows worked well, including Windows through WSL; WSL2 was reported as slightly ambiguous but still working. Versions, distributions, and coverage depth were not recorded. - Orca required for live sessions. Pure functions run without it.
What this is not
This repo owns workspace-level orchestration state only. Repo-local rules, hooks, wikis, and runbooks belong to a repository-harness layer. The connection between the two layers is contract-based. Submodules appear only as pinned example fixtures.
License
MIT
Explore related projects
Loading…

