/autonomous-fleet:autonomous-fleet-adapter-codexfrom autonomous-fleet
The CODEX adapter for autonomous-fleet-core. Maps each engine PRIMITIVE to OpenAI Codex mechanics — subagents, git worktrees, shell for git/gh, and the file ledger as durable truth. Load alongside autonomous-fleet-core when running a mission in Codex (app, IDE, or CLI). The coordinator IS the main Codex thread; workers are subagents or worktree-scoped sessions; the file ledger survives compaction.
Ships in autonomous-fleet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Runtime: OpenAI Codex (app, IDE extension, or CLI). The coordinator is the main thread; workers
are Codex subagents or shell-driven sessions in git worktrees. No separate orchestration daemon —
the FILE LEDGER is the durable source of truth. Branch prefix: use BRANCH_PREFIX from core
self-orientation (default fleet/; recorded in DECISIONS.md).
Enable goals if /goal is missing: codex features enable goals or features.goals = true in
config.toml.
| Primitive | Status | Mechanic |
|---|---|---|
| PLACE | real | git worktree add (+ optional container-use) |
| SPAWN_WORKER | real | fresh codex session / codex exec (headless) |
| DISPATCH | real | role-scoped prompt |
| WAIT | degraded | no blocking event API — poll-ledger.sh ledger polling |
| INSPECT | real | shell + gh pr list |
| WORKER_DONE | real | worker return + ledger write |
| ASK / REPLY | absent | no blocking worker→coordinator question exists on this host; workers get DECISION DEFAULTS up front and write BLOCKED to the ledger when a question is unanswerable — a documented FALLBACK, not the engine primitive |
| OPEN_PR / MERGE_PR / CLEANUP | real | gh + worktree remove |
| SYNC_TASK_STATE | degraded | ledger-only (no durable native task view) |
| SET_GOAL family (9–12) | real (interactive) / inert headless | /goal in the app; codex exec is single-shot |
| LOOP_POLL | degraded | automations/cron; unverified end-to-end |
| CONTINUE_WORKER | real | codex exec resume [SESSION_ID] [PROMPT] (VERIFIED codex-cli 0.140.0, issue #91) |
A git repo (REPO_ROOT resolvable) · gh auth status via shell (else local merge-commits into
BASE) · git worktree support · gitleaks availability checked · BASE exists (create off the default
branch at current HEAD if absent) · goals feature enabled for SET_GOAL · OPTIONAL: container-use
MCP (codex mcp add container-use -- container-use stdio, needs Docker) for sandboxed container
placement, see PLACE(independent) via container-use below.
Machine-readable preflight requires-block:
bins: [codex, git, gh]
activity_hooks: true
env: []
auth:
- check: "gh auth status"
skip_if_intent: "no_scm"
intent_gated:
scm: "willClaimExistingPR"
Codex parallelism is via subagents — multiple can run concurrently within one coordinator turn. There is no persistent external task daemon, so:
docs/<mission>-progress.md) is the durable source of truth across turns.independent → git worktree add ../<repo>-<slug>-<run_short> -b <BRANCH_PREFIX><slug>-<run_short> BASE.dependent → current checkout/branch (fresh subagent or sub-session; no new worktree).Register: codex mcp add container-use -- container-use stdio (needs Docker). PLACE(independent) MAY
then use a container-use ENVIRONMENT instead of a host git worktree — the canonical loop is in
engine-workers.md → CONTAINER-USE-PLACEMENT. VERIFIED on a live host: a codex exec worker created an
isolated ubuntu container on its own branch container-use/<env>.
git worktree add per PLACE(independent), drive work in that directory
via shell.Build payload: (1) mission ## Worker skills for the role per core engine.md; (2) task spec and
completion contract. Subagent: full payload in spawn prompt. Sub-session: write payload into
worktree and begin via shell.
Subagents return when done — collect structured results. For sub-sessions, poll ledger + git state. Timeout = checkpoint, not failure. Active worker = alive; do not abort.
Non-busy poll: use ./scripts/poll-ledger.sh --ledger docs/<mission>-progress.md --task <id> --expect '<flag>=t' between codex exec invocations instead of tight loops. Emit trace before
each ledger update (TRACE EMISSION below). Gap 1 status: ledger-poll + helper script (degraded OK).
Read FILE LEDGER + git worktree list + gh pr list --base BASE via shell.
Same as other adapters: gh pr create, conflict-aware rebase + re-review, gh pr merge --merge
(NEVER squash), delete branch. CLEANUP (WT_CLEAN gate): verify MERGED + branch-deleted FIRST;
apply core engine guard clauses — NEVER remove the active/unmerged/dirty worktree; then
git worktree remove ../<repo>-<slug>-<run_short>; set task-row WT_CLEAN=true; pull BASE.
Update FILE LEDGER flag. (No external task daemon — ledger is the task view.)
Codex exposes /goal in the INTERACTIVE thread composer (pair with /plan for ambiguous scope).
HEADLESS CAVEAT: codex exec (the unattended path the headless runner uses) is SINGLE-SHOT and does
NOT interpret slash commands — a /goal ... string in an exec prompt is inert text, and exec runs
one turn then stops. So for headless codex there is no native goal/continuation harness: drive
continuation with an EXTERNAL LOOP_POLL (cron / a loop that re-invokes codex exec on the same repo)
that re-runs until the ledger's DONE condition holds. The /goal mechanic below is for interactive
sessions only.
SET_GOAL: /goal <condition> after ledger init. Shape with /plan first when scope is
ambiguous. Record condition under ## Runtime goal in ledger per runtime-goals.md. Condition must
reference docs/ paths.
UPDATE_GOAL: Log in ledger LAST_UPDATE; Codex goal UI shows progress automatically.
GOAL_COMPLETE: After TERMINATE checks (ledger, readiness, validate-fleet-outcome.sh), mark
goal done in Codex UI or start next thread. Do not declare done before file validation.
GOAL_BLOCKED: Pause goal; write fleet-outcome.status: blocked in readiness.
LOOP_POLL: Codex automations or /loop-equivalent scheduling for CI polling only — not
mission sequencing.
Headless / non-interactive: Codex non-interactive mode with goal in prompt — see
scripts/run-mission-headless.sh codex ….
Before every ledger write, append one JSONL event:
python3 <SUBSTRATE>/emit_trace.py emit .fleet/runs/<run_id>/ \
--primitive WAIT --role COORDINATOR --status started \
--task-id <task> --id-only
Chain worker events with --parent-event. See docs/guide/16-trace-schema.md.
Reviewer isolation on this host — single-vendor caveat (issue #88). A fresh Codex subagent reviewing a Codex build is build-blind as instructed isolation: fresh context, handed only the diff + acceptance criteria, write-isolated. It is NOT the mechanical cross-vendor / separate-process guarantee (Orca's topology) — a same-vendor reviewer can share the builder's blind spots, and nothing in this runtime makes seeing the build session physically impossible. Record
reviewer_mode: same-vendor-instructedin DECISIONS.md and the run outcome. Scope of the "structural" claim: engine-review.md REVIEW step.
Follow the single-sourced contract in
autonomous-fleet-core → references/adapter-contract.md (issue #89 — do
NOT re-inline it here; the drift lint fails copies). It covers run_short
branch/worktree namespacing, the CONTINUE_WORKER resume discipline
(RESUME_COUNT / MAX_RESUME_ATTEMPTS), and reviewer write-isolation. This
adapter's only runtime-specific binding:
codex exec resume <SESSION_ID> (VERIFIED codex-cli 0.140.0); else ALIAS to SPAWN_WORKERWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (ravidsrk/autonomous-fleet) — no native marketplace selected
npx claudepluginhub p/ravidsrk-autonomous-fleet12 skills in this plugin
/adversarial-review-and-fix[Tier 2 · moderate autonomy · full review gate · the proven two-phase workhorse] Run a rigorous CODE-GROUNDED adversarial architecture review of a repo, FREEZE it as the source of truth, then close every confirmed finding one at a time until done. Use for a security/architecture/ reliability hardening pass, a pre-production audit-and-remediate, or "review the whole app and fix everything." Phase 0 reviews the actual source (not existing docs) and a skeptic narrows out false findings; Phase 1 fixes the confirmed set with full safety rails. Runs via the autonomous-fleet-core engine. Trigger on: "adversarial review and fix", "audit and remediate", "review the whole app and fix the issues", "harden this before production", "find and fix the architecture problems"./autonomous-fleetEntry point for the autonomous-fleet multi-agent engineering framework. Use whenever the user wants fully-autonomous coding runs, multi-agent orchestration, PR-per-task pipelines, or mentions autonomous-fleet — even if they have not named a specific mission yet. Routes to one mission or to fleet-program for sequential chains, loads autonomous-fleet-core plus a runtime adapter, and runs unattended on the current repo. Install from github.com/ravidsrk/autonomous-fleet. Trigger on: "use autonomous-fleet", "run autonomous fleet", "autonomous multi-agent run", "fleet mission", "which fleet mission should I use".