@cat-factory/contracts 0.343.0 → 0.344.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 (113) hide show
  1. package/dist/agent-presentation.d.ts +2 -2
  2. package/dist/bugFishing.d.ts +379 -0
  3. package/dist/bugFishing.d.ts.map +1 -0
  4. package/dist/bugFishing.js +412 -0
  5. package/dist/bugFishing.js.map +1 -0
  6. package/dist/deploy-fix.d.ts +53 -3
  7. package/dist/deploy-fix.d.ts.map +1 -1
  8. package/dist/deploy-fix.js +39 -2
  9. package/dist/deploy-fix.js.map +1 -1
  10. package/dist/entities.d.ts +18 -1
  11. package/dist/entities.d.ts.map +1 -1
  12. package/dist/entities.js +15 -0
  13. package/dist/entities.js.map +1 -1
  14. package/dist/environment-investigation.d.ts +55 -5
  15. package/dist/environment-investigation.d.ts.map +1 -1
  16. package/dist/environment-investigation.js +19 -2
  17. package/dist/environment-investigation.js.map +1 -1
  18. package/dist/errors.d.ts +1 -1
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +18 -0
  21. package/dist/errors.js.map +1 -1
  22. package/dist/execution.d.ts +104 -0
  23. package/dist/execution.d.ts.map +1 -1
  24. package/dist/execution.js +12 -0
  25. package/dist/execution.js.map +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/initiative.d.ts +15 -5
  31. package/dist/initiative.d.ts.map +1 -1
  32. package/dist/notification-routing.d.ts +3 -3
  33. package/dist/notification-webhooks.d.ts +7 -5
  34. package/dist/notification-webhooks.d.ts.map +1 -1
  35. package/dist/notifications.d.ts +25 -3
  36. package/dist/notifications.d.ts.map +1 -1
  37. package/dist/notifications.js +17 -0
  38. package/dist/notifications.js.map +1 -1
  39. package/dist/pipeline-purpose.d.ts +4 -0
  40. package/dist/pipeline-purpose.d.ts.map +1 -1
  41. package/dist/pipeline-purpose.js +6 -0
  42. package/dist/pipeline-purpose.js.map +1 -1
  43. package/dist/pr-report.d.ts +414 -6
  44. package/dist/pr-report.d.ts.map +1 -1
  45. package/dist/pr-report.js +143 -2
  46. package/dist/pr-report.js.map +1 -1
  47. package/dist/primitives.d.ts +71 -7
  48. package/dist/primitives.d.ts.map +1 -1
  49. package/dist/primitives.js +24 -1
  50. package/dist/primitives.js.map +1 -1
  51. package/dist/public-api.d.ts +6 -4
  52. package/dist/public-api.d.ts.map +1 -1
  53. package/dist/public-task-types.d.ts.map +1 -1
  54. package/dist/public-task-types.js +20 -0
  55. package/dist/public-task-types.js.map +1 -1
  56. package/dist/recurring.d.ts +12 -8
  57. package/dist/recurring.d.ts.map +1 -1
  58. package/dist/recurring.js +10 -5
  59. package/dist/recurring.js.map +1 -1
  60. package/dist/requests.d.ts +47 -7
  61. package/dist/requests.d.ts.map +1 -1
  62. package/dist/result-views.d.ts +1 -1
  63. package/dist/result-views.d.ts.map +1 -1
  64. package/dist/result-views.js +1 -0
  65. package/dist/result-views.js.map +1 -1
  66. package/dist/routes/agent-runs.d.ts +84 -0
  67. package/dist/routes/agent-runs.d.ts.map +1 -1
  68. package/dist/routes/board.d.ts +99 -20
  69. package/dist/routes/board.d.ts.map +1 -1
  70. package/dist/routes/bug-hunt.d.ts +92 -2
  71. package/dist/routes/bug-hunt.d.ts.map +1 -1
  72. package/dist/routes/bugFishing.d.ts +307 -0
  73. package/dist/routes/bugFishing.d.ts.map +1 -0
  74. package/dist/routes/bugFishing.js +51 -0
  75. package/dist/routes/bugFishing.js.map +1 -0
  76. package/dist/routes/execution.d.ts +428 -2
  77. package/dist/routes/execution.d.ts.map +1 -1
  78. package/dist/routes/human-review.d.ts +42 -0
  79. package/dist/routes/human-review.d.ts.map +1 -1
  80. package/dist/routes/human-test.d.ts +210 -0
  81. package/dist/routes/human-test.d.ts.map +1 -1
  82. package/dist/routes/index.d.ts +1 -0
  83. package/dist/routes/index.d.ts.map +1 -1
  84. package/dist/routes/index.js +1 -0
  85. package/dist/routes/index.js.map +1 -1
  86. package/dist/routes/initiative.d.ts +52 -17
  87. package/dist/routes/initiative.d.ts.map +1 -1
  88. package/dist/routes/notification-webhooks.d.ts +14 -14
  89. package/dist/routes/notifications.d.ts +12 -6
  90. package/dist/routes/notifications.d.ts.map +1 -1
  91. package/dist/routes/public-api.d.ts +17 -11
  92. package/dist/routes/public-api.d.ts.map +1 -1
  93. package/dist/routes/public-board.d.ts +2 -2
  94. package/dist/routes/public-evidence.d.ts +24 -1
  95. package/dist/routes/public-evidence.d.ts.map +1 -1
  96. package/dist/routes/recurring.d.ts +5 -5
  97. package/dist/routes/slack.d.ts +3 -3
  98. package/dist/routes/tasks.d.ts +12 -3
  99. package/dist/routes/tasks.d.ts.map +1 -1
  100. package/dist/routes/visual-confirm.d.ts +126 -0
  101. package/dist/routes/visual-confirm.d.ts.map +1 -1
  102. package/dist/routes/workspace-settings.d.ts +6 -3
  103. package/dist/routes/workspace-settings.d.ts.map +1 -1
  104. package/dist/routes/workspaces.d.ts +120 -14
  105. package/dist/routes/workspaces.d.ts.map +1 -1
  106. package/dist/slack.d.ts +2 -2
  107. package/dist/snapshot.d.ts +60 -7
  108. package/dist/snapshot.d.ts.map +1 -1
  109. package/dist/workspace-settings.d.ts +26 -3
  110. package/dist/workspace-settings.d.ts.map +1 -1
  111. package/dist/workspace-settings.js +23 -0
  112. package/dist/workspace-settings.js.map +1 -1
  113. package/package.json +1 -1
@@ -100,7 +100,7 @@ export declare const agentPresentationSchema: v.ObjectSchema<{
100
100
  * to the deployment and paired on the frontend (an unpaired one degrades to the generic
101
101
  * panel — the `pairById` `missing` bucket). Omitted ⇒ the generic step-detail panel.
102
102
  */
103
- readonly resultView: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<readonly ["outcome", "requirements-review", "clarity-review", "brainstorm", "tester", "human-test", "visual-confirm", "gate", "consensus-session", "generic-structured", "service-spec", "follow-ups", "merger", "initiative-tracker", "initiative-planning", "doc-interview", "fork-decision", "binary-candidates", "judge", "pr-review", "ralph-loop"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>, undefined>;
103
+ readonly resultView: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<readonly ["outcome", "requirements-review", "clarity-review", "brainstorm", "tester", "human-test", "visual-confirm", "gate", "consensus-session", "generic-structured", "service-spec", "follow-ups", "merger", "initiative-tracker", "initiative-planning", "doc-interview", "fork-decision", "binary-candidates", "judge", "pr-review", "bug-fishing", "ralph-loop"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>, undefined>;
104
104
  /**
105
105
  * When true the kind is INTERNAL: the platform dispatches it for a flow of its own and the
106
106
  * builder palette never offers it as a placeable block. The environment analyst is the model —
@@ -181,7 +181,7 @@ export declare const customAgentKindSchema: v.ObjectSchema<{
181
181
  * to the deployment and paired on the frontend (an unpaired one degrades to the generic
182
182
  * panel — the `pairById` `missing` bucket). Omitted ⇒ the generic step-detail panel.
183
183
  */
184
- readonly resultView: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<readonly ["outcome", "requirements-review", "clarity-review", "brainstorm", "tester", "human-test", "visual-confirm", "gate", "consensus-session", "generic-structured", "service-spec", "follow-ups", "merger", "initiative-tracker", "initiative-planning", "doc-interview", "fork-decision", "binary-candidates", "judge", "pr-review", "ralph-loop"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>, undefined>;
184
+ readonly resultView: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<readonly ["outcome", "requirements-review", "clarity-review", "brainstorm", "tester", "human-test", "visual-confirm", "gate", "consensus-session", "generic-structured", "service-spec", "follow-ups", "merger", "initiative-tracker", "initiative-planning", "doc-interview", "fork-decision", "binary-candidates", "judge", "pr-review", "bug-fishing", "ralph-loop"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>, undefined>;
185
185
  /**
186
186
  * When true the kind is INTERNAL: the platform dispatches it for a flow of its own and the
187
187
  * builder palette never offers it as a placeable block. The environment analyst is the model —
@@ -0,0 +1,379 @@
1
+ import * as v from 'valibot';
2
+ /**
3
+ * The ANGLES an expedition fishes from, each one pass of the read-only agent over the
4
+ * codebase. They are deliberately disjoint LENSES rather than a difficulty ladder: one pass
5
+ * asked to find everything returns the shallow half of everything, whereas a pass told to
6
+ * think only about concurrency reads the same files with a question that makes the race
7
+ * visible.
8
+ *
9
+ * A PERSISTED closed vocabulary: a phase id is written onto the step's recorded phases and
10
+ * onto every finding, so a value retired here still comes back out of stored runs. Nothing
11
+ * renders a phase by looking its id up — {@link bugFishingPhaseSchema} carries the title and
12
+ * goal it ran under — and {@link describeBugFishingPhase} names an unrecognised id as retired
13
+ * rather than guessing at a current member or rendering `undefined`.
14
+ */
15
+ export declare const BUG_FISHING_PHASE_IDS: readonly ['control-flow', 'error-handling', 'boundaries', 'concurrency', 'state-lifecycle', 'contracts', 'footguns', 'requirements'];
16
+ export declare const bugFishingPhaseIdSchema: v.PicklistSchema<readonly ["control-flow", "error-handling", "boundaries", "concurrency", "state-lifecycle", "contracts", "footguns", "requirements"], undefined>;
17
+ export type BugFishingPhaseId = v.InferOutput<typeof bugFishingPhaseIdSchema>;
18
+ /** Whether `id` is a phase angle this build still ships. Derived from the picklist itself. */
19
+ export declare function isBugFishingPhaseId(id: string): id is BugFishingPhaseId;
20
+ /** What one angle is, and what the pass fishing it is told to look for. */
21
+ export interface BugFishingPhaseDescriptor {
22
+ id: string;
23
+ /** Short human label (the window's phase header, the create form's checkbox). */
24
+ title: string;
25
+ /** One line saying what this pass is hunting — rendered to the human AND to the agent. */
26
+ goal: string;
27
+ /** The concrete prompt focus the agent is given for this pass. */
28
+ focus: string;
29
+ /** True for an id this build no longer ships (a stored run naming a retired angle). */
30
+ retired?: boolean;
31
+ }
32
+ /**
33
+ * The shipped angle catalog, in the order an expedition fishes them. Ordered so the angles
34
+ * that most often hide a real defect run first, because an expedition a human stops early has
35
+ * then still covered the ground worth covering.
36
+ */
37
+ export declare const BUG_FISHING_PHASES: readonly BugFishingPhaseDescriptor[];
38
+ /**
39
+ * The descriptor for a phase id, including one this build no longer ships.
40
+ *
41
+ * A retired angle is NAMED as retired rather than dropped or guessed onto a current member:
42
+ * stored runs keep the id they ran under, and the reader that hits it first is the window
43
+ * telling a human what an expedition actually covered. Answering `undefined` there would put
44
+ * an empty header over real findings.
45
+ */
46
+ export declare function describeBugFishingPhase(id: string): BugFishingPhaseDescriptor;
47
+ /** How serious a finding is, ordered critical → low. The window groups and colours by this. */
48
+ export declare const bugFishingSeveritySchema: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
49
+ export type BugFishingSeverity = v.InferOutput<typeof bugFishingSeveritySchema>;
50
+ /** Severity order (most severe first) — the one place the ranking is stated. */
51
+ export declare const BUG_FISHING_SEVERITY_ORDER: readonly BugFishingSeverity[];
52
+ /**
53
+ * What KIND of defect a finding is. Distinct from severity: an expedition is explicitly
54
+ * fishing for more than crashes, and a `footgun` that will cost a week next quarter is a
55
+ * different decision from an `edge-case` that fires today.
56
+ */
57
+ export declare const bugFishingFindingKindSchema: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
58
+ export type BugFishingFindingKind = v.InferOutput<typeof bugFishingFindingKindSchema>;
59
+ /** How sure the agent is that the finding is real — its own judgement, never platform-derived. */
60
+ export declare const bugFishingConfidenceSchema: v.PicklistSchema<["high", "medium", "low"], undefined>;
61
+ export type BugFishingConfidence = v.InferOutput<typeof bugFishingConfidenceSchema>;
62
+ /** A phase's lifecycle across the expedition's successive dispatches. */
63
+ export declare const bugFishingPhaseStatusSchema: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
64
+ export type BugFishingPhaseStatus = v.InferOutput<typeof bugFishingPhaseStatusSchema>;
65
+ /**
66
+ * One planned angle of the expedition, as recorded on the step.
67
+ *
68
+ * `title` and `goal` are COPIED from the catalog when the expedition is planned rather than
69
+ * looked up at render time, so a run keeps naming the angle it actually fished even after that
70
+ * angle is retired or reworded.
71
+ */
72
+ export declare const bugFishingPhaseSchema: v.ObjectSchema<{
73
+ /** The angle's id (a {@link BUG_FISHING_PHASE_IDS} member when it was planned). */
74
+ readonly id: v.StringSchema<undefined>;
75
+ /** The angle's label as it stood when this expedition planned it. */
76
+ readonly title: v.StringSchema<undefined>;
77
+ /** What this pass was told to hunt, as it stood when this expedition planned it. */
78
+ readonly goal: v.StringSchema<undefined>;
79
+ readonly status: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
80
+ /** The agent's one-paragraph account of what it covered; null until the pass settles. */
81
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
82
+ /** Epoch ms the pass settled (completed or failed); null while pending / fishing. */
83
+ readonly settledAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
84
+ /** Why the pass failed, when it did. Null otherwise. */
85
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
86
+ }, undefined>;
87
+ export type BugFishingPhase = v.InferOutput<typeof bugFishingPhaseSchema>;
88
+ /**
89
+ * How far a marked finding's spawn has got.
90
+ *
91
+ * - `pending`: the CLAIM. Written BEFORE the task exists, which is what makes marking safe
92
+ * against two people (or a retried request) marking one finding at the same time: the second
93
+ * claim finds the first and is refused, rather than both creating a task and a run.
94
+ * - `spawned`: terminal. The task exists and its run was started.
95
+ * - `failed`: the claim was taken and the work behind it did not land, carrying the cause. The
96
+ * finding is markable again, because nothing was created for it.
97
+ */
98
+ export declare const bugFishingSpawnStatusSchema: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
99
+ export type BugFishingSpawnStatus = v.InferOutput<typeof bugFishingSpawnStatusSchema>;
100
+ /**
101
+ * The record of a finding a human MARKED to be addressed: the bug-fix task the platform
102
+ * spawned for it, and the pipeline that task runs.
103
+ *
104
+ * It is what links the expedition to the work it caused: the window reads the spawned task's
105
+ * live status through it, and the spawned block carries the expedition's own block id back the
106
+ * other way (`Block.expeditionId`).
107
+ *
108
+ * Written TWICE, and the first write is the point. A spawn creates a board task and starts a run,
109
+ * so it is an external side effect in a path two callers can enter at once; the record is
110
+ * therefore taken as a `pending` CLAIM before any of that happens and settled to `spawned` or
111
+ * `failed` after. Reading it as "there is a fix task" means reading {@link
112
+ * bugFishingSpawnStatusSchema}, never merely the presence of this record.
113
+ */
114
+ export declare const bugFishingSpawnSchema: v.ObjectSchema<{
115
+ /** How far the spawn has got; see {@link bugFishingSpawnStatusSchema}. */
116
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
117
+ /** The spawned task block's id, minted with the claim so the claimer can recognise its own. */
118
+ readonly taskId: v.StringSchema<undefined>;
119
+ /**
120
+ * The run started on the task. Null while the claim is `pending`, and on a `spawned` record
121
+ * whose task was created but whose run reported no id.
122
+ */
123
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
124
+ /** The pipeline the spawned task runs (the resolved default, or the caller's override). */
125
+ readonly pipelineId: v.StringSchema<undefined>;
126
+ /** Who marked the finding. Null for a system-initiated marking. */
127
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
128
+ /** Epoch ms the claim was taken. */
129
+ readonly requestedAt: v.NumberSchema<undefined>;
130
+ /** Why the spawn failed, on a `failed` record. Null otherwise. */
131
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
132
+ }, undefined>;
133
+ export type BugFishingSpawn = v.InferOutput<typeof bugFishingSpawnSchema>;
134
+ /**
135
+ * How long a `pending` spawn claim holds a finding before another marking may take it.
136
+ *
137
+ * The claim is held across a board insert and a run start, so it is normally seconds. The window
138
+ * exists for the one case the claimer cannot clean up after itself: a process killed between
139
+ * taking the claim and settling it, which would otherwise leave the finding claimed by nobody,
140
+ * forever, with no fix task to show for it. Generous enough that it can never expire under a
141
+ * merely slow start, which would be exactly the double spawn the claim exists to prevent.
142
+ */
143
+ export declare const BUG_FISHING_SPAWN_CLAIM_TTL_MS: number;
144
+ /**
145
+ * Whether a finding is still OPEN: nothing is being done about it, so it may be marked (or
146
+ * dismissed) right now.
147
+ *
148
+ * Here rather than in the engine because both sides have to agree about it and neither owns the
149
+ * answer: the engine refuses a second marking with it, and the window counts "N left to triage"
150
+ * and decides which rows the working list shows with it. Stated once, the two cannot drift into
151
+ * a window that offers a mark the engine will refuse.
152
+ *
153
+ * Three ways to be open: nothing has been claimed, the last attempt `failed` (nothing was created,
154
+ * so there is nothing to collide with), or a `pending` claim has outlived
155
+ * {@link BUG_FISHING_SPAWN_CLAIM_TTL_MS} and its claimer is gone. A `spawned` record is terminal:
156
+ * the task exists, and marking again would file the same bug twice.
157
+ */
158
+ export declare function bugFishingSpawnIsClaimable(spawn: BugFishingSpawn | null | undefined, now: number): boolean;
159
+ /**
160
+ * One finding, id-stamped by the engine and anchored to the phase that surfaced it.
161
+ *
162
+ * `evidence` is kept apart from `detail` on purpose: an expedition that cannot point at the
163
+ * code it is describing is speculating, and separating the two makes that visible to the human
164
+ * triaging it rather than something they have to infer from the prose.
165
+ */
166
+ export declare const bugFishingFindingSchema: v.ObjectSchema<{
167
+ /** Engine-minted stable id (`bff_*`); the marking requests carry these ids. */
168
+ readonly id: v.StringSchema<undefined>;
169
+ /** The phase that surfaced it (a phase id; see {@link describeBugFishingPhase}). */
170
+ readonly phaseId: v.StringSchema<undefined>;
171
+ /** Repo-relative path the finding concerns; empty when it is not anchored to one file. */
172
+ readonly path: v.StringSchema<undefined>;
173
+ /** The line the finding anchors to, or null. */
174
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
175
+ readonly severity: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
176
+ readonly kind: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
177
+ readonly confidence: v.PicklistSchema<["high", "medium", "low"], undefined>;
178
+ /** Short headline. */
179
+ readonly title: v.StringSchema<undefined>;
180
+ /** The full finding, in prose: what is wrong and what happens because of it. */
181
+ readonly detail: v.StringSchema<undefined>;
182
+ /** How the defect manifests: the concrete inputs / interleaving / state that triggers it. */
183
+ readonly failureScenario: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
184
+ /** What the agent actually read that supports the claim (code it can point at). */
185
+ readonly evidence: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
186
+ /** A concrete suggested change, when the agent offered one. */
187
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
188
+ /**
189
+ * The bug-fix task spawned for this finding, when a human marked it. Null when nobody has.
190
+ * A record with a `failed` status is a mark that did not land: the finding is markable again,
191
+ * so a reader deciding whether this finding is being worked on reads the STATUS, not the
192
+ * presence of the record.
193
+ */
194
+ readonly spawn: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
195
+ /** How far the spawn has got; see {@link bugFishingSpawnStatusSchema}. */
196
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
197
+ /** The spawned task block's id, minted with the claim so the claimer can recognise its own. */
198
+ readonly taskId: v.StringSchema<undefined>;
199
+ /**
200
+ * The run started on the task. Null while the claim is `pending`, and on a `spawned` record
201
+ * whose task was created but whose run reported no id.
202
+ */
203
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
204
+ /** The pipeline the spawned task runs (the resolved default, or the caller's override). */
205
+ readonly pipelineId: v.StringSchema<undefined>;
206
+ /** Who marked the finding. Null for a system-initiated marking. */
207
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
208
+ /** Epoch ms the claim was taken. */
209
+ readonly requestedAt: v.NumberSchema<undefined>;
210
+ /** Why the spawn failed, on a `failed` record. Null otherwise. */
211
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
212
+ }, undefined>, undefined>, undefined>;
213
+ /** Set when a human dismissed the finding: it stays on the record, struck through. */
214
+ readonly dismissed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
215
+ }, undefined>;
216
+ export type BugFishingFinding = v.InferOutput<typeof bugFishingFindingSchema>;
217
+ /**
218
+ * The expedition lifecycle on a `bug-fisher` step:
219
+ * - `fishing`: a phase's read-only container job is in flight (or the next one is about to be).
220
+ * - `awaiting_triage`: every phase settled; parked for the human to finish triaging.
221
+ * - `done`: the human finished the expedition (the run advances past it).
222
+ *
223
+ * There is deliberately no `skipped`: an expedition with no angles cannot be asked for, because
224
+ * an empty selection means "fish every angle" (see `planBugFishingPhases`).
225
+ *
226
+ * There is deliberately no `triaging` state: marking a finding is available from the moment
227
+ * its phase lands, INCLUDING while later phases are still fishing, which is the whole reason
228
+ * the angles run as separate passes.
229
+ */
230
+ export declare const bugFishingStatusSchema: v.PicklistSchema<["fishing", "awaiting_triage", "done"], undefined>;
231
+ export type BugFishingStatus = v.InferOutput<typeof bugFishingStatusSchema>;
232
+ /**
233
+ * Live bug-fishing state carried on the run's `bug-fisher` step. Created by the engine when
234
+ * the step first runs (planning the phases from the task's selection), extended by each
235
+ * phase's completion, and mutated by the human's markings.
236
+ */
237
+ export declare const bugFishingStepStateSchema: v.ObjectSchema<{
238
+ readonly status: v.PicklistSchema<["fishing", "awaiting_triage", "done"], undefined>;
239
+ /** The planned angles, in the order they are fished. */
240
+ readonly phases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
241
+ /** The angle's id (a {@link BUG_FISHING_PHASE_IDS} member when it was planned). */
242
+ readonly id: v.StringSchema<undefined>;
243
+ /** The angle's label as it stood when this expedition planned it. */
244
+ readonly title: v.StringSchema<undefined>;
245
+ /** What this pass was told to hunt, as it stood when this expedition planned it. */
246
+ readonly goal: v.StringSchema<undefined>;
247
+ readonly status: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
248
+ /** The agent's one-paragraph account of what it covered; null until the pass settles. */
249
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
250
+ /** Epoch ms the pass settled (completed or failed); null while pending / fishing. */
251
+ readonly settledAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
252
+ /** Why the pass failed, when it did. Null otherwise. */
253
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
254
+ }, undefined>, undefined>, readonly []>;
255
+ /**
256
+ * Index into {@link bugFishingStepStateSchema}'s `phases` of the pass currently being fished
257
+ * (or about to be). Equal to `phases.length` once every angle has settled, which is what the
258
+ * `awaiting_triage` status says in the other direction; an index rather than a pointer so an
259
+ * empty phase list still has an unambiguous value.
260
+ */
261
+ readonly currentPhaseIndex: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
262
+ /** Every finding surfaced so far, oldest phase first, severity-ordered within a phase. */
263
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
264
+ /** Engine-minted stable id (`bff_*`); the marking requests carry these ids. */
265
+ readonly id: v.StringSchema<undefined>;
266
+ /** The phase that surfaced it (a phase id; see {@link describeBugFishingPhase}). */
267
+ readonly phaseId: v.StringSchema<undefined>;
268
+ /** Repo-relative path the finding concerns; empty when it is not anchored to one file. */
269
+ readonly path: v.StringSchema<undefined>;
270
+ /** The line the finding anchors to, or null. */
271
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
272
+ readonly severity: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
273
+ readonly kind: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
274
+ readonly confidence: v.PicklistSchema<["high", "medium", "low"], undefined>;
275
+ /** Short headline. */
276
+ readonly title: v.StringSchema<undefined>;
277
+ /** The full finding, in prose: what is wrong and what happens because of it. */
278
+ readonly detail: v.StringSchema<undefined>;
279
+ /** How the defect manifests: the concrete inputs / interleaving / state that triggers it. */
280
+ readonly failureScenario: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
281
+ /** What the agent actually read that supports the claim (code it can point at). */
282
+ readonly evidence: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
283
+ /** A concrete suggested change, when the agent offered one. */
284
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
285
+ /**
286
+ * The bug-fix task spawned for this finding, when a human marked it. Null when nobody has.
287
+ * A record with a `failed` status is a mark that did not land: the finding is markable again,
288
+ * so a reader deciding whether this finding is being worked on reads the STATUS, not the
289
+ * presence of the record.
290
+ */
291
+ readonly spawn: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
292
+ /** How far the spawn has got; see {@link bugFishingSpawnStatusSchema}. */
293
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
294
+ /** The spawned task block's id, minted with the claim so the claimer can recognise its own. */
295
+ readonly taskId: v.StringSchema<undefined>;
296
+ /**
297
+ * The run started on the task. Null while the claim is `pending`, and on a `spawned` record
298
+ * whose task was created but whose run reported no id.
299
+ */
300
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
301
+ /** The pipeline the spawned task runs (the resolved default, or the caller's override). */
302
+ readonly pipelineId: v.StringSchema<undefined>;
303
+ /** Who marked the finding. Null for a system-initiated marking. */
304
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
305
+ /** Epoch ms the claim was taken. */
306
+ readonly requestedAt: v.NumberSchema<undefined>;
307
+ /** Why the spawn failed, on a `failed` record. Null otherwise. */
308
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
309
+ }, undefined>, undefined>, undefined>;
310
+ /** Set when a human dismissed the finding: it stays on the record, struck through. */
311
+ readonly dismissed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
312
+ }, undefined>, undefined>, readonly []>;
313
+ /** Identifier of the model that fished, for transparency. */
314
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
315
+ /**
316
+ * The pipeline a marked finding's spawned task runs when the marking names none: the
317
+ * workspace's `bugFishingFixPipelineId`, else the built-in bug-fix preset. Resolved when the
318
+ * expedition is planned and recorded here, so the window can state the default it will use
319
+ * without a second read and the record says which default a spawn actually took.
320
+ */
321
+ readonly defaultFixPipelineId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
322
+ }, undefined>;
323
+ export type BugFishingStepState = v.InferOutput<typeof bugFishingStepStateSchema>;
324
+ /**
325
+ * The LENIENT structured shape the read-only `bug-fisher` container agent returns as
326
+ * `result.custom` for ONE phase (the engine mints the finding ids and stamps the phase).
327
+ * Every field falls back to a safe default (`v.fallback`) — exactly like
328
+ * `prReviewAgentOutputSchema` — so a partially-malformed reply degrades sensibly rather than
329
+ * failing a pass whose other findings are fine.
330
+ */
331
+ export declare const bugFishingAgentOutputSchema: v.ObjectSchema<{
332
+ /** What this pass covered and what it concluded, in one paragraph. */
333
+ readonly summary: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
334
+ /** The findings this pass surfaced. */
335
+ readonly findings: v.SchemaWithFallback<v.ArraySchema<v.SchemaWithFallback<v.ObjectSchema<{
336
+ readonly path: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
337
+ readonly line: v.SchemaWithFallback<v.OptionalSchema<v.NumberSchema<undefined>, undefined>, undefined>;
338
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["critical", "high", "medium", "low"], undefined>, "medium">;
339
+ readonly kind: v.SchemaWithFallback<v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>, "other">;
340
+ readonly confidence: v.SchemaWithFallback<v.PicklistSchema<["high", "medium", "low"], undefined>, "medium">;
341
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
342
+ readonly detail: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
343
+ readonly failureScenario: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
344
+ readonly evidence: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
345
+ readonly suggestedFix: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
346
+ }, undefined>, {
347
+ readonly path: "";
348
+ readonly severity: 'medium';
349
+ readonly kind: 'other';
350
+ readonly confidence: 'medium';
351
+ readonly title: "";
352
+ readonly detail: "";
353
+ }>, undefined>, readonly []>;
354
+ }, undefined>;
355
+ export type BugFishingAgentOutput = v.InferOutput<typeof bugFishingAgentOutputSchema>;
356
+ /**
357
+ * Mark findings to be addressed: each one spawns its OWN bug-fix task, linked back to the
358
+ * expedition. Accepted while the expedition is still fishing later phases as well as once it
359
+ * has parked, because a completed phase's findings are actionable the moment they land.
360
+ *
361
+ * `pipelineId` overrides, for THIS request only, the pipeline the spawned tasks run; omitted
362
+ * ⇒ the expedition's resolved default (the workspace's `bugFishingFixPipelineId`, else the
363
+ * built-in bug-fix preset).
364
+ */
365
+ export declare const addressBugFishingFindingsSchema: v.ObjectSchema<{
366
+ /** The findings to act on. At least one; an unknown or already-spawned id is refused. */
367
+ readonly findingIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
368
+ /** Pipeline the spawned tasks run; omitted ⇒ the expedition's default. */
369
+ readonly pipelineId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
370
+ }, undefined>;
371
+ export type AddressBugFishingFindingsInput = v.InferOutput<typeof addressBugFishingFindingsSchema>;
372
+ /**
373
+ * Finish a parked expedition: the human is done triaging and the run advances past the step.
374
+ * Takes no fields — every marking already happened through its own request, so there is no
375
+ * curated selection left to carry here.
376
+ */
377
+ export declare const resolveBugFishingSchema: v.ObjectSchema<{}, undefined>;
378
+ export type ResolveBugFishingInput = v.InferOutput<typeof resolveBugFishingSchema>;
379
+ //# sourceMappingURL=bugFishing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bugFishing.d.ts","sourceRoot":"","sources":["../src/bugFishing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAuB5B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,YAChC,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,cAAc,CACN,CAAA;AAEV,eAAO,MAAM,uBAAuB,mKAAoC,CAAA;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,iBAAiB,CAEvE;AAED,2EAA2E;AAC3E,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAA;IACZ,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS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