delegation-layer 0.3.0 → 0.4.0

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.
Files changed (33) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
  3. package/plugins/delegation-layer/.claude-plugin/plugin.json +1 -1
  4. package/plugins/delegation-layer/.codex-plugin/plugin.json +1 -1
  5. package/plugins/delegation-layer/skills/agent-integration/SKILL.md +16 -8
  6. package/plugins/delegation-layer/skills/agent-integration/evals/evals.json +23 -3
  7. package/plugins/delegation-layer/skills/agent-integration/examples/json-results.md +5 -2
  8. package/plugins/delegation-layer/skills/agent-integration/examples/managed-workspace.md +25 -10
  9. package/plugins/delegation-layer/skills/agent-integration/examples/read-only-task.md +3 -1
  10. package/plugins/delegation-layer/skills/agent-integration/references/ccr.md +5 -4
  11. package/plugins/delegation-layer/skills/agent-integration/references/collaboration.md +2 -2
  12. package/plugins/delegation-layer/skills/agent-integration/references/command-reference.md +69 -33
  13. package/plugins/delegation-layer/skills/agent-integration/references/continuation.md +7 -4
  14. package/plugins/delegation-layer/skills/agent-integration/references/interaction.md +6 -5
  15. package/plugins/delegation-layer/skills/agent-integration/references/result-handling.md +7 -4
  16. package/plugins/delegation-layer/skills/agent-integration/references/routing-rule.json +1 -1
  17. package/plugins/delegation-layer/skills/agent-integration/references/workspaces.md +18 -14
  18. package/plugins/delegation-layer/skills/agent-integration/scripts/delegate-routing-context.sh +2 -2
  19. package/scripts/installer/routing-store.mjs +79 -46
  20. package/skills/agent-integration/SKILL.md +16 -8
  21. package/skills/agent-integration/evals/evals.json +23 -3
  22. package/skills/agent-integration/examples/json-results.md +5 -2
  23. package/skills/agent-integration/examples/managed-workspace.md +25 -10
  24. package/skills/agent-integration/examples/read-only-task.md +3 -1
  25. package/skills/agent-integration/references/ccr.md +5 -4
  26. package/skills/agent-integration/references/collaboration.md +2 -2
  27. package/skills/agent-integration/references/command-reference.md +69 -33
  28. package/skills/agent-integration/references/continuation.md +7 -4
  29. package/skills/agent-integration/references/interaction.md +6 -5
  30. package/skills/agent-integration/references/result-handling.md +7 -4
  31. package/skills/agent-integration/references/routing-rule.json +1 -1
  32. package/skills/agent-integration/references/workspaces.md +18 -14
  33. package/skills/agent-integration/scripts/delegate-routing-context.sh +2 -2
package/README.md CHANGED
@@ -57,8 +57,10 @@ For a manual CLI task, use the packaged
57
57
  [read-only example](skills/agent-integration/examples/read-only-task.md).
58
58
 
59
59
  For recurring work, follow the [scheduler walkthrough](docs/getting-started.md#recurring-tasks)
60
- to save a definition, start the scheduler in your own terminal or tmux pane,
61
- inspect its first result and stop or restart it.
60
+ to start `delegate scheduler serve` in your own terminal or tmux pane, even
61
+ before saving a definition. Agents and manual commands share the CLI's default
62
+ state across projects. The walkthrough covers saving a schedule, inspecting its
63
+ first result and stopping or restarting the host.
62
64
 
63
65
  ## Help and contributing
64
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delegation-layer",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Multi-provider AI agent delegation CLI and Agent Skill for running bounded coding tasks across provider CLIs.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "delegation-layer",
3
3
  "displayName": "Delegation Layer",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "Consult external AI harnesses and CCR-configured models for reviews, research, implementation, and debate through the resumable Delegate CLI.",
6
6
  "author": {
7
7
  "name": "Hesham Karam",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delegation-layer",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Consult external AI harnesses and CCR-configured models for reviews, research, implementation, and debate through the resumable Delegate CLI.",
5
5
  "author": {
6
6
  "name": "Hesham Karam",
@@ -87,11 +87,16 @@ Use a supplied brief or write the worker's bounded assignment and acceptance
87
87
  criteria to a regular file. Do not copy the orchestration request or ask workers
88
88
  to recruit others unless recursive delegation was requested.
89
89
 
90
- Keep the state root outside provider-writable workspaces, provider runtime
91
- directories, and temporary trees they may write. For every task command pass
92
- `--root "${DELEGATE_ROOT:-$HOME/delegation-state}"` directly in that shell
93
- invocation. If the user explicitly requests another root, use that exact path
94
- consistently. Task IDs separate tasks; do not invent per-task roots.
90
+ For ordinary task, schedule, observation, interaction, and continuation commands,
91
+ omit `--root`; the CLI owns default-root resolution for the user's configuration
92
+ context, independently of the project cwd. Do not assemble a default path, use a
93
+ sample path or shell fallback, or treat ambient `DELEGATE_ROOT` as authority.
94
+ Only pass `--root` when the user explicitly supplies a root or existing work has
95
+ an already recorded custom or historical root; preserve that exact path for
96
+ every command concerning that work. Never search other roots for an old task.
97
+ Task IDs separate tasks; do not invent per-task or per-project roots. The state
98
+ root must remain outside provider-writable workspaces, provider runtime
99
+ directories, and temporary trees they may write.
95
100
 
96
101
  Prepare paths and dispatch in one tool invocation; shell variables may not
97
102
  persist between calls. Use saved absolute paths in later calls. Do not use
@@ -125,13 +130,16 @@ original command and intent.
125
130
  ### 5. Observe and collect
126
131
 
127
132
  Follow [observation decisions](references/result-handling.md#observe-and-collect)
128
- with the same root and created task ID:
133
+ with the created task ID, using the CLI default for ordinary work:
129
134
 
130
135
  ```sh
131
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" status TASK_ID --json
132
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" collect TASK_ID --watch 5s --json
136
+ delegate status TASK_ID --json
137
+ delegate collect TASK_ID --watch 5s --json
133
138
  ```
134
139
 
140
+ For work bound to an explicit custom or historical root, add its exact
141
+ `--root` to both commands under the [root rule](#3-prepare-separate-paths-and-a-finite-brief).
142
+
135
143
  Apply the owning decision order before waiting: terminal outcomes and concrete
136
144
  errors, cancellation/timeout/interruption, interaction, then pending
137
145
  observation. Keep collection in the foreground until completion or a reported
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "normal-dispatch",
12
12
  "prompt": "Run one bounded task through the available agent provider.",
13
- "expected": ["dispatch --auto", "--json", "save task_id", "status", "collect"]
13
+ "expected": ["dispatch --auto", "omit --root on ordinary commands", "--json", "save task_id", "status", "collect"]
14
14
  },
15
15
  {
16
16
  "name": "model-discovery-when-needed",
@@ -68,9 +68,29 @@
68
68
  "expected": ["use status with returned task_id", "read saved dispatch response if needed", "do not dispatch again to print an exit code", "exactly one admitted task for the assignment"]
69
69
  },
70
70
  {
71
- "name": "supplied-root-across-shell-calls",
71
+ "name": "ambient-root-ignored-across-shell-calls",
72
72
  "prompt": "DELEGATE_ROOT is already set. Consult a separate external agent and answer its questions; each shell tool call starts a new shell.",
73
- "expected": ["use supplied DELEGATE_ROOT on dispatch, status, collect, reply, steer, and continue", "resolve the same root in each shell call", "no invented task-specific root"]
73
+ "expected": ["omit --root on dispatch, status, collect, reply, steer, and continue", "ambient DELEGATE_ROOT has no root-selection authority", "CLI resolves its default in the same user/configuration context", "no assembled default, shell fallback, sample path, or per-task root"]
74
+ },
75
+ {
76
+ "name": "ordinary-root-from-another-project",
77
+ "prompt": "DELEGATE_ROOT is unset. An admitted task was dispatched without --root in project A. Observe and continue it from project B in the same user/configuration context.",
78
+ "expected": ["omit --root on status, collect, and continue", "use the recorded task ID", "CLI default is independent of project cwd", "no path guessed from project A or B", "no search across roots"]
79
+ },
80
+ {
81
+ "name": "explicit-root-across-shell-calls",
82
+ "prompt": "For this isolated test, I explicitly choose the state root /state/custom with spaces. Consult a separate external agent and answer its questions; each shell tool call starts a new shell.",
83
+ "expected": ["pass --root with the exact single argument /state/custom with spaces on dispatch, status, collect, reply, steer, and continue", "quote the root in shell commands", "save and reassign absolute brief and response paths in each needed shell invocation", "no ambient variable or fallback overrides the explicit choice"]
84
+ },
85
+ {
86
+ "name": "historical-root-continuation",
87
+ "prompt": "An eligible predecessor task has recorded historical root /state/legacy with spaces. Continue that exact task and collect its successor. The current CLI default is different.",
88
+ "expected": ["pass the exact recorded --root argument /state/legacy with spaces on continue, status, and collect", "use the exact predecessor and returned successor IDs", "no fresh dispatch", "do not move or search for the task in the default root"]
89
+ },
90
+ {
91
+ "name": "ordinary-schedule-root",
92
+ "prompt": "Create a recurring task in this project, then inspect its definition, history, and execution from another project in the same user/configuration context. No custom state root was requested.",
93
+ "expected": ["omit --root on schedule create, list, show, history, and execution", "keep the definition's own project --cwd", "no per-project root", "do not start a persistent scheduler inside the agent task", "forward any returned scheduler.serve_command argv intact"]
74
94
  },
75
95
  {
76
96
  "name": "pending-without-questions",
@@ -1,8 +1,11 @@
1
1
  # JSON decision sketch
2
2
 
3
+ Use the created task's exact ID as `TASK_ID` and follow the main skill's
4
+ [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief).
5
+
3
6
  ```sh
4
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" status "$TASK_ID" --json
5
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" collect "$TASK_ID" --watch 5s --json
7
+ delegate status TASK_ID --json
8
+ delegate collect TASK_ID --watch 5s --json
6
9
  ```
7
10
 
8
11
  Apply [result handling](../references/result-handling.md) to each response and
@@ -3,14 +3,18 @@
3
3
  Use this example for independent write work that should be isolated in a
4
4
  retained Git worktree. The source must be a Git checkout and the state root
5
5
  must remain outside provider-writable workspaces.
6
+ Commands use the CLI default under the main skill's
7
+ [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief); preserve any
8
+ explicit custom or recorded historical root on all related commands.
6
9
 
7
10
  ```sh
8
11
  SOURCE="$PWD"
9
- BRIEF="$(mktemp)"
10
- RESPONSE="$(mktemp)"
12
+ BRIEF="$(mktemp)" || exit 1
13
+ RESPONSE="$(mktemp)" || exit 1
11
14
  printf '%s\n' 'Implement the requested change and report the files changed.' >"$BRIEF"
15
+ printf 'Saved response: %s\n' "$RESPONSE"
12
16
 
13
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" dispatch --auto \
17
+ if delegate dispatch --auto \
14
18
  --brief "$BRIEF" --cwd "$SOURCE" \
15
19
  --permission workspace-write --isolation git-worktree \
16
20
  --base HEAD --workspace-budget 5m --budget 30m --json >"$RESPONSE"; then
@@ -26,9 +30,13 @@ Read the saved JSON before running another command. When
26
30
  `task_record: "created"`, use its `task_id` as `TASK_ID` below. When no task
27
31
  was created, follow the [result decisions](../references/result-handling.md#managed-workspace-results);
28
32
  do not run task status or collection against that nonexistent record.
33
+ Each later block is a separate shell invocation. Replace `ABS_SAVED_RESPONSE`
34
+ with the printed absolute response path and the ID placeholders with the actual
35
+ returned IDs; reassign the path in each invocation.
29
36
 
30
37
  ```sh
31
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" status TASK_ID --json >"$RESPONSE.status"; then
38
+ RESPONSE="ABS_SAVED_RESPONSE"
39
+ if delegate status TASK_ID --json >"$RESPONSE.status"; then
32
40
  status_exit=0
33
41
  else
34
42
  status_exit=$?
@@ -43,7 +51,8 @@ before running another command. Run the collection below only when that
43
51
  guidance calls for it.
44
52
 
45
53
  ```sh
46
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" collect TASK_ID --watch 5s --json >"$RESPONSE.collect"; then
54
+ RESPONSE="ABS_SAVED_RESPONSE"
55
+ if delegate collect TASK_ID --watch 5s --json >"$RESPONSE.collect"; then
47
56
  collect_exit=0
48
57
  else
49
58
  collect_exit=$?
@@ -64,7 +73,8 @@ Before release, wait for the workspace to return to `state: retained` and inspec
64
73
  its final capture. Only after the Lead explicitly chooses release, run:
65
74
 
66
75
  ```sh
67
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" workspace release WORKSPACE_ID \
76
+ RESPONSE="ABS_SAVED_RESPONSE"
77
+ if delegate workspace release WORKSPACE_ID \
68
78
  --budget 5m --json >"$RESPONSE.release"; then
69
79
  release_exit=0
70
80
  else
@@ -95,8 +105,9 @@ owns every response decision.
95
105
 
96
106
  ```sh
97
107
  SOURCE="$PWD"
98
- RESPONSE="$(mktemp)"
99
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" checkpoint create \
108
+ RESPONSE="$(mktemp)" || exit 1
109
+ printf 'Saved response: %s\n' "$RESPONSE"
110
+ if delegate checkpoint create \
100
111
  --cwd "$SOURCE" --budget 5m --json >"$RESPONSE.checkpoint"; then
101
112
  checkpoint_exit=0
102
113
  else
@@ -109,9 +120,12 @@ cat "$RESPONSE.checkpoint"
109
120
  Exit `3` with `checkpoint.id` and `next_action: "watch_checkpoint"` means the
110
121
  request was accepted, not captured. Use that `checkpoint.id` as
111
122
  `CHECKPOINT_ID`. Do not run `create` again.
123
+ For the later checkpoint blocks, replace `ABS_SAVED_RESPONSE` with the absolute
124
+ response path printed by this checkpoint invocation.
112
125
 
113
126
  ```sh
114
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" checkpoint status CHECKPOINT_ID \
127
+ RESPONSE="ABS_SAVED_RESPONSE"
128
+ if delegate checkpoint status CHECKPOINT_ID \
115
129
  --watch 30s --json >"$RESPONSE.checkpoint.status"; then
116
130
  checkpoint_status_exit=0
117
131
  else
@@ -130,7 +144,8 @@ dispatch example, replacing `--base HEAD` with `--base COMMIT_OID`. Report a
130
144
  When the Lead no longer needs the checkpoint, remove it explicitly:
131
145
 
132
146
  ```sh
133
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" checkpoint remove CHECKPOINT_ID \
147
+ RESPONSE="ABS_SAVED_RESPONSE"
148
+ if delegate checkpoint remove CHECKPOINT_ID \
134
149
  --budget 5m --json >"$RESPONSE.checkpoint.remove"; then
135
150
  checkpoint_remove_exit=0
136
151
  else
@@ -2,6 +2,8 @@
2
2
 
3
3
  Run from the intended workspace, outside Delegate's private state root.
4
4
  Use a catalog provider ID in place of `--auto` when a destination was named.
5
+ This example uses the CLI default under the main skill's
6
+ [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief).
5
7
  Prepare paths and dispatch in this same shell invocation:
6
8
 
7
9
  ```sh
@@ -13,7 +15,7 @@ Inspect the workspace and summarize the current test failures. Do not edit files
13
15
  You are the assigned worker; perform this task without delegating it.
14
16
  EOF
15
17
  printf 'Saved response: %s\n' "$RESPONSE"
16
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" dispatch --auto \
18
+ if delegate dispatch --auto \
17
19
  --brief "$BRIEF" --cwd "$WORKSPACE" \
18
20
  --permission read-only --budget 30m --json >"$RESPONSE"; then
19
21
  dispatch_exit=0
@@ -3,18 +3,19 @@
3
3
  Use this reference when asked to consult Claude Code Router (CCR), use one of
4
4
  its configured model aliases, or compare its models with other harnesses.
5
5
  CCR runs Claude Code against a configured third-party or local provider.
6
- `ROOT` below is the exact absolute state root selected for dispatch; use it
7
- unchanged for model discovery and dispatch.
6
+ Use the CLI default under the main skill's
7
+ [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief); preserve any
8
+ explicit custom or recorded historical root for model discovery and dispatch.
8
9
 
9
10
  1. Resolve CCR through `delegate providers --json`; its profile is `ccr:print`.
10
11
  2. Preserve an explicitly requested CCR alias as `--model ALIAS`. Do not replace
11
12
  it with an upstream model ID or reject it solely because discovery omitted it.
12
13
  3. If no alias was chosen, run
13
- `delegate --root ROOT models --provider ccr:print --cwd ABSOLUTE_WORKSPACE --json`.
14
+ `delegate models --provider ccr:print --cwd ABSOLUTE_WORKSPACE --json`.
14
15
  Choose a suitable configured alias from the available metadata and report
15
16
  the choice. Clarify when the intended model remains ambiguous. If discovery
16
17
  is unavailable and no alias is known, report the blocker; do not guess.
17
- 4. Dispatch through Delegate with the same `--root ROOT`,
18
+ 4. Dispatch through Delegate with
18
19
  `--provider ccr:print --model ALIAS`, the brief, workspace, permission, finite
19
20
  budget, and `--json`. Use the normal status, collect, and continuation procedure
20
21
  from the main skill.
@@ -45,7 +45,7 @@ RECEIPTS="$(mktemp -d)" || exit 1
45
45
  # Set these absolute paths and catalog IDs in this same tool invocation.
46
46
  # BRIEF_A and BRIEF_B contain the real independent assignments.
47
47
  (
48
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" dispatch --provider "$PROVIDER_A" \
48
+ if delegate dispatch --provider "$PROVIDER_A" \
49
49
  --brief "$BRIEF_A" --cwd "$WORKSPACE_A" \
50
50
  --permission read-only --budget 30m --json \
51
51
  >"$RECEIPTS/review-a.json" 2>"$RECEIPTS/review-a.stderr"; then
@@ -56,7 +56,7 @@ RECEIPTS="$(mktemp -d)" || exit 1
56
56
  printf '%s\n' "$dispatch_exit" >"$RECEIPTS/review-a.exit"
57
57
  ) &
58
58
  (
59
- if delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" dispatch --provider "$PROVIDER_B" \
59
+ if delegate dispatch --provider "$PROVIDER_B" \
60
60
  --brief "$BRIEF_B" --cwd "$WORKSPACE_B" \
61
61
  --permission read-only --budget 30m --json \
62
62
  >"$RECEIPTS/review-b.json" 2>"$RECEIPTS/review-b.stderr"; then
@@ -24,13 +24,15 @@ The main skill owns [root selection](../SKILL.md#3-prepare-separate-paths-and-a-
24
24
  | `schedule` | [Recurring definitions](#schedules), [history and execution evidence](#schedule-history-and-execution) | None |
25
25
  | `scheduler serve/status/stop` (when supported), `scheduler run` | [User-started host and compatibility runtime](#scheduler-runtime) | Due occurrences use normal dispatch; status/stop do not launch providers |
26
26
 
27
- Prefix every task command with `delegate --root ROOT`, using the same
28
- explicit root across invocations.
27
+ The commands below use the CLI default and omit `--root`. The advanced override
28
+ syntax is `delegate --root ABS COMMAND ...`; use it only for an explicitly
29
+ supplied or already recorded custom or historical root, preserved exactly under
30
+ the main skill's [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief).
29
31
 
30
32
  ## Dispatch
31
33
 
32
34
  ```text
33
- delegate --root ROOT dispatch [--auto | --provider ID] --brief FILE \
35
+ delegate dispatch [--auto | --provider ID] --brief FILE \
34
36
  --cwd ABS [--id TASK_ID] [--permission MODE] [--budget DURATION] \
35
37
  [--model MODEL] [--effort EFFORT] [--native-timeout DURATION] \
36
38
  [--interactive] [--review-target TARGET] [--resume-task TASK_ID] \
@@ -170,8 +172,8 @@ setup, even when there is no matching Team or project default.
170
172
  After a task record is created, inspect the same ID and root:
171
173
 
172
174
  ```sh
173
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" status TASK_ID --json
174
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" collect TASK_ID --watch 5s --json
175
+ delegate status TASK_ID --json
176
+ delegate collect TASK_ID --watch 5s --json
175
177
  ```
176
178
 
177
179
  Dispatch/status/collect optionally expose top-level `team`, the admitted
@@ -198,18 +200,18 @@ another create to obtain a running scheduler.
198
200
  See [definition and host results](result-handling.md#schedule-definition-and-host-results).
199
201
 
200
202
  ```text
201
- delegate --root ROOT schedule create --brief FILE --cwd ABS \
203
+ delegate schedule create --brief FILE --cwd ABS \
202
204
  [--auto | --provider ID] --cron 'MIN HOUR DOM MONTH DOW' \
203
205
  [--timezone ZONE] [--id SCHEDULE_ID] [--model MODEL] [--effort EFFORT] \
204
206
  [--permission MODE] [--budget DURATION] [--native-timeout DURATION] \
205
207
  [--review-target TARGET] \
206
208
  [--team-scope user|project --team TEAM_ID --member MEMBER_ID] \
207
209
  [--project-root ABS] --json
208
- delegate --root ROOT schedule list [--after SCHEDULE_ID] [--limit N] --json
209
- delegate --root ROOT schedule show SCHEDULE_ID --json
210
- delegate --root ROOT schedule pause SCHEDULE_ID --json
211
- delegate --root ROOT schedule resume SCHEDULE_ID --json
212
- delegate --root ROOT schedule delete SCHEDULE_ID --json
210
+ delegate schedule list [--after SCHEDULE_ID] [--limit N] --json
211
+ delegate schedule show SCHEDULE_ID --json
212
+ delegate schedule pause SCHEDULE_ID --json
213
+ delegate schedule resume SCHEDULE_ID --json
214
+ delegate schedule delete SCHEDULE_ID --json
213
215
  ```
214
216
 
215
217
  - Requested provider options remain as supplied, including omissions. Creation
@@ -245,9 +247,10 @@ delegate --root ROOT schedule delete SCHEDULE_ID --json
245
247
  history. Pause/delete do not cancel an active occurrence or require a live
246
248
  host. Create/resume preserve the saved definition even when the host is
247
249
  absent, starting, in backoff or otherwise not confirmed ready.
248
- - Only create initializes absent schedule storage. An absent store lists as
249
- empty; show/state commands report not found. List defaults to 50 rows, at most
250
- 100, including paused/deleted definitions. Use the returned cursor to page.
250
+ - Among schedule management commands, only create initializes absent storage.
251
+ An absent store lists as empty; show/state commands report not found. List
252
+ defaults to 50 rows, at most 100, including paused/deleted definitions. Use the
253
+ returned cursor to page.
251
254
  - Create/state responses are compact. Show returns saved requested choices and
252
255
  brief metadata, not brief contents, with a 2 MiB response limit. Keep the ID
253
256
  when output or storage reports uncertainty; inspect it with show rather than
@@ -265,8 +268,8 @@ timestamp range has a distinct range error, not a claim of permanent invalidity.
265
268
  ### Schedule history and execution
266
269
 
267
270
  ```text
268
- delegate --root ROOT schedule history SCHEDULE_ID [--before RFC3339Nano] [--limit N] --json
269
- delegate --root ROOT schedule execution TASK_ID --json
271
+ delegate schedule history SCHEDULE_ID [--before RFC3339Nano] [--limit N] --json
272
+ delegate schedule execution TASK_ID --json
270
273
  ```
271
274
 
272
275
  `history` returns occurrence summaries and compact skipped intervals together,
@@ -292,22 +295,49 @@ Missing task files and corrupt evidence are distinct; see
292
295
  [scheduled result handling](result-handling.md#scheduled-execution-results)
293
296
  for freshness, no-result states, response bounds, exit codes and recovery.
294
297
 
298
+ ## Supervisor owner control
299
+
300
+ ```sh
301
+ delegate supervisor stop-owner --json
302
+ ```
303
+
304
+ Use only when the installed build advertises this command. Preserve the explicit
305
+ root for work bound to a custom or historical root. This command contacts one
306
+ existing infrastructure owner; it does not initialize, repair or start one.
307
+ It leaves Pueue and admitted tasks running. Startup, accepted operations and
308
+ unresolved cleanup can make the owner busy.
309
+
310
+ The `supervisor_owner` response separates `state` (`serving_released`,
311
+ `not_initialized`, `busy` or `unknown`) from `process_closure` (`closed`,
312
+ `pending` or `unknown`). A released owner can remain alive as the sole waiter for
313
+ its daemon; serving release is not proof of process exit or root quiescence.
314
+ The optional `process` value (`pid`, `start_token`) identifies the validated
315
+ selected `startup`; it does not establish liveness. It is omitted when no owner
316
+ was selected or validated. Observe that exact incarnation after daemon shutdown;
317
+ a new root-selected stop can address a newer owner.
318
+ An absent root reports `not_initialized` with unknown process closure.
319
+ Exit `0` reports the observed release or uninitialized state, `3` reports busy,
320
+ and `1` reports a control or observation fault. Preserve an uncertain result;
321
+ the command does not resend an uncertain stop request. Human output exposes
322
+ the same separate observations.
323
+
295
324
  ## Scheduler runtime
296
325
 
297
326
  Check `delegate help` for the installed build's command surface. Use `serve`,
298
327
  `status` and `stop` only when that help advertises them; prefer `serve` for managed
299
- recovery. The signatures below describe the current command surface. Keep the
300
- same explicit absolute `ROOT` used by the schedule commands.
328
+ recovery. The signatures below describe the current command surface. They use
329
+ the same CLI default as ordinary schedule commands; preserve an explicit custom
330
+ or historical root when the schedule is bound to one.
301
331
 
302
332
  ```text
303
- delegate --root ROOT scheduler serve
304
- delegate --root ROOT scheduler status
305
- delegate --root ROOT scheduler stop
306
- delegate --root ROOT scheduler run [--pueue-config ABS] [--json]
333
+ delegate scheduler serve
334
+ delegate scheduler status
335
+ delegate scheduler stop
336
+ delegate scheduler run [--pueue-config ABS] [--json]
307
337
  ```
308
338
 
309
339
  If installed help offers only `scheduler run`, the user runs
310
- `delegate --root ROOT scheduler run` in an independent terminal or tmux pane and
340
+ `delegate scheduler run` in an independent terminal or tmux pane and
311
341
  leaves it in the foreground. Ctrl-C in its original pane stops it; it has no
312
342
  automatic child restart. Keep the saved schedule ID and inspect
313
343
  [history and execution](#schedule-history-and-execution) for actual occurrences.
@@ -332,9 +362,13 @@ When present, `scheduler.serve_command` preserves spaces and shell metacharacter
332
362
  as separate arguments. Human output also prints JSON argv, not an unquoted shell string.
333
363
  Preserve those boundaries; see the [scheduler response fields](result-handling.md#schedule-definition-and-host-results).
334
364
 
335
- Serve requires existing schedule storage; create owns initialization. A second
336
- host or competing `run` cannot acquire the same root's ownership. The host uses
337
- its retained launch context and the saved requested provider choices. For
365
+ Explicit `serve` may initialize absent scheduler storage through the same
366
+ scheduler owner lease used by `schedule create`. It can become ready with no
367
+ definitions; later creates reach that running host without a restart. Existing
368
+ root identity and data stay in place; invalid existing storage fails explicitly.
369
+ Passive reads and low-level `run` do not initialize absent storage. A second host
370
+ or competing `run` cannot acquire the same root's ownership. The host uses its
371
+ retained launch context and the saved requested provider choices. For
338
372
  Team-targeted schedules, new occurrences read the pinned catalog's latest Member
339
373
  defaults through normal admission; existing task IDs retain saved settings. Use
340
374
  the intended user configuration context, or a different catalog instance fails
@@ -452,8 +486,8 @@ A checkpoint is Git-content evidence, not a provider outcome.
452
486
  ## Providers and capabilities
453
487
 
454
488
  ```sh
455
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" providers --json
456
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" capabilities --provider PROVIDER_ID --json
489
+ delegate providers --json
490
+ delegate capabilities --provider PROVIDER_ID --json
457
491
  ```
458
492
 
459
493
  `providers` returns `schema_version: 1` and a sorted `providers` array.
@@ -479,9 +513,11 @@ Inspection-backed admission can return `status: "ready"` with
479
513
  `verification: "runtime"` after its probe. Managed runtime-only admission
480
514
  keeps the catalog projection; its supervised worker checks compatibility before
481
515
  provider execution. Collect the created task to establish the result.
482
- Optional protocol members `version` and `executable_sha256` are diagnostics,
483
- not launch authority. Live acceptance remains separate (`not_run`, `passed`,
484
- or `blocked`); a blocked prerequisite is unresolved.
516
+ Provider versions are optional diagnostics. Historical executable-digest members
517
+ remain readable as recorded data. Do not depend on these fields or calculate new
518
+ executable fingerprints for diagnostics or admission. Required behavior and the
519
+ selected installed executable govern compatibility. Live acceptance remains separate (`not_run`,
520
+ `passed`, or `blocked`); a blocked prerequisite is unresolved.
485
521
 
486
522
  ## Choosing models and effort
487
523
 
@@ -490,7 +526,7 @@ them. Keep defaults when no explicit choice is needed. Resolve a natural-languag
490
526
  name through native discovery:
491
527
 
492
528
  ```sh
493
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" models \
529
+ delegate models \
494
530
  --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE --json
495
531
  ```
496
532
 
@@ -533,7 +569,7 @@ reason codes and return no model facts.
533
569
  Use static preflight when readiness was requested, not before every task:
534
570
 
535
571
  ```sh
536
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" preflight \
572
+ delegate preflight \
537
573
  --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE \
538
574
  --permission REQUESTED_MODE --json
539
575
  ```
@@ -22,7 +22,7 @@ When `status` or `collect` reports a timed-out turn with:
22
22
  run:
23
23
 
24
24
  ```sh
25
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" continue \
25
+ delegate continue \
26
26
  --task PREDECESSOR_TASK_ID \
27
27
  --brief FOLLOW_UP_BRIEF \
28
28
  --budget 30m \
@@ -35,8 +35,11 @@ indefinitely for a publication that the interrupted turn cannot complete.
35
35
 
36
36
  The follow-up brief is optional. If it is omitted, Delegation Layer reuses the
37
37
  validated predecessor brief. A successful continuation returns a new task ID
38
- and links it to the predecessor. Observe and collect the new ID separately. Always retain the original state
39
- root, even if a returned command hint omits it. Permission is inherited; do not
38
+ and links it to the predecessor. Observe and collect the new ID separately.
39
+ Follow the main skill's [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief):
40
+ ordinary continuation omits `--root` in the same user/configuration context;
41
+ an explicit custom or recorded historical root must be retained exactly, even
42
+ if a returned command hint omits it. Permission is inherited; do not
40
43
  add `--permission` to `continue`. Apply
41
44
  [task creation](result-handling.md#task-creation) before retrying or observing.
42
45
  Any authorized admission retry remains the argv-equivalent `continue`;
@@ -85,7 +88,7 @@ observe that successor instead; if its creation is uncertain, follow the
85
88
  `workspace.id` from the task response; never guess an ID or path:
86
89
 
87
90
  ```sh
88
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" workspace status \
91
+ delegate workspace status \
89
92
  WORKSPACE_ID --watch 30s --json
90
93
  ```
91
94
 
@@ -62,7 +62,7 @@ question. A printed question alone is not a pending reply request.
62
62
  together with the exact answers. Submit the reply:
63
63
 
64
64
  ```sh
65
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" reply "$task_id" \
65
+ delegate reply "$task_id" \
66
66
  --request "$request_id" --answers "$answers_file" \
67
67
  --id "$message_id" --json
68
68
  ```
@@ -70,9 +70,10 @@ question. A printed question alone is not a pending reply request.
70
70
  6. Keep collecting. A receipt is not task completion. Only the task's
71
71
  authoritative `outcome` establishes the final result.
72
72
 
73
- Use the same root expression for dispatch, collection, reply, and steering.
74
- If the user explicitly chose another root, use that exact path for all of
75
- them. The other variables stand for actual values saved from this task;
73
+ Follow the main skill's [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief)
74
+ for dispatch, collection, reply, and steering. The examples use the CLI default;
75
+ preserve an explicit custom or recorded historical root for all of them.
76
+ The variables stand for actual values saved from this task;
76
77
  reassign them in each shell invocation if your tool does not preserve variables.
77
78
  A pending response without questions means keep collecting, not inspect OS
78
79
  processes or dispatch a replacement task.
@@ -86,7 +87,7 @@ reply IDs and earlier steering IDs. Submit it; for a lost response, follow the
86
87
  [delivery rules](#interpret-delivery-precisely) with the same ID and content:
87
88
 
88
89
  ```sh
89
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" steer "$task_id" \
90
+ delegate steer "$task_id" \
90
91
  --brief "$guidance_file" --id "$steering_message_id" --json
91
92
  ```
92
93
 
@@ -2,6 +2,9 @@
2
2
 
3
3
  Read response fields independently. A successful control command is not a
4
4
  successful provider result.
5
+ Examples use the CLI default under the main skill's
6
+ [root rule](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief); preserve an
7
+ explicit custom or recorded historical root on related commands.
5
8
 
6
9
  ## Task control response
7
10
 
@@ -49,7 +52,7 @@ this table to each dispatch or continuation attempt separately, in order:
49
52
  | Response | Next action |
50
53
  |---|---|
51
54
  | Usage error, no JSON response | Correct the reported syntax using Delegate help or `providers --json`, then invoke that request again. Parsing failed before admission. |
52
- | `task_record: not_created`, `failure.code: supervisor_upgrade_required`, and `failure.next_action: run_supervisor_migrate` | Run `delegate --root "<the exact absolute state root used by the failed command>" supervisor migrate --json` once. Retry the exact original admission argv once only after `supervisor_control.state: migrated` and `supervisor_control.next_action: retry_dispatch`; otherwise stop and report the migration response. Preserve an explicit custom root exactly. A failed `continue` must be retried as the same `continue`; never replace it with a fresh `dispatch` or a direct provider call. |
55
+ | `task_record: not_created`, `failure.code: supervisor_upgrade_required`, and `failure.next_action: run_supervisor_migrate` | Run `delegate supervisor migrate --json` once in the same user/configuration context for ordinary default-root work. If the failed command used an explicit custom or recorded historical root, run `delegate --root "<the exact absolute root used by the failed command>" supervisor migrate --json` instead. Retry the exact original admission argv once only after `supervisor_control.state: migrated` and `supervisor_control.next_action: retry_dispatch`; otherwise stop and report the migration response. A failed `continue` must be retried as the same `continue`; never replace it with a fresh `dispatch` or a direct provider call. |
53
56
  | `task_record: not_created` and `failure.next_action: correct_request` | Correct that request and retry it. |
54
57
  | `task_record: not_created`, `failure.code: workspace_provision_pending` or `workspace_busy`, and `failure.next_action: watch_workspace` | Follow [managed workspace recovery](#managed-workspace-results) using the same root and workspace. Once ready, retry the exact admission command and inputs. A failed `continue` remains that same `continue`, never a new dispatch. |
55
58
  | `task_record: not_created`, `failure.code: resource_pressure`, `failure.next_action: retry_later`, and `failure.retry_after_seconds: 30` | Delegate checked the host and confirmed resource pressure, so no ordinary task record was created and no provider task is running for this attempt. Do not poll or observe a task. Choose one: report the refusal and stop, or wait at least 30 seconds in the foreground and retry the exact original admission argv once. A `continue` stays that same `continue`. If the retry is refused again, report and stop. Never loop, retry in the background, schedule a retry, or run Pueue or process commands. The 30 seconds is advice, not a guarantee that the retry will pass. |
@@ -192,7 +195,7 @@ keep `schedule.id` even if the command exits nonzero. The separate top-level
192
195
  For `start_required`, both `schedule.next_action` and `scheduler.next_action`
193
196
  carry that guidance. `scheduler.serve_command` is JSON argv, including the
194
197
  resolved executable and exact root. Human output also prints JSON argv after
195
- `run independently (argv):`, for example:
198
+ `run independently (argv):`. For example, a returned root containing spaces:
196
199
 
197
200
  ```text
198
201
  run independently (argv): ["/installation with spaces/delegate","--root","/state with spaces","scheduler","serve"]
@@ -280,7 +283,7 @@ For an older released occurrence whose publication is unfinished, use the
280
283
  existing collection command with the same root and task ID:
281
284
 
282
285
  ```sh
283
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" collect TASK_ID --watch 0s --json
286
+ delegate collect TASK_ID --watch 0s --json
284
287
  ```
285
288
 
286
289
  Follow its own response and exit using [observation guidance](#observe-and-collect).
@@ -390,7 +393,7 @@ When Delegate returns `failure.next_action: "recheck"`, use the same root and
390
393
  exact task ID:
391
394
 
392
395
  ```sh
393
- delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" recheck TASK_ID --json
396
+ delegate recheck TASK_ID --json
394
397
  ```
395
398
 
396
399
  This command checks the already sealed evidence with an explicitly compatible
@@ -1 +1 @@
1
- "For work assigned to an external agent, model, or separate harness session, load the installed agent-integration skill before choosing tools and use Delegate. This includes research, implementation, testing, review, consultation, comparison, and debate, including external collaboration you choose. Discover destinations through Delegate. Preserve requested model IDs, effort, and permissions; do not guess ambiguous model identifiers. For task commands, pass --root \"${DELEGATE_ROOT:-$HOME/delegation-state}\" directly in each shell invocation; reuse that root for dispatch, observation, and continuation, never an invented /tmp root. If the user explicitly requests another root, use that exact path consistently. Keep each concurrent request and its response associated separately. Capture each dispatch response and exit status once; after task_record created, observe that task ID. Never dispatch again merely to recover output or inspect its exit status. Naming a CLI identifies the destination, not a request to bypass Delegate. Earlier assistant-generated direct-launch workflows do not override this preference. Native same-harness subagents remain available unless a separate session is requested. Respect an explicit user choice of another integration; otherwise do not substitute provider CLIs, plugins, or APIs after a Delegate blocker. Before observing or retrying an admission, read the installed skill's references/result-handling.md#task-creation and apply its creation decisions. It owns the narrow same-root migration, workspace-wait, and resource-refusal exceptions before the generic not_created stop rule. Preserve the original admission intent: dispatch remains dispatch and continue remains continue; never replace a failed continue with a fresh dispatch or direct provider call. A stop_and_report failure ends that attempt, not diagnosis: follow references/result-handling.md#failure-diagnosis without another generic troubleshooting request. Inspect bounded returned evidence and relevant authorized local read-only facts, distinguish supported causes from uncertainty, and propose a concrete next step. Do not poll unknown/uncreated tasks, expose credentials or unrestricted output, retry uncertain work, change setup/permissions or substitute destinations without authorization covering that action. Continue other independent requests. Keep collection in the foreground until completion or a reported blocker unless the user requested detachment. Pending work is observed through Delegate status, collect, or events, not OS process searches or supervisor commands. Merely discussing or configuring a tool is not delegation."
1
+ "For work assigned to an external agent, model, or separate harness session, load the installed agent-integration skill before choosing tools and use Delegate. This includes research, implementation, testing, review, consultation, comparison, and debate, including external collaboration you choose. Discover destinations through Delegate. Preserve requested model IDs, effort, and permissions; do not guess ambiguous model identifiers. For ordinary task, schedule, observation, interaction, and continuation commands, omit --root and let the CLI resolve its default in the same user/configuration context, independently of project cwd. Never assemble a default path, use a sample path or shell fallback, or treat ambient DELEGATE_ROOT as authority. Only pass --root for an explicitly user-supplied or already recorded custom or historical root; preserve that exact path for every command concerning its work. Do not search other roots for an old task or invent per-task or per-project roots. Keep each concurrent request and its response associated separately. Capture each dispatch response and exit status once; after task_record created, observe that task ID. Never dispatch again merely to recover output or inspect its exit status. Naming a CLI identifies the destination, not a request to bypass Delegate. Earlier assistant-generated direct-launch workflows do not override this preference. Native same-harness subagents remain available unless a separate session is requested. Respect an explicit user choice of another integration; otherwise do not substitute provider CLIs, plugins, or APIs after a Delegate blocker. Before observing or retrying an admission, read the installed skill's references/result-handling.md#task-creation and apply its creation decisions. It owns the narrow same-root migration, workspace-wait, and resource-refusal exceptions before the generic not_created stop rule. Preserve the original admission intent: dispatch remains dispatch and continue remains continue; never replace a failed continue with a fresh dispatch or direct provider call. A stop_and_report failure ends that attempt, not diagnosis: follow references/result-handling.md#failure-diagnosis without another generic troubleshooting request. Inspect bounded returned evidence and relevant authorized local read-only facts, distinguish supported causes from uncertainty, and propose a concrete next step. Do not poll unknown/uncreated tasks, expose credentials or unrestricted output, retry uncertain work, change setup/permissions or substitute destinations without authorization covering that action. Continue other independent requests. Keep collection in the foreground until completion or a reported blocker unless the user requested detachment. Pending work is observed through Delegate status, collect, or events, not OS process searches or supervisor commands. Merely discussing or configuring a tool is not delegation."