@haystackeditor/cli 0.15.19 → 0.15.21

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 (66) hide show
  1. package/README.md +100 -1
  2. package/dist/assets/skills/map-your-system.md +9 -4
  3. package/dist/commands/ask.js +2 -2
  4. package/dist/commands/config.d.ts +9 -0
  5. package/dist/commands/config.js +46 -14
  6. package/dist/commands/dismiss.d.ts +15 -3
  7. package/dist/commands/dismiss.js +66 -116
  8. package/dist/commands/mcp.js +96 -1
  9. package/dist/commands/policy.js +31 -12
  10. package/dist/commands/pr-status.d.ts +125 -2
  11. package/dist/commands/pr-status.js +88 -73
  12. package/dist/commands/pr.d.ts +1 -7
  13. package/dist/commands/pr.js +10 -21
  14. package/dist/commands/request-review.d.ts +12 -1
  15. package/dist/commands/request-review.js +42 -65
  16. package/dist/commands/review.d.ts +1 -0
  17. package/dist/commands/review.js +58 -60
  18. package/dist/commands/setup.js +4 -1
  19. package/dist/commands/submit.d.ts +3 -0
  20. package/dist/commands/submit.js +178 -38
  21. package/dist/commands/system-map.d.ts +42 -0
  22. package/dist/commands/system-map.js +228 -0
  23. package/dist/commands/tokens.js +3 -2
  24. package/dist/commands/traces.js +2 -2
  25. package/dist/commands/triage.d.ts +1 -6
  26. package/dist/commands/triage.js +51 -55
  27. package/dist/commands/verify-core.d.ts +424 -0
  28. package/dist/commands/verify-core.js +753 -0
  29. package/dist/commands/verify-mcp.d.ts +8 -0
  30. package/dist/commands/verify-mcp.js +458 -0
  31. package/dist/commands/verify-ops.d.ts +158 -0
  32. package/dist/commands/verify-ops.js +1148 -0
  33. package/dist/commands/verify-reseal.d.ts +9 -0
  34. package/dist/commands/verify-reseal.js +148 -0
  35. package/dist/commands/verify-sandboxes.d.ts +95 -0
  36. package/dist/commands/verify-sandboxes.js +352 -0
  37. package/dist/commands/verify.d.ts +11 -0
  38. package/dist/commands/verify.js +97 -0
  39. package/dist/index.js +343 -20
  40. package/dist/schema.d.ts +4 -0
  41. package/dist/schema.js +4 -0
  42. package/dist/states.d.ts +29 -0
  43. package/dist/states.js +46 -0
  44. package/dist/triage/runner.d.ts +7 -0
  45. package/dist/triage/runner.js +2 -2
  46. package/dist/types.d.ts +54 -0
  47. package/dist/types.js +15 -0
  48. package/dist/utils/action-output.d.ts +24 -0
  49. package/dist/utils/action-output.js +26 -0
  50. package/dist/utils/analysis-api.d.ts +11 -0
  51. package/dist/utils/analysis-api.js +29 -3
  52. package/dist/utils/auth.js +7 -0
  53. package/dist/utils/git.d.ts +4 -1
  54. package/dist/utils/git.js +17 -7
  55. package/dist/utils/haystack-api.d.ts +15 -0
  56. package/dist/utils/haystack-api.js +58 -7
  57. package/dist/utils/pr-ref.d.ts +27 -0
  58. package/dist/utils/pr-ref.js +56 -0
  59. package/package.json +2 -2
  60. package/schemas/action.v1.json +22 -0
  61. package/schemas/error.v1.json +14 -0
  62. package/schemas/pr-status.v1.json +61 -0
  63. package/schemas/pr.v1.json +80 -17
  64. package/schemas/setup.v1.json +66 -12
  65. package/schemas/submit.v1.json +88 -0
  66. package/schemas/triage.v1.json +71 -18
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Shared PR-identifier parsing for every command that takes a PR ref.
3
+ *
4
+ * One grammar, one error message, one repo-inference path. This used to be
5
+ * duplicated per command, and the copies drifted: different "accepted formats"
6
+ * lists (none mentioned the `#123` form the regex accepted), and one copy let
7
+ * a raw git error escape where the others gave a friendly hint. Commands must
8
+ * import from here rather than reimplementing the grammar.
9
+ *
10
+ * Accepted formats, in the order they are tried:
11
+ * https://github.com/owner/repo/pull/123 GitHub URL
12
+ * owner/repo#123 Fully qualified
13
+ * 123 or #123 PR number (repo inferred from the `origin` remote)
14
+ */
15
+ import { parseRemoteUrl } from './git.js';
16
+ /** The accepted-formats block used in parse errors and help text. */
17
+ export function acceptedPrRefFormats(commandName) {
18
+ return (` haystack ${commandName} 123\n` +
19
+ ` haystack ${commandName} #123\n` +
20
+ ` haystack ${commandName} owner/repo#123\n` +
21
+ ` haystack ${commandName} https://github.com/owner/repo/pull/123`);
22
+ }
23
+ /**
24
+ * Parse a PR identifier. `commandName` is interpolated into error messages so
25
+ * the agent can copy a corrected invocation verbatim (e.g. "triage",
26
+ * "pr get", "traces list").
27
+ */
28
+ export function parsePrRef(identifier, commandName) {
29
+ const urlMatch = identifier.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)\/?$/);
30
+ if (urlMatch) {
31
+ return { owner: urlMatch[1], repo: urlMatch[2], prNumber: parseInt(urlMatch[3], 10) };
32
+ }
33
+ // owner/repo#123 — repo segment may not contain `/` (a stray extra segment
34
+ // used to silently become part of the repo name and 404 downstream).
35
+ const qualifiedMatch = identifier.match(/^([^/#\s]+)\/([^/#\s]+)#(\d+)$/);
36
+ if (qualifiedMatch) {
37
+ return { owner: qualifiedMatch[1], repo: qualifiedMatch[2], prNumber: parseInt(qualifiedMatch[3], 10) };
38
+ }
39
+ const numberMatch = identifier.match(/^#?(\d+)$/);
40
+ if (numberMatch) {
41
+ const prNumber = parseInt(numberMatch[1], 10);
42
+ try {
43
+ const remote = parseRemoteUrl('origin');
44
+ return { owner: remote.owner, repo: remote.repo, prNumber };
45
+ }
46
+ catch (err) {
47
+ throw new Error(`Cannot determine the repository for PR #${prNumber} ` +
48
+ `(${err instanceof Error ? err.message : String(err)}).\n` +
49
+ `Run from inside a checkout with an "origin" remote, or use the full format:\n` +
50
+ ` haystack ${commandName} owner/repo#${prNumber}`);
51
+ }
52
+ }
53
+ throw new Error(`Invalid PR identifier: "${identifier}"\n\n` +
54
+ `Accepted formats:\n${acceptedPrRefFormats(commandName)}\n\n` +
55
+ `See \`haystack ${commandName.split(' ')[0]} --help\` for details.`);
56
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@haystackeditor/cli",
3
- "version": "0.15.19",
3
+ "version": "0.15.21",
4
4
  "description": "Set up Haystack for your project — automated PR review, triage, and merge queue",
5
5
  "type": "module",
6
6
  "bin": {
7
- "haystack": "./dist/index.js"
7
+ "haystack": "dist/index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "build": "rm -rf dist && tsc && cp -r src/assets dist/assets",
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/action.v1.json",
4
+ "title": "haystack <dismiss|mark-reviewed|undismiss|request-review|review> --json",
5
+ "description": "Shared envelope for every mutating command. Exactly one document on stdout; progress on stderr. status 'error' payloads accompany exit code 1.",
6
+ "type": "object",
7
+ "required": ["schema_version", "action", "status"],
8
+ "properties": {
9
+ "schema_version": { "type": "string", "const": "1.0.0" },
10
+ "action": { "type": "string", "enum": ["dismiss", "mark_reviewed", "undismiss", "request_review", "trigger_review", "clear_pending"] },
11
+ "status": { "type": "string", "enum": ["ok", "error"] },
12
+ "ref": { "type": ["string", "null"], "description": "owner/repo#number. Null on errors that happen before the ref resolves." },
13
+ "error": { "type": "string", "description": "Present only when status is 'error'. Actionable message including the remediation." },
14
+ "detail": { "type": "string", "description": "Human-readable statement of what changed." },
15
+ "head_sha": { "type": "string", "description": "dismiss/mark_reviewed: the head commit the override is tied to. A new commit invalidates the override." },
16
+ "reviewer": { "type": ["string", "null"], "description": "request_review: the GitHub user review was requested from, or null for the needs-assignment queue." },
17
+ "reviewer_request_failed": { "type": ["string", "null"], "description": "request_review: set when the label was applied but the specific-reviewer request failed (partial success)." },
18
+ "request_id": { "type": "string", "description": "trigger_review: the analysis run id." },
19
+ "run_status": { "type": "string", "enum": ["started", "already_processing", "completed", "superseded", "running"], "description": "trigger_review: state of the triggered run when the command returned." },
20
+ "next": { "type": ["string", "null"], "description": "Follow-up command to read results (e.g. `haystack triage <ref> --json`)." }
21
+ }
22
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/error.v1.json",
4
+ "title": "Generic --json error envelope",
5
+ "description": "Emitted on stdout (with exit code 1) when a read command invoked with --json fails before it can produce its own payload. Commands with richer contracts (submit, action) embed status:'error' in their own schemas instead.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "status", "error"],
9
+ "properties": {
10
+ "schema_version": { "type": "string", "const": "1.0.0" },
11
+ "status": { "type": "string", "const": "error" },
12
+ "error": { "type": "string", "description": "Actionable message including the remediation." }
13
+ }
14
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/pr-status.v1.json",
4
+ "title": "haystack pr-status <ref> --json",
5
+ "description": "Which Haystack feed bucket a PR is in, and why. All state tokens are snake_case — the same vocabulary as `haystack triage --json` and `haystack pr get --json`.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "ref", "bucket", "in_feed", "feed_priority", "reason", "analysis", "needs_human_review", "labels", "overrides", "author", "is_author", "is_open", "state_synced_at", "stale_warning"],
9
+ "properties": {
10
+ "schema_version": { "type": "string", "const": "1.0.0" },
11
+ "ref": { "type": "string", "description": "owner/repo#number" },
12
+ "bucket": {
13
+ "type": ["string", "null"],
14
+ "description": "Feed bucket in snake_case. Known values are enumerated below; new buckets may appear (always snake_case). Null when the PR is unclassified (closed or not yet analyzed).",
15
+ "examples": ["analyzing", "auto_fixing", "good_to_merge", "failed_when_merging", "issues", "needs_assignment", "needs_shepherding", "needs_fixing", "awaiting_review", "review_requested", "snoozed"]
16
+ },
17
+ "in_feed": { "type": ["boolean", "null"], "description": "Null when the PR is unclassified (e.g. closed)." },
18
+ "feed_priority": { "type": ["number", "null"] },
19
+ "reason": { "type": "string", "description": "Human-readable explanation of the classification." },
20
+ "analysis": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["status", "verdict", "rating"],
24
+ "properties": {
25
+ "status": { "type": "string", "enum": ["pending", "in_queue", "ready", "error"] },
26
+ "verdict": {
27
+ "anyOf": [
28
+ { "type": "string", "enum": ["good_to_merge", "needs_review", "needs_input"] },
29
+ { "type": "null" }
30
+ ],
31
+ "description": "Null until analysis is ready."
32
+ },
33
+ "rating": {
34
+ "anyOf": [
35
+ { "type": "integer", "minimum": 1, "maximum": 5 },
36
+ { "type": "null" }
37
+ ]
38
+ }
39
+ }
40
+ },
41
+ "needs_human_review": { "type": ["boolean", "null"] },
42
+ "labels": { "type": "array", "items": { "type": "string" } },
43
+ "overrides": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["snoozed", "dismissed", "dismissed_agent_alerts", "dismissed_needs_assignment", "manually_good_to_merge"],
47
+ "properties": {
48
+ "snoozed": { "type": "boolean" },
49
+ "dismissed": { "type": "boolean" },
50
+ "dismissed_agent_alerts": { "type": "boolean" },
51
+ "dismissed_needs_assignment": { "type": "boolean" },
52
+ "manually_good_to_merge": { "type": "boolean" }
53
+ }
54
+ },
55
+ "author": { "type": ["string", "null"], "description": "Null when the server could not resolve PR metadata." },
56
+ "is_author": { "type": ["boolean", "null"] },
57
+ "is_open": { "type": ["boolean", "null"] },
58
+ "state_synced_at": { "type": ["string", "null"] },
59
+ "stale_warning": { "type": ["string", "null"] }
60
+ }
61
+ }
@@ -2,32 +2,95 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://docs.haystackeditor.com/cli/schemas/pr.v1.json",
4
4
  "title": "haystack pr <ref> --json",
5
+ "deprecated": true,
6
+ "description": "HISTORICAL: superseded by pr.v2.json. The CLI no longer emits this shape; this file is retained immutably for consumers pinned to the v1 contract.",
5
7
  "type": "object",
6
- "required": ["schema_version", "owner", "repo", "prNumber", "bucket", "state"],
8
+ "required": [
9
+ "schema_version",
10
+ "owner",
11
+ "repo",
12
+ "prNumber",
13
+ "bucket",
14
+ "state"
15
+ ],
7
16
  "properties": {
8
- "schema_version": { "type": "string", "const": "1.0.0" },
9
- "owner": { "type": "string" },
10
- "repo": { "type": "string" },
11
- "prNumber": { "type": "integer" },
12
- "bucket": { "type": "string" },
13
- "state": { "type": "string", "enum": ["open", "closed", "merged"] },
14
- "title": { "type": "string" },
15
- "headSha": { "type": "string" },
16
- "haystackUrl": { "type": "string" },
17
+ "schema_version": {
18
+ "type": "string",
19
+ "const": "1.0.0"
20
+ },
21
+ "owner": {
22
+ "type": "string"
23
+ },
24
+ "repo": {
25
+ "type": "string"
26
+ },
27
+ "prNumber": {
28
+ "type": "integer"
29
+ },
30
+ "bucket": {
31
+ "type": "string"
32
+ },
33
+ "state": {
34
+ "type": "string",
35
+ "enum": [
36
+ "open",
37
+ "closed",
38
+ "merged"
39
+ ]
40
+ },
41
+ "title": {
42
+ "type": "string"
43
+ },
44
+ "headSha": {
45
+ "type": "string"
46
+ },
47
+ "haystackUrl": {
48
+ "type": "string"
49
+ },
17
50
  "mergeQueue": {
18
51
  "type": "object",
19
52
  "properties": {
20
- "state": { "type": "string", "enum": ["not-enrolled", "eligible", "grace", "queued", "merging", "merged", "blocked"] },
21
- "graceEndsAt": { "type": ["string", "null"] },
22
- "blockedReason": { "type": ["string", "null"] }
53
+ "state": {
54
+ "type": "string",
55
+ "enum": [
56
+ "not-enrolled",
57
+ "eligible",
58
+ "grace",
59
+ "queued",
60
+ "merging",
61
+ "merged",
62
+ "blocked"
63
+ ]
64
+ },
65
+ "graceEndsAt": {
66
+ "type": [
67
+ "string",
68
+ "null"
69
+ ]
70
+ },
71
+ "blockedReason": {
72
+ "type": [
73
+ "string",
74
+ "null"
75
+ ]
76
+ }
23
77
  }
24
78
  },
25
79
  "lastTriage": {
26
- "type": ["object", "null"],
80
+ "type": [
81
+ "object",
82
+ "null"
83
+ ],
27
84
  "properties": {
28
- "rating": { "type": "integer" },
29
- "completedAt": { "type": "string" },
30
- "headSha": { "type": "string" }
85
+ "rating": {
86
+ "type": "integer"
87
+ },
88
+ "completedAt": {
89
+ "type": "string"
90
+ },
91
+ "headSha": {
92
+ "type": "string"
93
+ }
31
94
  }
32
95
  }
33
96
  }
@@ -2,20 +2,74 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://docs.haystackeditor.com/cli/schemas/setup.v1.json",
4
4
  "title": "haystack setup --json event stream",
5
- "description": "NDJSON event stream. Each line is one event stamped with schema_version.",
5
+ "description": "NDJSON on stdout: each line is one event, stamped with schema_version. Human chrome goes to stderr. Replies are written to the CLI's stdin as one JSON object per line: questions are answered with {\"requestID\": \"<id>\", \"answers\": <bool | value[]>} or rejected with {\"requestID\": \"<id>\", \"reject\": true}; permissions are answered with {\"permissionID\": \"<id>\", \"response\": \"once\" | \"always\" | \"reject\"}. Pre-supplied answers (--answers file or flags) skip the matching question entirely.",
6
6
  "type": "object",
7
7
  "required": ["schema_version", "type"],
8
8
  "properties": {
9
- "schema_version": { "type": "string", "const": "1.0.0" },
10
- "type": {
11
- "type": "string",
12
- "enum": ["question", "permission", "log", "progress", "result"]
9
+ "schema_version": { "type": "string", "const": "1.0.0" }
10
+ },
11
+ "oneOf": [
12
+ {
13
+ "title": "question",
14
+ "description": "A decision the agent must answer on stdin, keyed by requestID.",
15
+ "properties": {
16
+ "schema_version": { "type": "string", "const": "1.0.0" },
17
+ "type": { "const": "question" },
18
+ "requestID": { "type": "string" },
19
+ "kind": { "type": "string", "enum": ["confirm", "multiselect"] },
20
+ "prompt": { "type": "string" },
21
+ "default": { "type": "boolean", "description": "confirm only" },
22
+ "options": {
23
+ "type": "array",
24
+ "description": "multiselect only",
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "value": {},
29
+ "label": { "type": "string" },
30
+ "default": { "type": "boolean" }
31
+ }
32
+ }
33
+ }
34
+ },
35
+ "required": ["type", "requestID", "kind", "prompt"]
13
36
  },
14
- "id": { "type": "string" },
15
- "prompt": { "type": "string" },
16
- "choices": { "type": "array" },
17
- "level": { "type": "string", "enum": ["info", "warn", "error"] },
18
- "message": { "type": "string" },
19
- "result": { "type": "object" }
20
- }
37
+ {
38
+ "title": "permission",
39
+ "description": "An out-of-band action (e.g. install the GitHub App at a URL). The CLI keeps polling for completion; reply on stdin keyed by permissionID to short-circuit ('once'/'always') or skip ('reject').",
40
+ "properties": {
41
+ "schema_version": { "type": "string", "const": "1.0.0" },
42
+ "type": { "const": "permission" },
43
+ "permissionID": { "type": "string" },
44
+ "prompt": { "type": "string" },
45
+ "url": { "type": "string" },
46
+ "poll": { "type": "boolean" }
47
+ },
48
+ "required": ["type", "permissionID", "prompt"]
49
+ },
50
+ {
51
+ "title": "progress",
52
+ "properties": {
53
+ "schema_version": { "type": "string", "const": "1.0.0" },
54
+ "type": { "const": "progress" },
55
+ "message": { "type": "string" },
56
+ "detail": { "type": "string" }
57
+ },
58
+ "required": ["type", "message"]
59
+ },
60
+ {
61
+ "title": "result",
62
+ "description": "Terminal event. Result fields are spread at the top level (not nested).",
63
+ "properties": {
64
+ "schema_version": { "type": "string", "const": "1.0.0" },
65
+ "type": { "const": "result" },
66
+ "status": { "type": "string", "enum": ["complete", "cancelled"] },
67
+ "repos": { "type": "array", "items": { "type": "string" } },
68
+ "pullRequests": { "type": "array" },
69
+ "feedUrl": { "type": "string" },
70
+ "summary": { "type": "string", "description": "Pre-rendered ANSI-free text safe to relay verbatim." }
71
+ },
72
+ "required": ["type", "status"]
73
+ }
74
+ ]
21
75
  }
@@ -0,0 +1,88 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/submit.v1.json",
4
+ "title": "haystack submit --json",
5
+ "description": "Emitted exactly once on stdout (progress goes to stderr). status 'created'/'already_exists' means the PR exists — read analysis.verdict for the outcome. status 'error' means the submit itself failed and the process exits 1.",
6
+ "type": "object",
7
+ "required": ["schema_version", "status"],
8
+ "properties": {
9
+ "schema_version": { "type": "string", "const": "1.0.0" },
10
+ "status": { "type": "string", "enum": ["created", "already_exists", "error"] },
11
+ "error": { "type": "string", "description": "Present only when status is 'error'. Actionable message including the remediation." },
12
+ "ref": { "type": "string", "description": "owner/repo#number" },
13
+ "pr_number": { "type": "integer" },
14
+ "url": { "type": "string" },
15
+ "title": { "type": "string" },
16
+ "title_source": { "type": "string", "enum": ["flag", "last-commit", "existing-pr"] },
17
+ "body": { "type": ["string", "null"], "description": "The exact body posted to GitHub. Null when the PR already existed (its body is not modified)." },
18
+ "body_source": { "type": "string", "enum": ["flag", "body-file", "stdin", "commit-messages", "existing-pr"] },
19
+ "branch": { "type": "string" },
20
+ "base": { "type": "string" },
21
+ "draft": { "type": "boolean" },
22
+ "account": { "type": ["string", "null"], "description": "GitHub login the submit was performed as." },
23
+ "auto_merge": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["enabled", "source"],
27
+ "properties": {
28
+ "enabled": { "type": "boolean", "description": "APPLIED state: true only if the haystack:auto-merge label is actually on the PR. False when it was requested but the label application failed (a warning appears on stderr)." },
29
+ "source": { "type": "string", "enum": ["flag", "config"], "description": "flag = explicit --auto-merge/--no-auto-merge; config = resolved from .haystack.json (false if absent)." }
30
+ }
31
+ },
32
+ "auto_fix": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["enabled", "source"],
36
+ "properties": {
37
+ "enabled": { "type": "boolean", "description": "APPLIED state: true only if the haystack:auto-fix label is actually on the PR." },
38
+ "source": { "type": "string", "enum": ["flag", "config"] }
39
+ }
40
+ },
41
+ "review_requested": {
42
+ "type": ["object", "null"],
43
+ "additionalProperties": false,
44
+ "description": "APPLIED state: non-null only if the haystack:needs-review label is actually on the PR. Null when --review was passed but the label application failed.",
45
+ "properties": {
46
+ "reviewer": { "type": ["string", "null"], "description": "The GitHub user review was successfully requested from, or null (needs-assignment queue, or the specific-reviewer request failed after the label applied)." }
47
+ }
48
+ },
49
+ "triage": {
50
+ "type": "object",
51
+ "properties": {
52
+ "status": { "type": "string", "enum": ["passed", "failed", "skipped", "unavailable"] },
53
+ "issues": {
54
+ "type": "array",
55
+ "description": "Present on the error envelope when blocking triage findings stopped the submit.",
56
+ "items": {
57
+ "type": "object",
58
+ "properties": {
59
+ "checker": { "type": "string" },
60
+ "severity": { "type": "string" },
61
+ "file": { "type": "string" },
62
+ "line": { "type": ["integer", "null"] },
63
+ "message": { "type": "string" },
64
+ "rule": { "type": ["string", "null"] }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "analysis": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": ["status", "verdict", "merged", "summary"],
74
+ "properties": {
75
+ "status": { "type": "string", "enum": ["complete", "pending", "failed"], "description": "pending = analysis still running server-side (no wait, SIGINT, timeout, or result fetch failed); poll `haystack triage <ref> --json`. failed = the status check itself kept failing (process exits 1)." },
76
+ "verdict": {
77
+ "anyOf": [
78
+ { "type": "string", "enum": ["good_to_merge", "needs_review", "needs_input"] },
79
+ { "type": "null" }
80
+ ]
81
+ },
82
+ "merged": { "type": "boolean", "description": "True only when GitHub confirms the PR merged." },
83
+ "summary": { "type": ["string", "null"] }
84
+ }
85
+ },
86
+ "next": { "type": ["string", "null"], "description": "Follow-up command when the analysis outcome is not final." }
87
+ }
88
+ }
@@ -2,21 +2,47 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://docs.haystackeditor.com/cli/schemas/triage.v1.json",
4
4
  "title": "haystack triage --json",
5
+ "deprecated": true,
6
+ "description": "HISTORICAL: superseded by triage.v2.json. The CLI no longer emits this shape; this file is retained immutably for consumers pinned to the v1 contract.",
5
7
  "type": "object",
6
- "required": ["schema_version", "owner", "repo", "prNumber", "rating", "findings"],
8
+ "required": [
9
+ "schema_version",
10
+ "owner",
11
+ "repo",
12
+ "prNumber",
13
+ "rating",
14
+ "findings"
15
+ ],
7
16
  "properties": {
8
- "schema_version": { "type": "string", "const": "1.0.0" },
9
- "owner": { "type": "string" },
10
- "repo": { "type": "string" },
11
- "prNumber": { "type": "integer" },
12
- "rating": { "type": "integer", "minimum": 1, "maximum": 5 },
17
+ "schema_version": {
18
+ "type": "string",
19
+ "const": "1.0.0"
20
+ },
21
+ "owner": {
22
+ "type": "string"
23
+ },
24
+ "repo": {
25
+ "type": "string"
26
+ },
27
+ "prNumber": {
28
+ "type": "integer"
29
+ },
30
+ "rating": {
31
+ "type": "integer",
32
+ "minimum": 1,
33
+ "maximum": 5
34
+ },
13
35
  "autoFixerHandling": {
14
36
  "type": "array",
15
37
  "items": {
16
38
  "type": "object",
17
39
  "properties": {
18
- "category": { "type": "string" },
19
- "summary": { "type": "string" }
40
+ "category": {
41
+ "type": "string"
42
+ },
43
+ "summary": {
44
+ "type": "string"
45
+ }
20
46
  }
21
47
  }
22
48
  },
@@ -25,9 +51,15 @@
25
51
  "items": {
26
52
  "type": "object",
27
53
  "properties": {
28
- "category": { "type": "string" },
29
- "summary": { "type": "string" },
30
- "reason": { "type": "string" }
54
+ "category": {
55
+ "type": "string"
56
+ },
57
+ "summary": {
58
+ "type": "string"
59
+ },
60
+ "reason": {
61
+ "type": "string"
62
+ }
31
63
  }
32
64
  }
33
65
  },
@@ -35,14 +67,35 @@
35
67
  "type": "array",
36
68
  "items": {
37
69
  "type": "object",
38
- "required": ["category", "summary"],
70
+ "required": [
71
+ "category",
72
+ "summary"
73
+ ],
39
74
  "properties": {
40
- "category": { "type": "string" },
41
- "summary": { "type": "string" },
42
- "detail": { "type": "string" },
43
- "agentFixPrompt": { "type": ["string", "null"] },
44
- "source": { "type": ["string", "null"] },
45
- "autoFixing": { "type": "boolean" }
75
+ "category": {
76
+ "type": "string"
77
+ },
78
+ "summary": {
79
+ "type": "string"
80
+ },
81
+ "detail": {
82
+ "type": "string"
83
+ },
84
+ "agentFixPrompt": {
85
+ "type": [
86
+ "string",
87
+ "null"
88
+ ]
89
+ },
90
+ "source": {
91
+ "type": [
92
+ "string",
93
+ "null"
94
+ ]
95
+ },
96
+ "autoFixing": {
97
+ "type": "boolean"
98
+ }
46
99
  }
47
100
  }
48
101
  }