@patronage/software-factory 1.0.0-alpha.33 → 1.0.0-alpha.35
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/dist/index.d.ts +303 -165
- package/dist/index.js +1614 -1217
- package/dist/schemas.d.ts +177 -177
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1303,6 +1303,212 @@ interface FactoryAppAccessDependencies {
|
|
|
1303
1303
|
*/
|
|
1304
1304
|
type ResolvedPrVerifyMode = "docs-only" | "trivial" | "full";
|
|
1305
1305
|
//#endregion
|
|
1306
|
+
//#region src/pr-verify-proof-contract.d.ts
|
|
1307
|
+
/**
|
|
1308
|
+
* The pr:verify proof versions a reader accepts: the current one only (#920
|
|
1309
|
+
* item 1). #917 narrowed the pr:ready reader the same way. A pr:verify proof
|
|
1310
|
+
* is per-candidate and short-lived — it is rewritten on every head — so no
|
|
1311
|
+
* stored v1–v3 proof can outlive the release that drops it. Pre-1.0 posture
|
|
1312
|
+
* applies: one current contract, no compat reader. A consumer on an older
|
|
1313
|
+
* factory must adopt this release before HQ ingests its pr:verify proofs.
|
|
1314
|
+
*/
|
|
1315
|
+
declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [4];
|
|
1316
|
+
type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS)[number];
|
|
1317
|
+
interface PrVerifyCommandResult {
|
|
1318
|
+
command: string;
|
|
1319
|
+
description: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* Epic #550 wave 3 (#430): the profile's declared impact target for this
|
|
1322
|
+
* command, recorded from v4 on. It is the proof's own command→target
|
|
1323
|
+
* mapping: a `notRequiredCommands` entry must name the target recorded HERE
|
|
1324
|
+
* for the same command, so a withholding cannot point at whichever released
|
|
1325
|
+
* target happens to be convenient. Absent for a command the profile does
|
|
1326
|
+
* not scope.
|
|
1327
|
+
*/
|
|
1328
|
+
impactTarget?: string;
|
|
1329
|
+
name: string;
|
|
1330
|
+
scope: "docs-only" | "trivial" | "full";
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* One failing test a verification command reported (#1035).
|
|
1334
|
+
*
|
|
1335
|
+
* The proof keeps the failing test's IDENTITY and its failure CLASS, and
|
|
1336
|
+
* nothing else. That is enough to decide retry-or-fix — a `timeout` under
|
|
1337
|
+
* machine load is a flake, an `assertion` is a real break — without rerunning
|
|
1338
|
+
* the aggregate to read a title off the console.
|
|
1339
|
+
*
|
|
1340
|
+
* It deliberately keeps no raw output tail and no error message body. This
|
|
1341
|
+
* payload is transmitted to HQ ingest, and arbitrary command output can carry
|
|
1342
|
+
* secrets (an echoed environment, a connection string inside a stack frame). A
|
|
1343
|
+
* file path, a test title, and a closed `kind` enum cannot. The cost is the
|
|
1344
|
+
* assertion diff and the stack frames: they help you FIX a failure, and the
|
|
1345
|
+
* operator still reads them from the run's own console output.
|
|
1346
|
+
*/
|
|
1347
|
+
interface PrVerifyTestFailure {
|
|
1348
|
+
/** The test file the reporter named, as the reporter wrote it. */
|
|
1349
|
+
file: string;
|
|
1350
|
+
/**
|
|
1351
|
+
* The failure class. `timeout` is the test-timeout error vitest raises at
|
|
1352
|
+
* its own ceiling; `assertion` is a failed expectation; `error` is every
|
|
1353
|
+
* other thrown failure.
|
|
1354
|
+
*/
|
|
1355
|
+
kind: "assertion" | "error" | "timeout";
|
|
1356
|
+
/** The full test title, suite names included, as the reporter wrote it. */
|
|
1357
|
+
title: string;
|
|
1358
|
+
}
|
|
1359
|
+
interface PrVerifyExecutedCommand {
|
|
1360
|
+
command: string;
|
|
1361
|
+
counts?: {
|
|
1362
|
+
testFiles?: number;
|
|
1363
|
+
tests?: number;
|
|
1364
|
+
};
|
|
1365
|
+
durationMs: number;
|
|
1366
|
+
exitCode: number;
|
|
1367
|
+
/**
|
|
1368
|
+
* The failing tests this command reported (#1035). Present only when the
|
|
1369
|
+
* command produced parseable failures, so a passing command's record is
|
|
1370
|
+
* byte-identical to the one it wrote before this field existed.
|
|
1371
|
+
*/
|
|
1372
|
+
failures?: PrVerifyTestFailure[];
|
|
1373
|
+
name: string;
|
|
1374
|
+
scope: "docs-only" | "trivial" | "full";
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* Epic #550 wave 3 (#430): a verification command the impact stamp proved this
|
|
1378
|
+
* candidate cannot reach, so the battery did not run it.
|
|
1379
|
+
*
|
|
1380
|
+
* The completeness invariant lives in the pairing: `verificationCommands`
|
|
1381
|
+
* records every command the resolved mode selected, `executedCommands` records
|
|
1382
|
+
* what ran, and this list records the rest WITH the stamp's own basis. A
|
|
1383
|
+
* withheld stack is therefore never silently absent from the proof — it is
|
|
1384
|
+
* present, named, and explained.
|
|
1385
|
+
*/
|
|
1386
|
+
interface PrVerifyNotRequiredCommand {
|
|
1387
|
+
basis: string;
|
|
1388
|
+
impactTarget: string;
|
|
1389
|
+
name: string;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
|
|
1393
|
+
* why. Bound to the proof's stamp identity — refused when the proof records no
|
|
1394
|
+
* stamp. The factory does not write this list; consumers do.
|
|
1395
|
+
*/
|
|
1396
|
+
interface PrVerifyNotDemandedRecord {
|
|
1397
|
+
basis: string;
|
|
1398
|
+
name: string;
|
|
1399
|
+
}
|
|
1400
|
+
interface PrVerifyProof {
|
|
1401
|
+
schemaVersion: PrVerifySchemaVersion;
|
|
1402
|
+
authoringSession: string;
|
|
1403
|
+
base: string;
|
|
1404
|
+
/**
|
|
1405
|
+
* The commit `base` resolved to when this proof was written (#1132): the
|
|
1406
|
+
* live pull request base tip, or the freshly fetched ref. Optional and
|
|
1407
|
+
* additive; a proof written before it existed parses unchanged.
|
|
1408
|
+
*/
|
|
1409
|
+
baseSha?: string;
|
|
1410
|
+
baselineFullProofs?: {
|
|
1411
|
+
base: string;
|
|
1412
|
+
changedFiles: string[];
|
|
1413
|
+
headSha: string;
|
|
1414
|
+
profilePath: string;
|
|
1415
|
+
projectKey: string;
|
|
1416
|
+
repository: string;
|
|
1417
|
+
}[];
|
|
1418
|
+
catchUpRecognition?: CatchUpRecognition;
|
|
1419
|
+
changedFiles: string[];
|
|
1420
|
+
classification: DiffClassification;
|
|
1421
|
+
classificationReasons: string[];
|
|
1422
|
+
command: "patronage-factory pr:verify";
|
|
1423
|
+
durationMs: number;
|
|
1424
|
+
endedAt: string;
|
|
1425
|
+
executedCommands?: PrVerifyExecutedCommand[];
|
|
1426
|
+
headSha: string;
|
|
1427
|
+
impactStamp?: ImpactStamp;
|
|
1428
|
+
mode: ResolvedPrVerifyMode;
|
|
1429
|
+
mergeBaseSha?: string;
|
|
1430
|
+
notDemandedRecords?: PrVerifyNotDemandedRecord[];
|
|
1431
|
+
notRequiredCommands?: PrVerifyNotRequiredCommand[];
|
|
1432
|
+
outcome?: "aborted" | "passed";
|
|
1433
|
+
patchId?: string;
|
|
1434
|
+
/**
|
|
1435
|
+
* The review policy identity this verification run resolved (#922 Slice B).
|
|
1436
|
+
*
|
|
1437
|
+
* Verification demands no review mode of its own. It records the identity so
|
|
1438
|
+
* `pr:ready` can see whether the stage that produced this proof judged the
|
|
1439
|
+
* candidate under the same policy readiness resolves. Optional, and normally
|
|
1440
|
+
* `unresolved` on the first run of a branch: a candidate is verified before
|
|
1441
|
+
* it has a pull request, and there is no authority to read without one.
|
|
1442
|
+
*/
|
|
1443
|
+
policyResolution?: PolicyResolution;
|
|
1444
|
+
profilePath: string;
|
|
1445
|
+
projectKey: string;
|
|
1446
|
+
repository: string;
|
|
1447
|
+
startedAt: string;
|
|
1448
|
+
verificationCommands: PrVerifyCommandResult[];
|
|
1449
|
+
}
|
|
1450
|
+
type PrVerifyBaselineFullProof = NonNullable<PrVerifyProof["baselineFullProofs"]>[number];
|
|
1451
|
+
declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
|
|
1452
|
+
//#endregion
|
|
1453
|
+
//#region src/pr-verify-check-payload.d.ts
|
|
1454
|
+
/**
|
|
1455
|
+
* Machine-readable binding carried on the `patronage-factory/pr-verify` check
|
|
1456
|
+
* run (#247), alongside the human-readable prose summary.
|
|
1457
|
+
*
|
|
1458
|
+
* It records *what was verified*, for the head SHA it was written for. It
|
|
1459
|
+
* grants nothing and gates nothing on its own: a consumer still has to verify
|
|
1460
|
+
* the producing App, the conclusion, and its own freshness rule. The payload
|
|
1461
|
+
* is a fenced JSON document in `output.text`.
|
|
1462
|
+
*/
|
|
1463
|
+
declare const PR_VERIFY_CHECK_PAYLOAD_KIND: "pr-verify-proof-binding";
|
|
1464
|
+
declare const PR_VERIFY_CHECK_PAYLOAD_SCHEMA_VERSION = 1;
|
|
1465
|
+
/**
|
|
1466
|
+
* `unknown` covers a proof written by a schema version that did not record a
|
|
1467
|
+
* classification. A consumer must treat it as "not stated", never as trivial.
|
|
1468
|
+
*/
|
|
1469
|
+
type PrVerifyPayloadClassification = DiffClassification | "unknown";
|
|
1470
|
+
interface PrVerifyCheckPayload {
|
|
1471
|
+
/**
|
|
1472
|
+
* Factory diff classification. Deliberately distinct from `mode`: the
|
|
1473
|
+
* workflow path filter and the factory classifier use different rules, so a
|
|
1474
|
+
* consumer must be able to see both.
|
|
1475
|
+
*/
|
|
1476
|
+
classification: PrVerifyPayloadClassification;
|
|
1477
|
+
/** Names of the verification commands that actually ran, in run order. */
|
|
1478
|
+
executedCommands: string[];
|
|
1479
|
+
/** The commit this verification describes. Binding is by tree, not patch. */
|
|
1480
|
+
headSha: string;
|
|
1481
|
+
/**
|
|
1482
|
+
* The proof's own identity-bound impact stamp. Kept opaque here: the hosted
|
|
1483
|
+
* proof-reuse gate validates the complete release tuple before subtracting
|
|
1484
|
+
* any command, and malformed data must remain visible to that fail-closed
|
|
1485
|
+
* reader rather than being normalized away during publication.
|
|
1486
|
+
*/
|
|
1487
|
+
impactStamp?: unknown;
|
|
1488
|
+
kind: typeof PR_VERIFY_CHECK_PAYLOAD_KIND;
|
|
1489
|
+
/**
|
|
1490
|
+
* Resolved verification mode. `docs-only` and `trivial` run reduced command
|
|
1491
|
+
* suites and publish the same successful check run as `full`, so this field
|
|
1492
|
+
* is what keeps them from being confusable after the fact.
|
|
1493
|
+
*/
|
|
1494
|
+
mode: ResolvedPrVerifyMode;
|
|
1495
|
+
/** Commands the proof withheld, including their claimed target and prose basis. */
|
|
1496
|
+
notRequiredCommands?: unknown;
|
|
1497
|
+
outcome: "aborted" | "passed";
|
|
1498
|
+
/** Stable patch id, when the proof recorded one. Informational only. */
|
|
1499
|
+
patchId?: string;
|
|
1500
|
+
/** `schemaVersion` of the local pr:verify proof this was rendered from. */
|
|
1501
|
+
proofSchemaVersion: number;
|
|
1502
|
+
/** `<owner>/<name>` the proof was produced for. */
|
|
1503
|
+
repository?: string;
|
|
1504
|
+
/** Version of *this* payload shape. */
|
|
1505
|
+
schemaVersion: typeof PR_VERIFY_CHECK_PAYLOAD_SCHEMA_VERSION;
|
|
1506
|
+
/** The proof's command-to-impact-target bindings used to validate releases. */
|
|
1507
|
+
verificationCommands?: unknown;
|
|
1508
|
+
/** Original validated proof. Absence requires normal verification on a fresh runner. */
|
|
1509
|
+
verificationProof?: PrVerifyProof;
|
|
1510
|
+
}
|
|
1511
|
+
//#endregion
|
|
1306
1512
|
//#region src/pr-verify-status.d.ts
|
|
1307
1513
|
type CommitStatusState = "failure" | "pending" | "success";
|
|
1308
1514
|
interface PostCommitStatusInput {
|
|
@@ -1408,6 +1614,42 @@ interface CheckRunDependencies extends FactoryAppAccessDependencies {
|
|
|
1408
1614
|
declare function ensureFactoryCheckRunPublished(input: PublishFactoryCheckInput, dependencies?: CheckRunDependencies & {
|
|
1409
1615
|
onDiagnostic?: (message: string) => void;
|
|
1410
1616
|
}): Promise<boolean>;
|
|
1617
|
+
type GhJsonRunner = <T>(args: string[]) => T;
|
|
1618
|
+
interface FactoryCheckRunProducer {
|
|
1619
|
+
identity: string;
|
|
1620
|
+
mode: "app";
|
|
1621
|
+
}
|
|
1622
|
+
interface PrVerifyProofBinding {
|
|
1623
|
+
completedAtMs: number;
|
|
1624
|
+
conclusion: string;
|
|
1625
|
+
payload: PrVerifyCheckPayload;
|
|
1626
|
+
producer: FactoryCheckRunProducer;
|
|
1627
|
+
}
|
|
1628
|
+
/**
|
|
1629
|
+
* Read the machine-readable `pr:verify` binding for one commit (#247).
|
|
1630
|
+
*
|
|
1631
|
+
* Deliberately narrow: it reads check runs only, and only those whose `app`
|
|
1632
|
+
* identity matches the configured factory App. It never consults commit
|
|
1633
|
+
* statuses. `patronage-factory/pr-verify` is postable as a commit status by any
|
|
1634
|
+
* token with write access, so that surface stays a human-readable mirror and
|
|
1635
|
+
* can never satisfy a consumer that wants proof. Absent, foreign, or
|
|
1636
|
+
* unparseable ⇒ `undefined` (fail closed).
|
|
1637
|
+
*/
|
|
1638
|
+
declare function fetchPrVerifyProofBinding({
|
|
1639
|
+
expectedAppId,
|
|
1640
|
+
githubApp,
|
|
1641
|
+
owner,
|
|
1642
|
+
repo,
|
|
1643
|
+
sha,
|
|
1644
|
+
runJson
|
|
1645
|
+
}: {
|
|
1646
|
+
/** Overrides the configured App id — CI has no user config (#247 part 3). */expectedAppId?: string;
|
|
1647
|
+
githubApp?: GithubAppConfig;
|
|
1648
|
+
owner: string;
|
|
1649
|
+
repo: string;
|
|
1650
|
+
sha: string;
|
|
1651
|
+
runJson?: GhJsonRunner;
|
|
1652
|
+
}): PrVerifyProofBinding | undefined;
|
|
1411
1653
|
//#endregion
|
|
1412
1654
|
//#region src/merge-freeze.d.ts
|
|
1413
1655
|
declare const MERGE_FREEZE_CHECK_NAME = "patronage-factory/merge-freeze";
|
|
@@ -1423,6 +1665,16 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1423
1665
|
reason: z.ZodString;
|
|
1424
1666
|
recordedAt: z.ZodISODateTime;
|
|
1425
1667
|
schemaVersion: z.ZodLiteral<1>;
|
|
1668
|
+
verification: z.ZodOptional<z.ZodObject<{
|
|
1669
|
+
jobs: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
1670
|
+
success: "success";
|
|
1671
|
+
failure: "failure";
|
|
1672
|
+
cancelled: "cancelled";
|
|
1673
|
+
skipped: "skipped";
|
|
1674
|
+
}>>;
|
|
1675
|
+
runAttempt: z.ZodNumber;
|
|
1676
|
+
runId: z.ZodNumber;
|
|
1677
|
+
}, z.core.$strip>>;
|
|
1426
1678
|
}, z.core.$strip>, z.ZodObject<{
|
|
1427
1679
|
active: z.ZodLiteral<false>;
|
|
1428
1680
|
clearRationale: z.ZodOptional<z.ZodString>;
|
|
@@ -1432,6 +1684,16 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1432
1684
|
reason: z.ZodString;
|
|
1433
1685
|
recordedAt: z.ZodISODateTime;
|
|
1434
1686
|
schemaVersion: z.ZodLiteral<1>;
|
|
1687
|
+
verification: z.ZodOptional<z.ZodObject<{
|
|
1688
|
+
jobs: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
1689
|
+
success: "success";
|
|
1690
|
+
failure: "failure";
|
|
1691
|
+
cancelled: "cancelled";
|
|
1692
|
+
skipped: "skipped";
|
|
1693
|
+
}>>;
|
|
1694
|
+
runAttempt: z.ZodNumber;
|
|
1695
|
+
runId: z.ZodNumber;
|
|
1696
|
+
}, z.core.$strip>>;
|
|
1435
1697
|
}, z.core.$strip>], "active">;
|
|
1436
1698
|
type MergeFreezeState = z.infer<typeof mergeFreezeStateSchema>;
|
|
1437
1699
|
/**
|
|
@@ -1459,18 +1721,30 @@ interface RunningMergeFreezeWitness {
|
|
|
1459
1721
|
/** The running `patronage-factory/merge-freeze` check-run id. */
|
|
1460
1722
|
runId: number;
|
|
1461
1723
|
}
|
|
1724
|
+
/** A push workflow run's status while it still owes a generation. */
|
|
1725
|
+
type PendingWorkflowRunStatus = "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
1462
1726
|
/**
|
|
1463
1727
|
* The evidence that a generation is settling because it is still owed (#521).
|
|
1728
|
+
*
|
|
1729
|
+
* The witness is the freeze-writing workflow's push run on the tip, identified
|
|
1730
|
+
* through lineage (#1276): the immediate parent's settled generation records
|
|
1731
|
+
* the workflow run that wrote it, that run names its workflow, and the same
|
|
1732
|
+
* workflow's pending push run on the tip owes the tip's generation. It is the
|
|
1733
|
+
* workflow run rather than the `verify` job's check run because GitHub creates
|
|
1734
|
+
* a job's check run only when the job is dispatched, which for the `verify`
|
|
1735
|
+
* summary job is near the end of the push Verify.
|
|
1464
1736
|
*/
|
|
1465
1737
|
interface AwaitedMergeFreezeWitness {
|
|
1466
1738
|
/** The base tip whose generation is awaited. */
|
|
1467
1739
|
headSha: string;
|
|
1468
1740
|
/** The immediate parent whose settled generation proves the writer runs. */
|
|
1469
1741
|
parentSha: string;
|
|
1470
|
-
/** The
|
|
1471
|
-
|
|
1742
|
+
/** The workflow whose run wrote the parent's settled generation. */
|
|
1743
|
+
workflowId: number;
|
|
1744
|
+
/** That workflow's push run on the tip, which owes the generation. */
|
|
1745
|
+
workflowRunId: number;
|
|
1472
1746
|
/** That run's status. A completed run owes nothing, so it is not settling. */
|
|
1473
|
-
|
|
1747
|
+
workflowRunStatus: PendingWorkflowRunStatus;
|
|
1474
1748
|
}
|
|
1475
1749
|
/**
|
|
1476
1750
|
* The two settling phases, each with the witness that proves it (#890).
|
|
@@ -1517,6 +1791,14 @@ interface GitHubCheckRunMergeFreezeApi {
|
|
|
1517
1791
|
name: string;
|
|
1518
1792
|
}) => unknown;
|
|
1519
1793
|
parent?: (input: MergeFreezeStoreInput) => unknown;
|
|
1794
|
+
/** One GitHub Actions workflow run, by id (`headSha` is not consulted). */
|
|
1795
|
+
workflowRun?: (input: MergeFreezeStoreInput & {
|
|
1796
|
+
runId: number;
|
|
1797
|
+
}) => unknown;
|
|
1798
|
+
/** A workflow's push runs on `headSha`, as `{ workflow_runs }`. */
|
|
1799
|
+
workflowRuns?: (input: MergeFreezeStoreInput & {
|
|
1800
|
+
workflowId: number;
|
|
1801
|
+
}) => unknown;
|
|
1520
1802
|
}
|
|
1521
1803
|
declare function createGitHubCheckRunMergeFreezeStore(api: GitHubCheckRunMergeFreezeApi): MergeFreezeAuthority;
|
|
1522
1804
|
//#endregion
|
|
@@ -1666,8 +1948,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
|
|
|
1666
1948
|
reviewedHeadSha: z.ZodOptional<z.ZodString>;
|
|
1667
1949
|
reviewedPatchId: z.ZodOptional<z.ZodString>;
|
|
1668
1950
|
status: z.ZodEnum<{
|
|
1669
|
-
"not-required": "not-required";
|
|
1670
1951
|
stale: "stale";
|
|
1952
|
+
"not-required": "not-required";
|
|
1671
1953
|
blocked: "blocked";
|
|
1672
1954
|
current: "current";
|
|
1673
1955
|
missing: "missing";
|
|
@@ -1678,8 +1960,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
|
|
|
1678
1960
|
reviewedHeadSha: z.ZodOptional<z.ZodString>;
|
|
1679
1961
|
reviewedPatchId: z.ZodOptional<z.ZodString>;
|
|
1680
1962
|
status: z.ZodEnum<{
|
|
1681
|
-
"not-required": "not-required";
|
|
1682
1963
|
stale: "stale";
|
|
1964
|
+
"not-required": "not-required";
|
|
1683
1965
|
blocked: "blocked";
|
|
1684
1966
|
current: "current";
|
|
1685
1967
|
missing: "missing";
|
|
@@ -1868,153 +2150,6 @@ interface UpsertFactoryPrStatusCommentResult {
|
|
|
1868
2150
|
url: string;
|
|
1869
2151
|
}
|
|
1870
2152
|
declare function upsertFactoryPrStatusComment(input: UpsertFactoryPrStatusCommentInput, dependencies?: UpsertFactoryPrStatusCommentDependencies): Promise<UpsertFactoryPrStatusCommentResult>;
|
|
1871
|
-
//#endregion
|
|
1872
|
-
//#region src/pr-verify-proof-contract.d.ts
|
|
1873
|
-
/**
|
|
1874
|
-
* The pr:verify proof versions a reader accepts: the current one only (#920
|
|
1875
|
-
* item 1). #917 narrowed the pr:ready reader the same way. A pr:verify proof
|
|
1876
|
-
* is per-candidate and short-lived — it is rewritten on every head — so no
|
|
1877
|
-
* stored v1–v3 proof can outlive the release that drops it. Pre-1.0 posture
|
|
1878
|
-
* applies: one current contract, no compat reader. A consumer on an older
|
|
1879
|
-
* factory must adopt this release before HQ ingests its pr:verify proofs.
|
|
1880
|
-
*/
|
|
1881
|
-
declare const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS: readonly [4];
|
|
1882
|
-
type PrVerifySchemaVersion = (typeof SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS)[number];
|
|
1883
|
-
interface PrVerifyCommandResult {
|
|
1884
|
-
command: string;
|
|
1885
|
-
description: string;
|
|
1886
|
-
/**
|
|
1887
|
-
* Epic #550 wave 3 (#430): the profile's declared impact target for this
|
|
1888
|
-
* command, recorded from v4 on. It is the proof's own command→target
|
|
1889
|
-
* mapping: a `notRequiredCommands` entry must name the target recorded HERE
|
|
1890
|
-
* for the same command, so a withholding cannot point at whichever released
|
|
1891
|
-
* target happens to be convenient. Absent for a command the profile does
|
|
1892
|
-
* not scope.
|
|
1893
|
-
*/
|
|
1894
|
-
impactTarget?: string;
|
|
1895
|
-
name: string;
|
|
1896
|
-
scope: "docs-only" | "trivial" | "full";
|
|
1897
|
-
}
|
|
1898
|
-
/**
|
|
1899
|
-
* One failing test a verification command reported (#1035).
|
|
1900
|
-
*
|
|
1901
|
-
* The proof keeps the failing test's IDENTITY and its failure CLASS, and
|
|
1902
|
-
* nothing else. That is enough to decide retry-or-fix — a `timeout` under
|
|
1903
|
-
* machine load is a flake, an `assertion` is a real break — without rerunning
|
|
1904
|
-
* the aggregate to read a title off the console.
|
|
1905
|
-
*
|
|
1906
|
-
* It deliberately keeps no raw output tail and no error message body. This
|
|
1907
|
-
* payload is transmitted to HQ ingest, and arbitrary command output can carry
|
|
1908
|
-
* secrets (an echoed environment, a connection string inside a stack frame). A
|
|
1909
|
-
* file path, a test title, and a closed `kind` enum cannot. The cost is the
|
|
1910
|
-
* assertion diff and the stack frames: they help you FIX a failure, and the
|
|
1911
|
-
* operator still reads them from the run's own console output.
|
|
1912
|
-
*/
|
|
1913
|
-
interface PrVerifyTestFailure {
|
|
1914
|
-
/** The test file the reporter named, as the reporter wrote it. */
|
|
1915
|
-
file: string;
|
|
1916
|
-
/**
|
|
1917
|
-
* The failure class. `timeout` is the test-timeout error vitest raises at
|
|
1918
|
-
* its own ceiling; `assertion` is a failed expectation; `error` is every
|
|
1919
|
-
* other thrown failure.
|
|
1920
|
-
*/
|
|
1921
|
-
kind: "assertion" | "error" | "timeout";
|
|
1922
|
-
/** The full test title, suite names included, as the reporter wrote it. */
|
|
1923
|
-
title: string;
|
|
1924
|
-
}
|
|
1925
|
-
interface PrVerifyExecutedCommand {
|
|
1926
|
-
command: string;
|
|
1927
|
-
counts?: {
|
|
1928
|
-
testFiles?: number;
|
|
1929
|
-
tests?: number;
|
|
1930
|
-
};
|
|
1931
|
-
durationMs: number;
|
|
1932
|
-
exitCode: number;
|
|
1933
|
-
/**
|
|
1934
|
-
* The failing tests this command reported (#1035). Present only when the
|
|
1935
|
-
* command produced parseable failures, so a passing command's record is
|
|
1936
|
-
* byte-identical to the one it wrote before this field existed.
|
|
1937
|
-
*/
|
|
1938
|
-
failures?: PrVerifyTestFailure[];
|
|
1939
|
-
name: string;
|
|
1940
|
-
scope: "docs-only" | "trivial" | "full";
|
|
1941
|
-
}
|
|
1942
|
-
/**
|
|
1943
|
-
* Epic #550 wave 3 (#430): a verification command the impact stamp proved this
|
|
1944
|
-
* candidate cannot reach, so the battery did not run it.
|
|
1945
|
-
*
|
|
1946
|
-
* The completeness invariant lives in the pairing: `verificationCommands`
|
|
1947
|
-
* records every command the resolved mode selected, `executedCommands` records
|
|
1948
|
-
* what ran, and this list records the rest WITH the stamp's own basis. A
|
|
1949
|
-
* withheld stack is therefore never silently absent from the proof — it is
|
|
1950
|
-
* present, named, and explained.
|
|
1951
|
-
*/
|
|
1952
|
-
interface PrVerifyNotRequiredCommand {
|
|
1953
|
-
basis: string;
|
|
1954
|
-
impactTarget: string;
|
|
1955
|
-
name: string;
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
|
|
1959
|
-
* why. Bound to the proof's stamp identity — refused when the proof records no
|
|
1960
|
-
* stamp. The factory does not write this list; consumers do.
|
|
1961
|
-
*/
|
|
1962
|
-
interface PrVerifyNotDemandedRecord {
|
|
1963
|
-
basis: string;
|
|
1964
|
-
name: string;
|
|
1965
|
-
}
|
|
1966
|
-
interface PrVerifyProof {
|
|
1967
|
-
schemaVersion: PrVerifySchemaVersion;
|
|
1968
|
-
authoringSession: string;
|
|
1969
|
-
base: string;
|
|
1970
|
-
/**
|
|
1971
|
-
* The commit `base` resolved to when this proof was written (#1132): the
|
|
1972
|
-
* live pull request base tip, or the freshly fetched ref. Optional and
|
|
1973
|
-
* additive; a proof written before it existed parses unchanged.
|
|
1974
|
-
*/
|
|
1975
|
-
baseSha?: string;
|
|
1976
|
-
baselineFullProofs?: {
|
|
1977
|
-
base: string;
|
|
1978
|
-
changedFiles: string[];
|
|
1979
|
-
headSha: string;
|
|
1980
|
-
profilePath: string;
|
|
1981
|
-
projectKey: string;
|
|
1982
|
-
repository: string;
|
|
1983
|
-
}[];
|
|
1984
|
-
catchUpRecognition?: CatchUpRecognition;
|
|
1985
|
-
changedFiles: string[];
|
|
1986
|
-
classification: DiffClassification;
|
|
1987
|
-
classificationReasons: string[];
|
|
1988
|
-
command: "patronage-factory pr:verify";
|
|
1989
|
-
durationMs: number;
|
|
1990
|
-
endedAt: string;
|
|
1991
|
-
executedCommands?: PrVerifyExecutedCommand[];
|
|
1992
|
-
headSha: string;
|
|
1993
|
-
impactStamp?: ImpactStamp;
|
|
1994
|
-
mode: ResolvedPrVerifyMode;
|
|
1995
|
-
mergeBaseSha?: string;
|
|
1996
|
-
notDemandedRecords?: PrVerifyNotDemandedRecord[];
|
|
1997
|
-
notRequiredCommands?: PrVerifyNotRequiredCommand[];
|
|
1998
|
-
outcome?: "aborted" | "passed";
|
|
1999
|
-
patchId?: string;
|
|
2000
|
-
/**
|
|
2001
|
-
* The review policy identity this verification run resolved (#922 Slice B).
|
|
2002
|
-
*
|
|
2003
|
-
* Verification demands no review mode of its own. It records the identity so
|
|
2004
|
-
* `pr:ready` can see whether the stage that produced this proof judged the
|
|
2005
|
-
* candidate under the same policy readiness resolves. Optional, and normally
|
|
2006
|
-
* `unresolved` on the first run of a branch: a candidate is verified before
|
|
2007
|
-
* it has a pull request, and there is no authority to read without one.
|
|
2008
|
-
*/
|
|
2009
|
-
policyResolution?: PolicyResolution;
|
|
2010
|
-
profilePath: string;
|
|
2011
|
-
projectKey: string;
|
|
2012
|
-
repository: string;
|
|
2013
|
-
startedAt: string;
|
|
2014
|
-
verificationCommands: PrVerifyCommandResult[];
|
|
2015
|
-
}
|
|
2016
|
-
type PrVerifyBaselineFullProof = NonNullable<PrVerifyProof["baselineFullProofs"]>[number];
|
|
2017
|
-
declare function validatePrVerifyProof(value: unknown): PrVerifyProof;
|
|
2018
2153
|
declare namespace verification_proof_d_exports {
|
|
2019
2154
|
export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotDemandedRecord, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, PrVerifyTestFailure, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedCatchUpRecognition, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
|
|
2020
2155
|
}
|
|
@@ -2798,8 +2933,8 @@ declare const loadEvidenceEnvelopes: (cwd: string) => LoadedEvidenceEnvelope[];
|
|
|
2798
2933
|
//#region src/review-proof-applicability.d.ts
|
|
2799
2934
|
declare const REVIEW_STATUS_VALUES: readonly ["not-required", "current", "stale", "missing", "blocked"];
|
|
2800
2935
|
declare const reviewStatusSchema: z.ZodEnum<{
|
|
2801
|
-
"not-required": "not-required";
|
|
2802
2936
|
stale: "stale";
|
|
2937
|
+
"not-required": "not-required";
|
|
2803
2938
|
blocked: "blocked";
|
|
2804
2939
|
current: "current";
|
|
2805
2940
|
missing: "missing";
|
|
@@ -3244,6 +3379,8 @@ interface PrVerifyArgs extends LoadProjectProfileInput {
|
|
|
3244
3379
|
mode: PrVerifyMode;
|
|
3245
3380
|
output?: string;
|
|
3246
3381
|
requireKnownAuthoringSession?: boolean;
|
|
3382
|
+
/** Recover the original proof from the accepted exact-head App binding. */
|
|
3383
|
+
reuseAccepted?: boolean;
|
|
3247
3384
|
}
|
|
3248
3385
|
interface PrVerifyGitDependencies {
|
|
3249
3386
|
changedFiles: (cwd: string, base: string) => string[];
|
|
@@ -3262,6 +3399,7 @@ interface PrVerifyGitDependencies {
|
|
|
3262
3399
|
stablePatchId: (cwd: string, base: string) => string;
|
|
3263
3400
|
}
|
|
3264
3401
|
interface PrVerifyDependencies {
|
|
3402
|
+
fetchVerifyBinding?: typeof fetchPrVerifyProofBinding;
|
|
3265
3403
|
/**
|
|
3266
3404
|
* The authoritative base-policy reader (#922). Injectable for the same
|
|
3267
3405
|
* reason `pr:ready` injects it: an unstated authority must be a refusal a
|
|
@@ -3577,18 +3715,18 @@ declare const LegacyWorkerCloseoutStatusTraceEventSchema: z.ZodObject<{
|
|
|
3577
3715
|
threadId: z.ZodOptional<z.ZodString>;
|
|
3578
3716
|
workerId: z.ZodOptional<z.ZodString>;
|
|
3579
3717
|
archiveStatus: z.ZodOptional<z.ZodEnum<{
|
|
3718
|
+
skipped: "skipped";
|
|
3580
3719
|
unavailable: "unavailable";
|
|
3581
3720
|
archived: "archived";
|
|
3582
|
-
skipped: "skipped";
|
|
3583
3721
|
"not-applicable": "not-applicable";
|
|
3584
3722
|
pending: "pending";
|
|
3585
3723
|
}>>;
|
|
3586
3724
|
closeoutReason: z.ZodOptional<z.ZodString>;
|
|
3587
3725
|
eventType: z.ZodLiteral<"worker-closeout-lessons">;
|
|
3588
3726
|
lessonStatus: z.ZodOptional<z.ZodEnum<{
|
|
3727
|
+
skipped: "skipped";
|
|
3589
3728
|
captured: "captured";
|
|
3590
3729
|
unavailable: "unavailable";
|
|
3591
|
-
skipped: "skipped";
|
|
3592
3730
|
}>>;
|
|
3593
3731
|
lessonSummary: z.ZodOptional<z.ZodString>;
|
|
3594
3732
|
typeVersion: z.ZodLiteral<2>;
|
|
@@ -3975,18 +4113,18 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
3975
4113
|
threadId: z.ZodOptional<z.ZodString>;
|
|
3976
4114
|
workerId: z.ZodOptional<z.ZodString>;
|
|
3977
4115
|
archiveStatus: z.ZodOptional<z.ZodEnum<{
|
|
4116
|
+
skipped: "skipped";
|
|
3978
4117
|
unavailable: "unavailable";
|
|
3979
4118
|
archived: "archived";
|
|
3980
|
-
skipped: "skipped";
|
|
3981
4119
|
"not-applicable": "not-applicable";
|
|
3982
4120
|
pending: "pending";
|
|
3983
4121
|
}>>;
|
|
3984
4122
|
closeoutReason: z.ZodOptional<z.ZodString>;
|
|
3985
4123
|
eventType: z.ZodLiteral<"worker-closeout-lessons">;
|
|
3986
4124
|
lessonStatus: z.ZodOptional<z.ZodEnum<{
|
|
4125
|
+
skipped: "skipped";
|
|
3987
4126
|
captured: "captured";
|
|
3988
4127
|
unavailable: "unavailable";
|
|
3989
|
-
skipped: "skipped";
|
|
3990
4128
|
}>>;
|
|
3991
4129
|
lessonSummary: z.ZodOptional<z.ZodString>;
|
|
3992
4130
|
typeVersion: z.ZodLiteral<2>;
|
|
@@ -4016,17 +4154,17 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
4016
4154
|
}, z.core.$strict>], "lessonStatus">;
|
|
4017
4155
|
readonly 2: z.ZodObject<{
|
|
4018
4156
|
archiveStatus: z.ZodOptional<z.ZodEnum<{
|
|
4157
|
+
skipped: "skipped";
|
|
4019
4158
|
unavailable: "unavailable";
|
|
4020
4159
|
archived: "archived";
|
|
4021
|
-
skipped: "skipped";
|
|
4022
4160
|
"not-applicable": "not-applicable";
|
|
4023
4161
|
pending: "pending";
|
|
4024
4162
|
}>>;
|
|
4025
4163
|
closeoutReason: z.ZodOptional<z.ZodString>;
|
|
4026
4164
|
lessonStatus: z.ZodOptional<z.ZodEnum<{
|
|
4165
|
+
skipped: "skipped";
|
|
4027
4166
|
captured: "captured";
|
|
4028
4167
|
unavailable: "unavailable";
|
|
4029
|
-
skipped: "skipped";
|
|
4030
4168
|
}>>;
|
|
4031
4169
|
lessonSummary: z.ZodOptional<z.ZodString>;
|
|
4032
4170
|
observedAt: z.ZodString;
|
|
@@ -4138,8 +4276,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
4138
4276
|
interiorCycle: z.ZodOptional<z.ZodNumber>;
|
|
4139
4277
|
observedAt: z.ZodString;
|
|
4140
4278
|
purpose: z.ZodEnum<{
|
|
4141
|
-
code: "code";
|
|
4142
4279
|
review: "review";
|
|
4280
|
+
code: "code";
|
|
4143
4281
|
}>;
|
|
4144
4282
|
slotResolution: z.ZodObject<{
|
|
4145
4283
|
effort: z.ZodEnum<{
|
|
@@ -4217,8 +4355,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
4217
4355
|
interiorCycle: z.ZodOptional<z.ZodNumber>;
|
|
4218
4356
|
observedAt: z.ZodString;
|
|
4219
4357
|
purpose: z.ZodEnum<{
|
|
4220
|
-
code: "code";
|
|
4221
4358
|
review: "review";
|
|
4359
|
+
code: "code";
|
|
4222
4360
|
}>;
|
|
4223
4361
|
slotResolution: z.ZodObject<{
|
|
4224
4362
|
effort: z.ZodEnum<{
|
|
@@ -4287,8 +4425,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
4287
4425
|
interiorCycle: z.ZodOptional<z.ZodNumber>;
|
|
4288
4426
|
observedAt: z.ZodString;
|
|
4289
4427
|
purpose: z.ZodEnum<{
|
|
4290
|
-
code: "code";
|
|
4291
4428
|
review: "review";
|
|
4429
|
+
code: "code";
|
|
4292
4430
|
}>;
|
|
4293
4431
|
slotResolution: z.ZodObject<{
|
|
4294
4432
|
effort: z.ZodEnum<{
|
|
@@ -4360,7 +4498,7 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
|
|
|
4360
4498
|
exitCode: number | null;
|
|
4361
4499
|
harness: string;
|
|
4362
4500
|
observedAt: string;
|
|
4363
|
-
purpose: "
|
|
4501
|
+
purpose: "review" | "code";
|
|
4364
4502
|
slotResolution: {
|
|
4365
4503
|
effort: "high" | "low" | "medium" | "xhigh";
|
|
4366
4504
|
engine: string;
|
|
@@ -4714,13 +4852,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
|
|
|
4714
4852
|
reviews: {
|
|
4715
4853
|
correctness: {
|
|
4716
4854
|
required: boolean;
|
|
4717
|
-
status: "
|
|
4855
|
+
status: "stale" | "not-required" | "blocked" | "current" | "missing";
|
|
4718
4856
|
reviewedHeadSha?: string | undefined;
|
|
4719
4857
|
reviewedPatchId?: string | undefined;
|
|
4720
4858
|
};
|
|
4721
4859
|
security?: {
|
|
4722
4860
|
required: boolean;
|
|
4723
|
-
status: "
|
|
4861
|
+
status: "stale" | "not-required" | "blocked" | "current" | "missing";
|
|
4724
4862
|
reviewedHeadSha?: string | undefined;
|
|
4725
4863
|
reviewedPatchId?: string | undefined;
|
|
4726
4864
|
} | undefined;
|