@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.
Files changed (136) hide show
  1. package/README.md +141 -61
  2. package/dist/assets/hooks/scripts/commit-msg.sh +3 -0
  3. package/dist/assets/hooks/scripts/post-commit.sh +3 -0
  4. package/dist/assets/hooks/scripts/pre-commit.sh +11 -6
  5. package/dist/assets/hooks/scripts/pre-push.sh +3 -0
  6. package/dist/assets/hooks/scripts/prepare-commit-msg.sh +3 -0
  7. package/dist/commands/case-batch-contract.js +694 -0
  8. package/dist/commands/case-batch.js +1011 -0
  9. package/dist/commands/cloud-verifier-identity-census.js +5 -2
  10. package/dist/commands/combination-search-hook.js +139 -0
  11. package/dist/commands/dismiss.js +2 -1
  12. package/dist/commands/hooks.js +66 -7
  13. package/dist/commands/install-session-hooks.js +131 -44
  14. package/dist/commands/policy.js +32 -45
  15. package/dist/commands/precompute-delivery.js +6 -1
  16. package/dist/commands/scaffold-provisional-universe.js +8 -10
  17. package/dist/commands/setup.js +32 -10
  18. package/dist/commands/submit.js +39 -71
  19. package/dist/commands/telemetry.js +17 -2
  20. package/dist/commands/triage.js +2 -1
  21. package/dist/commands/verify-explore.js +1 -0
  22. package/dist/commands/verify-hosted-mcp.js +3 -12
  23. package/dist/commands/verify-hosted-reproducibility.js +49 -547
  24. package/dist/commands/verify-hosted.js +66 -168
  25. package/dist/commands/verify-precompute.js +64 -11
  26. package/dist/commands/verify.js +51 -139
  27. package/dist/index.js +290 -366
  28. package/dist/lazy.js +8 -0
  29. package/dist/schema.js +2 -1
  30. package/dist/tools/detect.js +3 -24
  31. package/dist/triage/astra.js +199 -0
  32. package/dist/triage/prompts.js +145 -179
  33. package/dist/triage/runner.js +104 -300
  34. package/dist/triage/types.js +2 -2
  35. package/dist/types.js +2 -6
  36. package/dist/utils/auth.js +14 -2
  37. package/dist/utils/git.js +60 -29
  38. package/dist/utils/github-api.js +14 -1
  39. package/dist/utils/haystack-api.js +38 -7
  40. package/dist/utils/hooks.js +43 -6
  41. package/dist/utils/prompter.js +25 -10
  42. package/dist/utils/safe-write.js +31 -0
  43. package/dist/utils/secret-paths.js +115 -0
  44. package/dist/utils/secrets.js +0 -1
  45. package/dist/utils/telemetry.js +34 -14
  46. package/dist/utils/update-check.js +151 -0
  47. package/package.json +19 -14
  48. package/schemas/case-batch.v1.json +235 -0
  49. package/schemas/cloud-verifier.v1.json +55 -100
  50. package/schemas/submit.v1.json +4 -2
  51. package/dist/commands/ask.d.ts +0 -14
  52. package/dist/commands/cloud-verifier-behaviors.d.ts +0 -27
  53. package/dist/commands/cloud-verifier-data-store-census.d.ts +0 -47
  54. package/dist/commands/cloud-verifier-data-store-drift.d.ts +0 -42
  55. package/dist/commands/cloud-verifier-identity-census.d.ts +0 -88
  56. package/dist/commands/cloud-verifier-materialization.d.ts +0 -16
  57. package/dist/commands/cloud-verifier-pascal-selector-census.d.ts +0 -29
  58. package/dist/commands/cloud-verifier-python-manifest-selector-census.d.ts +0 -27
  59. package/dist/commands/cloud-verifier-specialized-operational-census.d.ts +0 -51
  60. package/dist/commands/cloud-verifier-universe.d.ts +0 -31
  61. package/dist/commands/config.d.ts +0 -46
  62. package/dist/commands/design-verify.d.ts +0 -33
  63. package/dist/commands/dismiss.d.ts +0 -29
  64. package/dist/commands/hooks.d.ts +0 -13
  65. package/dist/commands/inbox.d.ts +0 -65
  66. package/dist/commands/init.d.ts +0 -10
  67. package/dist/commands/install-session-hooks.d.ts +0 -17
  68. package/dist/commands/login.d.ts +0 -8
  69. package/dist/commands/mcp.d.ts +0 -1
  70. package/dist/commands/policy.d.ts +0 -31
  71. package/dist/commands/pr-status.d.ts +0 -144
  72. package/dist/commands/pr.d.ts +0 -40
  73. package/dist/commands/precompute-delivery-contract.d.ts +0 -68
  74. package/dist/commands/precompute-delivery.d.ts +0 -20
  75. package/dist/commands/prepare-universe-review.d.ts +0 -115
  76. package/dist/commands/production-source-deny-policy.d.ts +0 -15
  77. package/dist/commands/request-review.d.ts +0 -26
  78. package/dist/commands/review.d.ts +0 -25
  79. package/dist/commands/rules.d.ts +0 -4
  80. package/dist/commands/scaffold-provisional-universe.d.ts +0 -468
  81. package/dist/commands/schema-cmd.d.ts +0 -2
  82. package/dist/commands/setup.d.ts +0 -28
  83. package/dist/commands/skills.d.ts +0 -8
  84. package/dist/commands/status.d.ts +0 -4
  85. package/dist/commands/submit.d.ts +0 -30
  86. package/dist/commands/system-map.d.ts +0 -42
  87. package/dist/commands/telemetry.d.ts +0 -53
  88. package/dist/commands/tokens.d.ts +0 -14
  89. package/dist/commands/triage.d.ts +0 -35
  90. package/dist/commands/verify-core.d.ts +0 -449
  91. package/dist/commands/verify-core.js +0 -789
  92. package/dist/commands/verify-explore.d.ts +0 -14
  93. package/dist/commands/verify-history.d.ts +0 -14
  94. package/dist/commands/verify-hosted-mcp.d.ts +0 -12
  95. package/dist/commands/verify-hosted-reproducibility.d.ts +0 -90
  96. package/dist/commands/verify-hosted.d.ts +0 -92
  97. package/dist/commands/verify-mcp.d.ts +0 -8
  98. package/dist/commands/verify-mcp.js +0 -517
  99. package/dist/commands/verify-ops.d.ts +0 -158
  100. package/dist/commands/verify-ops.js +0 -1148
  101. package/dist/commands/verify-precompute.d.ts +0 -30
  102. package/dist/commands/verify-reproducibility.d.ts +0 -85
  103. package/dist/commands/verify-reproducibility.js +0 -494
  104. package/dist/commands/verify-reseal.d.ts +0 -9
  105. package/dist/commands/verify-reseal.js +0 -148
  106. package/dist/commands/verify-sandboxes.d.ts +0 -95
  107. package/dist/commands/verify-sandboxes.js +0 -352
  108. package/dist/commands/verify.d.ts +0 -28
  109. package/dist/commands/webhooks.d.ts +0 -30
  110. package/dist/index.d.ts +0 -22
  111. package/dist/schema.d.ts +0 -28
  112. package/dist/states.d.ts +0 -29
  113. package/dist/tools/detect.d.ts +0 -50
  114. package/dist/triage/prompts.d.ts +0 -24
  115. package/dist/triage/runner.d.ts +0 -34
  116. package/dist/triage/types.d.ts +0 -42
  117. package/dist/types/verify-history.d.ts +0 -38
  118. package/dist/types.d.ts +0 -1684
  119. package/dist/utils/action-output.d.ts +0 -24
  120. package/dist/utils/analysis-api.d.ts +0 -187
  121. package/dist/utils/auth.d.ts +0 -79
  122. package/dist/utils/config.d.ts +0 -24
  123. package/dist/utils/design-verifier-api.d.ts +0 -208
  124. package/dist/utils/design-verifier-history.d.ts +0 -46
  125. package/dist/utils/design-verifier-result.d.ts +0 -74
  126. package/dist/utils/detect.d.ts +0 -43
  127. package/dist/utils/git.d.ts +0 -135
  128. package/dist/utils/github-api.d.ts +0 -104
  129. package/dist/utils/haystack-api.d.ts +0 -37
  130. package/dist/utils/hooks.d.ts +0 -12
  131. package/dist/utils/pending-state.d.ts +0 -40
  132. package/dist/utils/pr-ref.d.ts +0 -27
  133. package/dist/utils/prompter.d.ts +0 -85
  134. package/dist/utils/secrets.d.ts +0 -47
  135. package/dist/utils/telemetry.d.ts +0 -19
  136. /package/dist/commands/{precompute-delivery-worker.d.ts → combination-search-hook-contract.js} +0 -0
@@ -1,33 +0,0 @@
1
- /**
2
- * design-verify command — Kick off a blind design-by-execution verification
3
- * run for a PR.
4
- *
5
- * haystack design-verify <pr>
6
- *
7
- * Unlike `haystack review` (finding-oriented analysis of the diff), design
8
- * verification executes the change: it infers intent from the diff alone,
9
- * designs pre-registered behavioral test cases, runs control-before, before,
10
- * and after in isolated sandboxes, and reports evidence-backed anomaly
11
- * candidates outside the registered intent.
12
- *
13
- * The command waits by default and returns an agent-facing behavioral result.
14
- * --no-wait preserves the asynchronous trigger-only path.
15
- */
16
- import { type DesignVerifierUniverseRole } from '../utils/design-verifier-api.js';
17
- export interface DesignVerifyOptions {
18
- json?: boolean;
19
- wait?: boolean;
20
- run?: string;
21
- pollInterval?: string;
22
- timeout?: string;
23
- case?: string;
24
- universe?: DesignVerifierUniverseRole;
25
- replay?: boolean;
26
- execJson?: string;
27
- cwd?: string;
28
- commandTimeout?: string;
29
- action?: string;
30
- history?: boolean;
31
- limit?: string;
32
- }
33
- export declare function designVerifyCommand(identifier: string, options: DesignVerifyOptions): Promise<void>;
@@ -1,29 +0,0 @@
1
- /**
2
- * dismiss & mark-reviewed commands — User overrides for PR findings.
3
- *
4
- * haystack dismiss <pr> — Dismiss analysis findings for a PR
5
- * haystack mark-reviewed <pr> — Mark human review as not needed for a PR
6
- *
7
- * Each posts a user override to the Haystack API so the PR moves toward
8
- * "Good to Merge" in the feed.
9
- *
10
- * Accepts a PR identifier in several formats:
11
- * 123 # Uses current repo's owner/repo
12
- * owner/repo#123 # Fully qualified
13
- * https://github.com/owner/repo/pull/123 # GitHub URL
14
- */
15
- import { type ActionPayload } from '../utils/action-output.js';
16
- type OverrideType = 'findings-dismissed' | 'review-not-needed';
17
- /** Post a user override and return the action payload. Throws on failure. */
18
- export declare function performOverride(identifier: string, type: OverrideType, commandName: string): Promise<ActionPayload & {
19
- head_sha: string;
20
- }>;
21
- /** Clear all overrides and return the action payload. Throws on failure. */
22
- export declare function performUndismiss(identifier: string): Promise<ActionPayload>;
23
- export interface OverrideCommandOptions {
24
- json?: boolean;
25
- }
26
- export declare function dismissCommand(identifier: string, options?: OverrideCommandOptions): Promise<void>;
27
- export declare function markReviewedCommand(identifier: string, options?: OverrideCommandOptions): Promise<void>;
28
- export declare function undismissCommand(identifier: string, options?: OverrideCommandOptions): Promise<void>;
29
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * haystack hooks - Install and manage git hooks for AI agent quality checks
3
- *
4
- * Installs:
5
- * - Pre-commit hook (agent detection, truncation checking, LLM rules review)
6
- * - Git hooks for Haystack quality checks and workflow guidance
7
- */
8
- interface HooksInstallOptions {
9
- force?: boolean;
10
- }
11
- export declare function hooksInstall(options: HooksInstallOptions): Promise<void>;
12
- export declare function hooksStatus(): Promise<void>;
13
- export {};
@@ -1,65 +0,0 @@
1
- interface GitHubPull {
2
- number: number;
3
- title: string;
4
- html_url: string;
5
- draft?: boolean;
6
- user: {
7
- id: number;
8
- login: string;
9
- };
10
- assignees?: Array<{
11
- id: number;
12
- login: string;
13
- }>;
14
- requested_reviewers?: Array<{
15
- id: number;
16
- login: string;
17
- }>;
18
- head: {
19
- sha: string;
20
- ref: string;
21
- };
22
- base: {
23
- ref: string;
24
- };
25
- }
26
- interface InboxCandidate extends GitHubPull {
27
- owner: string;
28
- repo: string;
29
- }
30
- interface AnalysisSummary {
31
- analysisStatus?: 'pending' | 'in_queue' | 'ready' | 'error';
32
- analysisVerdict?: 'clean' | 'has-issues' | 'needs-review';
33
- haystackRating?: number;
34
- needsHumanReview?: boolean;
35
- findingsCount?: number;
36
- merge?: {
37
- status: string;
38
- reason: string;
39
- blocking_checks: string[];
40
- action: string | null;
41
- };
42
- }
43
- export interface InboxListOptions {
44
- json?: boolean;
45
- }
46
- export declare function isRelevantToUser(pr: GitHubPull, userId: number): boolean;
47
- export declare function classify(candidate: InboxCandidate, analysis: AnalysisSummary | undefined): {
48
- bucket: string;
49
- reason: string;
50
- action: string;
51
- };
52
- export declare function fetchInboxPayload(token: string): Promise<{
53
- pull_requests: {
54
- bucket: string;
55
- reason: string;
56
- action: string;
57
- ref: string;
58
- title: string;
59
- head_sha: string;
60
- }[];
61
- } & {
62
- schema_version: string;
63
- }>;
64
- export declare function inboxListCommand(options: InboxListOptions): Promise<void>;
65
- export {};
@@ -1,10 +0,0 @@
1
- /**
2
- * haystack init - Interactive setup wizard
3
- *
4
- * Creates .haystack.json with auto-detected settings.
5
- */
6
- interface InitOptions {
7
- force?: boolean;
8
- }
9
- export declare function initCommand(options: InitOptions): Promise<void>;
10
- export {};
@@ -1,17 +0,0 @@
1
- /**
2
- * install-session-hooks — Wire up session-start and Stop hooks for coding CLIs.
3
- *
4
- * When a CLI session starts, `haystack triage --hook` runs automatically
5
- * and shows the user whether their last submitted PR is "Good to merge" or
6
- * "Needs input", with the Haystack rating and auto-fixer status.
7
- *
8
- * Supported CLIs:
9
- * - Claude Code: Native SessionStart and Stop hooks in .claude/settings.json
10
- * - Codex CLI: AGENTS.md instructions (no native hook support)
11
- * - Gemini CLI: GEMINI.md instructions (no native hook support)
12
- */
13
- export interface InstallSessionOptions {
14
- cli?: string;
15
- }
16
- export declare function installSessionHooks(options: InstallSessionOptions): Promise<void>;
17
- export declare function sessionHooksStatus(): Promise<void>;
@@ -1,8 +0,0 @@
1
- /**
2
- * Login command - GitHub OAuth device flow
3
- */
4
- export declare function loginCommand(): Promise<void>;
5
- export declare function logoutCommand(login?: string): Promise<void>;
6
- export declare function whoamiCommand(): Promise<void>;
7
- export declare function authListCommand(): Promise<void>;
8
- export declare function authUseCommand(login: string): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function runMcpServer(): Promise<void>;
@@ -1,31 +0,0 @@
1
- /**
2
- * haystack policy - Manage review policies
3
- *
4
- * Commands:
5
- * list - List all review policies
6
- * add - Add a new policy interactively
7
- * remove - Remove a policy by name
8
- * init - Create initial review-policy.md
9
- */
10
- /**
11
- * List all review policies
12
- */
13
- export declare function listPolicies(): Promise<void>;
14
- /**
15
- * Add a new review policy interactively
16
- */
17
- export declare function addPolicy(nameArg?: string): Promise<void>;
18
- /**
19
- * Remove a policy by name
20
- */
21
- export declare function removePolicy(name: string): Promise<void>;
22
- /**
23
- * Add a review instruction
24
- */
25
- export declare function addInstruction(text?: string): Promise<void>;
26
- /**
27
- * Create initial review-policy.md with example policies
28
- */
29
- export declare function initPolicies(options: {
30
- force?: boolean;
31
- }): Promise<void>;
@@ -1,144 +0,0 @@
1
- /**
2
- * pr-status command — Show the current Haystack status of a PR.
3
- *
4
- * Calls the classify-debug endpoint to determine which inbox bucket the PR
5
- * is in (analyzing, auto_fixing, good_to_merge, issues, needs_assignment,
6
- * etc.) and displays a human-readable summary.
7
- *
8
- * `--json` emits the versioned `pr-status` schema (see `haystack schema
9
- * pr-status`), with all state tokens normalized to the canonical snake_case
10
- * vocabulary shared by every CLI JSON surface. The server's raw kebab-case
11
- * classify-debug response is an internal shape and is not exposed.
12
- *
13
- * Accepts a PR identifier in several formats:
14
- * 123 # Uses current repo's owner/repo
15
- * #123 # PR number with hash
16
- * owner/repo#123 # Fully qualified
17
- * https://github.com/owner/repo/pull/123 # GitHub URL
18
- */
19
- import { type ParsedPR } from '../utils/pr-ref.js';
20
- import { type TriageVerdict } from '../states.js';
21
- export interface PRStatusOptions {
22
- json?: boolean;
23
- }
24
- interface ClassifyResponse {
25
- prId: string;
26
- bucket: string | null;
27
- feedPriority: number | null;
28
- isInFeed: boolean;
29
- reason: string;
30
- inputs: {
31
- isOpen: boolean;
32
- isAuthor: boolean;
33
- author: string;
34
- currentUsername: string;
35
- category: string;
36
- analysisStatus: string;
37
- analysisVerdict?: string;
38
- haystackRating?: number;
39
- needsHumanReview?: boolean;
40
- hasReviewer: boolean;
41
- reviewDecision?: string;
42
- snoozed: boolean;
43
- dismissed: boolean;
44
- dismissedAgentAlerts: boolean;
45
- dismissedNeedsAssignment: boolean;
46
- manuallyGoodToMerge: boolean;
47
- hasNeedsReviewLabel: boolean;
48
- hasFixingLabel: boolean;
49
- hasNeedsShepherdingLabel: boolean;
50
- labels: string[];
51
- };
52
- stateSyncedAt?: string;
53
- staleWarning?: string;
54
- }
55
- export interface PrStatusPayload extends Record<string, unknown> {
56
- ref: string;
57
- bucket: string | null;
58
- in_feed: boolean | null;
59
- feed_priority: number | null;
60
- reason: string;
61
- analysis: {
62
- status: string;
63
- verdict: TriageVerdict | null;
64
- rating: number | null;
65
- };
66
- needs_human_review: boolean | null;
67
- labels: string[];
68
- overrides: {
69
- snoozed: boolean;
70
- dismissed: boolean;
71
- dismissed_agent_alerts: boolean;
72
- dismissed_needs_assignment: boolean;
73
- manually_good_to_merge: boolean;
74
- };
75
- author: string | null;
76
- is_author: boolean | null;
77
- is_open: boolean | null;
78
- state_synced_at: string | null;
79
- stale_warning: string | null;
80
- }
81
- export declare function buildPrStatusPayload(pr: ParsedPR, data: ClassifyResponse): {
82
- ref: string;
83
- bucket: string | null;
84
- in_feed: boolean;
85
- feed_priority: number | null;
86
- reason: string;
87
- analysis: {
88
- status: string;
89
- verdict: "good_to_merge" | "needs_review" | "needs_input" | null;
90
- rating: number | null;
91
- };
92
- needs_human_review: boolean | null;
93
- labels: string[];
94
- overrides: {
95
- snoozed: boolean;
96
- dismissed: boolean;
97
- dismissed_agent_alerts: boolean;
98
- dismissed_needs_assignment: boolean;
99
- manually_good_to_merge: boolean;
100
- };
101
- author: string;
102
- is_author: boolean;
103
- is_open: boolean;
104
- state_synced_at: string | null;
105
- stale_warning: string | null;
106
- } & {
107
- schema_version: string;
108
- };
109
- export declare const BUCKET_DISPLAY: Record<string, {
110
- label: string;
111
- color: (s: string) => string;
112
- icon: string;
113
- }>;
114
- /** Pure read path (also used by MCP): returns the versioned payload without writing stdout. */
115
- export declare function fetchPrStatusPayload(identifier: string): Promise<{
116
- ref: string;
117
- bucket: string | null;
118
- in_feed: boolean;
119
- feed_priority: number | null;
120
- reason: string;
121
- analysis: {
122
- status: string;
123
- verdict: "good_to_merge" | "needs_review" | "needs_input" | null;
124
- rating: number | null;
125
- };
126
- needs_human_review: boolean | null;
127
- labels: string[];
128
- overrides: {
129
- snoozed: boolean;
130
- dismissed: boolean;
131
- dismissed_agent_alerts: boolean;
132
- dismissed_needs_assignment: boolean;
133
- manually_good_to_merge: boolean;
134
- };
135
- author: string;
136
- is_author: boolean;
137
- is_open: boolean;
138
- state_synced_at: string | null;
139
- stale_warning: string | null;
140
- } & {
141
- schema_version: string;
142
- }>;
143
- export declare function prStatusCommand(identifier: string, options: PRStatusOptions): Promise<void>;
144
- export {};
@@ -1,40 +0,0 @@
1
- export type { ParsedPR } from '../utils/pr-ref.js';
2
- interface GitHubPr {
3
- number: number;
4
- title: string;
5
- state: 'open' | 'closed';
6
- merged: boolean;
7
- mergeable_state?: string;
8
- head: {
9
- sha: string;
10
- ref: string;
11
- };
12
- base: {
13
- ref: string;
14
- };
15
- }
16
- interface MergeQueueEntry {
17
- status?: string;
18
- detail?: string;
19
- failedChecks?: string[];
20
- actionNeeded?: string;
21
- }
22
- export declare function mergePublicState(meta: GitHubPr, entry: MergeQueueEntry | undefined, queueAvailable?: boolean): {
23
- status: string;
24
- reason: string;
25
- blocking_checks: string[];
26
- action: string | null;
27
- };
28
- export declare function fetchMergePublicState(meta: GitHubPr, prNumber: number, owner: string, repo: string, token: string): Promise<{
29
- status: string;
30
- reason: string;
31
- blocking_checks: string[];
32
- action: string | null;
33
- }>;
34
- export interface PrReadOptions {
35
- json?: boolean;
36
- }
37
- export declare function fetchPrStatePayload(ref: string): Promise<Record<string, unknown> & {
38
- schema_version: string;
39
- }>;
40
- export declare function prReadCommand(ref: string, options: PrReadOptions): Promise<void>;
@@ -1,68 +0,0 @@
1
- import type { FrontHalfEnqueueRequest, RepoWalkHookStatus } from './verify-precompute.js';
2
- /** FIXED CONTRACT: hook delivery captures the exact request before returning.
3
- * Persist request and pending receipt with private permissions and durable,
4
- * atomic publication before starting a detached sender. Do not persist tokens.
5
- * The sender reads this immutable request, never reconstructs newer source,
6
- * and performs one authenticated POST with a total 60-second bound. Pending
7
- * is local custody only; acknowledged requires the existing validated server
8
- * response. Each delivery owns its receipt so older senders cannot overwrite
9
- * newer status. A latest-delivery pointer is written only by hook submission.
10
- * Failures/timeouts remain inspectable and cannot imply remote acceptance.
11
- * Terminal receipts retain exact request identity; after receipt fsync, remove
12
- * the captured patch file. Keep at most 50 terminal delivery directories on
13
- * later submissions, excluding the latest pointer and pending deliveries.
14
- * Explicit non-hook invocation retains its current synchronous behavior.
15
- * No new model/browser work, retry loop, or shared cache identity is added.
16
- * On Windows, owner-only access uses a protected current-user SID ACL,
17
- * established before capture and checked by the sender, not POSIX mode bits.
18
- * File contents are flushed before rename on every platform. Directory fsync
19
- * is POSIX-only; Windows publication does not promise power-loss durability.
20
- * Windows requests remain logically immutable without the read-only attribute,
21
- * so terminal cleanup can remove them. ACL setup/read failure fails closed.
22
- * A safe regular captured file may be parsed and identity-validated locally
23
- * before its privacy check. A rejected privacy check carries that identity
24
- * only for recording a failed receipt, never for a POST. Both this failure
25
- * path and the normal sender must acquire the same exclusive sender marker
26
- * before changing a receipt or deleting the capture. Unsafe/corrupt paths or
27
- * an unwritable store cannot authorize a fallback mutation.
28
- */
29
- export interface PrecomputeDeliveryRequest {
30
- schemaVersion: 'precompute-delivery-v1';
31
- deliveryId: string;
32
- request: FrontHalfEnqueueRequest;
33
- }
34
- export interface PrecomputeDeliveryAccessFailure extends Error {
35
- readonly delivery: PrecomputeDeliveryRequest;
36
- }
37
- export type PrecomputeAcknowledgment = {
38
- outcome: 'enqueued' | 'cached' | 'existing';
39
- runId?: string;
40
- walker?: RepoWalkHookStatus;
41
- };
42
- export type PrecomputeDeliveryReceipt = {
43
- schemaVersion: 'precompute-delivery-receipt-v1';
44
- deliveryId: string;
45
- repository: string;
46
- sourceCommit: string;
47
- updatedAt: string;
48
- requestIdentity: Pick<FrontHalfEnqueueRequest, 'baseCommit' | 'workCommit' | 'observedAt' | 'cacheKey' | 'patchSha256'>;
49
- } & ({
50
- status: 'pending';
51
- } | {
52
- status: 'acknowledged';
53
- acknowledgment: PrecomputeAcknowledgment;
54
- } | {
55
- status: 'failed' | 'timed-out';
56
- reason: string;
57
- });
58
- export interface PrecomputeDeliveryPointer {
59
- schemaVersion: 'precompute-delivery-pointer-v1';
60
- deliveryId: string;
61
- repository: string;
62
- sourceCommit: string;
63
- }
64
- export type StartPrecomputeDelivery = (metadataDirectory: string, request: FrontHalfEnqueueRequest) => Promise<{
65
- deliveryId: string;
66
- requestPath: string;
67
- }>;
68
- export type DeliverPrecomputeRequest = (request: FrontHalfEnqueueRequest, signal: AbortSignal) => Promise<PrecomputeAcknowledgment>;
@@ -1,20 +0,0 @@
1
- import type { PrecomputeDeliveryAccessFailure, PrecomputeDeliveryReceipt, PrecomputeDeliveryRequest, StartPrecomputeDelivery } from './precompute-delivery-contract.js';
2
- export declare class PrecomputeDeliveryAccessError extends Error implements PrecomputeDeliveryAccessFailure {
3
- readonly delivery: PrecomputeDeliveryRequest;
4
- constructor(delivery: PrecomputeDeliveryRequest);
5
- }
6
- export declare function readPrecomputeDelivery(requestPath: string): PrecomputeDeliveryRequest;
7
- export declare function writePrecomputeDeliveryReceipt(requestPath: string, delivery: PrecomputeDeliveryRequest, result: {
8
- status: 'pending';
9
- } | {
10
- status: 'acknowledged';
11
- acknowledgment: Extract<PrecomputeDeliveryReceipt, {
12
- status: 'acknowledged';
13
- }>['acknowledgment'];
14
- } | {
15
- status: 'failed' | 'timed-out';
16
- reason: string;
17
- }): void;
18
- /** An exclusive durable marker prevents a second invocation from posting this delivery. */
19
- export declare function claimPrecomputeDelivery(requestPath: string): void;
20
- export declare const startPrecomputeDelivery: StartPrecomputeDelivery;
@@ -1,115 +0,0 @@
1
- export interface ReviewExclusion {
2
- path: string;
3
- rule_id: string;
4
- }
5
- export interface ReviewSymlinkIssue {
6
- path: string;
7
- target: string;
8
- reason: 'absolute-target' | 'target-escapes-repository' | 'target-is-excluded' | 'target-is-not-retained-file' | 'target-cycle' | 'ambiguous-target' | 'unreadable-link';
9
- }
10
- export interface InlineTestCandidate {
11
- path: string;
12
- }
13
- export interface SnapshotLimitBlocker {
14
- kind: 'entry-count' | 'total-output-bytes';
15
- path: string;
16
- limit: number;
17
- attempted: number;
18
- reason: string;
19
- }
20
- export interface PrepareUniverseReviewResult {
21
- status: 'ready-for-confinement' | 'blocked';
22
- path: string;
23
- process_confinement_required: true;
24
- counts: {
25
- tracked: number;
26
- retained: number;
27
- copied: number;
28
- excluded: number;
29
- submodules_omitted: number;
30
- approved_inactive_submodules_omitted: number;
31
- symlinks_materialized: number;
32
- symlink_issues: number;
33
- symlinks_omitted_target_not_retained: number;
34
- omitted_unscannable: number;
35
- missing_or_changed_type: number;
36
- inline_test_candidates: number;
37
- inline_scan_skipped: number;
38
- binary_inline_scan_skipped: number;
39
- oversized_text_inline_scan_blockers: number;
40
- snapshot_limit_blockers: number;
41
- copied_bytes: number;
42
- };
43
- exclusions: ReviewExclusion[];
44
- submodules_omitted: string[];
45
- approved_inactive_submodule_omissions: {
46
- rule: {
47
- id: string;
48
- description: string;
49
- };
50
- paths: string[];
51
- };
52
- rules: Array<{
53
- id: string;
54
- description: string;
55
- }>;
56
- activated_conditional_rule_ids: string[];
57
- inline_marker_rules: Array<{
58
- id: string;
59
- description: string;
60
- }>;
61
- symlink_issues: ReviewSymlinkIssue[];
62
- omitted_symlinks: ReviewSymlinkIssue[];
63
- omitted_unscannable: {
64
- path: string;
65
- reason: string;
66
- }[];
67
- missing_or_changed_type: Array<{
68
- path: string;
69
- reason: string;
70
- }>;
71
- inline_test_candidates: InlineTestCandidate[];
72
- inline_scan_skipped: Array<{
73
- path: string;
74
- reason: string;
75
- }>;
76
- snapshot_limit_blockers: SnapshotLimitBlocker[];
77
- receipt: {
78
- detail: 'compact' | 'full';
79
- sample_limit: number;
80
- complete_blocking_details: true;
81
- collections: {
82
- exclusions: ReceiptCollectionSummary;
83
- approved_inactive_submodule_omissions: ReceiptCollectionSummary;
84
- binary_inline_scan_skips: ReceiptCollectionSummary;
85
- };
86
- };
87
- manifest: {
88
- path: string;
89
- sha256: string;
90
- entries: number;
91
- };
92
- }
93
- export interface PrepareUniverseReviewOptions {
94
- excludeInactiveSubmodules?: string[];
95
- /** Omit files whose test content cannot be ruled out instead of blocking. */
96
- omitUnscannableFiles?: boolean;
97
- fullReceipt?: boolean;
98
- limits?: {
99
- maxSnapshotEntries?: number;
100
- maxSnapshotOutputBytes?: number;
101
- };
102
- }
103
- interface ReceiptCollectionSummary {
104
- total: number;
105
- returned: number;
106
- truncated: number;
107
- }
108
- export declare function prepareUniverseReview(root: string, options?: PrepareUniverseReviewOptions): PrepareUniverseReviewResult;
109
- export declare function prepareUniverseReviewCommand(options: {
110
- json?: boolean;
111
- excludeInactiveSubmodule?: string[];
112
- omitUnscannableFiles?: boolean;
113
- fullReceipt?: boolean;
114
- }): Promise<void>;
115
- export {};
@@ -1,15 +0,0 @@
1
- export declare const CUSTOMER_REPLICA_PRODUCTION_SOURCE_DENY_POLICY: {
2
- readonly schemaVersion: 2;
3
- readonly policyId: "haystack-production-source-no-existing-tests-v2";
4
- readonly deniedDirectoryNames: readonly [".git", ".haystack", ".nyc_output", ".pytest_cache", "__tests__", "acceptance-test", "acceptance-tests", "acceptance_test", "acceptance_tests", "cypress", "e2e", "integration-test", "integration-tests", "integration_test", "integration_tests", "playwright", "playwright-report", "system-test", "system-tests", "system_test", "system_tests", "test", "test-data", "test-results", "testdata", "tests"];
5
- readonly conditionalDirectoryNames: readonly ["__fixtures__", "__mocks__", "__snapshots__", "fixtures", "mocks", "snapshots", "spec", "specs"];
6
- readonly conditionalDirectoryRule: "exclude root spec/specs when a test framework is detected; exclude fixture/mock/snapshot components only below a detected test root";
7
- readonly deniedFilePatterns: readonly ["*.test.{js,jsx,ts,tsx,mjs,cjs}", "*.spec.{js,jsx,ts,tsx,mjs,cjs,rb}", "*.e2e.{js,jsx,ts,tsx}", "*.e2e-spec.{js,jsx,ts,tsx}", "test-*.{js,jsx,ts,tsx,py,rb,go,rs}", "*-test.{js,jsx,ts,tsx,py,rb,go,rs}", "*_test.{py,go,rs,cc,cpp}", "*_tests.{py,rb}", "test_*.py", "*_unittest.{cc,cpp,py}", "*Test.{java,kt,kts,scala,groovy,cs,php,swift}", "*Tests.{java,kt,kts,scala,groovy,cs,php,swift}", "*ITCase.{java,kt,kts,scala,groovy,cs,php,swift}", "*.{snap,golden,approved}", "{jest,vitest,playwright,cypress}.config.*", "karma.conf.*", "mocha.config.*", "pytest.ini", "tox.ini", ".coveragerc", "junit*.xml"];
8
- readonly inlineTestScan: {
9
- readonly maximumTextFileBytes: number;
10
- readonly oversizedTextFileAction: "reject";
11
- readonly binaryFileAction: "retain";
12
- readonly markerRuleIds: readonly ["rust-cfg-test", "zig-inline-test", "vitest-import-meta", "deno-inline-test", "bun-inline-test", "c-unit-test-conditional", "rust-test-attribute", "jvm-test-annotation", "dotnet-test-attribute", "xctest-case", "python-unittest-case", "python-test-function"];
13
- };
14
- };
15
- export declare function isCustomerReplicaProductionSourceDeniedPath(path: string): boolean;
@@ -1,26 +0,0 @@
1
- /**
2
- * request-review command — Tag a PR as needing human review after creation.
3
- *
4
- * haystack request-review <pr> [reviewer]
5
- *
6
- * Adds the `haystack:needs-review` label to the PR. Optionally requests
7
- * review from a specific GitHub user. The PR will move to the
8
- * "Needs Assignment" or "Awaiting Review" bucket in the Haystack feed.
9
- *
10
- * Accepts a PR identifier in several formats:
11
- * 123 # Uses current repo's owner/repo
12
- * owner/repo#123 # Fully qualified
13
- * https://github.com/owner/repo/pull/123 # GitHub URL
14
- */
15
- import { type ActionPayload } from '../utils/action-output.js';
16
- export interface RequestReviewPayload extends ActionPayload {
17
- reviewer: string | null;
18
- /** Set when the label was applied but the specific-reviewer request failed. */
19
- reviewer_request_failed: string | null;
20
- }
21
- /** Apply the needs-review label (and optional reviewer). Throws on failure. */
22
- export declare function performRequestReview(identifier: string, reviewer?: string): Promise<RequestReviewPayload>;
23
- export interface RequestReviewOptions {
24
- json?: boolean;
25
- }
26
- export declare function requestReviewCommand(identifier: string, reviewer?: string, options?: RequestReviewOptions): Promise<void>;