@haystackeditor/cli 0.16.0 → 0.17.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 +31 -2
- package/dist/commands/case-batch-contract.js +93 -7
- package/dist/commands/case-batch.js +327 -29
- package/dist/commands/submit.js +32 -69
- package/dist/commands/verify-precompute.js +7 -1
- package/dist/index.js +56 -20
- package/dist/schema.js +2 -2
- package/dist/triage/astra.js +199 -0
- package/dist/triage/prompts.js +145 -180
- package/dist/triage/runner.js +99 -381
- package/dist/triage/types.js +2 -2
- package/dist/types.js +2 -6
- package/dist/utils/haystack-api.js +12 -0
- package/package.json +2 -1
- package/schemas/case-batch.v1.json +54 -3
- package/schemas/submit.v1.json +4 -2
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://docs.haystackeditor.com/cli/schemas/case-batch.v1.json",
|
|
4
4
|
"title": "Haystack hosted case batch (CASE-BATCH-V1)",
|
|
5
|
-
"description": "Machine-readable output of `haystack case-batch submit|status|cancel|bundle --json`. The run-side shapes mirror infra/lambda/haystack-design-verifier-shared/case_batch_contracts.ts.",
|
|
5
|
+
"description": "Machine-readable output of `haystack case-batch submit|status|cancel|finalize|bundle --json`. The run-side shapes mirror infra/lambda/haystack-design-verifier-shared/case_batch_contracts.ts.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["schema_version", "operation", "run_id"],
|
|
8
8
|
"properties": {
|
|
9
|
-
"schema_version": { "const": "1.0.
|
|
10
|
-
"operation": { "enum": ["submit", "status", "cancel", "bundle"] },
|
|
9
|
+
"schema_version": { "const": "1.0.1" },
|
|
10
|
+
"operation": { "enum": ["submit", "status", "cancel", "finalize", "bundle"] },
|
|
11
11
|
"run_id": { "type": "string", "pattern": "^cv_[0-9a-f]{48}$" },
|
|
12
12
|
"repository": { "type": "string", "pattern": "^[A-Za-z0-9_.-]{1,100}/[A-Za-z0-9_.-]{1,100}$" },
|
|
13
13
|
"admitted": { "enum": ["created", "existing"] },
|
|
@@ -44,6 +44,28 @@
|
|
|
44
44
|
"case_bundle_path": { "type": ["string", "null"] },
|
|
45
45
|
"differing_outcomes": { "type": "array", "items": { "type": "string" } },
|
|
46
46
|
"detail": { "type": ["string", "null"] },
|
|
47
|
+
"execution_path": { "enum": ["resident-sealed-plan", "sealed-plan", "record-replay", null] },
|
|
48
|
+
"node_ids": {
|
|
49
|
+
"description": "v4: the node each arm's VM was placed on; null when the outcome names none.",
|
|
50
|
+
"type": ["object", "null"],
|
|
51
|
+
"required": ["base1", "head"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"base1": { "type": ["string", "null"] },
|
|
54
|
+
"head": { "type": ["string", "null"] }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"failure": {
|
|
58
|
+
"description": "v4: the typed failure behind an UNKNOWN that is not an arrival or wall outcome, and behind an arrival-failed whose two arms stalled on the same step (error_class same-step-stall); null otherwise. Source is open like unknown_reason: a source added later still reads.",
|
|
59
|
+
"type": ["object", "null"],
|
|
60
|
+
"required": ["source", "arm", "error_class", "error_code", "node_id"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"source": { "type": "string", "description": "control-plane, transport, harness or runner" },
|
|
63
|
+
"arm": { "enum": ["base1", "head", null] },
|
|
64
|
+
"error_class": { "type": "string" },
|
|
65
|
+
"error_code": { "type": ["string", "null"] },
|
|
66
|
+
"node_id": { "type": ["string", "null"] }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
47
69
|
"phases": { "type": ["object", "null"] },
|
|
48
70
|
"vm_ids": { "type": "array", "items": { "type": "string" } },
|
|
49
71
|
"lease_ids": { "type": "array", "items": { "type": "string" } }
|
|
@@ -136,6 +158,11 @@
|
|
|
136
158
|
"exit_code": { "type": "integer", "minimum": 0, "maximum": 2 },
|
|
137
159
|
"error": { "type": "string" },
|
|
138
160
|
"cancel_requested": { "const": true },
|
|
161
|
+
"previous_status": { "description": "On finalize, the batch's recorded status just before it.", "type": "string" },
|
|
162
|
+
"last_updated_at": { "description": "On finalize, the batch record's last update before it.", "type": "string" },
|
|
163
|
+
"eligibility": { "description": "On finalize, what made the batch finalizable.", "enum": ["cancel-requested", "stale"] },
|
|
164
|
+
"reason": { "description": "On finalize, the operator's reason, recorded as the batch error.", "type": "string" },
|
|
165
|
+
"finalized_at": { "type": "string" },
|
|
139
166
|
"next_command": { "type": "string" },
|
|
140
167
|
"out_dir": { "type": "string" },
|
|
141
168
|
"manifest": {
|
|
@@ -161,6 +188,26 @@
|
|
|
161
188
|
}
|
|
162
189
|
},
|
|
163
190
|
"artifact_count": { "type": "integer", "minimum": 0 },
|
|
191
|
+
"pending": {
|
|
192
|
+
"description": "On bundle, the listed PNGs the service reported as still uploading (HTTP 409, reason artifact-pending): the coordinator publishes a batch's PNGs after it is terminal. Nothing is written for them. Non-empty means the command exited 75 (EX_TEMPFAIL); retry, for example with --only for each path.",
|
|
193
|
+
"type": "array",
|
|
194
|
+
"items": { "type": "string" }
|
|
195
|
+
},
|
|
196
|
+
"failed": {
|
|
197
|
+
"description": "On bundle, the listed PNGs the service reported as failed for good (HTTP 410, reason artifact-failed): the coordinator gave up on their upload and recorded why. Nothing is written for them and a retry cannot fetch them. Non-empty with nothing pending means the command exited 1.",
|
|
198
|
+
"type": "array",
|
|
199
|
+
"items": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"additionalProperties": false,
|
|
202
|
+
"required": ["path", "error_class", "status", "message"],
|
|
203
|
+
"properties": {
|
|
204
|
+
"path": { "type": "string" },
|
|
205
|
+
"error_class": { "type": "string" },
|
|
206
|
+
"status": { "type": ["integer", "null"] },
|
|
207
|
+
"message": { "type": "string" }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
164
211
|
"total_bytes": { "type": "integer", "minimum": 0 }
|
|
165
212
|
},
|
|
166
213
|
"allOf": [
|
|
@@ -176,6 +223,10 @@
|
|
|
176
223
|
"if": { "properties": { "operation": { "const": "cancel" } }, "required": ["operation"] },
|
|
177
224
|
"then": { "required": ["repository", "cancel_requested"] }
|
|
178
225
|
},
|
|
226
|
+
{
|
|
227
|
+
"if": { "properties": { "operation": { "const": "finalize" } }, "required": ["operation"] },
|
|
228
|
+
"then": { "required": ["repository", "status", "terminal", "cleanup_complete", "generation", "previous_status", "last_updated_at", "eligibility", "reason", "finalized_at"] }
|
|
229
|
+
},
|
|
179
230
|
{
|
|
180
231
|
"if": { "properties": { "operation": { "const": "bundle" } }, "required": ["operation"] },
|
|
181
232
|
"then": { "required": ["repository", "out_dir", "manifest", "artifacts", "artifact_count", "total_bytes"] }
|
package/schemas/submit.v1.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["schema_version", "status"],
|
|
8
8
|
"properties": {
|
|
9
|
-
"schema_version": { "type": "string", "const": "1.0.
|
|
9
|
+
"schema_version": { "type": "string", "const": "1.0.1" },
|
|
10
10
|
"status": { "type": "string", "enum": ["created", "already_exists", "error"] },
|
|
11
11
|
"error": { "type": "string", "description": "Present only when status is 'error'. Actionable message including the remediation." },
|
|
12
12
|
"ref": { "type": "string", "description": "owner/repo#number" },
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
"file": { "type": "string" },
|
|
62
62
|
"line": { "type": ["integer", "null"] },
|
|
63
63
|
"message": { "type": "string" },
|
|
64
|
-
"rule": { "type": ["string", "null"] }
|
|
64
|
+
"rule": { "type": ["string", "null"] },
|
|
65
|
+
"category": { "type": ["string", "null"], "description": "Finding category (e.g. null-access, secret, rule-violation)." },
|
|
66
|
+
"failure_scenario": { "type": ["string", "null"], "description": "Concrete inputs/state and the resulting wrong behavior." }
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
}
|