@haystackeditor/cli 0.15.31 → 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 +141 -61
- package/dist/assets/hooks/scripts/commit-msg.sh +3 -0
- package/dist/assets/hooks/scripts/post-commit.sh +3 -0
- package/dist/assets/hooks/scripts/pre-commit.sh +11 -6
- package/dist/assets/hooks/scripts/pre-push.sh +3 -0
- package/dist/assets/hooks/scripts/prepare-commit-msg.sh +3 -0
- package/dist/commands/case-batch-contract.js +694 -0
- package/dist/commands/case-batch.js +1011 -0
- package/dist/commands/cloud-verifier-identity-census.js +5 -2
- package/dist/commands/combination-search-hook.js +139 -0
- package/dist/commands/dismiss.js +2 -1
- package/dist/commands/hooks.js +66 -7
- package/dist/commands/install-session-hooks.js +131 -44
- package/dist/commands/policy.js +32 -45
- package/dist/commands/precompute-delivery.js +6 -1
- package/dist/commands/scaffold-provisional-universe.js +8 -10
- package/dist/commands/setup.js +32 -10
- package/dist/commands/submit.js +39 -71
- package/dist/commands/telemetry.js +17 -2
- package/dist/commands/triage.js +2 -1
- package/dist/commands/verify-explore.js +1 -0
- package/dist/commands/verify-hosted-mcp.js +3 -12
- package/dist/commands/verify-hosted-reproducibility.js +49 -547
- package/dist/commands/verify-hosted.js +66 -168
- package/dist/commands/verify-precompute.js +64 -11
- package/dist/commands/verify.js +51 -139
- package/dist/index.js +290 -366
- package/dist/lazy.js +8 -0
- package/dist/schema.js +2 -1
- package/dist/tools/detect.js +3 -24
- package/dist/triage/astra.js +199 -0
- package/dist/triage/prompts.js +145 -179
- package/dist/triage/runner.js +104 -300
- package/dist/triage/types.js +2 -2
- package/dist/types.js +2 -6
- package/dist/utils/auth.js +14 -2
- package/dist/utils/git.js +60 -29
- package/dist/utils/github-api.js +14 -1
- package/dist/utils/haystack-api.js +38 -7
- package/dist/utils/hooks.js +43 -6
- package/dist/utils/prompter.js +25 -10
- package/dist/utils/safe-write.js +31 -0
- package/dist/utils/secret-paths.js +115 -0
- package/dist/utils/secrets.js +0 -1
- package/dist/utils/telemetry.js +34 -14
- package/dist/utils/update-check.js +151 -0
- package/package.json +19 -14
- package/schemas/case-batch.v1.json +235 -0
- package/schemas/cloud-verifier.v1.json +55 -100
- package/schemas/submit.v1.json +4 -2
- package/dist/commands/ask.d.ts +0 -14
- package/dist/commands/cloud-verifier-behaviors.d.ts +0 -27
- package/dist/commands/cloud-verifier-data-store-census.d.ts +0 -47
- package/dist/commands/cloud-verifier-data-store-drift.d.ts +0 -42
- package/dist/commands/cloud-verifier-identity-census.d.ts +0 -88
- package/dist/commands/cloud-verifier-materialization.d.ts +0 -16
- package/dist/commands/cloud-verifier-pascal-selector-census.d.ts +0 -29
- package/dist/commands/cloud-verifier-python-manifest-selector-census.d.ts +0 -27
- package/dist/commands/cloud-verifier-specialized-operational-census.d.ts +0 -51
- package/dist/commands/cloud-verifier-universe.d.ts +0 -31
- package/dist/commands/config.d.ts +0 -46
- package/dist/commands/design-verify.d.ts +0 -33
- package/dist/commands/dismiss.d.ts +0 -29
- package/dist/commands/hooks.d.ts +0 -13
- package/dist/commands/inbox.d.ts +0 -65
- package/dist/commands/init.d.ts +0 -10
- package/dist/commands/install-session-hooks.d.ts +0 -17
- package/dist/commands/login.d.ts +0 -8
- package/dist/commands/mcp.d.ts +0 -1
- package/dist/commands/policy.d.ts +0 -31
- package/dist/commands/pr-status.d.ts +0 -144
- package/dist/commands/pr.d.ts +0 -40
- package/dist/commands/precompute-delivery-contract.d.ts +0 -68
- package/dist/commands/precompute-delivery.d.ts +0 -20
- package/dist/commands/prepare-universe-review.d.ts +0 -115
- package/dist/commands/production-source-deny-policy.d.ts +0 -15
- package/dist/commands/request-review.d.ts +0 -26
- package/dist/commands/review.d.ts +0 -25
- package/dist/commands/rules.d.ts +0 -4
- package/dist/commands/scaffold-provisional-universe.d.ts +0 -468
- package/dist/commands/schema-cmd.d.ts +0 -2
- package/dist/commands/setup.d.ts +0 -28
- package/dist/commands/skills.d.ts +0 -8
- package/dist/commands/status.d.ts +0 -4
- package/dist/commands/submit.d.ts +0 -30
- package/dist/commands/system-map.d.ts +0 -42
- package/dist/commands/telemetry.d.ts +0 -53
- package/dist/commands/tokens.d.ts +0 -14
- package/dist/commands/triage.d.ts +0 -35
- package/dist/commands/verify-core.d.ts +0 -449
- package/dist/commands/verify-core.js +0 -789
- package/dist/commands/verify-explore.d.ts +0 -14
- package/dist/commands/verify-history.d.ts +0 -14
- package/dist/commands/verify-hosted-mcp.d.ts +0 -12
- package/dist/commands/verify-hosted-reproducibility.d.ts +0 -90
- package/dist/commands/verify-hosted.d.ts +0 -92
- package/dist/commands/verify-mcp.d.ts +0 -8
- package/dist/commands/verify-mcp.js +0 -517
- package/dist/commands/verify-ops.d.ts +0 -158
- package/dist/commands/verify-ops.js +0 -1148
- package/dist/commands/verify-precompute.d.ts +0 -30
- package/dist/commands/verify-reproducibility.d.ts +0 -85
- package/dist/commands/verify-reproducibility.js +0 -494
- package/dist/commands/verify-reseal.d.ts +0 -9
- package/dist/commands/verify-reseal.js +0 -148
- package/dist/commands/verify-sandboxes.d.ts +0 -95
- package/dist/commands/verify-sandboxes.js +0 -352
- package/dist/commands/verify.d.ts +0 -28
- package/dist/commands/webhooks.d.ts +0 -30
- package/dist/index.d.ts +0 -22
- package/dist/schema.d.ts +0 -28
- package/dist/states.d.ts +0 -29
- package/dist/tools/detect.d.ts +0 -50
- package/dist/triage/prompts.d.ts +0 -24
- package/dist/triage/runner.d.ts +0 -34
- package/dist/triage/types.d.ts +0 -42
- package/dist/types/verify-history.d.ts +0 -38
- package/dist/types.d.ts +0 -1684
- package/dist/utils/action-output.d.ts +0 -24
- package/dist/utils/analysis-api.d.ts +0 -187
- package/dist/utils/auth.d.ts +0 -79
- package/dist/utils/config.d.ts +0 -24
- package/dist/utils/design-verifier-api.d.ts +0 -208
- package/dist/utils/design-verifier-history.d.ts +0 -46
- package/dist/utils/design-verifier-result.d.ts +0 -74
- package/dist/utils/detect.d.ts +0 -43
- package/dist/utils/git.d.ts +0 -135
- package/dist/utils/github-api.d.ts +0 -104
- package/dist/utils/haystack-api.d.ts +0 -37
- package/dist/utils/hooks.d.ts +0 -12
- package/dist/utils/pending-state.d.ts +0 -40
- package/dist/utils/pr-ref.d.ts +0 -27
- package/dist/utils/prompter.d.ts +0 -85
- package/dist/utils/secrets.d.ts +0 -47
- package/dist/utils/telemetry.d.ts +0 -19
- /package/dist/commands/{precompute-delivery-worker.d.ts → combination-search-hook-contract.js} +0 -0
package/README.md
CHANGED
|
@@ -10,6 +10,13 @@ haystack login
|
|
|
10
10
|
haystack setup
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Requires Node.js 22.18 or newer.
|
|
14
|
+
|
|
15
|
+
After a command finishes in an interactive terminal, the CLI checks npm at most
|
|
16
|
+
once a day and prints one line on stderr when a newer version exists. It never
|
|
17
|
+
runs with `--json`, when stdout is not a TTY, or when `CI` is set. Set
|
|
18
|
+
`HAYSTACK_NO_UPDATE_CHECK=1` to turn it off.
|
|
19
|
+
|
|
13
20
|
The `setup` command walks you through an interactive wizard:
|
|
14
21
|
|
|
15
22
|
1. **Select repositories** to configure
|
|
@@ -20,8 +27,9 @@ The `setup` command walks you through an interactive wizard:
|
|
|
20
27
|
6. **Write `.haystack.json`** to your repos
|
|
21
28
|
|
|
22
29
|
The CLI sends limited operational events to PostHog by default so Haystack can
|
|
23
|
-
measure setup reliability. Events contain a pseudonymous
|
|
24
|
-
|
|
30
|
+
measure setup reliability. Events contain a pseudonymous install identifier
|
|
31
|
+
(a random id generated once and stored in `~/.haystack/telemetry-id`; it is
|
|
32
|
+
not derived from your username or hostname), CLI/version/platform fields, command-step and error categories, and numeric
|
|
25
33
|
outcomes. They exclude source code, repository names, local paths, usernames,
|
|
26
34
|
hostnames, and raw error text. IP enrichment is disabled. Set `DO_NOT_TRACK=1`
|
|
27
35
|
or `HAYSTACK_TELEMETRY_DISABLED=1` to turn this telemetry off.
|
|
@@ -72,90 +80,89 @@ haystack triage <ref> --json # poll findings later / after --no-wait
|
|
|
72
80
|
`dismiss`, `mark_reviewed`, `undismiss`, `request_review`, `trigger_review`,
|
|
73
81
|
and `schema`.
|
|
74
82
|
|
|
75
|
-
**`haystack verify
|
|
76
|
-
|
|
77
|
-
`verify_cleanup`. Agents select state by an exact Archil fork ID or a stable
|
|
78
|
-
run/test/side coordinate; refork returns a durable child ID that can be
|
|
79
|
-
reopened or nested again without receiving provider credentials. The matching
|
|
80
|
-
CLI flow is:
|
|
83
|
+
**`haystack verify`** verifies the current change using the authenticated
|
|
84
|
+
Haystack fleet. Inside a git checkout, push your commit and run:
|
|
81
85
|
|
|
82
86
|
```bash
|
|
83
|
-
haystack verify
|
|
84
|
-
|
|
85
|
-
haystack verify refork latest 3 attempt:fix-2
|
|
86
|
-
haystack verify reopen archil:<disk-id>:branch:<returned-child>
|
|
87
|
+
haystack verify
|
|
88
|
+
haystack verify --json
|
|
87
89
|
```
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
The repository defaults to `owner/repo` from the `origin` remote URL. The head
|
|
92
|
+
is the current `HEAD` commit. The base is `git merge-base HEAD
|
|
93
|
+
origin/<default branch>`, using `origin/HEAD` to discover the default branch
|
|
94
|
+
and falling back to `origin/main`. If the current commit is not reachable from
|
|
95
|
+
any remote-tracking branch, the command asks you to push first.
|
|
96
|
+
Explicit `--repo`, `--base`, and `--head` values override their defaults; supplying
|
|
97
|
+
all three also works outside a checkout:
|
|
92
98
|
|
|
93
99
|
```bash
|
|
94
|
-
haystack verify
|
|
95
|
-
--base <40-character-commit-sha> \
|
|
96
|
-
--head <40-character-commit-sha> \
|
|
97
|
-
--json
|
|
100
|
+
haystack verify --repo owner/repo --base main --head feature --json
|
|
98
101
|
```
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
same
|
|
104
|
-
when a fresh execution is intentional. A
|
|
105
|
-
|
|
106
|
-
and `next_command`, then exits 2. Read or resume a known run with:
|
|
103
|
+
Intent is optional: `--intent-file <path>` accepts JSON with exactly `problem`,
|
|
104
|
+
`goal`, and `intended_outcomes`. The CLI uses your saved account and waits up to
|
|
105
|
+
35 minutes by default. Pass `--no-wait` to return after the fleet run is queued.
|
|
106
|
+
Repeating the same repository, refs, and intent reuses the same run; choose a new
|
|
107
|
+
`--idempotency-key` when a fresh execution is intentional. A wait that expires
|
|
108
|
+
prints `timed_out: true` and `next_command`, then exits 2. Resume with:
|
|
107
109
|
|
|
108
110
|
```bash
|
|
109
|
-
haystack verify hosted status cv_<48-lowercase-hex-characters>
|
|
110
|
-
|
|
111
|
-
--wait \
|
|
112
|
-
--json
|
|
111
|
+
haystack verify hosted status cv_<48-lowercase-hex-characters> --wait --json
|
|
112
|
+
haystack verify history owner/repo --limit 20
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
Use the returned account-bound `next_command` verbatim on machines with multiple
|
|
116
|
+
saved accounts. `haystack verify hosted start owner/repo --base <sha> --head
|
|
117
|
+
<sha>` starts the same fleet execution through an explicit subcommand.
|
|
118
|
+
|
|
119
|
+
Retained fleet cases remain available through their exact case IDs:
|
|
117
120
|
|
|
118
121
|
```bash
|
|
119
|
-
haystack verify
|
|
120
|
-
|
|
121
|
-
--head <40-character-commit-sha> \
|
|
122
|
-
--replay-plan-from cv_<48-lowercase-hex-characters> \
|
|
123
|
-
--json
|
|
122
|
+
haystack verify cases <run-id> --repo owner/repo
|
|
123
|
+
haystack verify explore <run-id> <case-id> --repo owner/repo
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
replay does not mint or deliver a planning-model credential.
|
|
126
|
+
Agents can use the same lifecycle with `haystack verify hosted mcp --account
|
|
127
|
+
<login>`. Its tools are `verify_start`, `verify_status`, and `verify_wait`.
|
|
129
128
|
|
|
130
|
-
|
|
129
|
+
To repeat independent fleet runs for one exact commit pair:
|
|
131
130
|
|
|
132
131
|
```bash
|
|
133
|
-
haystack verify hosted
|
|
132
|
+
haystack verify hosted reproducibility owner/repo \
|
|
133
|
+
--base <40-character-commit-sha> \
|
|
134
|
+
--head <40-character-commit-sha> \
|
|
135
|
+
--runs 3 --json
|
|
134
136
|
```
|
|
135
137
|
|
|
136
|
-
The
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
The report includes each run's fleet receipt. Each ordinal has a distinct
|
|
139
|
+
idempotency key derived from the printed series key, repository, commits, and
|
|
140
|
+
intent; `--series-key <key>` resumes the same series. Independent plans do not
|
|
141
|
+
share an execution identity, so reproducibility remains unestablished and the
|
|
142
|
+
command exits 2. A timeout stops the series and includes the active run's resume
|
|
143
|
+
command.
|
|
140
144
|
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
**`haystack case-batch`** runs an already-generated product-fuzzing case
|
|
146
|
+
batch on the hosted coordinator. The laptop only submits and polls: it holds no
|
|
147
|
+
fleet credential, creates no VM, and kills nothing.
|
|
143
148
|
|
|
144
149
|
```bash
|
|
145
|
-
haystack
|
|
146
|
-
--base <40-character-commit-sha> \
|
|
147
|
-
--
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
haystack case-batch submit --repository owner/repo \
|
|
151
|
+
--base <40-character-commit-sha> --head <40-character-commit-sha> \
|
|
152
|
+
--cases cases.json --combinations space.json --max-concurrent 200 --json
|
|
153
|
+
haystack case-batch status <run-id> --repository owner/repo --watch --json
|
|
154
|
+
haystack case-batch cancel <run-id> --repository owner/repo
|
|
155
|
+
haystack case-batch bundle <run-id> --repository owner/repo --out ./bundle
|
|
150
156
|
```
|
|
151
157
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
Cases and the combination space travel inline and the whole request is bounded
|
|
159
|
+
at 8 MiB; no source patch is sent unless `--source-patch <file>` names the
|
|
160
|
+
precompute-captured `{ cacheKey, patchSha256, patchGzBase64 }` record.
|
|
161
|
+
`status` follows the case cursor to the end of the list and prints one row per
|
|
162
|
+
case — id, position, status, unknown reason, wall time and whether cleanup was
|
|
163
|
+
proven — including when the batch ends `incomplete`, which exits 2 with a
|
|
164
|
+
summary rather than a single failure. `haystack schema case-batch` prints the
|
|
165
|
+
`--json` schema.
|
|
159
166
|
|
|
160
167
|
**`haystack setup --json`** speaks NDJSON: events (`question`, `permission`,
|
|
161
168
|
`progress`, `result`) on stdout, replies on stdin keyed by
|
|
@@ -211,7 +218,7 @@ haystack logout
|
|
|
211
218
|
|
|
212
219
|
### `haystack submit`
|
|
213
220
|
|
|
214
|
-
Create a PR from current changes. Runs pre-PR triage (code review, rules validation
|
|
221
|
+
Create a PR from current changes. Runs pre-PR triage (code review, rules validation), pushes your branch, and opens the PR.
|
|
215
222
|
|
|
216
223
|
```bash
|
|
217
224
|
haystack submit # Triage -> create PR -> wait for analysis
|
|
@@ -222,6 +229,28 @@ haystack submit --force # Skip triage checks
|
|
|
222
229
|
haystack submit --no-wait # Don't wait for analysis results
|
|
223
230
|
```
|
|
224
231
|
|
|
232
|
+
**Pre-PR triage**: two checkers run in parallel, each one structured call to
|
|
233
|
+
`gpt-6-astra` over the OpenAI Responses API at reasoning effort `max` (the
|
|
234
|
+
highest the API accepts for that model). The key comes from `OPENAI_API_KEY`
|
|
235
|
+
if set, else from the SSM SecureString `/haystack/secrets/shared/prod/OPENAI_API_KEY`
|
|
236
|
+
(us-west-2) through the default AWS credential chain (e.g. `AWS_PROFILE=prod`).
|
|
237
|
+
With neither, each checker reports `no OpenAI key (...)` and submit continues.
|
|
238
|
+
|
|
239
|
+
- **code-review** reads `git diff -U10 origin/<base>...HEAD` and reports objective bugs.
|
|
240
|
+
- **rules-validator** runs when `.haystack/pr-rules.yml` or an agent
|
|
241
|
+
instruction file (`CLAUDE.md`, `AGENTS.md`, `COPILOT.md`, `.cursorrules`,
|
|
242
|
+
`.github/copilot-instructions.md`) exists, and checks the diff against them.
|
|
243
|
+
|
|
244
|
+
Each finding carries `file`, `line`, `severity` (`error`/`warning`/`info`),
|
|
245
|
+
`category`, a one-sentence summary and a concrete failure scenario; results
|
|
246
|
+
are saved to `.haystack/triage/<checker>.json`. A finding with severity
|
|
247
|
+
`error` stops the submit (`--force` skips triage). A checker that cannot run
|
|
248
|
+
(missing key, API error, stalled stream) prints `code review failed: <error>`
|
|
249
|
+
and the submit continues. The reviewer sees only the diff, not the rest of the
|
|
250
|
+
repository. `--triage-timeout <sec>` (or `.haystack.json` `triage.timeoutMs`)
|
|
251
|
+
aborts a checker whose response stream has been silent that long (default
|
|
252
|
+
300s); there is no total-time cap.
|
|
253
|
+
|
|
225
254
|
The `--json` payload (`haystack schema submit`) reports the PR ref, the
|
|
226
255
|
resolved title/body and where each came from, auto-merge/auto-fix state with
|
|
227
256
|
its source (flag vs `.haystack.json`), and the analysis outcome in the shared
|
|
@@ -440,6 +469,57 @@ haystack hooks install-session --cli all # All detected CLIs
|
|
|
440
469
|
haystack hooks session-status # Check session hook status
|
|
441
470
|
```
|
|
442
471
|
|
|
472
|
+
### `haystack case-batch`
|
|
473
|
+
|
|
474
|
+
Submit and poll product-fuzzing case batches on the hosted coordinator
|
|
475
|
+
(`CASE-BATCH-V1`):
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
# Submit an ordered batch against one frozen world pair
|
|
479
|
+
haystack case-batch submit --repository owner/repo \
|
|
480
|
+
--base <sha> --head <sha> \
|
|
481
|
+
--cases cases.json --combinations space.json \
|
|
482
|
+
--base-world frz_<16-hex> --head-world frz_<16-hex> \
|
|
483
|
+
--max-concurrent 200 --per-case-wall-ms 15000 --total-budget-ms 600000 --json
|
|
484
|
+
|
|
485
|
+
# Read every per-case outcome; --watch polls until terminal or --max-wall
|
|
486
|
+
haystack case-batch status <run-id> --repository owner/repo --watch --json
|
|
487
|
+
|
|
488
|
+
# Request cancellation (a claimed batch drains until its owner proves cleanup)
|
|
489
|
+
haystack case-batch cancel <run-id> --repository owner/repo
|
|
490
|
+
|
|
491
|
+
# Download the replay bundle, verifying every artifact digest
|
|
492
|
+
haystack case-batch bundle <run-id> --repository owner/repo --out ./bundle
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
`bundle` requires the service's sealed SHA-256 for `manifest.json` (served as
|
|
496
|
+
its ETag), because the manifest is the one artifact with no parent digest to
|
|
497
|
+
check it against; without it the command fails and writes nothing. Every other
|
|
498
|
+
artifact is checked against the sha256 and byte length the manifest declares
|
|
499
|
+
for it.
|
|
500
|
+
|
|
501
|
+
Knobs and what turning them does:
|
|
502
|
+
|
|
503
|
+
| Flag | Default | Effect |
|
|
504
|
+
|------|---------|--------|
|
|
505
|
+
| `--max-concurrent <n>` | the case count, capped at 500 | Ceiling only. Admitted concurrency is the smaller of it and the fleet's free capacity; the run's receipt reports both. |
|
|
506
|
+
| `--per-case-wall-ms <ms>` | 120000 | A case that overruns is killed and recorded `UNKNOWN`/`wall-budget`, never dropped. Above the MVP's measured 103.8 s maximum, so it does not kill cases running at today's cost. |
|
|
507
|
+
| `--total-budget-ms <ms>` | 1800000 (the contract ceiling) | Bounds launches from the first launch. Cases already launched run to their own wall budget. |
|
|
508
|
+
| `--warm-settle-ms <ms>` | absent (0) | Each arm adopts only a warm clone that has been ready at least this long, 0 to the per-case wall. A clone adopted right after its restore attaches cold (quiet fleet: connectMs 5.8 s at 0 vs 1.1 s after 3.5-6 s of idle); each second of settle can delay a case's first create by up to a second. |
|
|
509
|
+
| `--idempotency-key <key>` | derived from the whole submission | An exact retry returns the original run; a new key is a new execution. |
|
|
510
|
+
| `--interval <seconds>` | 10 | Polling interval while `--watch` is set. |
|
|
511
|
+
| `--max-wall <minutes>` | 45 | Total polling wall. Hitting it prints the snapshot, says `timed_out`, and exits 2. |
|
|
512
|
+
|
|
513
|
+
`status` exits 0 for a `completed` batch with cleanup proven, and 2 for
|
|
514
|
+
`incomplete`, `cancelled`, unproven cleanup, or a wait that hits `--max-wall`.
|
|
515
|
+
Either way every per-case row is printed. A `--json` row from a v4 batch also
|
|
516
|
+
carries `node_ids: { base1, head }` (the node each arm's VM was placed on) and
|
|
517
|
+
`failure: { source, arm, error_class, error_code, node_id }` (the typed fact
|
|
518
|
+
behind an `UNKNOWN` that is not an arrival or wall outcome, and behind an
|
|
519
|
+
`arrival-failed` whose two arms stalled on the same step, `same-step-stall`); each
|
|
520
|
+
is `null` when the outcome has none. A case in `--cases` may carry `repeatIndex` (1-16), which
|
|
521
|
+
must be part of its `contentDigest`, to run as a repeat next to its original.
|
|
522
|
+
|
|
443
523
|
### `haystack policy`
|
|
444
524
|
|
|
445
525
|
Manage review policies (`.haystack/review-policy.md`):
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
+
# Haystack's own hooks never need the push credential the CLI exports for
|
|
3
|
+
# `git push`; drop it so nothing these hooks run can read it.
|
|
4
|
+
unset HAYSTACK_GIT_TOKEN
|
|
2
5
|
HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
3
6
|
REPO_ROOT="$(cd "$HOOKS_DIR/.." && pwd)"
|
|
4
7
|
TSX_IMPORT="$HOOKS_DIR/node_modules/tsx/dist/loader.mjs"
|
|
@@ -72,14 +75,16 @@ run_tsx() {
|
|
|
72
75
|
return
|
|
73
76
|
fi
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
"$TSX_BIN" "$@"
|
|
77
|
-
return
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
npx tsx "$@"
|
|
78
|
+
"$TSX_BIN" "$@"
|
|
81
79
|
}
|
|
82
80
|
|
|
81
|
+
# No network fallback: without a supported Node or the installed hook
|
|
82
|
+
# dependencies, fail rather than fetch an unpinned tsx with npx.
|
|
83
|
+
if ! node_supports_import && ! node_supports_loader && [ ! -x "$TSX_BIN" ]; then
|
|
84
|
+
echo "Haystack pre-commit: needs Node 18 or later, or hooks/node_modules (run npm ci in hooks/)." >&2
|
|
85
|
+
exit 1
|
|
86
|
+
fi
|
|
87
|
+
|
|
83
88
|
# Extract agent context if running under an AI agent
|
|
84
89
|
# Capture stderr to detect whether an AI agent is present
|
|
85
90
|
AGENT_OUTPUT=$(run_tsx "$HOOKS_DIR/agent-context/index.ts" "$REPO_ROOT" 2>&1) || true
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# Haystack pre-push hook
|
|
3
|
+
# Haystack's own hooks never need the push credential the CLI exports for
|
|
4
|
+
# `git push`; drop it so nothing these hooks run can read it.
|
|
5
|
+
unset HAYSTACK_GIT_TOKEN
|
|
3
6
|
# $1 is the remote name (e.g., "origin")
|
|
4
7
|
|
|
5
8
|
# Check if pushing a non-haystack branch and remind about haystack submit
|