@ours.network/fleet-codex 0.3.4 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ours-fleet",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "description": "Spawn, configure, and oversee ours-fleet roles from OpenAI Codex.",
5
5
  "author": {
6
6
  "name": "Adapt Framework Solutions Ltd",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/fleet-codex",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "description": "Native Codex plugin for spawning, configuring, and overseeing ours-fleet agents.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oversee-agents
3
- description: Inspect, monitor, and unstick ours-fleet agents from Codex using their tmux consoles and supervisor state. Use when the user asks to keep an eye on agents, oversee spawned roles, check agent status, babysit a subagent, resolve a fleet prompt, or when Codex has just spawned a role and should verify its progress.
3
+ description: Inspect, monitor, and unstick ours-fleet agents from Codex using their tmux or ACP session controls and supervisor state. Use when the user asks to keep an eye on agents, oversee spawned roles, check agent status, babysit a subagent, resolve a fleet prompt, or when Codex has just spawned a role and should verify its progress.
4
4
  ---
5
5
 
6
6
  # Oversee ours-fleet agents
@@ -8,6 +8,7 @@ description: Inspect, monitor, and unstick ours-fleet agents from Codex using th
8
8
  Use fleet state and console output as evidence:
9
9
 
10
10
  ```sh
11
+ ours-fleet docs
11
12
  ours-fleet ls
12
13
  ours-fleet peek <Name> [lines]
13
14
  ours-fleet status <Name>
@@ -16,27 +17,54 @@ ours-fleet send <Name> "<text>"
16
17
  ours-fleet send <Name> --key <key>
17
18
  ```
18
19
 
20
+ Text `send`, `peek`, and `attach` work for tmux and ACP. Raw `send --key` is
21
+ tmux-only; use the `/permit` control shown by ACP `attach` for ACP permissions.
22
+
19
23
  ## Establish scope
20
24
 
21
25
  Identify wards from the user's request, the current role briefing, or agents
22
26
  just spawned. Confirm the desired check interval when ongoing oversight is
23
27
  requested; default to five minutes only after the user agrees.
24
28
 
25
- This plugin does not add a timer or Claude Code's generic scheduled background
26
- monitor. Before promising recurring checks, identify an explicit timer/recurring
27
- monitor tool that is actually available in the current Codex session. The ours
28
- mail monitor is event-driven and does not provide five-minute timer wakeups. If
29
- no real timer tool is present, say that the interval cannot be armed: offer
30
- active foreground observation or manual checks instead. Never say “I created a
29
+ This plugin does not add a timer or a generic scheduled background monitor.
30
+ Before promising recurring checks, identify an explicit timer/recurring monitor
31
+ tool that is actually available in the current Codex session. The ours mail
32
+ monitor is event-driven and does not provide five-minute timer wakeups. If no
33
+ real timer tool is present, say that the interval cannot be armed: offer active
34
+ foreground observation or manual checks instead. Never say “I created a
31
35
  recurring monitor” based only on this skill. For durable operation, recommend a
32
36
  supervised coordinator role and message-driven wake through `ours-codex`, while
33
37
  remaining clear that messages—not elapsed time—wake it.
34
38
 
35
- ## On each check
39
+ ## One console command is not a liveness verdict
40
+
41
+ This is the mistake that gets busy agents killed. `peek` and `send` tell you what
42
+ happened to YOUR REQUEST. Only one of their outcomes is evidence that the agent
43
+ is gone. On each check run BOTH — they answer different questions:
44
+
45
+ ```sh
46
+ ours-fleet status <Name> # is the role supervised and alive?
47
+ ours-fleet peek <Name> # what is on its console right now?
48
+ ```
49
+
50
+ Read the result you actually got:
51
+
52
+ - **queued** — the session accepted the prompt for '<Name>'; a turn already running is not a failure. → Nothing. Do not resend, and do not read the absence of a reply as a stall — check progress with: ours-fleet peek <Name>
53
+ - **timeout** — '<Name>' did not answer in time; a busy agent looks exactly like this. Check: ours-fleet status <Name> → Treat delivery as UNCERTAIN — the request may already have been acted on, so do not resend it blindly.
54
+ - **rejected** — '<Name>' is running and refused the request. → Fix the request, not the agent. A refusal is proof of life.
55
+ - **control-unavailable** — this says nothing about whether '<Name>' is alive — its control plane did not answer; check: ours-fleet status <Name> → Read the role logs as well. The control plane and the agent are separate things, and one being unreachable is not evidence about the other.
56
+ - **backend** — this is a transport failure, not evidence that '<Name>' is gone; check: ours-fleet status <Name> → Investigate the transport, not the agent.
57
+ - **offline** — '<Name>' is confirmed offline. → This is the ONLY result that justifies a restart on its own: ours-fleet restart <Name> for a permanent role. Read the logs first.
58
+
59
+ Never translate any other result into "dead". `ours-fleet` prints the same
60
+ liveness note the CLI derived the result from, so quote what it said rather than
61
+ paraphrasing it as "not running".
62
+
63
+ ## Judge the console content
36
64
 
37
- Peek once and classify the evidence:
65
+ Once you know the role is alive, classify the evidence:
38
66
 
39
- - **Active and progressing:** leave it alone.
67
+ - **Active and progressing:** leave it alone. A long turn is not a stall.
40
68
  - **Codex MCP authorization prompt:** surface the requested tool and scope.
41
69
  Session-only approval is safer for tests; persistent approval requires the
42
70
  user's explicit authorization.
@@ -46,8 +74,8 @@ Peek once and classify the evidence:
46
74
  context; otherwise escalate.
47
75
  - **Idle with unfinished work:** ask for status and direct it to continue or
48
76
  declare `BLOCKED`.
49
- - **Crash or shell prompt:** inspect logs, diagnose, then restart permanent
50
- roles with `ours-fleet restart <Name>` when safe.
77
+ - **Crash or shell prompt:** inspect logs and diagnose. Restart a permanent role
78
+ with `ours-fleet restart <Name>` only once `status` confirms it is offline.
51
79
  - **Completed temporary role:** report the result and let its supervisor clean
52
80
  up; stop checking it.
53
81
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spawn-ours-agent
3
- description: Spawn and configure a new ours-fleet agent from Codex, either as a supervised persistent role or a temporary tmux agent. Use when the user asks to spawn an agent, create a fleet role, start a background agent, delegate work to another Codex session, choose its model or permissions, or create a subagent that should have its own ours identity and console.
3
+ description: Spawn and configure a new ours-fleet agent from Codex, with a permanent or temporary lifetime and a tmux or ACP session. Use when the user asks to spawn an agent, create a fleet role, start a background agent, delegate work to another Codex session, choose its model, session, or permissions, or create a subagent with its own ours identity and console.
4
4
  ---
5
5
 
6
6
  # Spawn an ours-fleet agent
@@ -8,23 +8,89 @@ description: Spawn and configure a new ours-fleet agent from Codex, either as a
8
8
  Use the `ours-fleet` CLI to create the role. Do not simulate a subagent inside
9
9
  the current conversation.
10
10
 
11
- ## 1. Check the host
12
-
13
- Run:
11
+ ## 1. Read the installed CLI reference — this step is not optional
14
12
 
15
13
  ```sh
14
+ ours-fleet docs
16
15
  ours-fleet doctor --harness codex
17
16
  ```
18
17
 
19
- Stop at a failed required check. Explain that `ours-codex` is preferred for
20
- background mail wake and native `codex` is the supported fallback.
21
-
22
- ## 2. Resolve the role design
18
+ `ours-fleet docs` from the INSTALLED CLI is authoritative for supported session
19
+ backends, permissions, and flags. This skill ships with a plugin and the CLI is
20
+ upgraded separately, so where the two differ the installed reference wins. Stop
21
+ at a failed required doctor check.
22
+
23
+ ## 2. Understand the two permission traps before you choose anything
24
+
25
+ Both traps produce the same symptom: an agent that does less than its briefing
26
+ told it to and reports no error, because the refusal happened inside the harness
27
+ with no console attached to see it.
28
+
29
+ **Trap 1 — a mode that suppresses the prompt without granting the action.** On
30
+ Claude Code this is `dontAsk`, which hides the permission prompt and still
31
+ refuses the action; it is why neutral `--approval allow` maps to
32
+ `bypassPermissions` rather than to the mode whose name sounds milder. On Codex
33
+ the same shape applies to native approval: only `never` reaches the tools
34
+ without a console, and `on-request` becomes a refusal when nobody can answer.
35
+ Judge a native mode by what it grants, not by how permissive its name sounds.
36
+
37
+ **Trap 2 — the unattended capability floor.** A role with no console cannot
38
+ answer a permission request, so the request is refused. `ours-fleet` checks each
39
+ role's resolved permissions against a fixed floor before launch:
40
+
41
+ - `read-state` — read its briefing, ROUTINES.md, and WORKLOG.md
42
+ - `write-state` — append its WORKLOG and its own state files
43
+ - `messaging` — bind its identity, send and receive ours mail
44
+ - `monitor` — arm and observe its mail monitor
45
+ - `workspace-edit` — edit and test files in its working directory
46
+ - `status-commands` — run the inspection commands its briefing prescribes
47
+
48
+ `ours-fleet config` and `ours-fleet doctor` report this per role as
49
+ `unattended floor: <Name>`. Under `--unattended deny` a shortfall FAILS doctor,
50
+ because those requests will be denied silently. Under `--unattended wait` it
51
+ warns, because a human can still attach and answer.
52
+
53
+ What this means in practice, on this harness:
54
+
55
+ | Neutral intent | Native settings | Meets the floor? |
56
+ | --- | --- | --- |
57
+ | `--approval allow --filesystem workspace` | `approval=never sandbox=workspace-write` | yes |
58
+ | `--approval allow --filesystem read-only` | `approval=never sandbox=read-only` | no — no `write-state`, no `workspace-edit` |
59
+ | `--approval ask` | `approval=on-request` | no — `read-state` only |
60
+ | `--approval deny` | `approval=on-request` | no — `read-state` only |
61
+
62
+ ## 3. Choose permissions from the job, not from a default
63
+
64
+ There is no safe blanket default. Ask what the role has to do and whether the
65
+ user authorizes it, then pick:
66
+
67
+ - **It must work with nobody watching** (the usual reason to spawn a fleet
68
+ role): it needs `--approval allow --filesystem workspace`. That is a real
69
+ grant, so get the user's explicit authorization for it, and confine the role
70
+ with `--isolation-file` rather than by withholding permissions it needs.
71
+ Use `--unattended deny` so the role never blocks on an unanswerable request.
72
+ - **A human will attach and answer prompts**: `--approval ask --filesystem
73
+ workspace --unattended wait`. Doctor warns that the floor is unmet — that
74
+ warning is correct and expected; the role will block until someone answers.
75
+ - **The user will not authorize `allow`, and nobody will attend it**: say so
76
+ plainly. That role cannot do its job, and doctor will fail it. Reduce the job
77
+ or get the authorization; do not paper over it with a mode that only hides
78
+ the prompt.
79
+
80
+ Never choose `--filesystem unrestricted`, `--sandbox danger-full-access`, or a
81
+ native `--permission-mode` override without the user asking for it by name and
82
+ understanding what it grants. `harness_options` wins over the neutral block at
83
+ launch, so stating intent in both places and disagreeing is how a role runs on
84
+ settings nobody chose — `ours-fleet config` and `doctor` print a
85
+ `permission conflict: <Name>` line when that happens.
86
+
87
+ ## 4. Resolve the rest of the role design
23
88
 
24
89
  Ask only for choices not already supplied:
25
90
 
26
91
  - **Lifetime:** permanent (supervised, restartable, survives reboot) or
27
- temporary (one tmux session, removed on exit).
92
+ temporary (detached supervisor, removed on exit/reboot).
93
+ - **Session:** `tmux` or `acp`; both lifetimes support both.
28
94
  - **Name:** `[A-Za-z0-9_-]+`; confirm it is absent from `ours-fleet config` and
29
95
  `ours-fleet ls`.
30
96
  - **Mission and working directory.**
@@ -36,64 +102,100 @@ Ask only for choices not already supplied:
36
102
  - **Mail monitoring:** explicitly ask whether to arm it. Pass `--monitor` only
37
103
  after a clear yes. This consent persists in the role configuration.
38
104
 
39
- Offer Codex controls when relevant; otherwise use safe defaults:
105
+ Codex-native controls, offered when relevant:
40
106
 
41
107
  - model: launcher default or `--model <id>`
42
- - approval: `untrusted`, `on-request`, or `never`
43
- - sandbox: `read-only`, `workspace-write`, or `danger-full-access`
108
+ - native approval: `--permission-mode untrusted|on-request|never`
109
+ - native sandbox: `--sandbox read-only|workspace-write|danger-full-access`
44
110
  - launcher: `auto` (preferred), `ours-codex`, or `codex`
45
111
  - profile: `--profile <name>`
46
112
  - search: `--search`
47
113
  - arbitrary config: repeatable `--codex-config key=value`
48
114
  - additional writable roots: repeatable `--add-dir <path>`
49
115
 
50
- Default to `--harness codex --launcher auto --sandbox workspace-write
51
- --permission-mode on-request`. Never select `danger-full-access` or `never`
52
- without explicit user direction.
53
-
54
- ## 3. Materialize approved profile text
116
+ ## 5. Materialize approved profile text
55
117
 
56
118
  Use `apply_patch` to write the approved bio and persona to uniquely named files
57
119
  under `/tmp`. Do not interpolate untrusted text into a shell heredoc.
58
120
 
59
- ## 4. Spawn
121
+ ## 6. Confine the role at creation, not later
60
122
 
61
- Build an argument array from the approved choices. Permanent example:
123
+ `--isolation-file <path>` supplies the role's sandbox policy at creation, so the
124
+ FIRST launch is already confined. A role that only gains `isolation:` on a later
125
+ `up` ran unsandboxed until then. The file holds exactly the `isolation:` mapping
126
+ documented in `ours-fleet docs` and nothing else:
127
+
128
+ ```yaml
129
+ network: deny
130
+ fs:
131
+ read: [/opt/reference]
132
+ resources:
133
+ mem: 2G
134
+ ```
135
+
136
+ An invalid file is rejected before anything is created — no config, no state
137
+ directory, no identity reservation. This is the right control for a role that
138
+ needs `--approval allow`: isolation is the outer boundary a permission mode
139
+ cannot cross.
140
+
141
+ ## 7. Spawn
142
+
143
+ Build an argument array from the approved choices. Permanent, unattended:
62
144
 
63
145
  ```sh
64
146
  ours-fleet spawn Worker --harness codex --launcher auto \
147
+ --session <tmux|acp> \
65
148
  --mission "Own the worker implementation" --cwd /absolute/project \
66
149
  --bio-file /tmp/worker-bio.md --persona-file /tmp/worker-persona.md \
67
- --sandbox workspace-write --permission-mode on-request \
150
+ --approval allow --filesystem workspace --unattended deny \
151
+ --isolation-file /tmp/worker-isolation.yaml \
68
152
  --coordinator Coordinator
69
153
  ```
70
154
 
71
- Add `--temp` for a temporary role and `--monitor` only after monitoring consent.
155
+ Permanent, attended a human will answer its prompts:
156
+
157
+ ```sh
158
+ ours-fleet spawn Worker --harness codex --launcher auto \
159
+ --session <tmux|acp> \
160
+ --mission "Own the worker implementation" --cwd /absolute/project \
161
+ --bio-file /tmp/worker-bio.md --persona-file /tmp/worker-persona.md \
162
+ --approval ask --filesystem workspace --unattended wait
163
+ ```
164
+
165
+ Add `--temp` for a temporary role; it can also use `--session acp`.
166
+ Pass `--monitor` only after monitoring consent.
72
167
  Pass model, profile, search, config, and additional directories exactly as
73
168
  approved. Do not persist secrets in `--codex-config` or fleet YAML; use the
74
169
  role's `env` configuration for environment-based credentials.
75
170
 
76
- ## 5. Verify the real session
77
-
78
- Run:
171
+ ## 8. Verify the real session
79
172
 
80
173
  ```sh
174
+ ours-fleet doctor --harness codex
81
175
  ours-fleet peek <Name> 60
82
176
  ours-fleet status <Name>
83
177
  ```
84
178
 
85
- For a temporary role, status may not have a system service; the tmux console is
86
- authoritative. Confirm that Codex loaded its briefing and reached identity
87
- binding. First use can display Codex authorization prompts for ours MCP tools.
179
+ Read doctor's `permissions: <Name>` and `unattended floor: <Name>` lines for the
180
+ role you just created. `permissions:` shows the neutral intent and the native
181
+ settings it translated to; the floor line lists what the role actually grants,
182
+ or names what is missing. A failure there means the role will silently do less
183
+ than its briefing says — fix the permissions rather than starting it.
184
+
185
+ For ACP, `status` must report `backend: acp`, `alive: true`, and a running/idle
186
+ readiness. For a temporary tmux role, the pane is authoritative. Confirm that
187
+ Codex loaded its briefing and reached identity binding. First use can display
188
+ Codex authorization prompts for ours MCP tools.
88
189
  Surface those prompts to the user; do not grant persistent trust without their
89
- explicit approval. Use `ours-fleet send <Name> --key <choice>` only for the
90
- authorization scope the user approved.
190
+ explicit approval. Use `ours-fleet send <Name> --key <choice>` only for tmux and
191
+ only for the authorization scope the user approved; ACP permissions are answered
192
+ through `ours-fleet attach`.
91
193
 
92
194
  If monitoring was approved, confirm the console reports `arm_monitor` success.
93
195
  Under native Codex, expect the role to surface the `ours-codex` recommendation
94
196
  before offering the blocking foreground fallback.
95
197
 
96
- ## 6. Hand off oversight
198
+ ## 9. Hand off oversight
97
199
 
98
200
  Treat the spawned role as a ward. Use the `oversee-agents` skill for immediate
99
201
  checks and interventions. State clearly whether ongoing timed oversight is