delegation-layer 0.1.38 → 0.2.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.
- package/README.md +45 -320
- package/package.json +1 -1
- package/plugins/delegation-layer/.claude-plugin/plugin.json +1 -1
- package/plugins/delegation-layer/.codex-plugin/plugin.json +1 -1
- package/plugins/delegation-layer/skills/agent-integration/SKILL.md +127 -355
- package/plugins/delegation-layer/skills/agent-integration/evals/cases.json +240 -0
- package/plugins/delegation-layer/skills/agent-integration/evals/routing.json +54 -0
- package/plugins/delegation-layer/skills/agent-integration/examples/read-only-task.md +29 -6
- package/plugins/delegation-layer/skills/agent-integration/examples/workspace-write-task.md +12 -10
- package/plugins/delegation-layer/skills/agent-integration/references/collaboration.md +5 -2
- package/plugins/delegation-layer/skills/agent-integration/references/command-reference.md +412 -145
- package/plugins/delegation-layer/skills/agent-integration/references/continuation.md +20 -12
- package/plugins/delegation-layer/skills/agent-integration/references/interaction.md +20 -7
- package/plugins/delegation-layer/skills/agent-integration/references/result-handling.md +246 -81
- package/plugins/delegation-layer/skills/agent-integration/references/routing-rule.json +1 -1
- package/plugins/delegation-layer/skills/agent-integration/references/workspaces.md +33 -0
- package/skills/agent-integration/SKILL.md +127 -355
- package/skills/agent-integration/evals/cases.json +240 -0
- package/skills/agent-integration/evals/routing.json +54 -0
- package/skills/agent-integration/examples/read-only-task.md +29 -6
- package/skills/agent-integration/examples/workspace-write-task.md +12 -10
- package/skills/agent-integration/references/collaboration.md +5 -2
- package/skills/agent-integration/references/command-reference.md +412 -145
- package/skills/agent-integration/references/continuation.md +20 -12
- package/skills/agent-integration/references/interaction.md +20 -7
- package/skills/agent-integration/references/result-handling.md +246 -81
- package/skills/agent-integration/references/routing-rule.json +1 -1
- package/skills/agent-integration/references/workspaces.md +33 -0
|
@@ -1,170 +1,439 @@
|
|
|
1
1
|
# Command reference
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`--json`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
workspace workaround. Ordinary tasks support non-Git directories. Git is
|
|
9
|
-
required for managed worktree creation/attachment and checkpoint creation or
|
|
10
|
-
removal only; native review retains
|
|
11
|
-
its separate explicit review-target contract. See [managed workspace guidance](workspaces.md)
|
|
12
|
-
for the policy owner.
|
|
13
|
-
|
|
14
|
-
| Command | Purpose | Launches provider work? |
|
|
3
|
+
Paths passed to `--root`, `--cwd`, and `--brief` must be absolute.
|
|
4
|
+
Use `--json` and preserve the response and process exit separately.
|
|
5
|
+
The main skill owns [root selection](../SKILL.md#3-prepare-separate-paths-and-a-finite-brief).
|
|
6
|
+
|
|
7
|
+
| Command | Purpose | Provider execution |
|
|
15
8
|
| --- | --- | --- |
|
|
16
|
-
| `delegate --version` |
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
step for a `supervisor_upgrade_required` admission response. Run it once with
|
|
34
|
-
the failed command's exact root. A successful response names its next action
|
|
35
|
-
`retry_dispatch`, but the original command and argv remain authoritative:
|
|
36
|
-
retry `dispatch` as `dispatch` or `continue` as `continue`, exactly once.
|
|
37
|
-
|
|
38
|
-
The bundled supervisor is managed by the released CLI under the state root.
|
|
39
|
-
Collection remains observational. Provider authentication remains the
|
|
40
|
-
provider’s own responsibility and is never performed by this skill.
|
|
41
|
-
|
|
42
|
-
Dispatch flags:
|
|
43
|
-
|
|
44
|
-
- `--brief FILE`: bounded task instructions; for `codex:review`, the brief is
|
|
45
|
-
retained as task evidence and the explicit review target supplies Codex's
|
|
46
|
-
native scope;
|
|
47
|
-
- `--cwd ABS`: workspace for the delegated turn;
|
|
48
|
-
- `--permission read-only|workspace-write`: read-only investigation or authorized unattended write execution, including commands (not independent containment);
|
|
49
|
-
- `--budget DURATION`: finite turn budget;
|
|
50
|
-
- `--auto`: let the CLI select a ready provider;
|
|
51
|
-
- `--provider ID`: preserve the caller’s named harness or provider, resolved through the catalog;
|
|
52
|
-
- `--review-target uncommitted|base:BRANCH|commit:SHA`: select the explicit Git state for `codex:review`; it is required for that read-only profile and unsupported by other profiles;
|
|
53
|
-
- `--model MODEL` and `--effort VALUE`: provider-advertised choices (CCR requires a model alias);
|
|
54
|
-
Codex maps effort to TOML `model_reasoning_effort` for ordinary turns or a native
|
|
55
|
-
turn parameter for interactive turns, while Claude and AGY
|
|
56
|
-
pass native effort flags; Pi maps effort to `--thinking`; OpenCode sends model
|
|
57
|
-
and effort as acknowledged ACP session options; CCR forwards effort to Claude and uses `--model` as a CCR alias; `default` is omitted;
|
|
58
|
-
- `--interactive`: enable advertised native clarification and steering; see [interaction](interaction.md);
|
|
59
|
-
- `--native-timeout DURATION`: optional provider-native timeout where advertised.
|
|
9
|
+
| `delegate --version` | Check the control CLI | None |
|
|
10
|
+
| `providers --json` | List compiled profiles | None |
|
|
11
|
+
| `capabilities --provider ID --json` | Read a compiled contract | None |
|
|
12
|
+
| `models --provider ID [--cwd ABS] --json` | Discover model/effort facts | Native inspection, no admitted task |
|
|
13
|
+
| `preflight --provider ID --cwd ABS --json` | Check static readiness | None |
|
|
14
|
+
| `dispatch [--auto \| --provider ID] ... --json` | Admit a bounded turn; a Member may supply the destination | At most one launch attempt |
|
|
15
|
+
| `status TASK --json` | Observe task state | No launch |
|
|
16
|
+
| `collect TASK [--watch DURATION] --json` | Read or wait for publication | No launch |
|
|
17
|
+
| `logs TASK --json` | Read validated stream descriptors | No launch |
|
|
18
|
+
| `cancel TASK --json` | Record an explicit stop | No launch |
|
|
19
|
+
| `continue --task TASK ... --json` | Create an exact-session successor | At most one successor launch attempt |
|
|
20
|
+
| `recheck TASK --json` | Reassess eligible evidence offline | None |
|
|
21
|
+
| `reply`, `steer`, `events` | [Active interaction](interaction.md) | No new launch |
|
|
22
|
+
| `workspace`, `checkpoint` | [Git resources](workspaces.md) | Helpers, not provider turns |
|
|
23
|
+
| `teams` | [Optional configuration and Member selection](#teams) | None |
|
|
24
|
+
| `schedule` | [Recurring definitions](#schedules), [history and execution evidence](#schedule-history-and-execution) | None |
|
|
25
|
+
| `scheduler run` | [Independent scheduler](#scheduler-runtime) | Admits due occurrences through normal dispatch |
|
|
60
26
|
|
|
61
|
-
|
|
27
|
+
Prefix every task command with `delegate --root ROOT`, using the same
|
|
28
|
+
explicit root across invocations.
|
|
29
|
+
|
|
30
|
+
## Dispatch
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
delegate --root ROOT dispatch [--auto | --provider ID] --brief FILE \
|
|
34
|
+
--cwd ABS [--id TASK_ID] [--permission MODE] [--budget DURATION] \
|
|
35
|
+
[--model MODEL] [--effort EFFORT] [--native-timeout DURATION] \
|
|
36
|
+
[--interactive] [--review-target TARGET] [--resume-task TASK_ID] \
|
|
37
|
+
[--team-scope user|project --team TEAM_ID --member MEMBER_ID] \
|
|
38
|
+
[--project-root ABS] --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Option | Contract |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `--brief FILE` | Regular file, at most 8 MiB; task input, not a raw provider argument. |
|
|
44
|
+
| `--cwd ABS` | Existing workspace, disjoint from the private state root. Ordinary tasks support non-Git directories. |
|
|
45
|
+
| `--auto` | Try static admission in deterministic provider-ID order; choose the first statically ready candidate. |
|
|
46
|
+
| `--provider ID` | Named catalog profile; mutually exclusive with `--auto`. |
|
|
47
|
+
| `--id TASK_ID` | Optional 32-character lowercase hexadecimal ID; omit to allocate. |
|
|
48
|
+
| `--permission MODE` | Default `read-only`; authorized `workspace-write` requests unattended commands and edits. Native access can extend beyond the workspace. |
|
|
49
|
+
| `--budget DURATION` | Positive Go duration; default `30m`, or `1h` for `codex:review`. Queue time is excluded. |
|
|
50
|
+
| `--model MODEL` | Exact selector for a profile advertising `model`: Codex, CCR, Claude, AGY, Pi, or OpenCode. CCR requires a configured alias. |
|
|
51
|
+
| `--effort VALUE` | Advertised effort selector; omitted or `default` preserves native defaults. |
|
|
52
|
+
| `--native-timeout DURATION` | Antigravity print timeout, no greater than `--budget`. |
|
|
53
|
+
| `--interactive` | Enable the profile's advertised native interaction; steering is a separate capability. See [interaction](interaction.md). |
|
|
54
|
+
| `--review-target TARGET` | Required only for native [Codex review](#codex-review). |
|
|
55
|
+
| `--resume-task TASK_ID` | Compatibility form for exact-predecessor continuation; prefer [continue](continuation.md). |
|
|
56
|
+
| `--team-scope`, `--team`, `--member` | Supply all three to choose one explicit [Member](#using-a-member); no implicit Team or Role-only target. |
|
|
57
|
+
| `--project-root ABS` | Explicit containing root for a non-Git project-scoped Member; invalid without that target or in a Git context. |
|
|
58
|
+
|
|
59
|
+
Without a Team target, exactly one of `--provider` and `--auto` is required.
|
|
60
|
+
A bound Member may supply an omitted destination; an unbound Member still
|
|
61
|
+
requires an explicit provider or auto. See [Teams](#teams) for saved defaults.
|
|
62
|
+
|
|
63
|
+
Codex maps effort to TOML `model_reasoning_effort` for ordinary turns or a
|
|
64
|
+
native parameter for interactive turns. CCR, Claude, and AGY pass their native
|
|
65
|
+
effort flag. Pi maps it to `--thinking`; OpenCode sends acknowledged ACP
|
|
66
|
+
session options, with model before effort. CCR treats model as a CCR alias.
|
|
67
|
+
|
|
68
|
+
Raw provider arguments, token ceilings, and dollar ceilings are not public
|
|
69
|
+
options. Preserve the selected workspace; do not initialize Git or change
|
|
70
|
+
trust settings as a workaround.
|
|
71
|
+
|
|
72
|
+
Every task ID identifies one immutable request and at most one provider launch
|
|
73
|
+
attempt. Changing its request is rejected; repeating it cannot grant another
|
|
74
|
+
launch. A selected provider's failure does not select a fallback.
|
|
75
|
+
Read [task creation](result-handling.md#task-creation) before any retry.
|
|
76
|
+
|
|
77
|
+
Omit `--runner`: Delegate selects its managed worker. A custom override
|
|
78
|
+
conflicting with managed workspaces or a predecessor returns `invalid_request`
|
|
79
|
+
with `managed_workspace_runner_conflict` or `continuation_runner_conflict`.
|
|
80
|
+
Correct it only under the returned task-creation guidance.
|
|
81
|
+
|
|
82
|
+
## Teams
|
|
83
|
+
|
|
84
|
+
Teams are optional configuration managed through the CLI and stored in SQLite.
|
|
85
|
+
The [Teams guide](https://github.com/hishamkaram/delegation-layer/blob/main/docs/teams.md)
|
|
86
|
+
owns definition examples, scopes/worktrees, safe edits, optional project defaults,
|
|
87
|
+
availability, saved-task semantics and limitations. Do not edit the catalog as
|
|
88
|
+
JSON or introduce another catalog file. `--root` remains an execution-state
|
|
89
|
+
option; it does not select a Team catalog or initialize execution state for
|
|
90
|
+
management commands.
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
delegate teams register --scope user|project --definition FILE_OR_DASH \
|
|
94
|
+
[--cwd ABS] [--project-root ABS] --json
|
|
95
|
+
delegate teams update --scope user|project --team TEAM_ID --expected-revision N \
|
|
96
|
+
--definition FILE_OR_DASH [--cwd ABS] [--project-root ABS] --json
|
|
97
|
+
delegate teams delete --scope user|project --team TEAM_ID --expected-revision N \
|
|
98
|
+
[--cwd ABS] [--project-root ABS] --json
|
|
99
|
+
delegate teams list [--cwd ABS] [--project-root ABS] [--limit N] [--after CURSOR] --json
|
|
100
|
+
delegate teams show --scope user|project --team TEAM_ID \
|
|
101
|
+
[--cwd ABS] [--project-root ABS] --json
|
|
102
|
+
delegate teams default show --cwd ABS [--project-root ABS] --json
|
|
103
|
+
delegate teams default set --cwd ABS [--project-root ABS] \
|
|
104
|
+
--team-scope user|project --team TEAM_ID --json
|
|
105
|
+
delegate teams default clear --cwd ABS [--project-root ABS] --json
|
|
106
|
+
```
|
|
62
107
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
108
|
+
- `--definition` reads a strict bounded definition from a file, or stdin when
|
|
109
|
+
its value is `-`. Register takes the Team ID from that definition; update
|
|
110
|
+
requires it to match `--team`. Update/delete require a positive current
|
|
111
|
+
`--expected-revision`; read it with show before deciding on a mutation.
|
|
112
|
+
- `--scope user` management takes no project context. `--scope project` requires
|
|
113
|
+
explicit `--cwd`; non-Git context also requires `--project-root`. List without
|
|
114
|
+
`--cwd` returns user Teams only; with context it also includes project Teams.
|
|
115
|
+
List defaults to 50 rows, at most 100. Pass returned `next_cursor` unchanged
|
|
116
|
+
as the exclusive `--after` cursor, retaining the same project context.
|
|
117
|
+
- Default commands always require project context. Set references a user Team
|
|
118
|
+
or a Team in that project. Show reports `unset`, `resolved` or `stale`;
|
|
119
|
+
clear is idempotent. The preference never selects a Member automatically.
|
|
120
|
+
- List, show and default show are passive; they neither initialize/migrate/repair
|
|
121
|
+
storage nor inspect provider readiness. A missing catalog lists as empty;
|
|
122
|
+
unreadable/corrupt storage remains an error. Safe partial listings carry
|
|
123
|
+
diagnostics, including unresolved project context or invalid individual rows.
|
|
68
124
|
|
|
69
|
-
|
|
125
|
+
Management JSON uses `schema_version: 1`, `command: "teams"`, `action`,
|
|
126
|
+
optional `default_action`, and `status` (`ok`, `empty`, `partial`, or `failed`).
|
|
127
|
+
Optional typed fields are `catalog_id`, `team`, `teams`, `next_cursor`,
|
|
128
|
+
`mutation`, `default`, `diagnostics`, `failure`, and `error` with
|
|
129
|
+
`error_truncated` when needed. Show's `team` has `reference`, `revision`,
|
|
130
|
+
and `definition`; list returns summaries, not complete definitions.
|
|
131
|
+
Register/update return `mutation.validation` with `definition: "validated"`,
|
|
132
|
+
`provider_capabilities: "validated"`, and `readiness: "not_checked"`.
|
|
133
|
+
Management never claims that a provider/model can execute.
|
|
134
|
+
|
|
135
|
+
Handler exit `0` means a successful read/mutation, including empty/no-default
|
|
136
|
+
and safe partial results. Exit `2` means invalid input/definition, an unknown
|
|
137
|
+
explicit target, revision conflict or project/catalog identity mismatch.
|
|
138
|
+
Exit `1` means operational/storage/schema failure. These do not replace task
|
|
139
|
+
or scheduler exit semantics. Argument errors may retain normal stderr usage
|
|
140
|
+
without JSON. Responses are bounded to 2 MiB; a successful mutation with output
|
|
141
|
+
failure is not permission to repeat it. Inspect the same target/default first.
|
|
142
|
+
For a revision conflict, inspect the current revision; for uncertain storage
|
|
143
|
+
or close errors, inspect durable state before deciding on another mutation.
|
|
144
|
+
|
|
145
|
+
### Using a Member
|
|
146
|
+
|
|
147
|
+
The lead inspects list/show and optional project-default guidance, then passes
|
|
148
|
+
all three target flags on dispatch or schedule creation. Match a named provider
|
|
149
|
+
through the existing provider catalog; preserve exact caller model/effort IDs.
|
|
150
|
+
Models are advisory, not an admission allowlist. Blocked optional discovery
|
|
151
|
+
does not prevent registration of a valid supported definition.
|
|
152
|
+
|
|
153
|
+
Caller options override Member defaults. A provider change discards model/effort
|
|
154
|
+
inherited from the previous provider; explicit replacement values survive.
|
|
155
|
+
`--auto` conflicts with a provider-bound Member. Roles grant no permission,
|
|
156
|
+
budget or routing authority. Keep the requested workspace, root and permissions.
|
|
157
|
+
For a Local target, the canonical source project owns identity across linked
|
|
158
|
+
worktrees; reject a mismatch rather than retargeting.
|
|
159
|
+
|
|
160
|
+
New task IDs and new scheduled occurrences resolve latest defaults once.
|
|
161
|
+
Same-ID replay/recovery and exact-session continuation retain saved selection
|
|
162
|
+
and settings without a catalog read. Continuation accepts its existing supported
|
|
163
|
+
overrides but rejects new Team/Member targeting flags. Preserve explicit target
|
|
164
|
+
failures; no substitution or automatic retry is added. If no Team target was
|
|
165
|
+
requested, ordinary provider/auto delegation stays available without catalog
|
|
166
|
+
setup, even when there is no matching Team or project default.
|
|
167
|
+
|
|
168
|
+
### Team task context
|
|
169
|
+
|
|
170
|
+
After a task record is created, inspect the same ID and root:
|
|
70
171
|
|
|
71
172
|
```sh
|
|
72
|
-
delegate --root
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
+
```
|
|
176
|
+
|
|
177
|
+
Dispatch/status/collect optionally expose top-level `team`, the admitted
|
|
178
|
+
immutable context from the task request. It includes the scoped target and
|
|
179
|
+
catalog ID, Team revision, names/purpose, Roles, Member and original caller
|
|
180
|
+
intent. Human output includes scope, Team ID, Member ID and revision. These
|
|
181
|
+
reads do not consult the catalog; an edit or deletion cannot change that saved
|
|
182
|
+
view. This differs from the live catalog record returned by `teams show`.
|
|
183
|
+
The task's canonical execution fields remain authoritative. Apply normal
|
|
184
|
+
[result decisions](result-handling.md#task-control-response); Team context does
|
|
185
|
+
not prove admission, provider readiness or successful publication.
|
|
186
|
+
|
|
187
|
+
## Schedules
|
|
188
|
+
|
|
189
|
+
The management commands below save and inspect definitions. They do not start
|
|
190
|
+
a scheduler, launch a provider, or prove that a task ran. Start the
|
|
191
|
+
[scheduler](#scheduler-runtime) separately to execute due occurrences.
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
delegate --root ROOT schedule create --brief FILE --cwd ABS \
|
|
195
|
+
[--auto | --provider ID] --cron 'MIN HOUR DOM MONTH DOW' \
|
|
196
|
+
[--timezone ZONE] [--id SCHEDULE_ID] [--model MODEL] [--effort EFFORT] \
|
|
197
|
+
[--permission MODE] [--budget DURATION] [--native-timeout DURATION] \
|
|
198
|
+
[--review-target TARGET] \
|
|
199
|
+
[--team-scope user|project --team TEAM_ID --member MEMBER_ID] \
|
|
200
|
+
[--project-root ABS] --json
|
|
201
|
+
delegate --root ROOT schedule list [--after SCHEDULE_ID] [--limit N] --json
|
|
202
|
+
delegate --root ROOT schedule show SCHEDULE_ID --json
|
|
203
|
+
delegate --root ROOT schedule pause SCHEDULE_ID --json
|
|
204
|
+
delegate --root ROOT schedule resume SCHEDULE_ID --json
|
|
205
|
+
delegate --root ROOT schedule delete SCHEDULE_ID --json
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
- Requested provider options remain as supplied, including omissions. Creation
|
|
209
|
+
validates inputs without checking provider installation, authentication or
|
|
210
|
+
readiness. It does not create a managed workspace. Interactive requests,
|
|
211
|
+
continuation/session options and supervisor/runner overrides are unsupported.
|
|
212
|
+
- Optional [Member targeting](#using-a-member) follows dispatch's destination
|
|
213
|
+
requirements. Creation validates the target and pins its catalog instance ID,
|
|
214
|
+
while saving raw caller overrides/omissions. Each new occurrence resolves
|
|
215
|
+
latest defaults; a different catalog instance or missing target fails without
|
|
216
|
+
fallback. A saved target change needs a new schedule. Follow the operator
|
|
217
|
+
[scheduler upgrade procedure](https://github.com/hishamkaram/delegation-layer/blob/main/docs/cli-reference.md#scheduler-upgrades)
|
|
218
|
+
before using Team-targeted definitions; mixed-version readers are unsupported.
|
|
219
|
+
- Cron has five fields and minute precision. Lists, ranges, steps and month/day
|
|
220
|
+
names are supported. Sunday is `0` or `SUN`, not `7`. `N/step` runs from `N`
|
|
221
|
+
through that field's maximum. Descriptors such as `@daily`, seconds, years,
|
|
222
|
+
embedded timezones, `?` and Quartz extensions are unsupported.
|
|
223
|
+
- Day-of-month and weekday restrictions follow the cron parser: when both fields
|
|
224
|
+
are restricted, either may match. `*` or `*/1` makes both fields necessary;
|
|
225
|
+
patterned steps such as `*/2` and full restricted ranges retain the either-field
|
|
226
|
+
behavior. Choose explicit fields for the intended recurrence.
|
|
227
|
+
- `--timezone` accepts a named zone such as `Europe/Berlin` or `UTC`. Omission
|
|
228
|
+
captures the host/process zone at creation. Later host changes do not change
|
|
229
|
+
it. An empty value or `Local` is invalid; if automatic resolution fails,
|
|
230
|
+
supply the zone explicitly.
|
|
231
|
+
- Missing dates/local times are skipped without moving the appointment or
|
|
232
|
+
disabling the definition. February 29 runs in leap years. A repeated local
|
|
233
|
+
minute runs only at its first chronological occurrence. Warnings are advisory;
|
|
234
|
+
they do not predict every future timezone change.
|
|
235
|
+
- Definitions are immutable. Pause blocks future admissions; resume skips the
|
|
236
|
+
interval from the stored cursor through now without catch-up. A clock behind
|
|
237
|
+
the cursor leaves that cursor unchanged. Delete is terminal and retains
|
|
238
|
+
history. Pause/delete do not cancel an active occurrence.
|
|
239
|
+
- Only create initializes absent schedule storage. An absent store lists as
|
|
240
|
+
empty; show/state commands report not found. List defaults to 50 rows, at most
|
|
241
|
+
100, including paused/deleted definitions. Use the returned cursor to page.
|
|
242
|
+
- Create/state responses are compact. Show returns saved requested choices and
|
|
243
|
+
brief metadata, not brief contents, with a 2 MiB response limit. Keep the ID
|
|
244
|
+
when output or storage reports uncertainty; inspect it with show rather than
|
|
245
|
+
submitting another create. Reusing an existing ID conflicts.
|
|
246
|
+
|
|
247
|
+
Handler results use exit `0` for success/advisory warnings, `2` for invalid
|
|
248
|
+
input/state transitions and `1` for not-found, conflicts or operational failures.
|
|
249
|
+
`--json` applies to handler responses; argument/usage errors retain the CLI's
|
|
250
|
+
normal stderr behavior. A valid rule with no future occurrence in the supported
|
|
251
|
+
timestamp range has a distinct range error, not a claim of permanent invalidity.
|
|
252
|
+
|
|
253
|
+
### Schedule history and execution
|
|
254
|
+
|
|
255
|
+
```text
|
|
256
|
+
delegate --root ROOT schedule history SCHEDULE_ID [--before RFC3339Nano] [--limit N] --json
|
|
257
|
+
delegate --root ROOT schedule execution TASK_ID --json
|
|
80
258
|
```
|
|
81
259
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
260
|
+
`history` returns occurrence summaries and compact skipped intervals together,
|
|
261
|
+
newest first by occurrence due time or interval end. It defaults to 50 entries,
|
|
262
|
+
at most 100. The returned continuation timestamp is the exclusive `--before`
|
|
263
|
+
cursor; use it unchanged for the next page. Newer entries appear when you start
|
|
264
|
+
a fresh first page, not as a frozen snapshot across requests. A skip is one
|
|
265
|
+
stored `(from, to]` interval with a reason, not an invented task for each minute.
|
|
266
|
+
|
|
267
|
+
`execution` accepts the task ID of one scheduled occurrence, including a released
|
|
268
|
+
one. It joins validated local task evidence with the occurrence and its cached
|
|
269
|
+
observation. It does not observe live OS/provider state or infer unrecorded
|
|
270
|
+
events. Returned result and log descriptors refer to existing evidence; contents
|
|
271
|
+
are not inlined. An ordinary task without an occurrence is not a scheduled
|
|
272
|
+
execution.
|
|
273
|
+
|
|
274
|
+
Both commands are passive: no provider/supervisor call, task control, filesystem
|
|
275
|
+
capability probe, initialization, migration or repair. They work with the
|
|
276
|
+
scheduler running or stopped, subject to the database busy timeout. Paused and
|
|
277
|
+
deleted schedules retain history. An existing schedule with no history returns
|
|
278
|
+
an empty page; missing root, database, schedule or occurrence returns not-found.
|
|
279
|
+
Missing task files and corrupt evidence are distinct; see
|
|
280
|
+
[scheduled result handling](result-handling.md#scheduled-execution-results)
|
|
281
|
+
for freshness, no-result states, response bounds, exit codes and recovery.
|
|
282
|
+
|
|
283
|
+
## Scheduler runtime
|
|
284
|
+
|
|
285
|
+
```text
|
|
286
|
+
delegate --root ROOT scheduler run [--pueue-config ABS] [--json]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
The scheduler requires the automatic managed worker. Use colocated `delegate`
|
|
290
|
+
and `delegate-run` binaries from the same build and omit the advanced `--runner`
|
|
291
|
+
override. An override selects custom ownership even when it names the bundled
|
|
292
|
+
worker; startup rejects it with exit `2` before opening storage or acquiring a
|
|
293
|
+
lease. Ordinary explicit custom-runner dispatch and continuation retain their
|
|
294
|
+
existing compatibility rules. Historical custom-runner claims are not
|
|
295
|
+
automatically repaired or released.
|
|
296
|
+
|
|
297
|
+
This foreground command requires existing schedule storage. One process owns
|
|
298
|
+
each root; a second fails busy. It uses the service launch environment and the
|
|
299
|
+
saved requested provider choices. Saving a definition never starts the service.
|
|
300
|
+
For Team-targeted schedules, new occurrences read the pinned catalog's latest
|
|
301
|
+
Member defaults through normal admission; existing task IDs retain saved settings.
|
|
302
|
+
Use the same intended user configuration context as creation, or a different
|
|
303
|
+
catalog instance fails admission even when Team/Member IDs match.
|
|
304
|
+
See [operator hosting](https://github.com/hishamkaram/delegation-layer/blob/main/docs/cli-reference.md#scheduler-hosting).
|
|
305
|
+
|
|
306
|
+
Startup skips past appointments. Expired, overlapping or capacity-limited
|
|
307
|
+
appointments are skipped with a recorded reason; no catch-up queue or automatic
|
|
308
|
+
retry/continuation is added. Pause/delete prevent new claims, without canceling
|
|
309
|
+
already claimed tasks. Use [history and execution](#schedule-history-and-execution)
|
|
310
|
+
to inspect recorded work, and [result handling](result-handling.md#scheduled-execution-results)
|
|
311
|
+
to collect its answer. Schedule reservation release is separate from result
|
|
312
|
+
publication.
|
|
313
|
+
|
|
314
|
+
Each appointment starts a fresh leader with its saved budget or the normal
|
|
315
|
+
provider default. Overlap protection covers that leader. Independently admitted
|
|
316
|
+
Delegate workers keep their own budgets; provider-native in-session subagents do
|
|
317
|
+
not acquire independent Delegate lifetimes. The workflow owns saved progress,
|
|
318
|
+
worker IDs and deduplication; unknown acknowledgment is not permission to resend.
|
|
319
|
+
|
|
320
|
+
Interrupting the service joins its admission/control work before releasing its
|
|
321
|
+
owner lease. Accepted lifecycle calls settle independently of the stop signal;
|
|
322
|
+
there is no shutdown-time guarantee. Already admitted tasks continue under their
|
|
323
|
+
own supervisors. The
|
|
324
|
+
service reports bounded identifiers/codes on stderr; `--json` selects the final
|
|
325
|
+
command response, not an event stream or daemon-control protocol. Uncertain task
|
|
326
|
+
evidence blocks only its schedule until the existing owners can prove closure.
|
|
327
|
+
|
|
328
|
+
## Codex review
|
|
329
|
+
|
|
330
|
+
For explicit native code review, select `codex:review` and one persisted
|
|
331
|
+
target: `uncommitted`, `base:BRANCH`, or `commit:SHA`. It is read-only
|
|
332
|
+
and supports neither `--interactive` nor continuation. Use `codex:exec`
|
|
333
|
+
for general investigation or edits. The brief is retained as task evidence;
|
|
334
|
+
Codex's native target flag supplies review scope because it cannot be combined
|
|
335
|
+
with a native prompt.
|
|
336
|
+
|
|
337
|
+
An `uncommitted` review includes current staged, unstaged, and untracked
|
|
338
|
+
changes, but excludes worker commits. For a complete managed turn use an
|
|
339
|
+
ordinary read-only task with sealed base/tree refs and `git diff BASE TREE`.
|
|
340
|
+
Preserve an explicitly requested narrower native target. See
|
|
341
|
+
[workspace review scope](workspaces.md#recovery-and-review-scope).
|
|
342
|
+
|
|
343
|
+
## Managed workspace commands
|
|
344
|
+
|
|
345
|
+
[Workspaces](workspaces.md#public-commands) owns creation, attachment, helper
|
|
346
|
+
budgets, capture, review, release, and forgetting. Use managed worktrees for
|
|
347
|
+
independent parallel writes unless the user explicitly chooses shared coordination.
|
|
104
348
|
|
|
105
349
|
## Checkpoint commands
|
|
106
350
|
|
|
107
|
-
Git checkpoints
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
351
|
+
[Git checkpoints](workspaces.md#git-checkpoints) owns commands and limits;
|
|
352
|
+
[checkpoint results](result-handling.md#checkpoint-results) owns decisions.
|
|
353
|
+
A checkpoint is Git-content evidence, not a provider outcome.
|
|
354
|
+
|
|
355
|
+
## Providers and capabilities
|
|
112
356
|
|
|
113
357
|
```sh
|
|
114
|
-
delegate --root
|
|
115
|
-
delegate --root
|
|
116
|
-
delegate --root ROOT checkpoint status CHECKPOINT_ID [--operation OP] [--watch DURATION] --json
|
|
117
|
-
delegate --root ROOT checkpoint list [--after CHECKPOINT_ID] [--limit 1..50] --json
|
|
118
|
-
delegate --root ROOT checkpoint remove CHECKPOINT_ID [--budget DURATION] --json
|
|
358
|
+
delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" providers --json
|
|
359
|
+
delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" capabilities --provider PROVIDER_ID --json
|
|
119
360
|
```
|
|
120
361
|
|
|
121
|
-
`
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
`
|
|
362
|
+
`providers` returns `schema_version: 1` and a sorted `providers` array.
|
|
363
|
+
Each entry exposes `id`, `supported_modes`, `supported_options`, any
|
|
364
|
+
`required_options`, `continuation`, `read_only`, `interaction`, and
|
|
365
|
+
`runtime` metadata. Supply every required option:
|
|
366
|
+
`ccr:print` requires a configured CCR model alias; `codex:review` requires
|
|
367
|
+
a review target. See [CCR](ccr.md).
|
|
368
|
+
|
|
369
|
+
These commands create no task or state, contact no supervisor, and launch no
|
|
370
|
+
provider. The capability envelope has `schema_version: 1`,
|
|
371
|
+
`command: "capabilities"`, and `capability`. Its catalog projection uses
|
|
372
|
+
`contract: "runtime-capability-v1"`, `status: "unknown"`,
|
|
373
|
+
`verification: "catalog"`, and `live_acceptance.status: "not_run"`.
|
|
374
|
+
It describes compiled support, not installation, authentication, or host readiness.
|
|
375
|
+
|
|
376
|
+
`read_only.containment: "provider-owned"` describes native permissions,
|
|
377
|
+
separately from guardian-owned process lifetime. Runtime metadata lists required
|
|
378
|
+
help/flag behavior. Required native behavior determines compatibility;
|
|
379
|
+
provider versions are optional diagnostics.
|
|
380
|
+
|
|
381
|
+
Inspection-backed admission can return `status: "ready"` with
|
|
382
|
+
`verification: "runtime"` after its probe. Managed runtime-only admission
|
|
383
|
+
keeps the catalog projection; its supervised worker checks compatibility before
|
|
384
|
+
provider execution. Collect the created task to establish the result.
|
|
385
|
+
Optional protocol members `version` and `executable_sha256` are diagnostics,
|
|
386
|
+
not launch authority. Live acceptance remains separate (`not_run`, `passed`,
|
|
387
|
+
or `blocked`); a blocked prerequisite is unresolved.
|
|
125
388
|
|
|
126
389
|
## Choosing models and effort
|
|
127
390
|
|
|
128
|
-
Pass
|
|
129
|
-
|
|
130
|
-
|
|
391
|
+
Pass exact requested model IDs and effort unchanged, even if discovery omits
|
|
392
|
+
them. Keep defaults when no explicit choice is needed. Resolve a natural-language
|
|
393
|
+
name through native discovery:
|
|
131
394
|
|
|
132
395
|
```sh
|
|
133
396
|
delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" models \
|
|
134
397
|
--provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE --json
|
|
135
398
|
```
|
|
136
399
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
focused question for that ID. Do not silently select a default or transform
|
|
149
|
-
spaces into hyphens to manufacture an ID. This ambiguity rule is guidance for
|
|
150
|
-
selecting a value, not a new admission restriction.
|
|
151
|
-
|
|
152
|
-
The response includes `schema_version`, `command: "models"`, `provider`,
|
|
400
|
+
If discovery cannot resolve a name to one exact ID, ask for that ID; never
|
|
401
|
+
manufacture an alias. An explicit ID needs no clarification just because it
|
|
402
|
+
is absent from discovery.
|
|
403
|
+
|
|
404
|
+
`--cwd` defaults to the current directory. Discovery uses the state-rooted
|
|
405
|
+
supervisor and a `model-discovery-v1` five-minute native inspection, allowing
|
|
406
|
+
first-run model/cache initialization. It may contact the provider, creates
|
|
407
|
+
inspection evidence, and admits no provider task. `codex:review` has no
|
|
408
|
+
model-discovery command.
|
|
409
|
+
|
|
410
|
+
The JSON envelope has `schema_version`, `command: "models"`, `provider`,
|
|
153
411
|
`observed_at`, `status`, `reason_code`, `complete`, `source`, nullable
|
|
154
|
-
`efforts`, and
|
|
155
|
-
`efforts`, and optional `default_effort`.
|
|
156
|
-
|
|
157
|
-
`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
412
|
+
`efforts`, and `models`. Rows have exact `id`, optional `name`, nullable
|
|
413
|
+
`efforts`, and optional `default_effort`.
|
|
414
|
+
|
|
415
|
+
`complete` describes enumeration, not effort knowledge. `efforts: null`
|
|
416
|
+
means unknown; `[]` means explicitly no choices. Do not apply harness-wide
|
|
417
|
+
efforts to every model. Omit effort for unknown/empty per-model metadata unless
|
|
418
|
+
explicitly requested. A listed model does not prove execution access;
|
|
419
|
+
discovery is advisory, never an admission allowlist.
|
|
420
|
+
|
|
421
|
+
| Status | Exit | Interpretation |
|
|
422
|
+
| --- | --- | --- |
|
|
423
|
+
| `available` or `partial` | `0` | Observed model facts; partial enumeration is incomplete. |
|
|
424
|
+
| `blocked` or `unavailable` | `2` | Unresolved prerequisite. |
|
|
425
|
+
| `failed` | `1` | Operational discovery failure. |
|
|
426
|
+
| `failed` | `2` | Invalid or unsupported request, such as invalid cwd or root/workspace overlap; not an authentication block. |
|
|
427
|
+
|
|
428
|
+
Validate the whole envelope. Keep optional typed `failure` and fixed `error`
|
|
429
|
+
with the result; follow `failure.next_action`, stopping on `stop_and_report`.
|
|
430
|
+
Supervisor refusals retain `supervisor_migration_blocked`,
|
|
431
|
+
`supervisor_migration_unsupported`, or `supervisor_upgrade_required` as
|
|
432
|
+
reason codes and return no model facts.
|
|
163
433
|
|
|
164
434
|
## Checking readiness
|
|
165
435
|
|
|
166
|
-
Use
|
|
167
|
-
required step before every dispatch:
|
|
436
|
+
Use static preflight when readiness was requested, not before every task:
|
|
168
437
|
|
|
169
438
|
```sh
|
|
170
439
|
delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" preflight \
|
|
@@ -172,11 +441,9 @@ delegate --root "${DELEGATE_ROOT:-$HOME/delegation-state}" preflight \
|
|
|
172
441
|
--permission REQUESTED_MODE --json
|
|
173
442
|
```
|
|
174
443
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
and
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
provider configuration changes. Honor `failure.next_action` without probing
|
|
182
|
-
provider CLIs yourself.
|
|
444
|
+
Supply required options; the supported request options also include budget,
|
|
445
|
+
model, effort, native timeout, and review target where advertised.
|
|
446
|
+
Preflight creates no task, starts no supervisor, and launches no provider.
|
|
447
|
+
A ready `verification: "preflight"` result is not live authentication or
|
|
448
|
+
execution proof. Report blocked/unsupported results and follow the returned
|
|
449
|
+
guidance; readiness checks do not authorize provider configuration changes.
|