delegation-layer 0.1.17 → 0.1.19

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.
@@ -0,0 +1,203 @@
1
+ {
2
+ "version": 1,
3
+ "cases": [
4
+ {
5
+ "name": "codex-review",
6
+ "prompt": "Ask Codex to review pricing.py for correctness. Return the finding without editing files.",
7
+ "external": true,
8
+ "provider": "codex:exec",
9
+ "split": "development",
10
+ "native_alternative_for": "codex"
11
+ },
12
+ {
13
+ "name": "agy-opinion",
14
+ "prompt": "Get Antigravity\u2019s opinion on the discount calculation in pricing.py. Do not edit files.",
15
+ "external": true,
16
+ "provider": "antigravity:print",
17
+ "split": "development"
18
+ },
19
+ {
20
+ "name": "claude-investigate",
21
+ "prompt": "Have Claude investigate why discounted_price(200, 10) returns the wrong value. Do not change files.",
22
+ "external": true,
23
+ "provider": "claude:print",
24
+ "split": "development",
25
+ "native_alternative_for": "claude"
26
+ },
27
+ {
28
+ "name": "external-write",
29
+ "prompt": "Ask Codex to fix pricing.py so discounts are percentages. Authorize edits only in this workspace and verify 200 with 10 percent gives 180.",
30
+ "external": true,
31
+ "provider": "codex:exec",
32
+ "split": "development",
33
+ "native_alternative_for": "codex"
34
+ },
35
+ {
36
+ "name": "external-testing",
37
+ "prompt": "Have Claude independently test the pricing calculation against the requirement in README.md. Report evidence without editing.",
38
+ "external": true,
39
+ "provider": "claude:print",
40
+ "split": "development",
41
+ "native_alternative_for": "claude"
42
+ },
43
+ {
44
+ "name": "external-research",
45
+ "prompt": "Consult another AI harness on how to represent percentage discounts without floating-point surprises. Give one concise recommendation.",
46
+ "external": true,
47
+ "provider": null,
48
+ "split": "development"
49
+ },
50
+ {
51
+ "name": "comparison",
52
+ "prompt": "Ask Codex and Claude independently whether pricing.py meets README.md, then compare their findings. No edits.",
53
+ "external": true,
54
+ "provider": [
55
+ "codex:exec",
56
+ "claude:print"
57
+ ],
58
+ "split": "validation"
59
+ },
60
+ {
61
+ "name": "debate",
62
+ "prompt": "Ask Codex for a critique of pricing.py, then ask Claude to challenge that critique. One round each, no edits.",
63
+ "external": true,
64
+ "provider": [
65
+ "codex:exec",
66
+ "claude:print"
67
+ ],
68
+ "split": "validation"
69
+ },
70
+ {
71
+ "name": "unavailable-destination",
72
+ "prompt": "Ask the NebulaReview9000 harness to review pricing.py. If it is unavailable, report that; do not substitute another harness.",
73
+ "external": true,
74
+ "provider": "unavailable",
75
+ "split": "validation"
76
+ },
77
+ {
78
+ "name": "follow-up",
79
+ "prompt": "Get a second opinion from a separate Codex CLI session on the calculation, then ask that same session one follow-up about the simplest correction. Do not edit.",
80
+ "external": true,
81
+ "provider": "codex:exec",
82
+ "split": "validation"
83
+ },
84
+ {
85
+ "name": "local-review",
86
+ "prompt": "Review pricing.py yourself for correctness. Do not consult another harness or change files.",
87
+ "external": false,
88
+ "provider": null,
89
+ "split": "development"
90
+ },
91
+ {
92
+ "name": "native-subagent",
93
+ "prompt": "Use an ordinary native subagent within this harness to examine pricing.py if available; otherwise examine it yourself. No external harness and no edits.",
94
+ "external": false,
95
+ "provider": null,
96
+ "split": "development"
97
+ },
98
+ {
99
+ "name": "explain-codex",
100
+ "prompt": "Explain what Codex is. Do not run it or ask it to do any work.",
101
+ "external": false,
102
+ "provider": null,
103
+ "split": "development"
104
+ },
105
+ {
106
+ "name": "claude-docs",
107
+ "prompt": "Add one sentence to README.md saying that Claude can review code. Do not ask it to review anything.",
108
+ "external": false,
109
+ "provider": null,
110
+ "split": "development"
111
+ },
112
+ {
113
+ "name": "provider-install",
114
+ "prompt": "Explain how to diagnose a command-not-found error for Codex. Do not install or run it.",
115
+ "external": false,
116
+ "provider": null,
117
+ "split": "development"
118
+ },
119
+ {
120
+ "name": "local-fix",
121
+ "prompt": "Fix pricing.py yourself so discounts are percentages. No external consultation.",
122
+ "external": false,
123
+ "provider": null,
124
+ "split": "development"
125
+ },
126
+ {
127
+ "name": "agy-question",
128
+ "prompt": "What does a read-only mode mean in an AI coding tool such as Antigravity? Answer conceptually without invoking it.",
129
+ "external": false,
130
+ "provider": null,
131
+ "split": "validation"
132
+ },
133
+ {
134
+ "name": "quote-request",
135
+ "prompt": "In README.md, quote the example sentence \"Ask Codex to review this\" as documentation. Do not execute the example.",
136
+ "external": false,
137
+ "provider": null,
138
+ "split": "validation"
139
+ },
140
+ {
141
+ "name": "compare-tools",
142
+ "prompt": "Explain the difference between a CLI and a plugin. Mention Claude and Codex as examples, without consulting them.",
143
+ "external": false,
144
+ "provider": null,
145
+ "split": "validation"
146
+ },
147
+ {
148
+ "name": "local-test",
149
+ "prompt": "Check the discount function yourself against README.md and report the result. No other agents.",
150
+ "external": false,
151
+ "provider": null,
152
+ "split": "validation"
153
+ },
154
+ {
155
+ "name": "ccr-review",
156
+ "prompt": "Ask Claude Code Router to review pricing.py for correctness without editing. Choose an appropriate configured model and report which one you used.",
157
+ "external": true,
158
+ "provider": "ccr:print",
159
+ "split": "development"
160
+ },
161
+ {
162
+ "name": "ccr-explicit-alias",
163
+ "prompt": "Ask CCR using the alias local-review to investigate pricing.py. Do not edit files.",
164
+ "external": true,
165
+ "provider": "ccr:print",
166
+ "model": "local-review",
167
+ "split": "validation"
168
+ },
169
+ {
170
+ "name": "ccr-write",
171
+ "prompt": "Have CCR with the alias local-review fix pricing.py so discounts are percentages, and test the correction. Authorize edits in this workspace.",
172
+ "external": true,
173
+ "provider": "ccr:print",
174
+ "model": "local-review",
175
+ "split": "validation"
176
+ },
177
+ {
178
+ "name": "ccr-follow-up",
179
+ "prompt": "Ask CCR using local-review to critique pricing.py, then ask that same session one follow-up about its recommendation. No edits.",
180
+ "external": true,
181
+ "provider": "ccr:print",
182
+ "model": "local-review",
183
+ "split": "validation"
184
+ },
185
+ {
186
+ "name": "ccr-explain",
187
+ "prompt": "Explain what Claude Code Router does. Do not ask it to perform work.",
188
+ "external": false,
189
+ "provider": null,
190
+ "split": "validation"
191
+ },
192
+ {
193
+ "name": "ccr-compare",
194
+ "prompt": "Ask CCR using local-review and a separate Codex session for independent reviews of pricing.py, then compare their findings. No edits.",
195
+ "external": true,
196
+ "provider": [
197
+ "ccr:print",
198
+ "codex:exec"
199
+ ],
200
+ "split": "validation"
201
+ }
202
+ ]
203
+ }
@@ -0,0 +1,33 @@
1
+ # CCR model selection
2
+
3
+ Use this reference when asked to consult Claude Code Router (CCR), use one of
4
+ its configured model aliases, or compare its models with other harnesses.
5
+ CCR runs Claude Code against a configured third-party or local provider.
6
+
7
+ 1. Resolve CCR through `delegate providers --json`; its profile is `ccr:print`.
8
+ 2. Preserve an explicitly requested CCR alias as `--model ALIAS`. Do not replace
9
+ it with an upstream model ID or reject it solely because discovery omitted it.
10
+ 3. If no alias was chosen, run
11
+ `delegate models --provider ccr:print --cwd ABSOLUTE_WORKSPACE --json`.
12
+ Choose a suitable configured alias from the available metadata and report
13
+ the choice. Clarify when the intended model remains ambiguous. If discovery
14
+ is unavailable and no alias is known, report the blocker; do not guess.
15
+ 4. Dispatch through Delegate with `--provider ccr:print --model ALIAS`, the brief,
16
+ workspace, permission, finite budget, and `--json`. Use the normal status,
17
+ collect, and continuation procedure from the main skill.
18
+
19
+ CCR requires an explicit alias. Unspecified external collaboration still uses
20
+ `dispatch --auto`; do not prefer CCR unless the request calls for it. Multiple
21
+ aliases can be assigned independent tasks for comparison or debate.
22
+
23
+ Read-only selects native Claude plan behavior; workspace-write selects native
24
+ unattended tool execution. Neither is an independent Delegate sandbox. Preserve
25
+ requested effort through `--effort`; unknown effort metadata is not an allowlist
26
+ or a reason to invent a level. Leave effort unspecified unless requested.
27
+
28
+ Delegate uses CCR's foreground provider-only route. Model/provider setup and
29
+ credentials belong to CCR. Never run `ccr launch`, configure CCR, inspect its
30
+ SQLite database, call Claude directly, or select another integration to bypass a
31
+ Delegate error. Ordinary questions about CCR or installation do not trigger
32
+ external collaboration. An explicit request to use another integration remains
33
+ an explicit user choice.
@@ -28,11 +28,11 @@ Dispatch flags:
28
28
  - `--permission read-only|workspace-write`: read-only investigation or authorized unattended write execution, including commands (not independent containment);
29
29
  - `--budget DURATION`: finite turn budget;
30
30
  - `--auto`: let the CLI select a ready provider;
31
- - `--provider ID`: use only when the caller explicitly selected an ID;
32
- - `--model MODEL` and `--effort VALUE`: optional provider-advertised choices;
31
+ - `--provider ID`: preserve the caller’s named harness or provider, resolved through the catalog;
32
+ - `--model MODEL` and `--effort VALUE`: provider-advertised choices (CCR requires a model alias);
33
33
  Codex maps effort to TOML `model_reasoning_effort`, while Claude and AGY
34
34
  pass native effort flags; Pi maps effort to `--thinking`; OpenCode maps it to
35
- `--variant`; `default` is omitted;
35
+ `--variant`; CCR forwards effort to Claude and uses `--model` as a CCR alias; `default` is omitted;
36
36
  - `--native-timeout DURATION`: optional provider-native timeout where advertised.
37
37
 
38
38
  Model discovery uses the same `--provider ID` profiles and accepts an optional
@@ -48,3 +48,51 @@ Continuation flags:
48
48
  - `--task TASK`: predecessor task ID;
49
49
  - `--brief FILE`: optional new follow-up instruction;
50
50
  - `--budget DURATION`, `--model MODEL`, and `--effort VALUE`: optional overrides.
51
+
52
+ ## Choosing models and effort
53
+
54
+ If the caller needs an explicit model or effort, use the implemented native
55
+ discovery command for that provider:
56
+
57
+ ```sh
58
+ delegate models --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE --json
59
+ ```
60
+
61
+ Omit `--cwd` to use the current directory. Run discovery only when the caller
62
+ needs a non-default choice; provider defaults are valid. The command uses the
63
+ state-rooted supervisor and a bounded `model-discovery-v1` five-minute native
64
+ inspection to allow first-run provider model/cache initialization. It creates
65
+ inspection evidence without admitting a provider task, and may contact the
66
+ provider CLI. It is advisory and never an admission allowlist. Do not reject a
67
+ requested value merely because discovery did not list it, and do not infer
68
+ per-model effort support from the harness-wide list. If a selected model has
69
+ `efforts: null` or `efforts: []`, omit `--effort` unless the caller explicitly
70
+ requested it; do not invent model aliases or combine options by guessing.
71
+
72
+ The response includes `schema_version`, `command: "models"`, `provider`,
73
+ `observed_at`, `status`, `reason_code`, `complete`, `source`, nullable
74
+ `efforts`, and model rows with exact `id` values plus optional `name`, nullable
75
+ `efforts`, and optional `default_effort`. `complete` describes model
76
+ enumeration, not effort metadata. `null` means effort metadata is unknown;
77
+ `[]` means the provider explicitly reported no choices. Discovery exits `0`
78
+ for `available` or `partial`, `2` for `blocked` or `unavailable`, and `1` for
79
+ `failed`. Preserve a blocked or unavailable discovery result as unresolved;
80
+ defaults remain allowed.
81
+
82
+ ## Checking readiness
83
+
84
+ Use `preflight` when the caller asks about static readiness, rather than as a
85
+ required step before every dispatch:
86
+
87
+ ```sh
88
+ delegate preflight --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE \
89
+ --permission REQUESTED_MODE --json
90
+ ```
91
+
92
+ Use `read-only` for investigation or `workspace-write` for authorized edits.
93
+ Supply any required provider options, including `--model ALIAS` for `ccr:print`.
94
+ Preflight does not create a task, start the supervisor, or launch a provider.
95
+ Its result is not proof of live authentication or successful execution. Report
96
+ `blocked` or `unsupported` results; a readiness request does not authorize
97
+ provider configuration changes. Honor `failure.next_action` without probing
98
+ provider CLIs yourself.
@@ -30,7 +30,10 @@ indefinitely for a publication that the interrupted turn cannot complete.
30
30
 
31
31
  The follow-up brief is optional. If it is omitted, Delegation Layer reuses the
32
32
  validated predecessor brief. A successful continuation returns a new task ID
33
- and links it to the predecessor. Observe and collect the new ID separately.
33
+ and links it to the predecessor. Observe and collect the new ID separately. Always retain the original state
34
+ root, even if a returned command hint omits it. Permission is inherited; do not
35
+ add `--permission` to `continue`. Apply the dispatch `task_record` error rules
36
+ in [result handling](result-handling.md) before retrying or observing.
34
37
 
35
38
  `mode` describes the provider contract:
36
39
 
@@ -4,10 +4,12 @@ Use the response fields independently. A successful control command is not
4
4
  the same as a successful provider result.
5
5
 
6
6
  1. Save `task_id` immediately after dispatch or continue.
7
- 2. If a dispatch or continue response does not confirm admission, preserve any
8
- task ID and report its bounded error. An uncertain admission must be
9
- inspected, never automatically dispatched again. Status and collect can
10
- report `admission: "unknown"` alongside valid terminal evidence.
7
+ 2. For a dispatch or continue error, inspect `task_record` first. When it is
8
+ `created`, observe the returned ID with `status`. When it is `not_created`,
9
+ do not poll; correct the request only if `failure.next_action` is
10
+ `correct_request`, otherwise report and stop. When it is `unknown`, stop and
11
+ report without polling or retrying. Status and collect can report
12
+ `admission: "unknown"` alongside valid terminal evidence for an existing task.
11
13
  3. If `status` is `timed_out`, follow the continuation procedure before treating
12
14
  pending publication as a reason to wait. `continuation.resumable: true`
13
15
  permits a linked successor even when no outcome has been published.
@@ -19,9 +21,8 @@ the same as a successful provider result.
19
21
  observe the same task again with a finite watch interval.
20
22
  7. If authentication is `blocked`, preserve that neutral state and tell the
21
23
  caller what prerequisite is unavailable without inventing a login command.
22
- 8. If a command reports an operational uncertainty, inspect the original task
23
- with `status` and `collect` before considering any action. Never relaunch an
24
- uncertain task by guessing.
24
+ 8. Never relaunch an uncertain task by guessing. Observe only a task whose
25
+ record is known to exist; the `task_record` decision above takes precedence.
25
26
 
26
27
  For `delegate models`, validate the complete JSON envelope before using any
27
28
  fact. Treat `available` and `partial` with exit `0` as observations, preserve
@@ -35,3 +36,9 @@ model is not an execution guarantee.
35
36
  Exit codes are bounded control signals: `0` is a completed command, `1` is an
36
37
  operational error, `2` is an invalid or unsupported request, `3` is a pending
37
38
  collection watch, and `4` is a validated rejected outcome.
39
+
40
+ Catalog facts (`verification: "catalog"`) are not runtime proof. Preflight
41
+ checks static readiness; runtime verification requires the supervised probe.
42
+ Versions and help are observations, not semantic-version allowlists.
43
+ Authentication is a separate live gate (`not_run`, `passed`, or `blocked`).
44
+ Report a blocked prerequisite without inventing a login command or retrying.