@patronage/software-factory 1.0.0-alpha.47 → 1.0.0-alpha.48
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/README.md +3 -1
- package/dist/cloud/gh-shim.mjs +1026 -0
- package/dist/cloud/run.sh +74 -0
- package/dist/cloud/session-env.sh +75 -0
- package/dist/index.d.ts +71 -402
- package/dist/index.js +295 -185
- package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
- package/dist/schemas.d.ts +8 -0
- package/dist/schemas.js +66 -63
- package/package.json +15 -14
- package/dist/rolldown-runtime-D8jQpDG7.js +0 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
3
|
-
import { PreviewProofRegistration } from "@patronage/factory-ci";
|
|
4
2
|
import { z } from "zod";
|
|
3
|
+
import { PreviewProofRegistration } from "@patronage/factory-ci";
|
|
4
|
+
import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
5
5
|
/**
|
|
6
6
|
* The opt-in broker permission set (#1360): `actions: read`, `checks: read`,
|
|
7
7
|
* `contents: read`, `issues: read`, and `pull_requests: write` on the
|
|
@@ -75,8 +75,9 @@ interface FactoryAppAccessDependencies {
|
|
|
75
75
|
/**
|
|
76
76
|
* The GitHub calls a Cursor VM's own `gh` credential cannot make (#1327).
|
|
77
77
|
* Cursor mints the VM token without `pull_requests: write` or `issues`, so on
|
|
78
|
-
* a Cursor managed runtime pull request creation, body edits,
|
|
79
|
-
* and the PR status HUD's pull
|
|
78
|
+
* a Cursor managed runtime pull request creation, body edits, the
|
|
79
|
+
* `factory:hold` label (#1653), issue reads, and the PR status HUD's pull
|
|
80
|
+
* request read use the broker's admission token.
|
|
80
81
|
* Its scope is `actions: read`, `checks: read`, `contents: read`,
|
|
81
82
|
* `issues: read`, and `pull_requests: write` (#1360, #1375, #1457).
|
|
82
83
|
* Contents read supports creation's head and base ref reads; checks and
|
|
@@ -85,7 +86,7 @@ interface FactoryAppAccessDependencies {
|
|
|
85
86
|
* retry with a different identity. Push, marking ready, arming auto-merge,
|
|
86
87
|
* check-run writes, and other calls keep their own credential.
|
|
87
88
|
*/
|
|
88
|
-
type AdmissionOperation = "create-pull-request" | "edit-pull-request-body" | "read-pull-request" | "read-issue" | "read-pull-request-for-status-hud";
|
|
89
|
+
type AdmissionOperation = "add-hold-label" | "create-pull-request" | "edit-pull-request-body" | "read-pull-request" | "read-issue" | "read-pull-request-for-status-hud";
|
|
89
90
|
/** The one repository the admission token is minted for. */
|
|
90
91
|
interface AdmissionRepository {
|
|
91
92
|
owner: string;
|
|
@@ -1550,6 +1551,7 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
|
|
|
1550
1551
|
conditional: z.ZodArray<z.ZodObject<{
|
|
1551
1552
|
paths: z.ZodArray<z.ZodString>;
|
|
1552
1553
|
}, z.core.$strict>>;
|
|
1554
|
+
roundsWithoutWaiver: z.ZodOptional<z.ZodNumber>;
|
|
1553
1555
|
}, z.core.$strict>>;
|
|
1554
1556
|
schemaVersion: z.ZodLiteral<6>;
|
|
1555
1557
|
verification: z.ZodObject<{
|
|
@@ -1760,6 +1762,13 @@ interface PrVerifyProof {
|
|
|
1760
1762
|
* not move.
|
|
1761
1763
|
*/
|
|
1762
1764
|
runner?: PrVerifyRunner;
|
|
1765
|
+
/**
|
|
1766
|
+
* `whole-tree` when every command saw the whole tree as its run context
|
|
1767
|
+
* (#1658): the empty-tree base ref and every tracked path. Absent means the
|
|
1768
|
+
* commands saw the diff and may have scoped themselves to it. Only a
|
|
1769
|
+
* whole-tree proof can stand in for a merge target's hosted battery.
|
|
1770
|
+
*/
|
|
1771
|
+
runScope?: "whole-tree";
|
|
1763
1772
|
startedAt: string;
|
|
1764
1773
|
verificationCommands: PrVerifyCommandResult[];
|
|
1765
1774
|
}
|
|
@@ -2063,6 +2072,11 @@ interface PrVerifyCheckPayload {
|
|
|
2063
2072
|
proofSchemaVersion: number;
|
|
2064
2073
|
/** `<owner>/<name>` the proof was produced for. */
|
|
2065
2074
|
repository?: string;
|
|
2075
|
+
/**
|
|
2076
|
+
* `whole-tree` when every command saw the whole tree (#1658). The hosted
|
|
2077
|
+
* gate reuses a proof on a merge-target push only when it says so.
|
|
2078
|
+
*/
|
|
2079
|
+
runScope?: "whole-tree";
|
|
2066
2080
|
/** Version of *this* payload shape. */
|
|
2067
2081
|
schemaVersion: typeof PR_VERIFY_CHECK_PAYLOAD_SCHEMA_VERSION;
|
|
2068
2082
|
/** The proof's command-to-impact-target bindings used to validate releases. */
|
|
@@ -2480,12 +2494,34 @@ type CandidatePullRequestLookup = {
|
|
|
2480
2494
|
reason: string;
|
|
2481
2495
|
status: "unavailable";
|
|
2482
2496
|
};
|
|
2497
|
+
interface RunCommandResult {
|
|
2498
|
+
stderr: string;
|
|
2499
|
+
stdout: string;
|
|
2500
|
+
}
|
|
2501
|
+
declare function runCapture(command: string, args: string[], cwd: string, options?: {
|
|
2502
|
+
acceptableExitCodes?: readonly number[];
|
|
2503
|
+
/**
|
|
2504
|
+
* Variables for this one subprocess only, over the inherited environment.
|
|
2505
|
+
* The admission token rides here (#1327), never on `process.env`.
|
|
2506
|
+
*/
|
|
2507
|
+
extraEnv?: Readonly<Record<string, string>>;
|
|
2508
|
+
/**
|
|
2509
|
+
* Overrides the default ten-minute bound for a command known to run
|
|
2510
|
+
* longer. Prefer this to raising the default for every caller.
|
|
2511
|
+
*/
|
|
2512
|
+
timeoutMs?: number;
|
|
2513
|
+
}): RunCommandResult;
|
|
2483
2514
|
interface HoldPullRequestInput {
|
|
2484
2515
|
cwd: string;
|
|
2485
2516
|
owner: string;
|
|
2486
2517
|
pr: number;
|
|
2487
2518
|
repo: string;
|
|
2488
2519
|
}
|
|
2520
|
+
interface HoldPullRequestDependencies {
|
|
2521
|
+
/** Defaults to the process-wide admission credential. */
|
|
2522
|
+
admission?: AdmissionCredential | undefined;
|
|
2523
|
+
run?: typeof runCapture;
|
|
2524
|
+
}
|
|
2489
2525
|
export declare const MERGE_FREEZE_CHECK_NAME = "patronage-factory/merge-freeze";
|
|
2490
2526
|
/**
|
|
2491
2527
|
* The Factory App's slug, as GitHub serves it on the runs the writer posts.
|
|
@@ -3202,7 +3238,7 @@ interface PrReadyDependencies {
|
|
|
3202
3238
|
*/
|
|
3203
3239
|
armingPolicy?: ArmingPolicyReads;
|
|
3204
3240
|
/** Applies `factory:hold` for `--hold` (#1513). Defaults to the REST call. */
|
|
3205
|
-
holdPullRequest?: (input: HoldPullRequestInput) => Promise<void> | void;
|
|
3241
|
+
holdPullRequest?: (input: HoldPullRequestInput, dependencies?: HoldPullRequestDependencies) => Promise<void> | void;
|
|
3206
3242
|
/**
|
|
3207
3243
|
* Reads the authoritative base review policy (#922): the profile committed at
|
|
3208
3244
|
* the live tip of the PR's own base ref. Defaults to the real GitHub reads,
|
|
@@ -3473,6 +3509,11 @@ interface PrVerifyGitDependencies {
|
|
|
3473
3509
|
checkoutRepository?: (cwd: string) => CheckoutRepository;
|
|
3474
3510
|
currentHeadSha: (cwd: string) => string;
|
|
3475
3511
|
emptyTreeHash: (cwd: string) => string;
|
|
3512
|
+
/**
|
|
3513
|
+
* Every path tracked at `ref` (#1658). Optional so existing fakes stay
|
|
3514
|
+
* valid; absent, the run never claims `runScope: "whole-tree"`.
|
|
3515
|
+
*/
|
|
3516
|
+
trackedFilesAt?: (cwd: string, ref: string) => string[];
|
|
3476
3517
|
/** Bring `refs/heads/<refName>` from origin into the checkout (#1132). */
|
|
3477
3518
|
fetchOriginRef?: (cwd: string, refName: string) => void;
|
|
3478
3519
|
mergeBaseSha: (cwd: string, base: string) => string;
|
|
@@ -4102,402 +4143,6 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
4102
4143
|
typeVersion: 1;
|
|
4103
4144
|
}>];
|
|
4104
4145
|
type FactoryTraceEvent = FactoryTraceEventFromDefinitions<typeof FACTORY_TRACE_EVENT_DEFINITIONS>;
|
|
4105
|
-
declare const { appendFactoryTraceEventSchema: AppendFactoryTraceEventSchema, factoryTraceEventSchema: FactoryTraceEventSchema, payloadSchemaRegistry, payloadVersions: FACTORY_TRACE_PAYLOAD_VERSIONS, wirePayloadFor }: {
|
|
4106
|
-
appendFactoryTraceEventSchema: z.ZodType<{
|
|
4107
|
-
createdAt: string;
|
|
4108
|
-
eventId: string;
|
|
4109
|
-
issue?: number | undefined;
|
|
4110
|
-
pr?: number | undefined;
|
|
4111
|
-
repo: string;
|
|
4112
|
-
schemaVersion: 1;
|
|
4113
|
-
threadId?: string | undefined;
|
|
4114
|
-
workerId?: string | undefined;
|
|
4115
|
-
base: string;
|
|
4116
|
-
changedFiles: string[];
|
|
4117
|
-
headSha: string;
|
|
4118
|
-
maxReviewCycles: number;
|
|
4119
|
-
observedAt: string;
|
|
4120
|
-
outcome: "not-required";
|
|
4121
|
-
patchId: string;
|
|
4122
|
-
reason: "faithful-merge" | "no-applicable-mode";
|
|
4123
|
-
reviewCycle: number;
|
|
4124
|
-
eventType: "review-gate";
|
|
4125
|
-
typeVersion: 1;
|
|
4126
|
-
} | {
|
|
4127
|
-
createdAt: string;
|
|
4128
|
-
eventId: string;
|
|
4129
|
-
issue?: number | undefined;
|
|
4130
|
-
pr?: number | undefined;
|
|
4131
|
-
repo: string;
|
|
4132
|
-
schemaVersion: 1;
|
|
4133
|
-
threadId?: string | undefined;
|
|
4134
|
-
workerId?: string | undefined;
|
|
4135
|
-
cycle: number;
|
|
4136
|
-
cyclesToClean?: number | undefined;
|
|
4137
|
-
engine?: string | undefined;
|
|
4138
|
-
findingsSummary: {
|
|
4139
|
-
blocking: number;
|
|
4140
|
-
bySeverity: {
|
|
4141
|
-
critical: number;
|
|
4142
|
-
high: number;
|
|
4143
|
-
low: number;
|
|
4144
|
-
medium: number;
|
|
4145
|
-
unknown: number;
|
|
4146
|
-
};
|
|
4147
|
-
flagged: number;
|
|
4148
|
-
open: number;
|
|
4149
|
-
staleRepeats: number;
|
|
4150
|
-
};
|
|
4151
|
-
forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
|
|
4152
|
-
headSha?: string | undefined;
|
|
4153
|
-
model?: string | undefined;
|
|
4154
|
-
observedAt: string;
|
|
4155
|
-
patchId?: string | undefined;
|
|
4156
|
-
session?: {
|
|
4157
|
-
orchestrationMode?: "autonomous" | "manual" | undefined;
|
|
4158
|
-
resumedSession?: boolean | undefined;
|
|
4159
|
-
runtime?: string | undefined;
|
|
4160
|
-
sessionId?: string | undefined;
|
|
4161
|
-
} | undefined;
|
|
4162
|
-
stage: "gate" | "interior";
|
|
4163
|
-
usage?: {
|
|
4164
|
-
estimatedCostUsd?: number | undefined;
|
|
4165
|
-
source?: string | undefined;
|
|
4166
|
-
totalTokens?: number | undefined;
|
|
4167
|
-
} | undefined;
|
|
4168
|
-
eventType: "review-ladder-stage";
|
|
4169
|
-
typeVersion: 1;
|
|
4170
|
-
}, unknown, z.core.$ZodTypeInternals<{
|
|
4171
|
-
createdAt: string;
|
|
4172
|
-
eventId: string;
|
|
4173
|
-
issue?: number | undefined;
|
|
4174
|
-
pr?: number | undefined;
|
|
4175
|
-
repo: string;
|
|
4176
|
-
schemaVersion: 1;
|
|
4177
|
-
threadId?: string | undefined;
|
|
4178
|
-
workerId?: string | undefined;
|
|
4179
|
-
base: string;
|
|
4180
|
-
changedFiles: string[];
|
|
4181
|
-
headSha: string;
|
|
4182
|
-
maxReviewCycles: number;
|
|
4183
|
-
observedAt: string;
|
|
4184
|
-
outcome: "not-required";
|
|
4185
|
-
patchId: string;
|
|
4186
|
-
reason: "faithful-merge" | "no-applicable-mode";
|
|
4187
|
-
reviewCycle: number;
|
|
4188
|
-
eventType: "review-gate";
|
|
4189
|
-
typeVersion: 1;
|
|
4190
|
-
} | {
|
|
4191
|
-
createdAt: string;
|
|
4192
|
-
eventId: string;
|
|
4193
|
-
issue?: number | undefined;
|
|
4194
|
-
pr?: number | undefined;
|
|
4195
|
-
repo: string;
|
|
4196
|
-
schemaVersion: 1;
|
|
4197
|
-
threadId?: string | undefined;
|
|
4198
|
-
workerId?: string | undefined;
|
|
4199
|
-
cycle: number;
|
|
4200
|
-
cyclesToClean?: number | undefined;
|
|
4201
|
-
engine?: string | undefined;
|
|
4202
|
-
findingsSummary: {
|
|
4203
|
-
blocking: number;
|
|
4204
|
-
bySeverity: {
|
|
4205
|
-
critical: number;
|
|
4206
|
-
high: number;
|
|
4207
|
-
low: number;
|
|
4208
|
-
medium: number;
|
|
4209
|
-
unknown: number;
|
|
4210
|
-
};
|
|
4211
|
-
flagged: number;
|
|
4212
|
-
open: number;
|
|
4213
|
-
staleRepeats: number;
|
|
4214
|
-
};
|
|
4215
|
-
forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
|
|
4216
|
-
headSha?: string | undefined;
|
|
4217
|
-
model?: string | undefined;
|
|
4218
|
-
observedAt: string;
|
|
4219
|
-
patchId?: string | undefined;
|
|
4220
|
-
session?: {
|
|
4221
|
-
orchestrationMode?: "autonomous" | "manual" | undefined;
|
|
4222
|
-
resumedSession?: boolean | undefined;
|
|
4223
|
-
runtime?: string | undefined;
|
|
4224
|
-
sessionId?: string | undefined;
|
|
4225
|
-
} | undefined;
|
|
4226
|
-
stage: "gate" | "interior";
|
|
4227
|
-
usage?: {
|
|
4228
|
-
estimatedCostUsd?: number | undefined;
|
|
4229
|
-
source?: string | undefined;
|
|
4230
|
-
totalTokens?: number | undefined;
|
|
4231
|
-
} | undefined;
|
|
4232
|
-
eventType: "review-ladder-stage";
|
|
4233
|
-
typeVersion: 1;
|
|
4234
|
-
}, unknown>>;
|
|
4235
|
-
appendUnionSchemas: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[];
|
|
4236
|
-
definitionByKind: Record<string, {
|
|
4237
|
-
emit: (event: {
|
|
4238
|
-
createdAt: string;
|
|
4239
|
-
eventId: string;
|
|
4240
|
-
issue?: number | undefined;
|
|
4241
|
-
pr?: number | undefined;
|
|
4242
|
-
repo: string;
|
|
4243
|
-
schemaVersion: 1;
|
|
4244
|
-
threadId?: string | undefined;
|
|
4245
|
-
workerId?: string | undefined;
|
|
4246
|
-
base: string;
|
|
4247
|
-
changedFiles: string[];
|
|
4248
|
-
headSha: string;
|
|
4249
|
-
maxReviewCycles: number;
|
|
4250
|
-
observedAt: string;
|
|
4251
|
-
outcome: "not-required";
|
|
4252
|
-
patchId: string;
|
|
4253
|
-
reason: "faithful-merge" | "no-applicable-mode";
|
|
4254
|
-
reviewCycle: number;
|
|
4255
|
-
eventType: "review-gate";
|
|
4256
|
-
typeVersion: 1;
|
|
4257
|
-
} | {
|
|
4258
|
-
createdAt: string;
|
|
4259
|
-
eventId: string;
|
|
4260
|
-
issue?: number | undefined;
|
|
4261
|
-
pr?: number | undefined;
|
|
4262
|
-
repo: string;
|
|
4263
|
-
schemaVersion: 1;
|
|
4264
|
-
threadId?: string | undefined;
|
|
4265
|
-
workerId?: string | undefined;
|
|
4266
|
-
cycle: number;
|
|
4267
|
-
cyclesToClean?: number | undefined;
|
|
4268
|
-
engine?: string | undefined;
|
|
4269
|
-
findingsSummary: {
|
|
4270
|
-
blocking: number;
|
|
4271
|
-
bySeverity: {
|
|
4272
|
-
critical: number;
|
|
4273
|
-
high: number;
|
|
4274
|
-
low: number;
|
|
4275
|
-
medium: number;
|
|
4276
|
-
unknown: number;
|
|
4277
|
-
};
|
|
4278
|
-
flagged: number;
|
|
4279
|
-
open: number;
|
|
4280
|
-
staleRepeats: number;
|
|
4281
|
-
};
|
|
4282
|
-
forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
|
|
4283
|
-
headSha?: string | undefined;
|
|
4284
|
-
model?: string | undefined;
|
|
4285
|
-
observedAt: string;
|
|
4286
|
-
patchId?: string | undefined;
|
|
4287
|
-
session?: {
|
|
4288
|
-
orchestrationMode?: "autonomous" | "manual" | undefined;
|
|
4289
|
-
resumedSession?: boolean | undefined;
|
|
4290
|
-
runtime?: string | undefined;
|
|
4291
|
-
sessionId?: string | undefined;
|
|
4292
|
-
} | undefined;
|
|
4293
|
-
stage: "gate" | "interior";
|
|
4294
|
-
usage?: {
|
|
4295
|
-
estimatedCostUsd?: number | undefined;
|
|
4296
|
-
source?: string | undefined;
|
|
4297
|
-
totalTokens?: number | undefined;
|
|
4298
|
-
} | undefined;
|
|
4299
|
-
eventType: "review-ladder-stage";
|
|
4300
|
-
typeVersion: 1;
|
|
4301
|
-
}) => unknown;
|
|
4302
|
-
}>;
|
|
4303
|
-
factoryTraceEventSchema: z.ZodType<{
|
|
4304
|
-
createdAt: string;
|
|
4305
|
-
eventId: string;
|
|
4306
|
-
issue?: number | undefined;
|
|
4307
|
-
pr?: number | undefined;
|
|
4308
|
-
repo: string;
|
|
4309
|
-
schemaVersion: 1;
|
|
4310
|
-
threadId?: string | undefined;
|
|
4311
|
-
workerId?: string | undefined;
|
|
4312
|
-
base: string;
|
|
4313
|
-
changedFiles: string[];
|
|
4314
|
-
headSha: string;
|
|
4315
|
-
maxReviewCycles: number;
|
|
4316
|
-
observedAt: string;
|
|
4317
|
-
outcome: "not-required";
|
|
4318
|
-
patchId: string;
|
|
4319
|
-
reason: "faithful-merge" | "no-applicable-mode";
|
|
4320
|
-
reviewCycle: number;
|
|
4321
|
-
eventType: "review-gate";
|
|
4322
|
-
typeVersion: 1;
|
|
4323
|
-
} | {
|
|
4324
|
-
createdAt: string;
|
|
4325
|
-
eventId: string;
|
|
4326
|
-
issue?: number | undefined;
|
|
4327
|
-
pr?: number | undefined;
|
|
4328
|
-
repo: string;
|
|
4329
|
-
schemaVersion: 1;
|
|
4330
|
-
threadId?: string | undefined;
|
|
4331
|
-
workerId?: string | undefined;
|
|
4332
|
-
cycle: number;
|
|
4333
|
-
cyclesToClean?: number | undefined;
|
|
4334
|
-
engine?: string | undefined;
|
|
4335
|
-
findingsSummary: {
|
|
4336
|
-
blocking: number;
|
|
4337
|
-
bySeverity: {
|
|
4338
|
-
critical: number;
|
|
4339
|
-
high: number;
|
|
4340
|
-
low: number;
|
|
4341
|
-
medium: number;
|
|
4342
|
-
unknown: number;
|
|
4343
|
-
};
|
|
4344
|
-
flagged: number;
|
|
4345
|
-
open: number;
|
|
4346
|
-
staleRepeats: number;
|
|
4347
|
-
};
|
|
4348
|
-
forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
|
|
4349
|
-
headSha?: string | undefined;
|
|
4350
|
-
model?: string | undefined;
|
|
4351
|
-
observedAt: string;
|
|
4352
|
-
patchId?: string | undefined;
|
|
4353
|
-
session?: {
|
|
4354
|
-
orchestrationMode?: "autonomous" | "manual" | undefined;
|
|
4355
|
-
resumedSession?: boolean | undefined;
|
|
4356
|
-
runtime?: string | undefined;
|
|
4357
|
-
sessionId?: string | undefined;
|
|
4358
|
-
} | undefined;
|
|
4359
|
-
stage: "gate" | "interior";
|
|
4360
|
-
usage?: {
|
|
4361
|
-
estimatedCostUsd?: number | undefined;
|
|
4362
|
-
source?: string | undefined;
|
|
4363
|
-
totalTokens?: number | undefined;
|
|
4364
|
-
} | undefined;
|
|
4365
|
-
eventType: "review-ladder-stage";
|
|
4366
|
-
typeVersion: 1;
|
|
4367
|
-
}, unknown, z.core.$ZodTypeInternals<{
|
|
4368
|
-
createdAt: string;
|
|
4369
|
-
eventId: string;
|
|
4370
|
-
issue?: number | undefined;
|
|
4371
|
-
pr?: number | undefined;
|
|
4372
|
-
repo: string;
|
|
4373
|
-
schemaVersion: 1;
|
|
4374
|
-
threadId?: string | undefined;
|
|
4375
|
-
workerId?: string | undefined;
|
|
4376
|
-
base: string;
|
|
4377
|
-
changedFiles: string[];
|
|
4378
|
-
headSha: string;
|
|
4379
|
-
maxReviewCycles: number;
|
|
4380
|
-
observedAt: string;
|
|
4381
|
-
outcome: "not-required";
|
|
4382
|
-
patchId: string;
|
|
4383
|
-
reason: "faithful-merge" | "no-applicable-mode";
|
|
4384
|
-
reviewCycle: number;
|
|
4385
|
-
eventType: "review-gate";
|
|
4386
|
-
typeVersion: 1;
|
|
4387
|
-
} | {
|
|
4388
|
-
createdAt: string;
|
|
4389
|
-
eventId: string;
|
|
4390
|
-
issue?: number | undefined;
|
|
4391
|
-
pr?: number | undefined;
|
|
4392
|
-
repo: string;
|
|
4393
|
-
schemaVersion: 1;
|
|
4394
|
-
threadId?: string | undefined;
|
|
4395
|
-
workerId?: string | undefined;
|
|
4396
|
-
cycle: number;
|
|
4397
|
-
cyclesToClean?: number | undefined;
|
|
4398
|
-
engine?: string | undefined;
|
|
4399
|
-
findingsSummary: {
|
|
4400
|
-
blocking: number;
|
|
4401
|
-
bySeverity: {
|
|
4402
|
-
critical: number;
|
|
4403
|
-
high: number;
|
|
4404
|
-
low: number;
|
|
4405
|
-
medium: number;
|
|
4406
|
-
unknown: number;
|
|
4407
|
-
};
|
|
4408
|
-
flagged: number;
|
|
4409
|
-
open: number;
|
|
4410
|
-
staleRepeats: number;
|
|
4411
|
-
};
|
|
4412
|
-
forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
|
|
4413
|
-
headSha?: string | undefined;
|
|
4414
|
-
model?: string | undefined;
|
|
4415
|
-
observedAt: string;
|
|
4416
|
-
patchId?: string | undefined;
|
|
4417
|
-
session?: {
|
|
4418
|
-
orchestrationMode?: "autonomous" | "manual" | undefined;
|
|
4419
|
-
resumedSession?: boolean | undefined;
|
|
4420
|
-
runtime?: string | undefined;
|
|
4421
|
-
sessionId?: string | undefined;
|
|
4422
|
-
} | undefined;
|
|
4423
|
-
stage: "gate" | "interior";
|
|
4424
|
-
usage?: {
|
|
4425
|
-
estimatedCostUsd?: number | undefined;
|
|
4426
|
-
source?: string | undefined;
|
|
4427
|
-
totalTokens?: number | undefined;
|
|
4428
|
-
} | undefined;
|
|
4429
|
-
eventType: "review-ladder-stage";
|
|
4430
|
-
typeVersion: 1;
|
|
4431
|
-
}, unknown>>;
|
|
4432
|
-
payloadSchemaRegistry: Record<string, Record<number, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
4433
|
-
payloadVersions: Record<string, readonly number[]>;
|
|
4434
|
-
readUnionSchemas: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[];
|
|
4435
|
-
wirePayloadFor: (event: {
|
|
4436
|
-
createdAt: string;
|
|
4437
|
-
eventId: string;
|
|
4438
|
-
issue?: number | undefined;
|
|
4439
|
-
pr?: number | undefined;
|
|
4440
|
-
repo: string;
|
|
4441
|
-
schemaVersion: 1;
|
|
4442
|
-
threadId?: string | undefined;
|
|
4443
|
-
workerId?: string | undefined;
|
|
4444
|
-
base: string;
|
|
4445
|
-
changedFiles: string[];
|
|
4446
|
-
headSha: string;
|
|
4447
|
-
maxReviewCycles: number;
|
|
4448
|
-
observedAt: string;
|
|
4449
|
-
outcome: "not-required";
|
|
4450
|
-
patchId: string;
|
|
4451
|
-
reason: "faithful-merge" | "no-applicable-mode";
|
|
4452
|
-
reviewCycle: number;
|
|
4453
|
-
eventType: "review-gate";
|
|
4454
|
-
typeVersion: 1;
|
|
4455
|
-
} | {
|
|
4456
|
-
createdAt: string;
|
|
4457
|
-
eventId: string;
|
|
4458
|
-
issue?: number | undefined;
|
|
4459
|
-
pr?: number | undefined;
|
|
4460
|
-
repo: string;
|
|
4461
|
-
schemaVersion: 1;
|
|
4462
|
-
threadId?: string | undefined;
|
|
4463
|
-
workerId?: string | undefined;
|
|
4464
|
-
cycle: number;
|
|
4465
|
-
cyclesToClean?: number | undefined;
|
|
4466
|
-
engine?: string | undefined;
|
|
4467
|
-
findingsSummary: {
|
|
4468
|
-
blocking: number;
|
|
4469
|
-
bySeverity: {
|
|
4470
|
-
critical: number;
|
|
4471
|
-
high: number;
|
|
4472
|
-
low: number;
|
|
4473
|
-
medium: number;
|
|
4474
|
-
unknown: number;
|
|
4475
|
-
};
|
|
4476
|
-
flagged: number;
|
|
4477
|
-
open: number;
|
|
4478
|
-
staleRepeats: number;
|
|
4479
|
-
};
|
|
4480
|
-
forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
|
|
4481
|
-
headSha?: string | undefined;
|
|
4482
|
-
model?: string | undefined;
|
|
4483
|
-
observedAt: string;
|
|
4484
|
-
patchId?: string | undefined;
|
|
4485
|
-
session?: {
|
|
4486
|
-
orchestrationMode?: "autonomous" | "manual" | undefined;
|
|
4487
|
-
resumedSession?: boolean | undefined;
|
|
4488
|
-
runtime?: string | undefined;
|
|
4489
|
-
sessionId?: string | undefined;
|
|
4490
|
-
} | undefined;
|
|
4491
|
-
stage: "gate" | "interior";
|
|
4492
|
-
usage?: {
|
|
4493
|
-
estimatedCostUsd?: number | undefined;
|
|
4494
|
-
source?: string | undefined;
|
|
4495
|
-
totalTokens?: number | undefined;
|
|
4496
|
-
} | undefined;
|
|
4497
|
-
eventType: "review-ladder-stage";
|
|
4498
|
-
typeVersion: 1;
|
|
4499
|
-
}) => unknown;
|
|
4500
|
-
};
|
|
4501
4146
|
type FactoryTraceEnvelope = z.infer<typeof FactoryTraceEnvelopeCoreSchema>;
|
|
4502
4147
|
interface TraceSink {
|
|
4503
4148
|
append: (envelope: FactoryTraceEnvelope) => void;
|
|
@@ -4843,6 +4488,12 @@ interface EvaluationInput {
|
|
|
4843
4488
|
*/
|
|
4844
4489
|
policyIdentityRefusals?: string[];
|
|
4845
4490
|
reviewProof?: PrReviewProof;
|
|
4491
|
+
/**
|
|
4492
|
+
* The review-round limit the authoritative base policy declares (#1280,
|
|
4493
|
+
* #922), resolved at the command boundary. Absent ⇒
|
|
4494
|
+
* `REVIEW_ROUNDS_WITHOUT_WAIVER`.
|
|
4495
|
+
*/
|
|
4496
|
+
reviewRoundsWithoutWaiver?: number;
|
|
4846
4497
|
verificationProof?: VerificationProofState;
|
|
4847
4498
|
docsOnlyVerifyBaselineHeadShas?: string[];
|
|
4848
4499
|
externalRequiredChecks?: RequiredCheck[];
|
|
@@ -5366,16 +5017,34 @@ interface VerificationRunContextInput {
|
|
|
5366
5017
|
*/
|
|
5367
5018
|
lockfileImporters?: readonly string[];
|
|
5368
5019
|
tmpDir?: string;
|
|
5020
|
+
/**
|
|
5021
|
+
* #1658: every tracked path in the tree under verification. When the run
|
|
5022
|
+
* forces the full suite and no lockfile scoping applies, the changed-files
|
|
5023
|
+
* list handed to commands is this list, so a command that reads
|
|
5024
|
+
* FACTORY_CHANGED_FILES directly (rather than through `psf affected`)
|
|
5025
|
+
* still covers the whole tree. That is what lets the proof record
|
|
5026
|
+
* `runScope: "whole-tree"`. Absent, the run never claims whole-tree.
|
|
5027
|
+
*/
|
|
5028
|
+
trackedFiles?: () => string[];
|
|
5369
5029
|
}
|
|
5370
5030
|
interface VerificationEnv {
|
|
5371
5031
|
env: Record<string, string>;
|
|
5372
5032
|
cleanup: () => void;
|
|
5373
5033
|
}
|
|
5034
|
+
/**
|
|
5035
|
+
* #1658: whether every verification command saw the whole tree. A
|
|
5036
|
+
* `whole-tree` run hands commands the empty-tree base ref and every tracked
|
|
5037
|
+
* path, so no command can scope itself to the diff; anything else is
|
|
5038
|
+
* `diff-scoped`, whatever each command then chose to do with it.
|
|
5039
|
+
*/
|
|
5040
|
+
type VerificationRunScope = "diff-scoped" | "whole-tree";
|
|
5374
5041
|
interface VerificationRunContext {
|
|
5375
5042
|
readonly baseRef: string;
|
|
5376
5043
|
readonly changedFiles: string[];
|
|
5377
5044
|
readonly forcesFullSuite: boolean;
|
|
5378
5045
|
readonly fullSuiteReasons: string[];
|
|
5046
|
+
/** Absent reads as `diff-scoped` (#1658). */
|
|
5047
|
+
readonly runScope?: VerificationRunScope;
|
|
5379
5048
|
buildEnv: () => VerificationEnv;
|
|
5380
5049
|
runSummaryLines: () => string[];
|
|
5381
5050
|
}
|