@haystackeditor/cli 0.15.26 → 0.15.28

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.
Files changed (87) hide show
  1. package/README.md +52 -23
  2. package/dist/assets/hooks/agent-context/detect.ts +7 -7
  3. package/dist/assets/hooks/agent-context/parsers/claude.ts +1 -1
  4. package/dist/assets/hooks/package-lock.json +598 -0
  5. package/dist/assets/hooks/scripts/commit-msg.sh +1 -3
  6. package/dist/assets/hooks/scripts/post-commit.sh +1 -3
  7. package/dist/assets/hooks/scripts/pre-push.sh +1 -4
  8. package/dist/assets/hooks/scripts/prepare-commit-msg.sh +1 -2
  9. package/dist/assets/skills/map-cloud-verifier-universe/SKILL.md +2051 -0
  10. package/dist/assets/skills/map-cloud-verifier-universe/agents/openai.yaml +4 -0
  11. package/dist/assets/skills/map-cloud-verifier-universe/references/output-contract.md +3411 -0
  12. package/dist/assets/telemetry/browser-runtime.js +1469 -0
  13. package/dist/assets/telemetry/runtime.cjs +1503 -0
  14. package/dist/commands/cloud-verifier-behaviors.d.ts +27 -0
  15. package/dist/commands/cloud-verifier-behaviors.js +218 -0
  16. package/dist/commands/cloud-verifier-data-store-census.d.ts +47 -0
  17. package/dist/commands/cloud-verifier-data-store-census.js +539 -0
  18. package/dist/commands/cloud-verifier-data-store-drift.d.ts +42 -0
  19. package/dist/commands/cloud-verifier-data-store-drift.js +158 -0
  20. package/dist/commands/cloud-verifier-identity-census.d.ts +88 -0
  21. package/dist/commands/cloud-verifier-identity-census.js +4057 -0
  22. package/dist/commands/cloud-verifier-materialization.d.ts +16 -0
  23. package/dist/commands/cloud-verifier-materialization.js +704 -0
  24. package/dist/commands/cloud-verifier-pascal-selector-census.d.ts +29 -0
  25. package/dist/commands/cloud-verifier-pascal-selector-census.js +1382 -0
  26. package/dist/commands/cloud-verifier-python-manifest-selector-census.d.ts +27 -0
  27. package/dist/commands/cloud-verifier-python-manifest-selector-census.js +2015 -0
  28. package/dist/commands/cloud-verifier-specialized-operational-census.d.ts +51 -0
  29. package/dist/commands/cloud-verifier-specialized-operational-census.js +11432 -0
  30. package/dist/commands/cloud-verifier-universe.d.ts +31 -0
  31. package/dist/commands/cloud-verifier-universe.js +10178 -0
  32. package/dist/commands/design-verify.d.ts +31 -0
  33. package/dist/commands/design-verify.js +285 -0
  34. package/dist/commands/hooks.d.ts +1 -5
  35. package/dist/commands/hooks.js +12 -114
  36. package/dist/commands/install-session-hooks.d.ts +2 -2
  37. package/dist/commands/install-session-hooks.js +71 -21
  38. package/dist/commands/mcp.js +1 -34
  39. package/dist/commands/pr.js +2 -7
  40. package/dist/commands/prepare-universe-review.d.ts +115 -0
  41. package/dist/commands/prepare-universe-review.js +1092 -0
  42. package/dist/commands/production-source-deny-policy.d.ts +15 -0
  43. package/dist/commands/production-source-deny-policy.js +100 -0
  44. package/dist/commands/scaffold-provisional-universe.d.ts +468 -0
  45. package/dist/commands/scaffold-provisional-universe.js +808 -0
  46. package/dist/commands/schema-cmd.js +32 -0
  47. package/dist/commands/setup.d.ts +1 -2
  48. package/dist/commands/setup.js +18 -272
  49. package/dist/commands/skills.d.ts +2 -2
  50. package/dist/commands/skills.js +415 -47
  51. package/dist/commands/submit.js +1 -2
  52. package/dist/commands/telemetry.d.ts +53 -0
  53. package/dist/commands/telemetry.js +832 -0
  54. package/dist/commands/verify-hosted.d.ts +13 -0
  55. package/dist/commands/verify-hosted.js +49 -1
  56. package/dist/commands/verify-precompute.d.ts +19 -0
  57. package/dist/commands/verify-precompute.js +328 -0
  58. package/dist/index.js +168 -47
  59. package/dist/schema.d.ts +1 -2
  60. package/dist/schema.js +1 -2
  61. package/dist/triage/prompts.d.ts +0 -7
  62. package/dist/triage/prompts.js +0 -145
  63. package/dist/triage/runner.js +10 -28
  64. package/dist/triage/types.d.ts +1 -8
  65. package/dist/types.d.ts +8 -8
  66. package/dist/types.js +1 -1
  67. package/dist/utils/design-verifier-api.d.ts +200 -0
  68. package/dist/utils/design-verifier-api.js +271 -0
  69. package/dist/utils/design-verifier-result.d.ts +57 -0
  70. package/dist/utils/design-verifier-result.js +345 -0
  71. package/dist/utils/git.d.ts +5 -1
  72. package/dist/utils/git.js +19 -9
  73. package/dist/utils/github-api.js +11 -14
  74. package/dist/utils/haystack-api.d.ts +2 -0
  75. package/dist/utils/haystack-api.js +10 -3
  76. package/dist/utils/hooks.d.ts +1 -15
  77. package/dist/utils/hooks.js +3 -128
  78. package/dist/utils/telemetry.d.ts +2 -0
  79. package/dist/utils/telemetry.js +81 -8
  80. package/package.json +8 -2
  81. package/schemas/cloud-verifier.v1.json +69 -3
  82. package/schemas/{pr.v2.json → pr.v3.json} +3 -12
  83. package/dist/commands/traces.d.ts +0 -48
  84. package/dist/commands/traces.js +0 -92
  85. package/dist/triage/traces.d.ts +0 -20
  86. package/dist/triage/traces.js +0 -311
  87. package/schemas/traces.v1.json +0 -53
package/README.md CHANGED
@@ -19,6 +19,13 @@ The `setup` command walks you through an interactive wizard:
19
19
  5. **Review and toggle** discovered items
20
20
  6. **Write `.haystack.json`** to your repos
21
21
 
22
+ The CLI sends limited operational events to PostHog by default so Haystack can
23
+ measure setup reliability. Events contain a pseudonymous machine identifier,
24
+ CLI/version/platform fields, command-step and error categories, and numeric
25
+ outcomes. They exclude source code, repository names, local paths, usernames,
26
+ hostnames, and raw error text. IP enrichment is disabled. Set `DO_NOT_TRACK=1`
27
+ or `HAYSTACK_TELEMETRY_DISABLED=1` to turn this telemetry off.
28
+
22
29
  ---
23
30
 
24
31
  ## For AI agents: the machine-readable contract
@@ -62,8 +69,8 @@ haystack triage <ref> --json # poll findings later / after --no-wait
62
69
 
63
70
  **`haystack mcp`** runs a stdio MCP server exposing the same payloads as tools:
64
71
  `inbox_list`, `pr_get`, `pr_status`, `triage_get`, `ask_haystack`,
65
- `traces_list`, `traces_get`, `dismiss`, `mark_reviewed`, `undismiss`,
66
- `request_review`, `trigger_review`, and `schema`.
72
+ `dismiss`, `mark_reviewed`, `undismiss`, `request_review`, `trigger_review`,
73
+ and `schema`.
67
74
 
68
75
  **`haystack verify mcp`** runs the cloud-verifier MCP server. Retained
69
76
  application state is available through `verify_reopen`, `verify_refork`, and
@@ -259,7 +266,7 @@ haystack inbox list --json
259
266
 
260
267
  ### `haystack pr get`
261
268
 
262
- Get the useful state of one PR: triage, minimal merge blockers, and customer-trace availability:
269
+ Get the useful state of one PR: triage and minimal merge blockers:
263
270
 
264
271
  ```bash
265
272
  haystack pr get 42
@@ -278,18 +285,6 @@ haystack ask owner/repo#42 "What about its callers?" --session <session-id> --js
278
285
 
279
286
  Chat may search the complete authorized repository when the changed files are insufficient. Search results and fetched source are included in `evidence`.
280
287
 
281
- ### `haystack traces`
282
-
283
- Inspect retained customer-owned Entire checkpoints and transcript chunks:
284
-
285
- ```bash
286
- haystack traces list owner/repo#42 --json
287
- haystack traces get owner/repo#42 <checkpoint-id> --json
288
- haystack traces get owner/repo#42 <checkpoint-id> --cursor 20 --limit 20 --json
289
- ```
290
-
291
- These commands expose customer coding-session data, not Haystack's internal analysis-agent execution.
292
-
293
288
  ### `haystack review`
294
289
 
295
290
  Trigger a fresh *machine* analysis of a PR's current head (Haystack analyzes once at PR open; later pushes only get a resolution check). For requesting *human* review, use `haystack request-review`.
@@ -384,25 +379,59 @@ queue wait forever for a bot that can't post).
384
379
  Manage AI skills for your coding CLI:
385
380
 
386
381
  ```bash
387
- haystack skills install # Auto-detect CLI and install
388
- haystack skills install --cli codex # Install for Codex only
389
- haystack skills install --cli manual # Show manual setup instructions
382
+ haystack skills install # Install portable .agents/skills
383
+ haystack skills install --cli codex # Portable install for Codex
384
+ haystack skills install --cli claude # Also install Claude command shims
385
+ haystack skills install --cli manual # Install portable skills and print their location
390
386
  haystack skills list # List available skills
387
+ haystack skills scaffold-provisional-universe --input /tmp/facts.json # Write a missing-authority receipt
388
+ haystack skills prepare-universe-review --json # Build a filtered reviewer source snapshot
389
+ haystack skills validate-universe --json # Parse and cross-check universe artifacts
391
390
  ```
392
391
 
392
+ Installed skills include `/map-cloud-verifier-universe`, which asks the
393
+ customer's coding agent to map the application's production dependencies and
394
+ uses a read-only reviewer subagent to check the map before Cloud Verifier
395
+ onboarding. It first checks for an authoritative hosted-deployment source; if
396
+ that source is private, it produces a provisional map and one bounded request
397
+ for a summary from the customer's local replicator or catalog. It never asks
398
+ for production credentials or direct Haystack access to production.
399
+
400
+ Start a customer-owned Cloud Verifier adapter before a universe map exists, from
401
+ only the three selections the user actually makes — which application, which
402
+ environment, and which approved replica destination:
403
+
404
+ ```bash
405
+ haystack cloud-verifier connector bootstrap \
406
+ --application-id Checkout \
407
+ --environment-id production \
408
+ --destination-policy-file ./replica-destination-policy.json
409
+ ```
410
+
411
+ Application and environment accept a plain name and are normalized to stable IDs
412
+ (`application:checkout`, `environment:production`); pass an explicit
413
+ `application:<id>` when you want to choose it yourself. The destination is named
414
+ by its approved policy document, whose SHA-256 the command computes and reports.
415
+ Pass `--destination-policy-sha256 <64-hex>` instead only if your tooling already
416
+ holds the digest. Exactly one of the two is required.
417
+
418
+ The scaffold stays blocked until the customer's coding agent completes bounded
419
+ local discovery and provider-profile conformance. It includes the lifecycle and
420
+ binding executable, encrypted connector-owned vault contract, cold golden
421
+ refresh scheduler, and a setup/update-only reviewer-subagent request. No
422
+ reviewer runs on ordinary verification requests or routine golden refreshes.
423
+
393
424
  ### `haystack hooks`
394
425
 
395
426
  Manage git hooks for AI agent quality checks:
396
427
 
397
428
  ```bash
398
- # Install hooks + Entire CLI
399
- haystack hooks install # Install with pinned Entire version
429
+ # Install hooks
430
+ haystack hooks install
400
431
  haystack hooks install --force # Overwrite existing hooks
401
- haystack hooks install --skip-entire # Only install Haystack hooks
402
432
 
403
- # Status and updates
433
+ # Status
404
434
  haystack hooks status # Check installation status
405
- haystack hooks update # Update Entire CLI to latest
406
435
 
407
436
  # Session hooks (triage on CLI start)
408
437
  haystack hooks install-session # Auto-detect CLIs
@@ -153,11 +153,11 @@ function codexSessionMatchesRepo(
153
153
  }
154
154
 
155
155
  function getCodexSessionRoots(): string[] {
156
- const overrideDir = process.env.ENTIRE_TEST_CODEX_SESSION_DIR;
156
+ const overrideDir = process.env.HAYSTACK_TEST_CODEX_SESSION_DIR;
157
157
  if (overrideDir) return [overrideDir];
158
158
 
159
159
  const codexHome =
160
- process.env.ENTIRE_TEST_CODEX_HOME ||
160
+ process.env.HAYSTACK_TEST_CODEX_HOME ||
161
161
  process.env.CODEX_HOME ||
162
162
  path.join(os.homedir(), '.codex');
163
163
 
@@ -176,7 +176,7 @@ function extractCodexSessionId(filePath: string): string {
176
176
  }
177
177
 
178
178
  function detectClaude(repoPath: string): DetectionResult {
179
- const overrideDir = process.env.ENTIRE_TEST_CLAUDE_PROJECT_DIR;
179
+ const overrideDir = process.env.HAYSTACK_TEST_CLAUDE_PROJECT_DIR;
180
180
  const sessionDir =
181
181
  overrideDir ||
182
182
  path.join(os.homedir(), '.claude', 'projects', sanitizePath(repoPath));
@@ -195,7 +195,7 @@ function detectClaude(repoPath: string): DetectionResult {
195
195
  }
196
196
 
197
197
  function detectGemini(repoPath: string): DetectionResult {
198
- const overrideDir = process.env.ENTIRE_TEST_GEMINI_PROJECT_DIR;
198
+ const overrideDir = process.env.HAYSTACK_TEST_GEMINI_PROJECT_DIR;
199
199
  const projectHash = sha256(repoPath);
200
200
  const sessionDir =
201
201
  overrideDir ||
@@ -215,10 +215,10 @@ function detectGemini(repoPath: string): DetectionResult {
215
215
  }
216
216
 
217
217
  function detectOpenCode(repoPath: string): DetectionResult {
218
- const overrideDir = process.env.ENTIRE_TEST_OPENCODE_PROJECT_DIR;
218
+ const overrideDir = process.env.HAYSTACK_TEST_OPENCODE_PROJECT_DIR;
219
219
  const sessionDir =
220
220
  overrideDir ||
221
- path.join(os.tmpdir(), 'entire-opencode', sanitizePath(repoPath));
221
+ path.join(os.tmpdir(), 'haystack-opencode', sanitizePath(repoPath));
222
222
 
223
223
  const sessionFile = findMostRecentFile(sessionDir, /\.json$/);
224
224
  if (!sessionFile || !isRecent(sessionFile)) {
@@ -234,7 +234,7 @@ function detectOpenCode(repoPath: string): DetectionResult {
234
234
  }
235
235
 
236
236
  function detectCodex(repoPath: string): DetectionResult {
237
- const overrideFile = process.env.ENTIRE_TEST_CODEX_SESSION_FILE;
237
+ const overrideFile = process.env.HAYSTACK_TEST_CODEX_SESSION_FILE;
238
238
  if (
239
239
  overrideFile &&
240
240
  isRecent(overrideFile) &&
@@ -38,7 +38,7 @@ interface ClaudeLine {
38
38
  cache_read_input_tokens?: number;
39
39
  };
40
40
  };
41
- // New Entire CLI format: id/content at top level (type is the role)
41
+ // Alternate format: id/content at top level (type is the role)
42
42
  id?: string;
43
43
  content?: unknown;
44
44
  }