@farmslot/protocol 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/agents/reviewer-context.d.ts +4 -4
- package/dist/agents/reviewer-context.d.ts.map +1 -1
- package/dist/agents/reviewer-context.js +10 -10
- package/dist/agents/reviewer-context.js.map +1 -1
- package/dist/agents/roles.d.ts +2 -2
- package/dist/agents/roles.d.ts.map +1 -1
- package/dist/agents/roles.js +5 -9
- package/dist/agents/roles.js.map +1 -1
- package/dist/checklist-target.d.ts +6 -6
- package/dist/checklist-target.d.ts.map +1 -1
- package/dist/checklist-target.js +11 -11
- package/dist/checklist-target.js.map +1 -1
- package/dist/contracts/acceptance.d.ts +19 -34
- package/dist/contracts/acceptance.d.ts.map +1 -1
- package/dist/contracts/acceptance.js +11 -156
- package/dist/contracts/acceptance.js.map +1 -1
- package/dist/contracts/agents.d.ts +7 -2
- package/dist/contracts/agents.d.ts.map +1 -1
- package/dist/contracts/agents.js +13 -2
- package/dist/contracts/agents.js.map +1 -1
- package/dist/contracts/analytics.d.ts +2 -2
- package/dist/contracts/analytics.d.ts.map +1 -1
- package/dist/contracts/backlog.d.ts +16 -7
- package/dist/contracts/backlog.d.ts.map +1 -1
- package/dist/contracts/backlog.js.map +1 -1
- package/dist/contracts/config.d.ts +12 -3
- package/dist/contracts/config.d.ts.map +1 -1
- package/dist/contracts/config.js +32 -0
- package/dist/contracts/config.js.map +1 -1
- package/dist/contracts/dispatch.d.ts +7 -4
- package/dist/contracts/dispatch.d.ts.map +1 -1
- package/dist/contracts/family.d.ts +2 -2
- package/dist/contracts/family.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +3 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/pr-monitoring.d.ts +8 -8
- package/dist/contracts/pr-monitoring.d.ts.map +1 -1
- package/dist/contracts/pr-rules.d.ts +5 -7
- package/dist/contracts/pr-rules.d.ts.map +1 -1
- package/dist/contracts/pr-rules.js +4 -6
- package/dist/contracts/pr-rules.js.map +1 -1
- package/dist/contracts/qa.d.ts +2 -2
- package/dist/contracts/qa.d.ts.map +1 -1
- package/dist/contracts/qa.js +5 -9
- package/dist/contracts/qa.js.map +1 -1
- package/dist/contracts/recipe-conformance.d.ts +51 -0
- package/dist/contracts/recipe-conformance.d.ts.map +1 -1
- package/dist/contracts/recipe-conformance.js +134 -1
- package/dist/contracts/recipe-conformance.js.map +1 -1
- package/dist/contracts/resources.d.ts +1 -1
- package/dist/contracts/resources.d.ts.map +1 -1
- package/dist/contracts/resources.js.map +1 -1
- package/dist/contracts/reviews.d.ts +19 -3
- package/dist/contracts/reviews.d.ts.map +1 -1
- package/dist/contracts/reviews.js +2 -2
- package/dist/contracts/reviews.js.map +1 -1
- package/dist/contracts/run-gate-readiness.d.ts +26 -0
- package/dist/contracts/run-gate-readiness.d.ts.map +1 -0
- package/dist/contracts/run-gate-readiness.js +5 -0
- package/dist/contracts/run-gate-readiness.js.map +1 -0
- package/dist/contracts/run-lifecycle-view.d.ts +17 -0
- package/dist/contracts/run-lifecycle-view.d.ts.map +1 -0
- package/dist/contracts/run-lifecycle-view.js +70 -0
- package/dist/contracts/run-lifecycle-view.js.map +1 -0
- package/dist/contracts/runner-mobile-keys.d.ts +217 -0
- package/dist/contracts/runner-mobile-keys.d.ts.map +1 -0
- package/dist/contracts/runner-mobile-keys.js +189 -0
- package/dist/contracts/runner-mobile-keys.js.map +1 -0
- package/dist/contracts/runs.d.ts +109 -91
- package/dist/contracts/runs.d.ts.map +1 -1
- package/dist/contracts/runs.js +12 -14
- package/dist/contracts/runs.js.map +1 -1
- package/dist/contracts/runtime-capabilities.d.ts +2 -0
- package/dist/contracts/runtime-capabilities.d.ts.map +1 -1
- package/dist/contracts/runtime-capabilities.js.map +1 -1
- package/dist/contracts/template-placeholders.d.ts +0 -6
- package/dist/contracts/template-placeholders.d.ts.map +1 -1
- package/dist/contracts/template-placeholders.js +22 -4
- package/dist/contracts/template-placeholders.js.map +1 -1
- package/dist/contracts/worker-terminal.d.ts +19 -0
- package/dist/contracts/worker-terminal.d.ts.map +1 -1
- package/dist/contracts/worker-terminal.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/pr-monitoring.d.ts.map +1 -1
- package/dist/integrations/pr-monitoring.js +9 -3
- package/dist/integrations/pr-monitoring.js.map +1 -1
- package/dist/integrations/pr-rule-config.d.ts.map +1 -1
- package/dist/integrations/pr-rule-config.js +21 -25
- package/dist/integrations/pr-rule-config.js.map +1 -1
- package/dist/integrations/pr-workflow-defaults.d.ts.map +1 -1
- package/dist/integrations/pr-workflow-defaults.js +2 -5
- package/dist/integrations/pr-workflow-defaults.js.map +1 -1
- package/dist/recipe/artifact.d.ts.map +1 -1
- package/dist/recipe/artifact.js +20 -4
- package/dist/recipe/artifact.js.map +1 -1
- package/dist/recipe/document.d.ts +5 -1
- package/dist/recipe/document.d.ts.map +1 -1
- package/dist/recipe/document.js +66 -37
- package/dist/recipe/document.js.map +1 -1
- package/dist/recipe/evidence.d.ts +128 -0
- package/dist/recipe/evidence.d.ts.map +1 -0
- package/dist/recipe/evidence.js +141 -0
- package/dist/recipe/evidence.js.map +1 -0
- package/dist/recipe/hud-intent.d.ts +56 -0
- package/dist/recipe/hud-intent.d.ts.map +1 -0
- package/dist/recipe/hud-intent.js +46 -0
- package/dist/recipe/hud-intent.js.map +1 -0
- package/dist/recipe/index.d.ts +4 -2
- package/dist/recipe/index.d.ts.map +1 -1
- package/dist/recipe/index.js +4 -2
- package/dist/recipe/index.js.map +1 -1
- package/dist/recipe/recording.d.ts +7 -0
- package/dist/recipe/recording.d.ts.map +1 -1
- package/dist/recipe/recording.js +48 -0
- package/dist/recipe/recording.js.map +1 -1
- package/dist/recipe/workflow.d.ts.map +1 -1
- package/dist/recipe/workflow.js +23 -1
- package/dist/recipe/workflow.js.map +1 -1
- package/dist/recipes/step-io.d.ts +8 -4
- package/dist/recipes/step-io.d.ts.map +1 -1
- package/dist/recipes/step-io.js.map +1 -1
- package/dist/rpc/copilot-runtime.d.ts +1 -1
- package/dist/rpc/copilot-runtime.d.ts.map +1 -1
- package/dist/rpc/dispatch.d.ts +10 -6
- package/dist/rpc/dispatch.d.ts.map +1 -1
- package/dist/rpc/native-session.d.ts +1 -0
- package/dist/rpc/native-session.d.ts.map +1 -1
- package/dist/rpc/native-session.js.map +1 -1
- package/dist/rpc/roadmap.d.ts +2 -0
- package/dist/rpc/roadmap.d.ts.map +1 -1
- package/dist/rpc/run.d.ts +5 -3
- package/dist/rpc/run.d.ts.map +1 -1
- package/dist/rpc/run.js.map +1 -1
- package/dist/rpc/slot.d.ts +1 -0
- package/dist/rpc/slot.d.ts.map +1 -1
- package/dist/rpc/tmux.d.ts +10 -0
- package/dist/rpc/tmux.d.ts.map +1 -1
- package/dist/runs/ci-decision-context.d.ts +40 -0
- package/dist/runs/ci-decision-context.d.ts.map +1 -0
- package/dist/runs/ci-decision-context.js +129 -0
- package/dist/runs/ci-decision-context.js.map +1 -0
- package/dist/runs/decision-resolution.d.ts +37 -1
- package/dist/runs/decision-resolution.d.ts.map +1 -1
- package/dist/runs/decision-resolution.js +44 -1
- package/dist/runs/decision-resolution.js.map +1 -1
- package/dist/runs/family-iteration-ledger.js +1 -1
- package/dist/runs/family-iteration-ledger.js.map +1 -1
- package/dist/runs/publish-approval.d.ts +20 -0
- package/dist/runs/publish-approval.d.ts.map +1 -0
- package/dist/runs/publish-approval.js +29 -0
- package/dist/runs/publish-approval.js.map +1 -0
- package/dist/runs/review-chain.d.ts +2 -2
- package/dist/runs/review-chain.d.ts.map +1 -1
- package/dist/runs/review-chain.js +4 -4
- package/dist/runs/review-chain.js.map +1 -1
- package/dist/runs/review-curation.d.ts +51 -0
- package/dist/runs/review-curation.d.ts.map +1 -0
- package/dist/runs/review-curation.js +138 -0
- package/dist/runs/review-curation.js.map +1 -0
- package/dist/runs/review-policy.d.ts +9 -0
- package/dist/runs/review-policy.d.ts.map +1 -0
- package/dist/runs/review-policy.js +34 -0
- package/dist/runs/review-policy.js.map +1 -0
- package/dist/runs/review-retries.d.ts +10 -10
- package/dist/runs/review-retries.d.ts.map +1 -1
- package/dist/runs/review-retries.js +17 -22
- package/dist/runs/review-retries.js.map +1 -1
- package/dist/runs/slot-resolution.js +1 -1
- package/dist/runs/slot-resolution.js.map +1 -1
- package/dist/transport/signal.d.ts +3 -3
- package/dist/transport/signal.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -2
- package/schemas/recipe-v1.schema.json +113 -22
- package/scripts/acceptance.d.mts +16 -0
- package/scripts/acceptance.mjs +233 -0
package/dist/contracts/runs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArtifactRef,
|
|
1
|
+
import type { ArtifactRef, ReviewIssue } from '../recipes/step-io.js';
|
|
2
2
|
import type { WorkerSignalChecklistEvent, WorkerSignalChecklistTiming, WorkerSignalStatus } from '../transport/signal.js';
|
|
3
3
|
import type { AcceptanceStatusLedger } from './acceptance.js';
|
|
4
4
|
import type { AgentContext, AgentContextTarget, RunnerSessionArchiveRef, SafetyTier, ScriptedRunnerConfig, WorkerTransport } from './agents.js';
|
|
@@ -8,11 +8,13 @@ import type { EvidenceQualityReport, RecipeQualityArtifact } from './recipes.js'
|
|
|
8
8
|
import type { ResourcePostureWaitPolicy, RunResourcePostureState } from './resource-posture.js';
|
|
9
9
|
import type { ResourceType } from './resources.js';
|
|
10
10
|
import type { RunImportProvenance } from './run-bundles.js';
|
|
11
|
+
import type { RunGateReadiness } from './run-gate-readiness.js';
|
|
11
12
|
import type { RuntimeCapabilityProofRequirement } from './runtime-capabilities.js';
|
|
12
13
|
import type { SlotHealth } from './slots.js';
|
|
13
14
|
import type { SubtaskSource } from './task.js';
|
|
14
15
|
import type { ProfileFitSuggestion, ValidationPlanStep } from './validation-plan.js';
|
|
15
|
-
|
|
16
|
+
import type { DeterministicChecklistCheck } from './worker-terminal.js';
|
|
17
|
+
export type RunStatus = 'created' | 'grading' | 'writing-task' | 'slot-finding' | 'preparing' | 'dispatching' | 'monitoring' | 'reviewing' | 'fixing' | 'review-failed' | 'reconciling' | 'completing' | 'human-gating' | 'ci-watching' | 'paused' | 'done' | 'blocked' | 'failed' | 'cancelled';
|
|
16
18
|
export declare const TERMINAL_RUN_STATUSES: readonly RunStatus[];
|
|
17
19
|
export declare const ACTIVE_RUN_STATUSES: readonly RunStatus[];
|
|
18
20
|
export declare function isTerminalRunStatus(status: RunStatus): boolean;
|
|
@@ -101,6 +103,8 @@ export interface EvidenceManifestStandalone {
|
|
|
101
103
|
}
|
|
102
104
|
export interface ReviewGatePayload {
|
|
103
105
|
kind: 'review';
|
|
106
|
+
gateReadiness?: RunGateReadiness;
|
|
107
|
+
session?: ReviewSessionTrace;
|
|
104
108
|
prNumber: number | null;
|
|
105
109
|
repo: string | null;
|
|
106
110
|
/** PR/project base branch used by the review diff workspace. */
|
|
@@ -120,48 +124,65 @@ export interface ReviewGatePayload {
|
|
|
120
124
|
workerLearnings?: string;
|
|
121
125
|
}
|
|
122
126
|
/** Review evidence retained independently of the decision to publish it. */
|
|
123
|
-
export type RunReviewResult = Pick<ReviewGatePayload, 'recommendation' | 'reviewMd' | 'lineComments' | 'reviewSnapshot' | 'artifactManifest' | 'reviewInputArtifactPaths'>;
|
|
127
|
+
export type RunReviewResult = Pick<ReviewGatePayload, 'recommendation' | 'session' | 'reviewMd' | 'lineComments' | 'reviewSnapshot' | 'artifactManifest' | 'reviewInputArtifactPaths'>;
|
|
124
128
|
export type PublicationTarget = 'draft' | 'ready';
|
|
125
129
|
export type PublicationStatus = 'not_published' | 'pending_publish' | 'published_draft' | 'published_ready' | 'publish_failed';
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
/** Independent review loops required beyond `minimumIndependentReviews`. */
|
|
130
|
-
extraLoopsRequested: number;
|
|
131
|
-
/** V2 counts the first configured loop in the minimum, not again as an extra. */
|
|
132
|
-
countingVersion?: 2;
|
|
130
|
+
/** Publication count policy. Rechecking a review never creates another counted review. */
|
|
131
|
+
export interface ReviewPolicy {
|
|
132
|
+
minimumReviews: number;
|
|
133
133
|
requestedBy: 'dispatch' | 'human-gate' | 'agent-gate';
|
|
134
134
|
}
|
|
135
|
-
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
135
|
+
/** Session and diff range are selected together. A first review is COLD. */
|
|
136
|
+
export type ReviewMode = 'warm' | 'cold';
|
|
137
|
+
export declare const REVIEW_MODES: readonly ReviewMode[];
|
|
138
|
+
export declare const DEFAULT_REVIEW_MODE: ReviewMode;
|
|
139
|
+
export declare function isReviewMode(value: unknown): value is ReviewMode;
|
|
140
|
+
/** The only configurable review dimensions. Null explicitly selects the runner default. */
|
|
141
|
+
export interface ReviewSelection {
|
|
142
|
+
runner: string;
|
|
143
|
+
model: string | null;
|
|
144
|
+
effort: string | null;
|
|
145
|
+
mode: ReviewMode;
|
|
146
|
+
}
|
|
147
|
+
/** Ordered reviewer selections. Array order is the execution order. */
|
|
148
|
+
export type ReviewSequence = ReviewSelection[];
|
|
149
|
+
/** Trusted request provenance, separate from the four configurable choices. */
|
|
150
|
+
export interface ReviewContinuationContext {
|
|
151
|
+
repository: string;
|
|
152
|
+
prNumber: number;
|
|
153
|
+
reviewId: string;
|
|
154
|
+
}
|
|
155
|
+
/** Context rows align with the complete sequence, including the first request row. */
|
|
156
|
+
export interface ReviewRequestContext {
|
|
157
|
+
reviewLineages: Array<ReviewContinuationContext | null>;
|
|
158
|
+
}
|
|
159
|
+
/** One gate receipt contains the first selection and any remaining ordered selections. */
|
|
160
|
+
export interface ReviewRequestPayload extends ReviewSelection {
|
|
161
|
+
sequence?: ReviewSequence;
|
|
162
|
+
context?: ReviewRequestContext;
|
|
163
|
+
}
|
|
146
164
|
export type ReviewValidationDepth = 'static-code' | 'full-live';
|
|
147
|
-
export type ReviewScope = 'incremental' | 'full';
|
|
148
|
-
export declare const REVIEW_SCOPES: readonly ReviewScope[];
|
|
149
|
-
export declare function isReviewScope(value: unknown): value is ReviewScope;
|
|
150
165
|
export declare const REVIEW_VALIDATION_DEPTHS: readonly ReviewValidationDepth[];
|
|
151
166
|
export declare function isReviewValidationDepth(value: unknown): value is ReviewValidationDepth;
|
|
152
167
|
export declare function reviewValidationDepthForLoop(_index: number, _total: number): ReviewValidationDepth;
|
|
153
|
-
/**
|
|
154
|
-
export type
|
|
155
|
-
|
|
156
|
-
export type ReviewSessionContinuity = 'fresh' | 'resumed' | 'fallback-fresh' | 'resume-unconfirmed';
|
|
157
|
-
export type ReviewSessionFallbackReason = 'unsupported-runner' | 'slot-mismatch' | 'runner-mismatch' | 'model-mismatch' | 'missing-session' | 'session-unavailable';
|
|
168
|
+
/** Observed launch provenance, kept separate from user selection. */
|
|
169
|
+
export type ReviewSessionContinuity = 'fresh' | 'resumed' | 'resume-unconfirmed' | 'refused';
|
|
170
|
+
export type ReviewSessionRefusalReason = 'unsupported-runner' | 'repository-mismatch' | 'pr-mismatch' | 'slot-mismatch' | 'runner-mismatch' | 'model-mismatch' | 'effort-mismatch' | 'missing-session' | 'missing-reviewed-head' | 'session-busy' | 'session-unavailable';
|
|
158
171
|
export interface ReviewSessionTrace {
|
|
159
|
-
|
|
172
|
+
mode: ReviewMode;
|
|
160
173
|
continuity: ReviewSessionContinuity;
|
|
174
|
+
/** Durable reviewer lineage, independent of retry and run IDs. */
|
|
175
|
+
reviewId?: string;
|
|
176
|
+
repository?: string;
|
|
177
|
+
prNumber?: number;
|
|
178
|
+
lastReviewedHeadSha?: string;
|
|
179
|
+
runner?: string;
|
|
180
|
+
model?: string | null;
|
|
181
|
+
effort?: string | null;
|
|
161
182
|
priorRunId?: string;
|
|
162
183
|
priorSessionId?: string;
|
|
163
184
|
sessionId?: string;
|
|
164
|
-
|
|
185
|
+
refusalReason?: ReviewSessionRefusalReason;
|
|
165
186
|
}
|
|
166
187
|
/** Frozen summary for one run in a repeated-PR review chain. */
|
|
167
188
|
export interface ReviewChainEntry {
|
|
@@ -173,7 +194,7 @@ export interface ReviewChainEntry {
|
|
|
173
194
|
prNumber: number;
|
|
174
195
|
baseSha?: string;
|
|
175
196
|
headSha?: string;
|
|
176
|
-
|
|
197
|
+
mode: ReviewMode;
|
|
177
198
|
validationDepth: ReviewValidationDepth;
|
|
178
199
|
verdict: string;
|
|
179
200
|
unresolvedCount: number | null;
|
|
@@ -188,7 +209,6 @@ export interface RepeatReviewContext {
|
|
|
188
209
|
version: 1;
|
|
189
210
|
chainId: string;
|
|
190
211
|
generation: number;
|
|
191
|
-
contextMode: 'reuse' | 'fresh';
|
|
192
212
|
priorRunId: string;
|
|
193
213
|
priorFamilyId: string;
|
|
194
214
|
repository: string;
|
|
@@ -197,31 +217,19 @@ export interface RepeatReviewContext {
|
|
|
197
217
|
currentHeadSha: string;
|
|
198
218
|
baseRef?: string;
|
|
199
219
|
verdict: string;
|
|
200
|
-
unresolvedFindings:
|
|
220
|
+
unresolvedFindings: ReviewIssue[];
|
|
201
221
|
artifactRefs: EvidenceManifestEntry[];
|
|
202
222
|
farmslotEvidenceRefs: EvidenceManifestEntry[];
|
|
203
223
|
originatingRunId?: string;
|
|
204
|
-
|
|
224
|
+
mode: ReviewMode;
|
|
205
225
|
validationDepth: ReviewValidationDepth;
|
|
206
|
-
|
|
207
|
-
/** Incremental may resume; every full review resets reviewer reasoning. */
|
|
208
|
-
sessionIntent?: ReviewSessionIntent;
|
|
226
|
+
warmUnavailableReason?: string;
|
|
209
227
|
/** Dispatch-time observation of the requested reviewer-session transition. */
|
|
210
228
|
session?: ReviewSessionTrace;
|
|
211
229
|
/** Completed predecessors, oldest first. The current run is derived from this Run record. */
|
|
212
230
|
priorGenerations?: ReviewChainEntry[];
|
|
213
231
|
}
|
|
214
|
-
export
|
|
215
|
-
order: number;
|
|
216
|
-
runner: 'same' | ReviewRunnerId;
|
|
217
|
-
model?: string | null;
|
|
218
|
-
/** Reasoning / thinking level for this reviewer. Runner-specific (Codex, Grok, PI). */
|
|
219
|
-
effort?: string | null;
|
|
220
|
-
validationDepth?: ReviewValidationDepth;
|
|
221
|
-
/** Resume this run's reviewer context, or reset it before this review generation. */
|
|
222
|
-
sessionIntent?: ReviewSessionIntent;
|
|
223
|
-
}
|
|
224
|
-
export type ReviewRunnerId = 'claude' | 'codex' | 'cursor' | 'grok' | 'opencode' | 'pi';
|
|
232
|
+
export type ReviewRunnerId = string;
|
|
225
233
|
export interface DiffStat {
|
|
226
234
|
files: number;
|
|
227
235
|
additions: number;
|
|
@@ -283,17 +291,19 @@ export interface ReviewLoopTimelineSegment {
|
|
|
283
291
|
startedAt: string;
|
|
284
292
|
completedAt?: string;
|
|
285
293
|
durationMs?: number;
|
|
286
|
-
verdict?:
|
|
294
|
+
verdict?: ReviewAttempt['verdict'];
|
|
287
295
|
unresolvedCount?: number;
|
|
288
296
|
artifactPaths?: string[];
|
|
289
297
|
}
|
|
290
|
-
export interface
|
|
298
|
+
export interface ReviewAttempt {
|
|
299
|
+
mode: ReviewMode;
|
|
300
|
+
session?: ReviewSessionTrace;
|
|
291
301
|
loopNumber: number;
|
|
292
302
|
verdict: 'pending' | 'pass' | 'issues' | 'failed' | 'cancelled' | 'skipped';
|
|
293
303
|
unresolvedCount: number;
|
|
294
304
|
/** Transport/lifecycle explanation when a review did not complete normally. */
|
|
295
305
|
reason?: string;
|
|
296
|
-
issues?:
|
|
306
|
+
issues?: ReviewIssue[];
|
|
297
307
|
validationDepth?: ReviewValidationDepth;
|
|
298
308
|
usage?: RunnerSessionUsage;
|
|
299
309
|
/** Checklist marks and timings captured from this review round's role-scoped signal. */
|
|
@@ -306,21 +316,23 @@ export interface IndependentReviewAttempt {
|
|
|
306
316
|
startedAt?: string;
|
|
307
317
|
completedAt?: string;
|
|
308
318
|
}
|
|
309
|
-
export interface
|
|
319
|
+
export interface ReviewStatus {
|
|
310
320
|
id: string;
|
|
311
|
-
source?: 'dispatch' | 'human-gate' | '
|
|
321
|
+
source?: 'dispatch' | 'human-gate' | 'pipeline';
|
|
312
322
|
runner?: string | null;
|
|
313
323
|
model?: string | null;
|
|
314
324
|
/** Reasoning / thinking level this reviewer launched with. */
|
|
315
325
|
effort?: string | null;
|
|
326
|
+
mode: ReviewMode;
|
|
327
|
+
/** Verified review-session and exact-PR provenance, supplied by the runtime. */
|
|
328
|
+
session?: ReviewSessionTrace;
|
|
316
329
|
reviewerSessionId?: string | null;
|
|
317
|
-
crossRunner: boolean;
|
|
318
330
|
loopNumber: number;
|
|
319
331
|
verdict: 'pending' | 'pass' | 'issues' | 'failed' | 'cancelled' | 'skipped';
|
|
320
332
|
unresolvedCount: number;
|
|
321
333
|
/** Transport/lifecycle explanation when a review did not complete normally. */
|
|
322
334
|
reason?: string;
|
|
323
|
-
issues?:
|
|
335
|
+
issues?: ReviewIssue[];
|
|
324
336
|
validationDepth?: ReviewValidationDepth;
|
|
325
337
|
usage?: RunnerSessionUsage;
|
|
326
338
|
feedbackSent?: boolean;
|
|
@@ -328,11 +340,11 @@ export interface IndependentReviewStatus {
|
|
|
328
340
|
recoveryContinuationPending?: boolean;
|
|
329
341
|
/** Worker-fix attempts already consumed in this review loop. */
|
|
330
342
|
retryCount?: number;
|
|
331
|
-
/** Effective worker-fix cap for this loop (`
|
|
343
|
+
/** Effective worker-fix cap for this loop (`review.max_retries`, raised if Continue Fixing authorizes another pass). */
|
|
332
344
|
maxRetries?: number;
|
|
333
345
|
/** True when the loop stopped because retryCount reached maxRetries with findings still open. */
|
|
334
346
|
maxRetriesExhausted?: boolean;
|
|
335
|
-
attempts?:
|
|
347
|
+
attempts?: ReviewAttempt[];
|
|
336
348
|
artifactPaths?: string[];
|
|
337
349
|
taskProgressArtifactPath?: string;
|
|
338
350
|
timeline?: ReviewLoopTimelineSegment[];
|
|
@@ -385,7 +397,7 @@ export type GateSummaryKind = (typeof GATE_SUMMARY_KINDS)[keyof typeof GATE_SUMM
|
|
|
385
397
|
* review outcomes are the headline; token cost is a supporting section.
|
|
386
398
|
*
|
|
387
399
|
* Built by `buildGateSummary` in the gateway by *projecting* already-captured
|
|
388
|
-
* state ({@link
|
|
400
|
+
* state ({@link ReviewStatus}, {@link RunMetrics}, family runs) — it
|
|
389
401
|
* does not re-derive review state or re-read artifacts.
|
|
390
402
|
*/
|
|
391
403
|
export interface GateSummary {
|
|
@@ -394,7 +406,7 @@ export interface GateSummary {
|
|
|
394
406
|
flowType?: FlowType;
|
|
395
407
|
/** Who owns/authorizes the gate and why (reused from the gate policy). */
|
|
396
408
|
gatePolicy?: GatePolicy;
|
|
397
|
-
/** One-line human narrative, e.g. "Worker done in 55 turns;
|
|
409
|
+
/** One-line human narrative, e.g. "Worker done in 55 turns; review skipped (lightweight dev); 0 reviews triggered re-work." */
|
|
398
410
|
headline?: string;
|
|
399
411
|
worker: {
|
|
400
412
|
model: string | null;
|
|
@@ -440,9 +452,9 @@ export interface GateSummary {
|
|
|
440
452
|
custom?: Record<string, unknown>;
|
|
441
453
|
capturedAt?: string;
|
|
442
454
|
}
|
|
443
|
-
/** Review outcomes for a gate, projected from
|
|
455
|
+
/** Review outcomes for a gate, projected from review + reviews. */
|
|
444
456
|
export interface ReviewSummary {
|
|
445
|
-
|
|
457
|
+
review?: {
|
|
446
458
|
status: 'skipped' | 'done' | 'failed' | 'pending';
|
|
447
459
|
/** Descriptive reason when skipped/failed, e.g. "disabled-lightweight-dev-flow". */
|
|
448
460
|
reason?: string;
|
|
@@ -452,13 +464,12 @@ export interface ReviewSummary {
|
|
|
452
464
|
triggeredReWork: boolean;
|
|
453
465
|
artifactPaths?: string[];
|
|
454
466
|
};
|
|
455
|
-
/** Projected from {@link
|
|
456
|
-
|
|
467
|
+
/** Projected from {@link ReviewStatus} — outcome-first, no raw artifacts. */
|
|
468
|
+
reviews: Array<{
|
|
457
469
|
id: string;
|
|
458
|
-
source?: 'dispatch' | 'human-gate' | '
|
|
470
|
+
source?: 'dispatch' | 'human-gate' | 'pipeline';
|
|
459
471
|
runner?: string | null;
|
|
460
472
|
model?: string | null;
|
|
461
|
-
crossRunner: boolean;
|
|
462
473
|
loopNumber: number;
|
|
463
474
|
verdict: 'pending' | 'pass' | 'issues' | 'failed' | 'cancelled' | 'skipped';
|
|
464
475
|
unresolvedCount: number;
|
|
@@ -470,7 +481,7 @@ export interface ReviewSummary {
|
|
|
470
481
|
startedAt?: string;
|
|
471
482
|
completedAt?: string;
|
|
472
483
|
}>;
|
|
473
|
-
/** Reviews required by the gate's {@link
|
|
484
|
+
/** Reviews required by the gate's {@link ReviewPolicy}, if any. */
|
|
474
485
|
requiredReviews?: number;
|
|
475
486
|
passingReviews: number;
|
|
476
487
|
totalUnresolved: number;
|
|
@@ -489,7 +500,7 @@ export interface GateTokenSummary {
|
|
|
489
500
|
turns: number;
|
|
490
501
|
};
|
|
491
502
|
/**
|
|
492
|
-
* Per
|
|
503
|
+
* Per review (from {@link ReviewStatus.usage}). The
|
|
493
504
|
* input/output/cache split is present when the review's usage record carried
|
|
494
505
|
* it; older entries may only have `total`.
|
|
495
506
|
*/
|
|
@@ -560,7 +571,7 @@ export interface ReadyGatePrPackage {
|
|
|
560
571
|
remoteBranchRef?: string | null;
|
|
561
572
|
headSha?: string;
|
|
562
573
|
diffStat: DiffStat;
|
|
563
|
-
/** Exact worktree diff identity captured with the same scope as
|
|
574
|
+
/** Exact worktree diff identity captured with the same scope as reviews. */
|
|
564
575
|
reviewSnapshot?: ReviewDiffSnapshot;
|
|
565
576
|
draftTitle: string;
|
|
566
577
|
draftBody: string;
|
|
@@ -568,11 +579,13 @@ export interface ReadyGatePrPackage {
|
|
|
568
579
|
selectedEvidenceKeys?: string[];
|
|
569
580
|
validationSummaryPath?: string | null;
|
|
570
581
|
validationSummaryHash?: string | null;
|
|
582
|
+
/** Verified local command receipts for this package's source inputs, ADR-064. */
|
|
583
|
+
deterministicChecks?: DeterministicChecklistCheck[];
|
|
571
584
|
reviewArtifactIds: string[];
|
|
572
585
|
dispatchMode?: 'interactive' | 'autonomous' | 'validation';
|
|
573
586
|
gatePolicy: GatePolicy;
|
|
574
587
|
/** Frozen at package preparation time so approval/review policy cannot drift with config edits. */
|
|
575
|
-
|
|
588
|
+
reviewPolicy?: ReviewPolicy;
|
|
576
589
|
publicationTarget: PublicationTarget;
|
|
577
590
|
publicationStatus: PublicationStatus;
|
|
578
591
|
supersededByPackageId?: string | null;
|
|
@@ -589,6 +602,7 @@ export interface ReadyGateInputSnapshot {
|
|
|
589
602
|
}
|
|
590
603
|
export interface ReadyGatePayload {
|
|
591
604
|
kind: 'ready';
|
|
605
|
+
gateReadiness?: RunGateReadiness;
|
|
592
606
|
prNumber: number | null;
|
|
593
607
|
repo: string | null;
|
|
594
608
|
diffStat: DiffStat;
|
|
@@ -607,8 +621,8 @@ export interface ReadyGatePayload {
|
|
|
607
621
|
recipeQualityArtifact?: RecipeQualityArtifact | null;
|
|
608
622
|
qualityReport?: EvidenceQualityReport | null;
|
|
609
623
|
artifactManifest?: EvidenceManifestEntry[];
|
|
610
|
-
|
|
611
|
-
|
|
624
|
+
reviewVerdict?: string;
|
|
625
|
+
reviewSummary?: string;
|
|
612
626
|
workerLearnings?: string;
|
|
613
627
|
ciChecks?: Array<{
|
|
614
628
|
name: string;
|
|
@@ -638,8 +652,8 @@ export interface ReadyGatePayload {
|
|
|
638
652
|
body: string;
|
|
639
653
|
publishedAt?: string;
|
|
640
654
|
};
|
|
641
|
-
|
|
642
|
-
|
|
655
|
+
reviewPolicy?: ReviewPolicy;
|
|
656
|
+
reviews?: ReviewStatus[];
|
|
643
657
|
reviewLaunchRejection?: PublicationReviewLaunchRejection;
|
|
644
658
|
gatePolicy?: GatePolicy;
|
|
645
659
|
/** Consolidated "what happened to reach this gate" snapshot (worker → reviews → cost). */
|
|
@@ -685,6 +699,7 @@ export interface EvidenceRefreshOverrideRecord {
|
|
|
685
699
|
}
|
|
686
700
|
export interface NoChangeGatePayload {
|
|
687
701
|
kind: 'no-change';
|
|
702
|
+
gateReadiness?: RunGateReadiness;
|
|
688
703
|
disposition: WorkerTerminalDisposition;
|
|
689
704
|
reason?: string;
|
|
690
705
|
evidence?: WorkerTerminalEvidence;
|
|
@@ -873,8 +888,8 @@ export interface RetrospectivePayload {
|
|
|
873
888
|
kind: 'retrospective';
|
|
874
889
|
outcome: 'success' | 'failure' | 'partial' | 'cancelled' | 'unknown';
|
|
875
890
|
whatThisIs: string;
|
|
876
|
-
|
|
877
|
-
|
|
891
|
+
reviewVerdict?: string;
|
|
892
|
+
reviewSummary?: string;
|
|
878
893
|
workerLearnings?: string;
|
|
879
894
|
reportExcerpt?: string;
|
|
880
895
|
ciWatch?: {
|
|
@@ -1005,10 +1020,11 @@ export interface RunDecision {
|
|
|
1005
1020
|
triageAssessmentId?: string;
|
|
1006
1021
|
payload?: RunDecisionPayload;
|
|
1007
1022
|
/**
|
|
1008
|
-
*
|
|
1023
|
+
* Detail keys `run.list` left out because their values are large (review
|
|
1009
1024
|
* markdown, input snapshots, PR packages, artifact manifests). Absent on
|
|
1010
1025
|
* `run.get`, `run.forSlot` and every run event, which carry the full
|
|
1011
|
-
* payload;
|
|
1026
|
+
* payload/context; `context.checkSnapshot` also names omitted CI context.
|
|
1027
|
+
* A reader that needs one of these keys fetches the run directly.
|
|
1012
1028
|
*/
|
|
1013
1029
|
payloadTrimmed?: string[];
|
|
1014
1030
|
selectionData?: Record<string, unknown>;
|
|
@@ -2052,7 +2068,8 @@ export interface Run {
|
|
|
2052
2068
|
/** Code breadth for review-pr. Independent from runtime validation depth. */
|
|
2053
2069
|
/** Explicitly finish static review without waiting for operator questions/publication. */
|
|
2054
2070
|
reviewAutoFinish?: boolean;
|
|
2055
|
-
|
|
2071
|
+
reviewMode?: ReviewMode;
|
|
2072
|
+
reviewContext?: ReviewRequestContext;
|
|
2056
2073
|
/** Static by default; full-live is an explicit operator escalation. */
|
|
2057
2074
|
reviewValidationDepth?: ReviewValidationDepth;
|
|
2058
2075
|
/** Frozen provenance for a repeated review of the same canonical PR. */
|
|
@@ -2125,13 +2142,13 @@ export declare function isInteractiveDevRun(run: Pick<Run, 'flowType' | 'mode'>)
|
|
|
2125
2142
|
/** Persisted run-engine state — see ADR-027. */
|
|
2126
2143
|
export interface RunEngineState {
|
|
2127
2144
|
/**
|
|
2128
|
-
* What the last passing review (pipeline
|
|
2145
|
+
* What the last passing review (pipeline review or a publication review)
|
|
2129
2146
|
* judged on the slot: HEAD, the evidence manifest and the evidence files. When
|
|
2130
|
-
* any of them changes,
|
|
2147
|
+
* any of them changes, review must run again before publication is
|
|
2131
2148
|
* approved; the PR description is not part of it. Records taken while the
|
|
2132
2149
|
* description was still included keep matching until HEAD or evidence changes,
|
|
2133
|
-
* except that a description edit on such a record re-runs
|
|
2134
|
-
* `rerunFor` is the changed state
|
|
2150
|
+
* except that a description edit on such a record re-runs review once.
|
|
2151
|
+
* `rerunFor` is the changed state review already ran again for, so it runs
|
|
2135
2152
|
* once per change.
|
|
2136
2153
|
*/
|
|
2137
2154
|
reviewedInputs?: {
|
|
@@ -2199,11 +2216,12 @@ export interface RunEngineState {
|
|
|
2199
2216
|
publicationTarget?: PublicationTarget;
|
|
2200
2217
|
publicationStatus?: PublicationStatus;
|
|
2201
2218
|
prNumber?: number | null;
|
|
2202
|
-
|
|
2203
|
-
|
|
2219
|
+
reviewPolicy?: ReviewPolicy;
|
|
2220
|
+
reviewSequence?: ReviewSequence;
|
|
2221
|
+
reviewSequenceContext?: ReviewRequestContext;
|
|
2204
2222
|
/** Creation time for the current pending plan, used to ignore reviews from earlier work orders. */
|
|
2205
|
-
|
|
2206
|
-
|
|
2223
|
+
reviewSequenceRequestedAt?: string;
|
|
2224
|
+
reviews?: ReviewStatus[];
|
|
2207
2225
|
/** Latest recoverable refusal to launch a publication reviewer. */
|
|
2208
2226
|
reviewLaunchRejection?: PublicationReviewLaunchRejection;
|
|
2209
2227
|
supersededPackageIds?: string[];
|
|
@@ -2293,7 +2311,7 @@ export interface FamilyDiffProvenance {
|
|
|
2293
2311
|
error?: string;
|
|
2294
2312
|
repository?: string;
|
|
2295
2313
|
prNumber?: number;
|
|
2296
|
-
|
|
2314
|
+
reviewMode?: ReviewMode;
|
|
2297
2315
|
}
|
|
2298
2316
|
export declare function isFamilyDiffProvenance(value: unknown): value is FamilyDiffProvenance;
|
|
2299
2317
|
export interface FamilyInputCommitMetadata {
|
|
@@ -2303,7 +2321,7 @@ export interface FamilyInputCommitMetadata {
|
|
|
2303
2321
|
baseSha?: string;
|
|
2304
2322
|
headRef?: string;
|
|
2305
2323
|
headSha?: string;
|
|
2306
|
-
|
|
2324
|
+
reviewMode?: ReviewMode;
|
|
2307
2325
|
capturedAt: string;
|
|
2308
2326
|
source: 'github-pr' | 'local-git' | 'unavailable';
|
|
2309
2327
|
missingReason?: string;
|
|
@@ -2425,7 +2443,7 @@ export declare function normalizeFlowType(value: string | null | undefined): Flo
|
|
|
2425
2443
|
export declare function normalizeCiActionId(actionId: string): string;
|
|
2426
2444
|
export type DevInteractiveProfile = 'lightweight' | 'reviewed';
|
|
2427
2445
|
export declare const DEFAULT_DEV_INTERACTIVE_PROFILE: DevInteractiveProfile;
|
|
2428
|
-
export type DevInteractiveCompletionAction = 'done-no-pr' | 'detect-pr-and-ci-watch' | 'link-pr-and-ci-watch' | 'link-pr-and-pr-complete' | 'run-
|
|
2446
|
+
export type DevInteractiveCompletionAction = 'done-no-pr' | 'detect-pr-and-ci-watch' | 'link-pr-and-ci-watch' | 'link-pr-and-pr-complete' | 'run-review' | 'blocked' | 'failed' | 'abort';
|
|
2429
2447
|
export interface DevInteractiveActionRecord {
|
|
2430
2448
|
action: DevInteractiveCompletionAction;
|
|
2431
2449
|
source: 'operator';
|
|
@@ -2441,7 +2459,7 @@ export declare const PipelineSteps: {
|
|
|
2441
2459
|
readonly PREPARE: "prepare";
|
|
2442
2460
|
readonly DISPATCH: "dispatch";
|
|
2443
2461
|
readonly MONITOR: "monitor";
|
|
2444
|
-
readonly
|
|
2462
|
+
readonly REVIEW: "review";
|
|
2445
2463
|
readonly COMPLETE: "complete";
|
|
2446
2464
|
readonly HUMAN_GATE: "human-gate";
|
|
2447
2465
|
readonly FINALIZE: "finalize";
|