@patronage/software-factory 1.0.0-alpha.15 → 1.0.0-alpha.17

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/CONTEXT.md CHANGED
@@ -20,7 +20,7 @@ The shared Patronage software factory: typed lifecycle state, proof gates, and o
20
20
 
21
21
  ### Impact
22
22
 
23
- **Impact**: The candidate-bound classification of which declared product targets a changed path or lockfile graph can reach. Path impact is opt-in: a target is affected if and only if a valid changed path matches one of its declared globs. A valid path matched by no target is **unsubscribed** and demands no target-scoped work, while remaining explicit in the stamp basis and human summary. Shared paths affect every target that subscribes to them. Invalid paths and unreadable or malformed required inputs still fail closed. Impact may withdraw target-scoped work; it never certifies a merge target, whose push-triggered verification stays full. Defined by ADR 0027. _Avoid_: affectedness; ownership (the declaration is a subscription, not an implicit filesystem owner).
23
+ **Impact**: The candidate-bound classification of which declared product targets a changed path or lockfile graph can reach. Path impact is opt-in: a target is affected if and only if a valid changed path matches one of its declared globs. A valid path matched by no target is **unsubscribed** and demands no target-scoped work, while remaining explicit in the stamp basis and human summary. A valid path that matches `impact.inert` and no target is **inert-owned**: the stamp records it in `inertPaths`, distinct from `unsubscribedPaths`. A path matching both a target subscription and an inert glob is product-owned and appears in neither list. `pnpm-lock.yaml` is a graph input and is never inert. Shared paths affect every target that subscribes to them. Invalid paths and unreadable or malformed required inputs still fail closed. Impact may withdraw target-scoped work; it never certifies a merge target, whose push-triggered verification stays full. Defined by ADR 0027. _Avoid_: affectedness; implicit filesystem ownership (target `paths` are subscriptions; inert-owned is the explicit `impact.inert` declaration).
24
24
 
25
25
  ### Planning intake
26
26
 
package/README.md CHANGED
@@ -64,6 +64,8 @@ The repository profile declares its admission policy. Operator-local settings an
64
64
 
65
65
  Generated production workflows may call `psf production:impact --before <sha> --after <sha> --github-output <path>`. The command recomputes the profile's opt-in impact subscriptions from those exact real commits and emits stable demanded/withdrawn target outputs, the changed-file decision basis, and unsubscribed paths. It only withdraws work: missing, zero, malformed, unreachable, non-ancestral, or otherwise unclassifiable identities leave every known target demanded. The factory owns this decision seam; each consumer owns its deploy jobs, commands, credentials, topology, and post-deploy convergence/no-op proof. Merge-target Verify remains full and does not consult this command.
66
66
 
67
+ Generated pull-request workflows may call `psf candidate:impact --base <sha> --head <sha> --github-output <path>` to route Candidate verification surfaces. The command evaluates the same profile impact declarations and pnpm dependency graph from the exact base/head identity, diffed from their merge base; it is the candidate-named sibling of `production:impact` and replaces repository-owned path filters, never adds a second matcher. The `head` commit must be the checked-out `HEAD`, and both commits must be reachable (`fetch-depth: 0`). Every doubt path — unreadable identity, malformed or unsupported graph data, an unowned profile change, a working-tree profile that differs from the head commit, or classifier refusal — fails closed and leaves every declared target demanded. `production:impact` keeps its merge-push `before`/`after` contract unchanged.
68
+
67
69
  For factory workflow, install the four canonical skills from the repository:
68
70
 
69
71
  ```bash
package/dist/index.d.ts CHANGED
@@ -285,6 +285,15 @@ interface HqSpoolEntryOutcome {
285
285
  detail?: string;
286
286
  eventId: string;
287
287
  kind: string;
288
+ /**
289
+ * `true` when HQ refused the content as schema-invalid (HTTP 422, #739).
290
+ * The same bytes get the same verdict on every retry under the current
291
+ * ingest schema, so retrying without a schema change cannot succeed.
292
+ * Distinct from `undeliverable`: an HQ schema fix can still admit these
293
+ * bytes, so eviction is an operator decision (`hq:flush --evict-permanent`),
294
+ * never automatic.
295
+ */
296
+ permanent?: boolean;
288
297
  spool: string;
289
298
  /**
290
299
  * `undeliverable` is the one terminal verdict (#445). Every other status
@@ -302,6 +311,13 @@ interface HqSpoolFlushInput {
302
311
  clientSecret: string;
303
312
  /** The profile's HQ origin; entries recorded against another are refused. */
304
313
  endpoint: string;
314
+ /**
315
+ * Disposition schema-permanent rejections (HTTP 422) in place with the
316
+ * `.undeliverable` suffix instead of retaining them (#739). Operator
317
+ * opt-in: a later HQ schema fix can still admit the same bytes, so the
318
+ * drain never evicts on its own.
319
+ */
320
+ evictPermanentRejections?: boolean;
305
321
  /** Operator-named spool directories; replaces the default two locations. */
306
322
  explicitDirectories?: string[];
307
323
  repository: HqSpoolRepository;
@@ -617,10 +633,82 @@ declare const FollowUpActionSchema: z.ZodType<FollowUpAction>;
617
633
  declare const DIFF_CLASSIFICATIONS: readonly ["docs/process-only", "trivial", "non-trivial"];
618
634
  type DiffClassification = (typeof DIFF_CLASSIFICATIONS)[number];
619
635
  //#endregion
636
+ //#region src/impact-stamp.d.ts
637
+ /**
638
+ * The recorded stamp. `targets` satisfies the completeness invariant: every
639
+ * target the profile declares is present, each with its exact basis — never
640
+ * silently absent. `basis: "conservative"` means an unmodelled or unprovable
641
+ * input widened every target to full impact.
642
+ */
643
+ declare const impactStampSchema: z.ZodObject<{
644
+ basis: z.ZodEnum<{
645
+ "target-scoped": "target-scoped";
646
+ conservative: "conservative";
647
+ }>;
648
+ inertPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
649
+ reasons: z.ZodArray<z.ZodString>;
650
+ stampVersion: z.ZodLiteral<3>;
651
+ targets: z.ZodArray<z.ZodObject<{
652
+ basis: z.ZodString;
653
+ impact: z.ZodEnum<{
654
+ affected: "affected";
655
+ "not-affected": "not-affected";
656
+ }>;
657
+ name: z.ZodString;
658
+ }, z.core.$strip>>;
659
+ unsubscribedPaths: z.ZodArray<z.ZodString>;
660
+ }, z.core.$strip>;
661
+ type ImpactStamp = z.infer<typeof impactStampSchema>;
662
+ /**
663
+ * The surfaces that consume the stamp. One classification, consumed
664
+ * everywhere (#430): every surface routes through
665
+ * {@link impactStampScopeDecision}, so no surface can be more trusting than
666
+ * another, and no surface re-derives path rules of its own. The value only
667
+ * selects the wording of the conservative floor a refusal falls back to.
668
+ */
669
+ declare const IMPACT_SCOPE_SURFACES: {
670
+ readonly demand: "full demand floor";
671
+ readonly "preview-lifecycle": "full preview-lifecycle floor";
672
+ readonly "verification-battery": "full verification-battery floor";
673
+ };
674
+ type ImpactScopeSurface = keyof typeof IMPACT_SCOPE_SURFACES;
675
+ interface ImpactScopeDecision {
676
+ reason: string;
677
+ /** True ⇒ this target's work is provably unreachable and may be released. */
678
+ scoped: boolean;
679
+ }
680
+ /**
681
+ * Whether a trusted stamp RELEASES one target-scoped unit of work — an
682
+ * external proof demand (#542 wave 2), a verification-battery command, or a
683
+ * preview (Alchemy) lifecycle stack (#430 wave 3).
684
+ *
685
+ * The only release path is a `target-scoped` stamp of exactly this build's
686
+ * stamp version whose target entry for exactly this name is provably
687
+ * `not-affected`. Every other input — no trusted stamp, an unknown stamp
688
+ * version, a conservative stamp, a name the stamp does not classify, or an
689
+ * `affected` verdict — keeps today's full-work floor. Work only ever gets
690
+ * released, never added or satisfied: this function can withdraw a demand, it
691
+ * can never certify one.
692
+ *
693
+ * Identity binding is the CALLER's precondition: pass only a stamp computed
694
+ * for, or read from a pr:verify proof bound to, the current candidate (see
695
+ * `trustedImpactStamp` in `pr-readiness/verification-proof.ts`); pass
696
+ * `undefined` otherwise.
697
+ */
698
+ declare const impactStampScopeDecision: ({
699
+ stamp,
700
+ surface,
701
+ targetName
702
+ }: {
703
+ stamp: ImpactStamp | undefined;
704
+ surface: ImpactScopeSurface;
705
+ targetName: string;
706
+ }) => ImpactScopeDecision;
707
+ //#endregion
620
708
  //#region src/profile.d.ts
621
709
  declare const DEFAULT_FACTORY_REPOSITORY = "unknown/unknown";
622
- /** The one profile shape this build accepts (ADR 0023, #318, #351). */
623
- declare const PROFILE_SCHEMA_VERSION = 5;
710
+ /** The one profile shape this build accepts (ADR 0023, #318, #351, #742). */
711
+ declare const PROFILE_SCHEMA_VERSION = 6;
624
712
  declare const factoryProjectProfileSchema: z.ZodObject<{
625
713
  $schema: z.ZodOptional<z.ZodString>;
626
714
  extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -629,18 +717,13 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
629
717
  endpoint: z.ZodIntersection<z.ZodString, z.ZodString>;
630
718
  }, z.core.$strict>>;
631
719
  impact: z.ZodOptional<z.ZodObject<{
720
+ inert: z.ZodOptional<z.ZodArray<z.ZodString>>;
632
721
  targets: z.ZodArray<z.ZodObject<{
633
722
  importers: z.ZodArray<z.ZodString>;
634
723
  name: z.ZodString;
635
724
  paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
636
725
  }, z.core.$strict>>;
637
726
  }, z.core.$strict>>;
638
- proof: z.ZodObject<{
639
- classificationPolicy: z.ZodObject<{
640
- docsOnly: z.ZodDefault<z.ZodArray<z.ZodString>>;
641
- trivial: z.ZodDefault<z.ZodArray<z.ZodString>>;
642
- }, z.core.$strict>;
643
- }, z.core.$strict>;
644
727
  repository: z.ZodObject<{
645
728
  name: z.ZodString;
646
729
  owner: z.ZodString;
@@ -649,7 +732,6 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
649
732
  name: z.ZodString;
650
733
  scope: z.ZodOptional<z.ZodObject<{
651
734
  classifications: z.ZodArray<z.ZodEnum<{
652
- trivial: "trivial";
653
735
  "docs/process-only": "docs/process-only";
654
736
  "non-trivial": "non-trivial";
655
737
  }>>;
@@ -660,7 +742,7 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
660
742
  paths: z.ZodArray<z.ZodString>;
661
743
  }, z.core.$strict>>;
662
744
  }, z.core.$strict>>;
663
- schemaVersion: z.ZodLiteral<5>;
745
+ schemaVersion: z.ZodLiteral<6>;
664
746
  verification: z.ZodObject<{
665
747
  commands: z.ZodArray<z.ZodObject<{
666
748
  command: z.ZodString;
@@ -840,8 +922,8 @@ declare const mergeFreezeStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
840
922
  generationId: z.ZodNumber;
841
923
  headSha: z.ZodString;
842
924
  outcome: z.ZodEnum<{
843
- active: "active";
844
925
  stale: "stale";
926
+ active: "active";
845
927
  }>;
846
928
  reason: z.ZodString;
847
929
  recordedAt: z.ZodISODateTime;
@@ -1217,8 +1299,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1217
1299
  baseSha: z.ZodString;
1218
1300
  blockingReasons: z.ZodArray<z.ZodString>;
1219
1301
  classification: z.ZodEnum<{
1220
- trivial: "trivial";
1221
1302
  "docs/process-only": "docs/process-only";
1303
+ trivial: "trivial";
1222
1304
  "non-trivial": "non-trivial";
1223
1305
  }>;
1224
1306
  externalChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1231,8 +1313,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1231
1313
  reason: z.ZodOptional<z.ZodString>;
1232
1314
  scope: z.ZodOptional<z.ZodObject<{
1233
1315
  classifications: z.ZodArray<z.ZodEnum<{
1234
- trivial: "trivial";
1235
1316
  "docs/process-only": "docs/process-only";
1317
+ trivial: "trivial";
1236
1318
  "non-trivial": "non-trivial";
1237
1319
  }>>;
1238
1320
  }, z.core.$strict>>;
@@ -1282,15 +1364,15 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1282
1364
  unknown: "unknown";
1283
1365
  critical: "critical";
1284
1366
  high: "high";
1285
- medium: "medium";
1286
1367
  low: "low";
1368
+ medium: "medium";
1287
1369
  }>>;
1288
1370
  highestOpenSeverity: z.ZodOptional<z.ZodEnum<{
1289
1371
  unknown: "unknown";
1290
1372
  critical: "critical";
1291
1373
  high: "high";
1292
- medium: "medium";
1293
1374
  low: "low";
1375
+ medium: "medium";
1294
1376
  }>>;
1295
1377
  maxReviewCycles: z.ZodOptional<z.ZodNumber>;
1296
1378
  nonBlockingFindings: z.ZodNumber;
@@ -1318,8 +1400,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1318
1400
  }>;
1319
1401
  stage: z.ZodEnum<{
1320
1402
  gate: "gate";
1321
- "interior-complete": "interior-complete";
1322
1403
  interior: "interior";
1404
+ "interior-complete": "interior-complete";
1323
1405
  }>;
1324
1406
  }, z.core.$strip>>;
1325
1407
  reviewRuns: z.ZodOptional<z.ZodArray<z.ZodType<PrReviewResult, unknown, z.core.$ZodTypeInternals<PrReviewResult, unknown>>>>;
@@ -1334,10 +1416,10 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1334
1416
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1335
1417
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1336
1418
  status: z.ZodEnum<{
1337
- stale: "stale";
1338
1419
  blocked: "blocked";
1339
1420
  "not-required": "not-required";
1340
1421
  current: "current";
1422
+ stale: "stale";
1341
1423
  missing: "missing";
1342
1424
  }>;
1343
1425
  }, z.core.$strip>;
@@ -1346,10 +1428,10 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1346
1428
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
1347
1429
  reviewedPatchId: z.ZodOptional<z.ZodString>;
1348
1430
  status: z.ZodEnum<{
1349
- stale: "stale";
1350
1431
  blocked: "blocked";
1351
1432
  "not-required": "not-required";
1352
1433
  current: "current";
1434
+ stale: "stale";
1353
1435
  missing: "missing";
1354
1436
  }>;
1355
1437
  }, z.core.$strip>>;
@@ -1360,8 +1442,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
1360
1442
  docsOnlyDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
1361
1443
  docsOnlyVerifiedHeadSha: z.ZodOptional<z.ZodString>;
1362
1444
  prVerify: z.ZodEnum<{
1363
- stale: "stale";
1364
1445
  passed: "passed";
1446
+ stale: "stale";
1365
1447
  missing: "missing";
1366
1448
  }>;
1367
1449
  trivialDeltaAccepted: z.ZodOptional<z.ZodBoolean>;
@@ -1598,84 +1680,13 @@ declare function validatePrReadyProof(value: unknown): PrReadyProof;
1598
1680
  declare function readPrReadyProof(filePath: string): PrReadyProof;
1599
1681
  declare function runPrReady(args: PrReadyArgs, dependencies?: PrReadyDependencies): Promise<PrReadyProof>;
1600
1682
  //#endregion
1601
- //#region src/impact-stamp.d.ts
1602
- /**
1603
- * The recorded stamp. `targets` satisfies the completeness invariant: every
1604
- * target the profile declares is present, each with its exact basis — never
1605
- * silently absent. `basis: "conservative"` means an unmodelled or unprovable
1606
- * input widened every target to full impact.
1607
- */
1608
- declare const impactStampSchema: z.ZodObject<{
1609
- basis: z.ZodEnum<{
1610
- "target-scoped": "target-scoped";
1611
- conservative: "conservative";
1612
- }>;
1613
- reasons: z.ZodArray<z.ZodString>;
1614
- stampVersion: z.ZodLiteral<3>;
1615
- targets: z.ZodArray<z.ZodObject<{
1616
- basis: z.ZodString;
1617
- impact: z.ZodEnum<{
1618
- affected: "affected";
1619
- "not-affected": "not-affected";
1620
- }>;
1621
- name: z.ZodString;
1622
- }, z.core.$strip>>;
1623
- unsubscribedPaths: z.ZodArray<z.ZodString>;
1624
- }, z.core.$strip>;
1625
- type ImpactStamp = z.infer<typeof impactStampSchema>;
1626
- /**
1627
- * The surfaces that consume the stamp. One classification, consumed
1628
- * everywhere (#430): every surface routes through
1629
- * {@link impactStampScopeDecision}, so no surface can be more trusting than
1630
- * another, and no surface re-derives path rules of its own. The value only
1631
- * selects the wording of the conservative floor a refusal falls back to.
1632
- */
1633
- declare const IMPACT_SCOPE_SURFACES: {
1634
- readonly demand: "full demand floor";
1635
- readonly "preview-lifecycle": "full preview-lifecycle floor";
1636
- readonly "verification-battery": "full verification-battery floor";
1637
- };
1638
- type ImpactScopeSurface = keyof typeof IMPACT_SCOPE_SURFACES;
1639
- interface ImpactScopeDecision {
1640
- reason: string;
1641
- /** True ⇒ this target's work is provably unreachable and may be released. */
1642
- scoped: boolean;
1643
- }
1644
- /**
1645
- * Whether a trusted stamp RELEASES one target-scoped unit of work — an
1646
- * external proof demand (#542 wave 2), a verification-battery command, or a
1647
- * preview (Alchemy) lifecycle stack (#430 wave 3).
1648
- *
1649
- * The only release path is a `target-scoped` stamp of exactly this build's
1650
- * stamp version whose target entry for exactly this name is provably
1651
- * `not-affected`. Every other input — no trusted stamp, an unknown stamp
1652
- * version, a conservative stamp, a name the stamp does not classify, or an
1653
- * `affected` verdict — keeps today's full-work floor. Work only ever gets
1654
- * released, never added or satisfied: this function can withdraw a demand, it
1655
- * can never certify one.
1656
- *
1657
- * Identity binding is the CALLER's precondition: pass only a stamp computed
1658
- * for, or read from a pr:verify proof bound to, the current candidate (see
1659
- * `trustedImpactStamp` in `pr-readiness/verification-proof.ts`); pass
1660
- * `undefined` otherwise.
1661
- */
1662
- declare const impactStampScopeDecision: ({
1663
- stamp,
1664
- surface,
1665
- targetName
1666
- }: {
1667
- stamp: ImpactStamp | undefined;
1668
- surface: ImpactScopeSurface;
1669
- targetName: string;
1670
- }) => ImpactScopeDecision;
1671
- //#endregion
1672
1683
  //#region src/required-check-policy.d.ts
1673
1684
  declare const EVIDENCE_CHECK_TYPES: readonly ["review", "verify"];
1674
1685
  type EvidenceCheckType = (typeof EVIDENCE_CHECK_TYPES)[number];
1675
1686
  declare const requiredCheckScopeSchema: z.ZodObject<{
1676
1687
  classifications: z.ZodArray<z.ZodEnum<{
1677
- trivial: "trivial";
1678
1688
  "docs/process-only": "docs/process-only";
1689
+ trivial: "trivial";
1679
1690
  "non-trivial": "non-trivial";
1680
1691
  }>>;
1681
1692
  }, z.core.$strict>;
@@ -1863,10 +1874,10 @@ declare const loadEvidenceEnvelopes: (cwd: string) => LoadedEvidenceEnvelope[];
1863
1874
  //#region src/review-proof-applicability.d.ts
1864
1875
  declare const REVIEW_STATUS_VALUES: readonly ["not-required", "current", "stale", "missing", "blocked"];
1865
1876
  declare const reviewStatusSchema: z.ZodEnum<{
1866
- stale: "stale";
1867
1877
  blocked: "blocked";
1868
1878
  "not-required": "not-required";
1869
1879
  current: "current";
1880
+ stale: "stale";
1870
1881
  missing: "missing";
1871
1882
  }>;
1872
1883
  type ReviewStatus = z.infer<typeof reviewStatusSchema>;
@@ -2009,6 +2020,16 @@ interface PrVerifyNotRequiredCommand {
2009
2020
  impactTarget: string;
2010
2021
  name: string;
2011
2022
  }
2023
+ /**
2024
+ * Epic #758 (#762): a consumer package a stamp-scoped selection skipped, and
2025
+ * why. Bound to the proof's stamp identity — the field is v4-only (the same
2026
+ * window that can carry `impactStamp`) and refused when the proof records no
2027
+ * stamp. The factory does not write this list; consumers do.
2028
+ */
2029
+ interface PrVerifyNotDemandedRecord {
2030
+ basis: string;
2031
+ name: string;
2032
+ }
2012
2033
  interface PrVerifyProof {
2013
2034
  schemaVersion: PrVerifySchemaVersion;
2014
2035
  authoringSession?: string;
@@ -2032,6 +2053,7 @@ interface PrVerifyProof {
2032
2053
  impactStamp?: ImpactStamp;
2033
2054
  mode: ResolvedPrVerifyMode;
2034
2055
  mergeBaseSha?: string;
2056
+ notDemandedRecords?: PrVerifyNotDemandedRecord[];
2035
2057
  notRequiredCommands?: PrVerifyNotRequiredCommand[];
2036
2058
  outcome?: "aborted" | "passed";
2037
2059
  patchId?: string;
@@ -2050,7 +2072,7 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2050
2072
  boundary: z.ZodOptional<z.ZodString>;
2051
2073
  command: z.ZodLiteral<"patronage-factory boundary:check">;
2052
2074
  coveredSet: z.ZodArray<z.ZodObject<{
2053
- issue: z.ZodNumber;
2075
+ issue: z.ZodOptional<z.ZodNumber>;
2054
2076
  pr: z.ZodNumber;
2055
2077
  sha: z.ZodString;
2056
2078
  state: z.ZodEnum<{
@@ -2093,8 +2115,8 @@ declare const boundaryCheckProofSchema: z.ZodObject<{
2093
2115
  value: z.ZodString;
2094
2116
  }, z.core.$strip>>;
2095
2117
  status: z.ZodEnum<{
2096
- blocked: "blocked";
2097
2118
  ready: "ready";
2119
+ blocked: "blocked";
2098
2120
  }>;
2099
2121
  }, z.core.$strip>;
2100
2122
  type BoundaryCheckProofRecord = z.infer<typeof boundaryCheckProofSchema>;
@@ -2216,7 +2238,7 @@ interface PrReviewDependencies {
2216
2238
  }
2217
2239
  declare function runPrReview(args: PrReviewArgs, dependencies?: PrReviewDependencies): Promise<PrReviewProof>;
2218
2240
  declare namespace verification_proof_d_exports {
2219
- export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
2241
+ export { PrVerifyBaselineFullProof, PrVerifyCommandResult, PrVerifyExecutedCommand, PrVerifyNotDemandedRecord, PrVerifyNotRequiredCommand, PrVerifyProof, PrVerifySchemaVersion, ResolvedPrVerifyMode, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, VerificationHeadShas, VerificationProofState, VerifiedHeadShas, prVerifyFullHeadShasForDiff, prVerifyProofHeadShas, readPrVerifyProof, resolveVerifyProofApplicability, trustedImpactStamp, validatePrVerifyProof, verificationProofApplicabilityFor, verificationProofBlockingReason, verificationProofForReadiness, verificationProofStateFor, verifyProofIdentityMatches, verifyProofPassed };
2220
2242
  }
2221
2243
  interface VerifiedHeadShas {
2222
2244
  docsOnlyVerifiedHeadShas: string[];
@@ -2372,7 +2394,7 @@ interface CleanInstallResolutionDependencies {
2372
2394
  }
2373
2395
  //#endregion
2374
2396
  //#region src/pr-verify.d.ts
2375
- type PrVerifyMode = "auto" | "docs-only" | "trivial" | "full";
2397
+ type PrVerifyMode = "auto" | "docs-only" | "full";
2376
2398
  interface VerificationCommandOutcome {
2377
2399
  counts?: {
2378
2400
  testFiles?: number;
@@ -3218,8 +3240,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3218
3240
  slotResolution: z.ZodObject<{
3219
3241
  effort: z.ZodEnum<{
3220
3242
  high: "high";
3221
- medium: "medium";
3222
3243
  low: "low";
3244
+ medium: "medium";
3223
3245
  xhigh: "xhigh";
3224
3246
  }>;
3225
3247
  engine: z.ZodString;
@@ -3297,8 +3319,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3297
3319
  slotResolution: z.ZodObject<{
3298
3320
  effort: z.ZodEnum<{
3299
3321
  high: "high";
3300
- medium: "medium";
3301
3322
  low: "low";
3323
+ medium: "medium";
3302
3324
  xhigh: "xhigh";
3303
3325
  }>;
3304
3326
  engine: z.ZodString;
@@ -3367,8 +3389,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3367
3389
  slotResolution: z.ZodObject<{
3368
3390
  effort: z.ZodEnum<{
3369
3391
  high: "high";
3370
- medium: "medium";
3371
3392
  low: "low";
3393
+ medium: "medium";
3372
3394
  xhigh: "xhigh";
3373
3395
  }>;
3374
3396
  engine: z.ZodString;
@@ -3436,7 +3458,7 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
3436
3458
  observedAt: string;
3437
3459
  purpose: "review" | "code";
3438
3460
  slotResolution: {
3439
- effort: "high" | "medium" | "low" | "xhigh";
3461
+ effort: "high" | "low" | "medium" | "xhigh";
3440
3462
  engine: string;
3441
3463
  layerSource: "committedDefault" | "operatorSession" | "userConfig";
3442
3464
  model: string;
@@ -3761,7 +3783,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
3761
3783
  ledger: {
3762
3784
  baseSha: string;
3763
3785
  blockingReasons: string[];
3764
- classification: "trivial" | "docs/process-only" | "non-trivial";
3786
+ classification: "docs/process-only" | "trivial" | "non-trivial";
3765
3787
  github: {
3766
3788
  draft: boolean;
3767
3789
  mergeStateStatus: string;
@@ -3781,13 +3803,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
3781
3803
  reviews: {
3782
3804
  correctness: {
3783
3805
  required: boolean;
3784
- status: "stale" | "blocked" | "not-required" | "current" | "missing";
3806
+ status: "blocked" | "not-required" | "current" | "stale" | "missing";
3785
3807
  reviewedHeadSha?: string | undefined;
3786
3808
  reviewedPatchId?: string | undefined;
3787
3809
  };
3788
3810
  security?: {
3789
3811
  required: boolean;
3790
- status: "stale" | "blocked" | "not-required" | "current" | "missing";
3812
+ status: "blocked" | "not-required" | "current" | "stale" | "missing";
3791
3813
  reviewedHeadSha?: string | undefined;
3792
3814
  reviewedPatchId?: string | undefined;
3793
3815
  } | undefined;
@@ -3795,7 +3817,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
3795
3817
  schemaVersion: 1;
3796
3818
  verification: {
3797
3819
  command: "patronage-factory pr:verify";
3798
- prVerify: "stale" | "passed" | "missing";
3820
+ prVerify: "passed" | "stale" | "missing";
3799
3821
  docsOnlyDeltaAccepted?: boolean | undefined;
3800
3822
  docsOnlyVerifiedHeadSha?: string | undefined;
3801
3823
  trivialDeltaAccepted?: boolean | undefined;
@@ -3810,7 +3832,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
3810
3832
  status: "satisfied" | "unmet" | "out-of-scope";
3811
3833
  reason?: string | undefined;
3812
3834
  scope?: {
3813
- classifications: ("trivial" | "docs/process-only" | "non-trivial")[];
3835
+ classifications: ("docs/process-only" | "trivial" | "non-trivial")[];
3814
3836
  } | undefined;
3815
3837
  }[] | undefined;
3816
3838
  mergeBaseSha?: string | undefined;
@@ -3826,8 +3848,8 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
3826
3848
  nonBlockingFindings: number;
3827
3849
  openFindings: number;
3828
3850
  windowExhausted: boolean;
3829
- highestBlockingSeverity?: "unknown" | "critical" | "high" | "medium" | "low" | undefined;
3830
- highestOpenSeverity?: "unknown" | "critical" | "high" | "medium" | "low" | undefined;
3851
+ highestBlockingSeverity?: "unknown" | "critical" | "high" | "low" | "medium" | undefined;
3852
+ highestOpenSeverity?: "unknown" | "critical" | "high" | "low" | "medium" | undefined;
3831
3853
  maxReviewCycles?: number | undefined;
3832
3854
  reviewCycle?: number | undefined;
3833
3855
  staleRepeatFindings?: number | undefined;
@@ -3838,7 +3860,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
3838
3860
  interior: number;
3839
3861
  };
3840
3862
  nextAction: "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human" | "advance-to-gate" | "run-interior-cycle";
3841
- stage: "gate" | "interior-complete" | "interior";
3863
+ stage: "gate" | "interior" | "interior-complete";
3842
3864
  forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
3843
3865
  } | undefined;
3844
3866
  reviewRuns?: PrReviewResult[] | undefined;
@@ -4163,6 +4185,34 @@ declare const appendReviewLadderStageTraceEvent: ({
4163
4185
  }) => AppendFactoryTraceEventResult;
4164
4186
  declare const tryAppendReviewLadderStageTraceEvent: (input: Parameters<typeof appendReviewLadderStageTraceEvent>[0]) => ReviewLadderStageTraceWriteResult;
4165
4187
  //#endregion
4188
+ //#region src/verification-run-context.d.ts
4189
+ declare const FACTORY_BASE_REF_ENV = "FACTORY_BASE_REF";
4190
+ declare const FACTORY_CHANGED_FILES_ENV = "FACTORY_CHANGED_FILES";
4191
+ declare const FACTORY_CHANGED_FILES_FILE_ENV = "FACTORY_CHANGED_FILES_FILE";
4192
+ declare const EMPTY_TREE_OBJECT_HASH = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
4193
+ declare const DEFAULT_ROOT_SHARED_GLOBS: string[];
4194
+ interface VerificationRunContextInput {
4195
+ baseRef: string;
4196
+ changedFiles: string[];
4197
+ fullSuiteBaseRef?: string;
4198
+ rootSharedGlobs?: string[];
4199
+ inlineLimitBytes?: number;
4200
+ tmpDir?: string;
4201
+ }
4202
+ interface VerificationEnv {
4203
+ env: Record<string, string>;
4204
+ cleanup: () => void;
4205
+ }
4206
+ interface VerificationRunContext {
4207
+ readonly baseRef: string;
4208
+ readonly changedFiles: string[];
4209
+ readonly forcesFullSuite: boolean;
4210
+ readonly fullSuiteReasons: string[];
4211
+ buildEnv: () => VerificationEnv;
4212
+ runSummaryLines: () => string[];
4213
+ }
4214
+ declare function createVerificationRunContext(input: VerificationRunContextInput): VerificationRunContext;
4215
+ //#endregion
4166
4216
  //#region src/verification-battery.d.ts
4167
4217
  type BatteryDisposition = "executed" | "not-required";
4168
4218
  /**
@@ -4359,4 +4409,4 @@ interface CreateProgramOptions {
4359
4409
  declare function createProgram(options?: CreateProgramOptions): Command;
4360
4410
  declare function run(argv?: string[]): Promise<void>;
4361
4411
  //#endregion
4362
- export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, CreateProgramOptions, DEFAULT_DEMAND_WAIVER_PATH, DEFAULT_FACTORY_REPOSITORY, type DagDocument, type DemandWaiveArgs, type DemandWaiveDependencies, DemandWaiveRefusalError, type DemandWaiver, type DemandWaiverStore, EPIC_STRUCTURE_NODE_STATUSES, EPIC_STRUCTURE_SCHEMA_VERSION, type EpicStructureEvent, type EpicStructureGraphPayload, type EpicStructureNodeStatus, EpicStructureValidationError, type EvidenceEmitArgs, type EvidenceEmitDependencies, type EvidenceEmitResult, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FindingDisposition, type FindingLedgerEntry, type FollowUpAction, FollowUpActionSchema, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, type LadderDispositionDeclaration, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeState, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, REVIEW_FOCUS_SECTION, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewLadderCycle, type ReviewLadderEvaluation, type ReviewLadderPolicy, type ReviewLadderStageEvent, type ReviewLadderTraceIdentity, type ReviewPromptSection, type ReviewPromptSectionProvenance, type ScanFactoryTraceDiagnosticsOptions, type ScanFactoryTraceOptions, type ScanFactoryTraceResult, type ScopedOutCommand, type TraceMirrorDiagnostic, type TraceSink, type TraceWriteResult, type TraceWriteSinks, type VerificationBatteryPlan, type VerificationReuse, type WaivedDemand, WorkerCheckoutGuardError, type WorkerCloseoutLessonsTraceEvent, appendReviewLadderStageTraceEvent, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, blockingLadderFindings, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, buildReviewLadderStageTraceEvent, comment_provenance_d_exports as commentProvenance, createLocalJsonlTraceSink, createProgram, doctorProjectProfile, epicStructureEventId, evaluateReviewLadder, evidenceEnvelopeFilename, findingKey, followUpFromArgv, impactStampScopeDecision, inferFixedInThreadDispositions, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, openLadderFindings, planPreviewLifecycle, planPublishFollowUp, planVerificationBattery, readiness_evaluation_d_exports as prReadinessEvaluation, external_evidence_d_exports as prReadinessExternalEvidence, pr_body_renderer_d_exports as prReadinessPrBodyRenderer, proof_identity_d_exports as prReadinessProofIdentity, review_proof_d_exports as prReadinessReviewProof, status_check_rollup_d_exports as prReadinessStatusChecks, verification_proof_d_exports as prReadinessVerificationProof, previewLifecycleTargets, publishEpicStructure, readDemandWaivers, readPrReadyProof, readPrReviewProof, resolveFactoryRepository, resolveFindingBlocking, resolveReviewFindingCategory, resolveReviewFindingSeverity, resolveReviewLadderPolicy, resolveTraceWriteSinks, reviewCycleStateFor, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, staleRepeatLadderFindings, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, tryAppendReviewLadderStageTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrReviewProof, validatePrVerifyProof, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };
4412
+ export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, CreateProgramOptions, DEFAULT_DEMAND_WAIVER_PATH, DEFAULT_FACTORY_REPOSITORY, DEFAULT_ROOT_SHARED_GLOBS, type DagDocument, type DemandWaiveArgs, type DemandWaiveDependencies, DemandWaiveRefusalError, type DemandWaiver, type DemandWaiverStore, EMPTY_TREE_OBJECT_HASH, EPIC_STRUCTURE_NODE_STATUSES, EPIC_STRUCTURE_SCHEMA_VERSION, type EpicStructureEvent, type EpicStructureGraphPayload, type EpicStructureNodeStatus, EpicStructureValidationError, type EvidenceEmitArgs, type EvidenceEmitDependencies, type EvidenceEmitResult, FACTORY_BASE_REF_ENV, FACTORY_CHANGED_FILES_ENV, FACTORY_CHANGED_FILES_FILE_ENV, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FindingDisposition, type FindingLedgerEntry, type FollowUpAction, FollowUpActionSchema, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, type LadderDispositionDeclaration, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeState, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, REVIEW_FOCUS_SECTION, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, type ReviewLadderCycle, type ReviewLadderEvaluation, type ReviewLadderPolicy, type ReviewLadderStageEvent, type ReviewLadderTraceIdentity, type ReviewPromptSection, type ReviewPromptSectionProvenance, type ScanFactoryTraceDiagnosticsOptions, type ScanFactoryTraceOptions, type ScanFactoryTraceResult, type ScopedOutCommand, type TraceMirrorDiagnostic, type TraceSink, type TraceWriteResult, type TraceWriteSinks, type VerificationBatteryPlan, type VerificationReuse, type VerificationRunContext, type VerificationRunContextInput, type WaivedDemand, WorkerCheckoutGuardError, type WorkerCloseoutLessonsTraceEvent, appendReviewLadderStageTraceEvent, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, blockingLadderFindings, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, buildReviewLadderStageTraceEvent, comment_provenance_d_exports as commentProvenance, createLocalJsonlTraceSink, createProgram, createVerificationRunContext, doctorProjectProfile, epicStructureEventId, evaluateReviewLadder, evidenceEnvelopeFilename, findingKey, followUpFromArgv, impactStampScopeDecision, inferFixedInThreadDispositions, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, openLadderFindings, planPreviewLifecycle, planPublishFollowUp, planVerificationBattery, readiness_evaluation_d_exports as prReadinessEvaluation, external_evidence_d_exports as prReadinessExternalEvidence, pr_body_renderer_d_exports as prReadinessPrBodyRenderer, proof_identity_d_exports as prReadinessProofIdentity, review_proof_d_exports as prReadinessReviewProof, status_check_rollup_d_exports as prReadinessStatusChecks, verification_proof_d_exports as prReadinessVerificationProof, previewLifecycleTargets, publishEpicStructure, readDemandWaivers, readPrReadyProof, readPrReviewProof, resolveFactoryRepository, resolveFindingBlocking, resolveReviewFindingCategory, resolveReviewFindingSeverity, resolveReviewLadderPolicy, resolveTraceWriteSinks, reviewCycleStateFor, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, staleRepeatLadderFindings, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, tryAppendReviewLadderStageTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrReviewProof, validatePrVerifyProof, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };