tryharness 0.7.68 → 0.7.70

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,313 @@
1
+ {
2
+ "contract_version": 1,
3
+ "source": {
4
+ "room_post": 251,
5
+ "reviewed_decision_sha256": "bfe002b51b9c4df9791558030f4c270d2b2c5bf094dc15868a2beffb5a6982d5"
6
+ },
7
+ "implemented_capabilities": ["start-exact-owner-run", "start-owner-template", "workspace-read@1", "workspace-files@1"],
8
+ "accounting_unit": "one native task start; no financial or service-dollar allowance is created",
9
+ "decision_output_schema": {
10
+ "$schema": "http://json-schema.org/draft-07/schema#",
11
+ "title": "Relay decision v1 closed action grammar; initial executor supports dispatch only",
12
+ "type": "object",
13
+ "properties": {
14
+ "contract_version": {
15
+ "const": 1
16
+ },
17
+ "input_ref": {
18
+ "$ref": "#/definitions/ref"
19
+ },
20
+ "owner_epoch": {
21
+ "type": "integer",
22
+ "minimum": 1
23
+ },
24
+ "basis_ref": {
25
+ "$ref": "#/definitions/ref"
26
+ },
27
+ "action": {
28
+ "oneOf": [
29
+ {
30
+ "type": "object",
31
+ "properties": {
32
+ "kind": {
33
+ "const": "inspect"
34
+ },
35
+ "candidate_ref": {
36
+ "$ref": "#/definitions/ref"
37
+ }
38
+ },
39
+ "required": ["kind", "candidate_ref"],
40
+ "additionalProperties": false
41
+ },
42
+ {
43
+ "type": "object",
44
+ "properties": {
45
+ "kind": {
46
+ "const": "dispatch"
47
+ },
48
+ "work_ref": {
49
+ "$ref": "#/definitions/ref"
50
+ },
51
+ "assignment_refs": {
52
+ "type": "array",
53
+ "items": {
54
+ "$ref": "#/definitions/ref"
55
+ },
56
+ "minItems": 1,
57
+ "uniqueItems": true
58
+ }
59
+ },
60
+ "required": ["kind", "work_ref", "assignment_refs"],
61
+ "additionalProperties": false
62
+ },
63
+ {
64
+ "type": "object",
65
+ "properties": {
66
+ "kind": {
67
+ "const": "continue"
68
+ },
69
+ "work_ref": {
70
+ "$ref": "#/definitions/ref"
71
+ },
72
+ "message_ref": {
73
+ "$ref": "#/definitions/ref"
74
+ }
75
+ },
76
+ "required": ["kind", "work_ref", "message_ref"],
77
+ "additionalProperties": false
78
+ },
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "kind": {
83
+ "const": "execute"
84
+ },
85
+ "prepared_effect_ref": {
86
+ "$ref": "#/definitions/ref"
87
+ }
88
+ },
89
+ "required": ["kind", "prepared_effect_ref"],
90
+ "additionalProperties": false
91
+ },
92
+ {
93
+ "type": "object",
94
+ "properties": {
95
+ "kind": {
96
+ "const": "ask_owner"
97
+ },
98
+ "question_ref": {
99
+ "$ref": "#/definitions/ref"
100
+ }
101
+ },
102
+ "required": ["kind", "question_ref"],
103
+ "additionalProperties": false
104
+ },
105
+ {
106
+ "type": "object",
107
+ "properties": {
108
+ "kind": {
109
+ "const": "deliver"
110
+ },
111
+ "artifact_ref": {
112
+ "$ref": "#/definitions/ref"
113
+ }
114
+ },
115
+ "required": ["kind", "artifact_ref"],
116
+ "additionalProperties": false
117
+ },
118
+ {
119
+ "type": "object",
120
+ "properties": {
121
+ "kind": {
122
+ "const": "wait"
123
+ },
124
+ "wait_set_ref": {
125
+ "$ref": "#/definitions/ref"
126
+ }
127
+ },
128
+ "required": ["kind", "wait_set_ref"],
129
+ "additionalProperties": false
130
+ },
131
+ {
132
+ "type": "object",
133
+ "properties": {
134
+ "kind": {
135
+ "const": "cancel"
136
+ },
137
+ "work_ref": {
138
+ "$ref": "#/definitions/ref"
139
+ },
140
+ "cancellation_ref": {
141
+ "$ref": "#/definitions/ref"
142
+ }
143
+ },
144
+ "required": ["kind", "work_ref", "cancellation_ref"],
145
+ "additionalProperties": false
146
+ },
147
+ {
148
+ "type": "object",
149
+ "properties": {
150
+ "kind": {
151
+ "const": "finish"
152
+ },
153
+ "completion_ref": {
154
+ "$ref": "#/definitions/ref"
155
+ }
156
+ },
157
+ "required": ["kind", "completion_ref"],
158
+ "additionalProperties": false
159
+ },
160
+ {
161
+ "type": "object",
162
+ "properties": {
163
+ "kind": {
164
+ "const": "abstain"
165
+ },
166
+ "reason": {
167
+ "enum": ["insufficient_context", "no_suitable_candidate"]
168
+ }
169
+ },
170
+ "required": ["kind", "reason"],
171
+ "additionalProperties": false
172
+ }
173
+ ]
174
+ }
175
+ },
176
+ "required": [
177
+ "contract_version",
178
+ "input_ref",
179
+ "owner_epoch",
180
+ "basis_ref",
181
+ "action"
182
+ ],
183
+ "additionalProperties": false,
184
+ "definitions": {
185
+ "ref": {
186
+ "type": "string",
187
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:@-]*$"
188
+ }
189
+ }
190
+ },
191
+ "assignment_candidate_schema": {
192
+ "$schema": "http://json-schema.org/draft-07/schema#",
193
+ "type": "object",
194
+ "properties": {
195
+ "assignment_ref": {
196
+ "$ref": "#/definitions/ref"
197
+ },
198
+ "work_ref": {
199
+ "$ref": "#/definitions/ref"
200
+ },
201
+ "agent_ref": {
202
+ "$ref": "#/definitions/ref"
203
+ },
204
+ "computer_ref": {
205
+ "$ref": "#/definitions/ref"
206
+ },
207
+ "basis_ref": {
208
+ "$ref": "#/definitions/ref"
209
+ },
210
+ "eligibility_ref": {
211
+ "$ref": "#/definitions/ref"
212
+ },
213
+ "role": {
214
+ "enum": [
215
+ "frame",
216
+ "make",
217
+ "check",
218
+ "research",
219
+ "assemble",
220
+ "prepare_effect",
221
+ "recover"
222
+ ]
223
+ },
224
+ "mode": {
225
+ "enum": ["work", "review"]
226
+ },
227
+ "workspace_ref": {
228
+ "$ref": "#/definitions/ref"
229
+ },
230
+ "checkout_ref": {
231
+ "$ref": "#/definitions/ref"
232
+ },
233
+ "capability_ref": {
234
+ "$ref": "#/definitions/ref"
235
+ },
236
+ "cost_bound": {
237
+ "type": "integer",
238
+ "minimum": 0,
239
+ "description": "Runtime-offered bound in the grant ledger\u2019s exact accounting units; never a model-authored amount."
240
+ }
241
+ },
242
+ "required": [
243
+ "assignment_ref",
244
+ "work_ref",
245
+ "agent_ref",
246
+ "computer_ref",
247
+ "basis_ref",
248
+ "eligibility_ref",
249
+ "role",
250
+ "mode",
251
+ "workspace_ref",
252
+ "checkout_ref",
253
+ "capability_ref",
254
+ "cost_bound"
255
+ ],
256
+ "additionalProperties": false,
257
+ "definitions": {
258
+ "ref": {
259
+ "type": "string",
260
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:@-]*$"
261
+ }
262
+ }
263
+ },
264
+ "scope_capability": {
265
+ "authority": "trusted owner socket command only; fixed owner templates, local eligible agents and clean checkout revision",
266
+ "identity": "scope + template, once; independent of proposer or transport wake",
267
+ "accounting": "one cumulative native-start counter across all tasks and assignments; reservations never refunded after unknown outcomes",
268
+ "scope_invalidation": [
269
+ "owner revoke",
270
+ "root source or active state changes",
271
+ "checkout changes",
272
+ "owner off",
273
+ "unavailable selected agent/provider"
274
+ ],
275
+ "limitations": [
276
+ "no arbitrary agent-authored executable brief",
277
+ "no narrower filesystem sandbox",
278
+ "no source advancement",
279
+ "no remote execution lease",
280
+ "no financial allowance"
281
+ ]
282
+ },
283
+ "prompt_scope": {
284
+ "entry": "owner natural-language objective with application-supplied workspace/message identity; no fixed child templates",
285
+ "permissions": "existing standing scope and cumulative native-start reservations; generated fields never raise it",
286
+ "interpreter": "temporary tool-free native Claude adapter; not the Relay-shipped fine-tuned model; private mode refuses unverified transport",
287
+ "capabilities": {
288
+ "workspace-read@1": [
289
+ "list source names",
290
+ "read ordinary source/staged text"
291
+ ],
292
+ "workspace-files@1": [
293
+ "list source names",
294
+ "read ordinary source/staged text",
295
+ "write private staged text artifacts"
296
+ ]
297
+ },
298
+ "execution": "Claude Code >=2.1.248, bare/restricted with built-ins disabled and only scoped MCP",
299
+ "bounds": {
300
+ "observed_files": 100,
301
+ "file_bytes": 64000
302
+ },
303
+ "source": "original owner prompt, named computer source spans, pinned source revision and observed file/absence receipts",
304
+ "children": "free objectives/briefs are agent data; identical proposals deduplicate; children wait for their proposing task to finish successfully",
305
+ "limits": [
306
+ "no native shell or direct filesystem tools",
307
+ "no network, vault, wallet or financial adapter",
308
+ "remote execution refuses rather than falling back to Home",
309
+ "no automatic application of generated code to the source checkout",
310
+ "normal app routing, full controller and live semantic evaluation remain work"
311
+ ]
312
+ }
313
+ }
@@ -0,0 +1,87 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ const contract = createRequire(import.meta.url)("./dispatchContract.json");
4
+ const fields = {
5
+ action: { type: "string", enum: ["scopes", "propose", "view", "dispatch"] },
6
+ root_id: { type: "string" },
7
+ task_id: { type: "string" },
8
+ proposal: {
9
+ oneOf: [
10
+ {
11
+ type: "object",
12
+ properties: {
13
+ scope_ref: { type: "string" },
14
+ template_ref: { type: "string" },
15
+ },
16
+ required: ["scope_ref", "template_ref"],
17
+ additionalProperties: false,
18
+ },
19
+ {
20
+ type: "object",
21
+ properties: {
22
+ scope_ref: { type: "string" },
23
+ objective: { type: "string" },
24
+ brief: { type: "string" },
25
+ capability_ref: { type: "string" },
26
+ },
27
+ required: ["scope_ref", "objective", "brief", "capability_ref"],
28
+ additionalProperties: false,
29
+ },
30
+ ],
31
+ },
32
+ decision: contract.decision_output_schema,
33
+ };
34
+ // This adapter offers no owner grant or approval operation to agents.
35
+ export const DISPATCH_WORK_TOOL = {
36
+ name: "dispatch_work",
37
+ description:
38
+ "Use an existing scope without another Start. Prompt scopes accept new child objectives and briefs under their offered capability; legacy scopes accept an offered template. Read the task's eligible assignments, then dispatch with code-offered typed references. All children share the cumulative start budget. Agent prose cannot widen permissions. The original owner prompt remains the completion standard.",
39
+ inputSchema: {
40
+ definitions: contract.decision_output_schema.definitions,
41
+ type: "object",
42
+ properties: fields,
43
+ required: ["action"],
44
+ additionalProperties: false,
45
+ },
46
+ };
47
+ export const SCOPE_WORKSPACE_TOOL = {
48
+ name: "scope_workspace",
49
+ description:
50
+ "List/read source files and stage file writes in this run's private workspace through Relay. Writes return reviewable artifacts. Paths are relative; hidden paths, symlinks, runtime code, credentials and paths outside the workspace are refused. Writes need the exact sha256 returned by read, or null to create a new file. No shell, networking or financial operation is available.",
51
+ inputSchema: {
52
+ type: "object",
53
+ properties: {
54
+ operation: { type: "string", enum: ["list", "read", "write"] },
55
+ path: { type: "string" },
56
+ text: { type: "string" },
57
+ expected_sha256: { type: ["string", "null"] },
58
+ },
59
+ required: ["operation"],
60
+ additionalProperties: false,
61
+ },
62
+ };
63
+ export function dispatchWorkRequest(args) {
64
+ const required = {
65
+ scopes: ["action", "root_id"],
66
+ propose: ["action", "proposal"],
67
+ view: ["action", "task_id"],
68
+ dispatch: ["action", "task_id", "decision"],
69
+ }[args.action];
70
+ if (
71
+ !required ||
72
+ Object.keys(args).length !== required.length ||
73
+ !required.every((key) => Object.hasOwn(args, key))
74
+ )
75
+ return { error: "Use only the fields for the selected dispatch action." };
76
+ if (args.action === "scopes")
77
+ return { command: "board.dispatch.scope.list", rootId: args.root_id };
78
+ if (args.action === "propose")
79
+ return { command: "board.dispatch.propose", proposal: args.proposal };
80
+ if (args.action === "view")
81
+ return { command: "board.dispatch.view", id: args.task_id };
82
+ return {
83
+ command: "board.dispatch.apply",
84
+ id: args.task_id,
85
+ decision: args.decision,
86
+ };
87
+ }