@patronage/software-factory 1.0.0-alpha.43 → 1.0.0-alpha.45

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 CHANGED
@@ -8,7 +8,7 @@ Admission is fail closed. A clean-session review and required verification produ
8
8
 
9
9
  ## Develop the package
10
10
 
11
- This section and the two below describe the source repository; the paths they mention are not part of the installed npm package. The package lives in the repository pnpm workspace and requires Node 24.20.0 from `.nvmrc`. Published `engines.node` remains `^24.0.0`. From the repository root:
11
+ This section and the two below describe the source repository; the paths they mention are not part of the installed npm package. The package lives in the repository pnpm workspace and requires Node 24 from `.nvmrc`. Published `engines.node` remains `^24.0.0`. From the repository root:
12
12
 
13
13
  ```bash
14
14
  bash scripts/bootstrap-worktree.sh .
@@ -30,7 +30,7 @@ A public export leaves this package only with the supported-consumer, migration
30
30
 
31
31
  This is the release checklist. It lives here and nowhere else; the repository runbook links to it rather than restating it. Do not let merged work accumulate untagged: merged work that no release-owning boundary carries rides the next attended release.
32
32
 
33
- Releases are attended and hand-cut. Nothing in the factory publishes, tags, or releases on its own, and no step below may be automated as a drive-by. Delivery closeout (`boundary:check --final`, then `factory:closeout` on the epic) is a separate act with a separate owner: it closes the epic and releases nothing. Only a release-owning boundary carries a release, and one issue at a time holds that authority for a given version. A docs-only or non-release-owning runtime boundary closes without a bump and waits for the next attended cut. The admission skill's [closeout reference](../skills/patronage-software-factory-admission/references/epic-closeout.md#delivery-closeout-is-not-a-release) states the same split from the closeout side.
33
+ Releases are attended. Nothing in the factory publishes, tags, or releases on its own, and no step below may be automated as a drive-by. Delivery closeout (`boundary:check --final`, then `factory:closeout` on the epic) is a separate act with a separate owner: it closes the epic and releases nothing. Only a release-owning boundary carries a release, and one issue at a time holds that authority for a given version. A docs-only or non-release-owning runtime boundary closes without a bump and waits for the next attended cut. The admission skill's [closeout reference](../skills/patronage-software-factory-admission/references/epic-closeout.md#delivery-closeout-is-not-a-release) states the same split from the closeout side.
34
34
 
35
35
  The factory family has one version posture (ADR 0026, `docs/adr/0026-factory-family-version-lines-move-in-lockstep.md` in the source repository): `@patronage/factory-ci` moves in lockstep majors with this CLI. From factory-ci's first release in the CLI's current series onward, majors and prerelease series move together while patch and prerelease increments stay independent per package. A consumer pins a factory-ci from the same major/prerelease series as its CLI; there is no compatibility matrix. Until that first lockstep release, factory-ci's published 0.x line is the named pre-adoption state and pairs with any CLI version. `@patronage/alchemy-d1-state` keeps independent SemVer. Lockstep is a rule the maintainer follows when cutting releases, never automation.
36
36
 
@@ -41,7 +41,7 @@ A stacked release train has one terminal release-owning slice. Interior slices d
41
41
  A stable cut has two phases. Phase 1 is the verified package candidate: steps 1 through 4 below, ending in the attended npm publish, tag, and GitHub release. Phase 2 is post-publication stable-doc convergence: steps 5 and 6, a normal admitted docs PR followed by the read-only convergence assertion from a clean `main`. Stable docs must never claim an unpublished version, so they cannot land in the phase-1 change. Prerelease behavior is unchanged: prerelease notes may land before publish while stable docs keep naming the prior stable version.
42
42
 
43
43
  1. Bump `package.json` to valid SemVer. The assertion derives its expected stable or prerelease channel from the version; it accepts no channel flag. Before publishing, prove production HQ accepts this candidate's proof schema. The manifest bump triggers the CI-only `HQ Deploy` workflow because HQ bundles this package's public schemas. From a clean `main`, record `RELEASE_SHA="$(git rev-parse HEAD)"`, find the `HQ Deploy` run with `gh run list --workflow "HQ Deploy" --commit "$RELEASE_SHA"`, and use `gh run watch <run-id> --exit-status`; an older green deployment does not count. One exception is defined: when the version bump merged earlier inside the release boundary and the release-owning PR touches no `HQ Deploy` path, no run can exist at the release SHA. The gate then binds to the most recent merge that modified an `HQ Deploy`-triggering path; that run must be green at its exact SHA, every later merge up to the release SHA must be outside those paths, and the release notes record which SHA satisfied the gate. Then, outside a sandbox, run `psf hq:flush --cwd <candidate-worktree>` against the candidate's retained `pr-verify-proof`. The release may proceed only when the current proof exists, the exact-SHA deployment passed, and the drain reports that proof `delivered` or `duplicate` (or no pending spool because its original delivery already succeeded), with `rejected 0` and no event remaining. This is an attended release-compatibility gate; it does not make HQ authoritative for ordinary admission.
44
- 2. Build and review one pnpm tarball, then publish that exact tarball per the [repository operations runbook](../docs/repository-operations.md#publishing) (attended and hand-cut). Publishing the workspace directory is not allowed because it rebuilds during `prepack` after the artifact review. **Always pass `--tag` explicitly, on every publish, prerelease or stable**: `pnpm publish "$SOFTWARE_FACTORY_TARBALL" --tag next --access public` for a prerelease, `--tag latest` for a stable cut. A filtered directory publish takes pnpm's recursive path, which passes its own `--tag` (defaulting to `latest`) to npm and therefore ignores the `publishConfig.tag: next` pin both factory packages carry; that is how 1.0.0-alpha.6 briefly took `latest` (#658). The pins stay as belt and braces, but they are not the control. Omitting the flag is not a safe failure: it moves `latest`, which the convergence assertion can only report after the fact. The attended token path does not promise an npm provenance attestation; the source SHA and reviewed tarball SRI are its operational provenance.
44
+ 2. Build and review one pnpm tarball, then publish that exact tarball with `pnpm release:publish` per the [repository operations runbook](../docs/repository-operations.md#publishing). The command is attended: it asks for the exact `name@version` before it publishes. Publishing the workspace directory is not allowed because it rebuilds during `prepack` after the artifact review, and the command refuses a directory. **Always pass `--tag` explicitly, on every publish, prerelease or stable**: `pnpm release:publish "$SOFTWARE_FACTORY_TARBALL" --tag next` for a prerelease, `--tag latest` for a stable cut. The command refuses a missing tag or one that disagrees with the version, checks that pnpm published the reviewed bytes, and reads the tag and integrity back from the registry. A filtered directory publish takes pnpm's recursive path, which passes its own `--tag` (defaulting to `latest`) to npm and therefore ignores the `publishConfig.tag: next` pin both factory packages carry; that is how 1.0.0-alpha.6 briefly took `latest` (#658). The pins stay as belt and braces, but they are not the control. For a raw `pnpm publish`, omitting the flag is not a safe failure: it moves `latest`, which the convergence assertion can only report after the fact. The attended token path does not promise an npm provenance attestation; the source SHA and reviewed tarball SRI are its operational provenance.
45
45
  3. Cut the `software-factory-vX.Y.Z` tag and push it.
46
46
  4. Cut the GitHub release for that tag, with notes covering features, deletions, breaking changes, and closed issues. Mark it as a prerelease exactly when its SemVer version has a prerelease component. When the release changes the profile `schemaVersion`, state it in the notes — the profile schema version is a separate axis from the package version.
47
47
  5. Converge the stable docs after publication. Update affected `software-factory-docs/` pages through a normal admitted docs PR. Stable docs must state the current stable version. Prerelease docs may record the candidate and its migration notes, but must not represent it as the current stable release.
package/dist/index.d.ts CHANGED
@@ -138,8 +138,8 @@ declare const boundaryManifestBaseSchema: z.ZodObject<{
138
138
  integrationBranch: z.ZodOptional<z.ZodString>;
139
139
  schemaVersion: z.ZodLiteral<1>;
140
140
  topology: z.ZodEnum<{
141
- flagged: "flagged";
142
141
  "each-to-main": "each-to-main";
142
+ flagged: "flagged";
143
143
  stacked: "stacked";
144
144
  "each-to-epic": "each-to-epic";
145
145
  }>;
@@ -167,8 +167,8 @@ declare const boundaryManifestSchema: z.ZodObject<{
167
167
  integrationBranch: z.ZodOptional<z.ZodString>;
168
168
  schemaVersion: z.ZodLiteral<1>;
169
169
  topology: z.ZodEnum<{
170
- flagged: "flagged";
171
170
  "each-to-main": "each-to-main";
171
+ flagged: "flagged";
172
172
  stacked: "stacked";
173
173
  "each-to-epic": "each-to-epic";
174
174
  }>;
@@ -657,68 +657,6 @@ interface HqSpoolOrphanSweep {
657
657
  orphans: HqSpoolOrphan[];
658
658
  root: string;
659
659
  }
660
- /**
661
- * Reports spooled evidence sitting under an earlier key for *this* repository
662
- * (#420).
663
- *
664
- * The spool is keyed by owner and repo, so a change to the segment encoding
665
- * itself — which happened during #390's own development — moves the address
666
- * without moving the evidence. Both readers of the spool resolve exactly one
667
- * key, so the events under the old one become invisible: the drain reports
668
- * success, doctor reports empty, and three real proofs sat unread until an
669
- * attended recovery enumerated the tree by hand.
670
- *
671
- * This sweep only reports. Draining another key's events is a decision this
672
- * does not make — the operator gets the location and the count, and
673
- * `hq:flush --dir` remains the recovery path.
674
- *
675
- * **Why candidate keys and not a walk of the root (#446).** The root is shared
676
- * by every factory repository on the machine, so enumerating it and calling
677
- * everything that is not the current key an orphan describes another
678
- * repository's ordinary, current, correct spool exactly as well as it describes
679
- * this repository's obsolete one. That made doctor red in one checkout because
680
- * a different repository had pending work, and told the operator to drain it —
681
- * confidently prescribing the wrong action. Nothing on disk distinguishes the
682
- * two cases: an unrecognised key carries no statement about who wrote it.
683
- *
684
- * So discovery is scoped to the keys *this* repository could plausibly have
685
- * produced — the current scheme plus the earlier ones listed in
686
- * `hqSpoolCandidateKeys` — and a key outside that set is never this
687
- * repository's business. The #420 incident is inside it: the joined
688
- * single-segment key is one of the candidates.
689
- *
690
- * **And a marked walk beside them (#447).** Derivation's other blind spot is a
691
- * key whose *encoding* this checkout no longer produces but whose owner and
692
- * repo are unchanged — the retired non-injective era being the live example.
693
- * That era cannot be derived safely, because a candidate built from it can
694
- * equal a different repository's current key, so #446 dropped it rather than
695
- * risk the cross-repository claim again.
696
- *
697
- * `SPOOL_REPOSITORY_MARKER` supplies the proof that derivation could not. Every
698
- * enqueue stamps its spool with the repository writing it, so the root can be
699
- * walked again: a directory whose marker names *this* repository is this
700
- * repository's, whatever key encoding it sits under, and a directory whose
701
- * marker names another repository is never reported here. That is the
702
- * discriminator #446 correctly said did not exist — it exists now because
703
- * something writes it down.
704
- *
705
- * The two discoveries are complements, not alternatives. The walk sees only
706
- * what was stamped; directories written before this shipped have no marker, and
707
- * candidate keys still find those. An unmarked directory is still never
708
- * reported, because it still carries no statement about who wrote it.
709
- *
710
- * **What this does NOT close, despite being the marker's obvious use: renames
711
- * and owner changes.** A marker records the identity that was current when the
712
- * directory was written, so after `patronage/old` becomes `patronage/new` the
713
- * stranded directory is stamped `patronage/old` — and matching is equality
714
- * against the checkout's *present* identity, which rejects it. Making that work
715
- * needs an identifier that survives a rename, which neither the profile nor the
716
- * marker carries today; accepting a non-matching marker instead would be
717
- * guessing, which is the #446 defect wearing a new hat. #447 stays open for it.
718
- *
719
- * Also outside the sweep, by construction: evidence under a *different state
720
- * root*, if `XDG_STATE_HOME` moves. No walk of this root can reach another one.
721
- */
722
660
  declare function sweepHqSpoolOrphans(input: {
723
661
  repository: HqSpoolRepository;
724
662
  }, dependencies?: {
@@ -1112,6 +1050,7 @@ declare const factoryProjectProfileSchema: z.ZodObject<{
1112
1050
  endpoint: z.ZodIntersection<z.ZodString, z.ZodString>;
1113
1051
  }, z.core.$strict>>;
1114
1052
  impact: z.ZodOptional<z.ZodObject<{
1053
+ dependencyLocal: z.ZodOptional<z.ZodArray<z.ZodString>>;
1115
1054
  inert: z.ZodOptional<z.ZodArray<z.ZodString>>;
1116
1055
  targets: z.ZodArray<z.ZodObject<{
1117
1056
  importers: z.ZodArray<z.ZodString>;
@@ -1370,6 +1309,19 @@ declare const followUpFromArgv: (argv: string[]) => FollowUpAction;
1370
1309
  /** Canonical zod schema for the optional follow-up field on JSON outputs. */
1371
1310
  declare const FollowUpActionSchema: z.ZodType<FollowUpAction>;
1372
1311
  //#endregion
1312
+ //#region src/hq-access.d.ts
1313
+ /** Cloudflare Access service-token credentials for production HQ ingest. */
1314
+ interface CloudflareAccessServiceToken {
1315
+ clientId: string;
1316
+ clientSecret: string;
1317
+ }
1318
+ //#endregion
1319
+ //#region src/check-run-relay.d.ts
1320
+ interface CheckRunRelay {
1321
+ credentials: CloudflareAccessServiceToken;
1322
+ url: URL;
1323
+ }
1324
+ //#endregion
1373
1325
  //#region src/pr-verify-mode.d.ts
1374
1326
  /**
1375
1327
  * The verification mode `pr:verify` resolved for a run.
@@ -1639,6 +1591,12 @@ interface PublishFactoryCheckInput {
1639
1591
  }
1640
1592
  interface CheckRunDependencies extends FactoryAppAccessDependencies {
1641
1593
  postCommitStatus?: PostCommitStatus;
1594
+ /**
1595
+ * Post through HQ's check-run relay instead of with an App token (#1567).
1596
+ * The read-back then sends no credential of its own: the only machine that
1597
+ * relays is one whose egress proxy authenticates its GitHub reads.
1598
+ */
1599
+ relay?: CheckRunRelay;
1642
1600
  resolveDetailsUrl?: (input: PublishFactoryCheckInput, signal?: AbortSignal) => Promise<string> | string;
1643
1601
  /**
1644
1602
  * Bounded retry for the check-run POST. GitHub answers 422 for a head SHA it
@@ -2023,8 +1981,8 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
2023
1981
  "ready-for-human": "ready-for-human";
2024
1982
  }>;
2025
1983
  stage: z.ZodEnum<{
2026
- interior: "interior";
2027
1984
  gate: "gate";
1985
+ interior: "interior";
2028
1986
  "interior-complete": "interior-complete";
2029
1987
  }>;
2030
1988
  }, z.core.$strip>>;
@@ -2040,9 +1998,9 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
2040
1998
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
2041
1999
  reviewedPatchId: z.ZodOptional<z.ZodString>;
2042
2000
  status: z.ZodEnum<{
2043
- "not-required": "not-required";
2044
2001
  stale: "stale";
2045
2002
  blocked: "blocked";
2003
+ "not-required": "not-required";
2046
2004
  current: "current";
2047
2005
  missing: "missing";
2048
2006
  }>;
@@ -2052,9 +2010,9 @@ declare const managedReadinessLedgerSchema: z.ZodObject<{
2052
2010
  reviewedHeadSha: z.ZodOptional<z.ZodString>;
2053
2011
  reviewedPatchId: z.ZodOptional<z.ZodString>;
2054
2012
  status: z.ZodEnum<{
2055
- "not-required": "not-required";
2056
2013
  stale: "stale";
2057
2014
  blocked: "blocked";
2015
+ "not-required": "not-required";
2058
2016
  current: "current";
2059
2017
  missing: "missing";
2060
2018
  }>;
@@ -2089,7 +2047,7 @@ type ReadinessStatus = "ready" | "blocked";
2089
2047
  type ManagedReadinessLedger = z.infer<typeof managedReadinessLedgerSchema>;
2090
2048
  declare function validateManagedReadinessLedger(value: unknown): ManagedReadinessLedger;
2091
2049
  declare namespace status_check_rollup_d_exports {
2092
- export { CheckState, HOSTED_VERIFY_CHECK_NAME, HOSTED_VERIFY_DRAFT_CHECK_NAME, StatusCheckRollup, hostedVerifyCheckState, isDraftHostedVerifyCheck, isExcludedFromAdmissionChecks, isFactoryReadyCheck, isHostedVerifyCheck, isSupersededHostedVerifyCheck, pendingCheckNames, statusCheckState };
2050
+ export { CheckState, HOSTED_VERIFY_CHECK_NAME, HOSTED_VERIFY_DRAFT_CHECK_NAME, StatusCheckRollup, admissionCheckExclusion, admissionCheckSetDescription, fetchRequiredStatusCheckContexts, hostedVerifyCheckState, isCancelledPrStatusHudCheck, isDraftHostedVerifyCheck, isExcludedFromAdmissionChecks, isFactoryReadyCheck, isHostedVerifyCheck, isRequiredStatusCheck, isSupersededHostedVerifyCheck, pendingCheckNames, requiredStatusCheckContexts, statusCheckState, unsettledNonRequiredCheckNames };
2093
2051
  }
2094
2052
  type CheckState = "passed" | "failed" | "pending" | "none" | "unknown";
2095
2053
  interface StatusCheckRollup {
@@ -2150,12 +2108,49 @@ declare const HOSTED_VERIFY_DRAFT_CHECK_NAME = "verify (draft)";
2150
2108
  * `verify` row already answers for, so admission does not judge it.
2151
2109
  */
2152
2110
  declare const isDraftHostedVerifyCheck: (check: StatusCheckRollup) => boolean;
2111
+ /**
2112
+ * Is this a cancelled run of the PR status HUD job (#1056)?
2113
+ *
2114
+ * The HUD job keeps one stable name across Verify generations, so a superseded
2115
+ * run and its replacement share a context and `effectiveChecks` keeps only the
2116
+ * newer. But the Verify workflow cancels an in-flight pull-request run when the
2117
+ * next one starts (`ready_for_review` is the next one), and until the
2118
+ * replacement's HUD job appears, the rollup carries only the CANCELLED row. A
2119
+ * readiness read in that window would report a failed required check that
2120
+ * names a job nobody broke.
2121
+ *
2122
+ * The HUD only presents. It verifies nothing and never gates, so its
2123
+ * cancellation says nothing about the candidate. Only a cancellation is
2124
+ * excluded: a HUD run that failed still reads as failed, and every
2125
+ * verification and deploy check keeps its own state.
2126
+ */
2127
+ declare const isCancelledPrStatusHudCheck: (check: StatusCheckRollup) => boolean;
2153
2128
  /**
2154
2129
  * The rollup rows an admission read must not judge: the factory's own branded
2155
- * checks (it would be judging itself) and the draft-head summary residue
2156
- * above.
2130
+ * checks (it would be judging itself), the draft-head summary residue above,
2131
+ * and a cancelled PR status HUD run.
2157
2132
  */
2158
2133
  declare const isExcludedFromAdmissionChecks: (check: StatusCheckRollup) => boolean;
2134
+ /**
2135
+ * Does the base branch require this rollup row? (#1580)
2136
+ *
2137
+ * The hosted `verify` gate always counts: it is pinned by the factory's own
2138
+ * ruleset, and readiness reads it by presence regardless. Otherwise a row is
2139
+ * required when its check-run name or status context is one the rulesets
2140
+ * list. Matching on the name alone is the conservative direction here: a
2141
+ * same-named run from another workflow is waited on, never skipped.
2142
+ */
2143
+ declare const isRequiredStatusCheck: (check: StatusCheckRollup, requiredContexts: readonly string[]) => boolean;
2144
+ /**
2145
+ * The exclusion an admission read applies to the rollup (#1580).
2146
+ *
2147
+ * With the required contexts known, every row the base branch does not
2148
+ * require is excluded too, so a docs build or a status-only job neither holds
2149
+ * publish open nor refuses readiness. GitHub auto-merge does not wait for
2150
+ * those rows either. Unknown (`undefined`) or none required (`[]`) keeps
2151
+ * every row, which is the behaviour before #1580.
2152
+ */
2153
+ declare const admissionCheckExclusion: (requiredContexts?: readonly string[]) => (check: StatusCheckRollup) => boolean;
2159
2154
  /**
2160
2155
  * The hosted `verify` gate's state on this head, read by presence (#477).
2161
2156
  *
@@ -2180,6 +2175,15 @@ declare const hostedVerifyCheckState: (rollup: StatusCheckRollup[] | undefined)
2180
2175
  * unprintable.
2181
2176
  */
2182
2177
  declare const pendingCheckNames: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => string[];
2178
+ /**
2179
+ * The non-required rows that are red or still running (#1580), so readiness
2180
+ * can name them in a notice. They no longer gate; saying nothing would hide a
2181
+ * failing docs build behind a green admission.
2182
+ */
2183
+ declare const unsettledNonRequiredCheckNames: (rollup: StatusCheckRollup[] | undefined, requiredContexts: readonly string[]) => {
2184
+ failed: string[];
2185
+ pending: string[];
2186
+ };
2183
2187
  declare const statusCheckState: (rollup: StatusCheckRollup[] | undefined, exclude?: (check: StatusCheckRollup) => boolean) => CheckState;
2184
2188
  /**
2185
2189
  * Is this a hosted `verify` check run that GitHub started before `cutoffIso`?
@@ -2200,6 +2204,17 @@ declare const statusCheckState: (rollup: StatusCheckRollup[] | undefined, exclud
2200
2204
  * this exists to remove.
2201
2205
  */
2202
2206
  declare const isSupersededHostedVerifyCheck: (check: StatusCheckRollup, cutoffIso: string) => boolean;
2207
+ declare const requiredStatusCheckContexts: (rules: unknown, branch?: unknown) => string[] | undefined;
2208
+ /**
2209
+ * Best-effort read: a failed request is the same "not known" as an unreadable
2210
+ * answer, so it can only keep today's wider wait, never narrow it.
2211
+ */
2212
+ declare const fetchRequiredStatusCheckContexts: (fetchRules: () => unknown, fetchBranch?: () => unknown) => string[] | undefined;
2213
+ /**
2214
+ * One line naming the set an admission read judges (#1580), so a log shows
2215
+ * whether the narrowing took effect or the read fell back to every run.
2216
+ */
2217
+ declare const admissionCheckSetDescription: (requiredContexts?: readonly string[]) => string;
2203
2218
  //#endregion
2204
2219
  //#region src/github-client.d.ts
2205
2220
  /**
@@ -2512,6 +2527,12 @@ interface CompletedFactoryCheckSnapshot {
2512
2527
  * generation (#1158). Absent when the newest generation stands.
2513
2528
  */
2514
2529
  readonly readPastRunIds?: readonly number[];
2530
+ /**
2531
+ * Merge freeze only (#1503): why readiness refuses to read the freeze at
2532
+ * this tip, when it does. The row then presents that refusal, never the
2533
+ * run's own conclusion.
2534
+ */
2535
+ readonly refusal?: string;
2515
2536
  }
2516
2537
  interface FailedPreviewSnapshot {
2517
2538
  readonly completedAt: string;
@@ -2721,6 +2742,12 @@ interface GitHubPullRequest {
2721
2742
  mergeable: string;
2722
2743
  number: number;
2723
2744
  reviewDecision: string | null;
2745
+ /**
2746
+ * The status-check contexts the base branch's rulesets require (#1580).
2747
+ * Absent means not known, and every hosted run on the head is judged, as
2748
+ * before #1580.
2749
+ */
2750
+ requiredCheckContexts?: string[];
2724
2751
  state: "OPEN" | "CLOSED" | "MERGED";
2725
2752
  statusCheckRollup?: StatusCheckRollup[];
2726
2753
  title: string;
@@ -3131,9 +3158,9 @@ declare const loadEvidenceEnvelopes: (cwd: string) => LoadedEvidenceEnvelope[];
3131
3158
  //#region src/review-proof-applicability.d.ts
3132
3159
  declare const REVIEW_STATUS_VALUES: readonly ["not-required", "current", "stale", "missing", "blocked"];
3133
3160
  declare const reviewStatusSchema: z.ZodEnum<{
3134
- "not-required": "not-required";
3135
3161
  stale: "stale";
3136
3162
  blocked: "blocked";
3163
+ "not-required": "not-required";
3137
3164
  current: "current";
3138
3165
  missing: "missing";
3139
3166
  }>;
@@ -4092,8 +4119,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4092
4119
  sessionId: z.ZodOptional<z.ZodString>;
4093
4120
  }, z.core.$strict>>;
4094
4121
  stage: z.ZodEnum<{
4095
- interior: "interior";
4096
4122
  gate: "gate";
4123
+ interior: "interior";
4097
4124
  }>;
4098
4125
  usage: z.ZodOptional<z.ZodObject<{
4099
4126
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -4145,8 +4172,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4145
4172
  sessionId: z.ZodOptional<z.ZodString>;
4146
4173
  }, z.core.$strict>>;
4147
4174
  stage: z.ZodEnum<{
4148
- interior: "interior";
4149
4175
  gate: "gate";
4176
+ interior: "interior";
4150
4177
  }>;
4151
4178
  usage: z.ZodOptional<z.ZodObject<{
4152
4179
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -4189,8 +4216,8 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4189
4216
  sessionId: z.ZodOptional<z.ZodString>;
4190
4217
  }, z.core.$strict>>;
4191
4218
  stage: z.ZodEnum<{
4192
- interior: "interior";
4193
4219
  gate: "gate";
4220
+ interior: "interior";
4194
4221
  }>;
4195
4222
  usage: z.ZodOptional<z.ZodObject<{
4196
4223
  estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
@@ -4220,7 +4247,7 @@ declare const FACTORY_TRACE_EVENT_DEFINITIONS: readonly [DefinedTraceEvent<"revi
4220
4247
  staleRepeats: number;
4221
4248
  };
4222
4249
  observedAt: string;
4223
- stage: "interior" | "gate";
4250
+ stage: "gate" | "interior";
4224
4251
  issue?: number | undefined;
4225
4252
  pr?: number | undefined;
4226
4253
  threadId?: string | undefined;
@@ -4680,13 +4707,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4680
4707
  reviews: {
4681
4708
  correctness: {
4682
4709
  required: boolean;
4683
- status: "not-required" | "stale" | "blocked" | "current" | "missing";
4710
+ status: "stale" | "blocked" | "not-required" | "current" | "missing";
4684
4711
  reviewedHeadSha?: string | undefined;
4685
4712
  reviewedPatchId?: string | undefined;
4686
4713
  };
4687
4714
  security?: {
4688
4715
  required: boolean;
4689
- status: "not-required" | "stale" | "blocked" | "current" | "missing";
4716
+ status: "stale" | "blocked" | "not-required" | "current" | "missing";
4690
4717
  reviewedHeadSha?: string | undefined;
4691
4718
  reviewedPatchId?: string | undefined;
4692
4719
  } | undefined;
@@ -4749,7 +4776,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4749
4776
  interior: number;
4750
4777
  };
4751
4778
  nextAction: "run-interior-cycle" | "advance-to-gate" | "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human";
4752
- stage: "interior" | "gate" | "interior-complete";
4779
+ stage: "gate" | "interior" | "interior-complete";
4753
4780
  forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4754
4781
  } | undefined;
4755
4782
  reviewRuns?: PrReviewResult[] | undefined;
@@ -4799,13 +4826,13 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4799
4826
  reviews: {
4800
4827
  correctness: {
4801
4828
  required: boolean;
4802
- status: "not-required" | "stale" | "blocked" | "current" | "missing";
4829
+ status: "stale" | "blocked" | "not-required" | "current" | "missing";
4803
4830
  reviewedHeadSha?: string | undefined;
4804
4831
  reviewedPatchId?: string | undefined;
4805
4832
  };
4806
4833
  security?: {
4807
4834
  required: boolean;
4808
- status: "not-required" | "stale" | "blocked" | "current" | "missing";
4835
+ status: "stale" | "blocked" | "not-required" | "current" | "missing";
4809
4836
  reviewedHeadSha?: string | undefined;
4810
4837
  reviewedPatchId?: string | undefined;
4811
4838
  } | undefined;
@@ -4868,7 +4895,7 @@ declare const evaluateReadiness: (input: EvaluationInput) => {
4868
4895
  interior: number;
4869
4896
  };
4870
4897
  nextAction: "run-interior-cycle" | "advance-to-gate" | "run-gate-cycle" | "accept-nonblocking-findings" | "escalate-to-triage" | "ready-for-human";
4871
- stage: "interior" | "gate" | "interior-complete";
4898
+ stage: "gate" | "interior" | "interior-complete";
4872
4899
  forcedTransition?: "gate-cap-exhausted" | "interior-cap-reached" | undefined;
4873
4900
  } | undefined;
4874
4901
  reviewRuns?: PrReviewResult[] | undefined;
@@ -4928,13 +4955,6 @@ declare const evidenceEnvelopeFilename: (check: string, headSha: string) => stri
4928
4955
  declare function buildEvidenceEnvelope(args: EvidenceEmitArgs, dependencies?: EvidenceEmitDependencies): EvidenceEnvelope;
4929
4956
  declare function runEvidenceEmit(args: EvidenceEmitArgs, dependencies?: EvidenceEmitDependencies): EvidenceEmitResult;
4930
4957
  //#endregion
4931
- //#region src/hq-access.d.ts
4932
- /** Cloudflare Access service-token credentials for production HQ ingest. */
4933
- interface CloudflareAccessServiceToken {
4934
- clientId: string;
4935
- clientSecret: string;
4936
- }
4937
- //#endregion
4938
4958
  //#region src/epic-structure.d.ts
4939
4959
  /**
4940
4960
  * Producer-side `epic-structure` v1 emitter (epic #132, lane #135).
@@ -5168,6 +5188,8 @@ declare const assembleReviewPrompt: ({
5168
5188
  declare const FACTORY_BASE_REF_ENV = "FACTORY_BASE_REF";
5169
5189
  declare const FACTORY_CHANGED_FILES_ENV = "FACTORY_CHANGED_FILES";
5170
5190
  declare const FACTORY_CHANGED_FILES_FILE_ENV = "FACTORY_CHANGED_FILES_FILE";
5191
+ declare const FACTORY_LOCKFILE_IMPORTERS_ENV = "FACTORY_LOCKFILE_IMPORTERS";
5192
+ declare const FACTORY_LOCKFILE_BASE_REF_ENV = "FACTORY_LOCKFILE_BASE_REF";
5171
5193
  declare const EMPTY_TREE_OBJECT_HASH = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
5172
5194
  declare const DEFAULT_ROOT_SHARED_GLOBS: string[];
5173
5195
  interface VerificationRunContextInput {
@@ -5176,6 +5198,13 @@ interface VerificationRunContextInput {
5176
5198
  fullSuiteBaseRef?: string;
5177
5199
  rootSharedGlobs?: string[];
5178
5200
  inlineLimitBytes?: number;
5201
+ /**
5202
+ * #1579: the importers a changed `pnpm-lock.yaml` is scoped to. The
5203
+ * lockfile still forces the full-suite base ref; when it is the only
5204
+ * root/shared change, `psf affected` selects the packages at these
5205
+ * importers from the real base instead.
5206
+ */
5207
+ lockfileImporters?: readonly string[];
5179
5208
  tmpDir?: string;
5180
5209
  }
5181
5210
  interface VerificationEnv {
@@ -5315,4 +5344,4 @@ declare function createProgram(options?: CreateProgramOptions): Command;
5315
5344
  */
5316
5345
  declare function run(argv?: string[], cliEntry?: string): Promise<void>;
5317
5346
  //#endregion
5318
- export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, type CompletedFactoryCheckSnapshot, 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 FactoryPrStatusCheckName, type FactoryPrStatusSources, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FollowUpAction, FollowUpActionSchema, type GitHubCheckRunMergeFreezeApi, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeAuthority, type MergeFreezeGeneration, type MergeFreezeState, type MergeFreezeStoreInput, type PlanFactoryPrStatusHudInput, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PrVerifyProof, type PresentFactoryPrStatusHudDependencies, type PresentFactoryPrStatusHudInput, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, REVIEW_FOCUS_SECTION, type ReadFactoryPrStatusSourcesDependencies, type ReadFactoryPrStatusSourcesInput, type RefreshFactoryPrStatusHudInput, type RenderFactoryPrStatusHudInput, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, 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, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertFactoryPrStatusIdentity, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, comment_provenance_d_exports as commentProvenance, createGitHubCheckRunMergeFreezeStore, createLocalJsonlTraceSink, createProgram, createVerificationRunContext, doctorProjectProfile, epicStructureEventId, evidenceEnvelopeFilename, followUpFromArgv, impactStampScopeDecision, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, planFactoryPrStatusHud, 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, presentFactoryPrStatusHud, previewLifecycleTargets, publishEpicStructure, readDemandWaivers, readFactoryPrStatusSources, readPrReadyProof, refreshFactoryPrStatusHud, refreshFactoryPrStatusHudSafely, renderFactoryPrStatusHud, resolveFactoryRepository, resolveTraceWriteSinks, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrVerifyProof, validatePreviewLifecyclePlan, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };
5347
+ export { type AppendFactoryTraceEventResult, type AssembledReviewPrompt, type BatteryCommandDisposition, type BatteryDisposition, type BoundaryCheckArgs, type BoundaryCheckDependencies, type BoundaryCheckProofRecord, type BuildEpicStructureEventInput, type CloudflareAccessServiceToken, type CompletedFactoryCheckSnapshot, 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, FACTORY_LOCKFILE_BASE_REF_ENV, FACTORY_LOCKFILE_IMPORTERS_ENV, type FactoryCliInvocation, FactoryCliInvocationSchema, type FactoryPrStatusCheckName, type FactoryPrStatusSources, type FactoryProjectProfile, type FactoryTraceDiagnostic, type FactoryTraceEnvelope, type FactoryTraceEvent, type FollowUpAction, FollowUpActionSchema, type GitHubCheckRunMergeFreezeApi, type ImpactScopeDecision, type ImpactScopeSurface, type IssueReviewFocus, MERGE_FREEZE_APP_SLUG, MERGE_FREEZE_CHECK_NAME, type MergeFreezeAuthority, type MergeFreezeGeneration, type MergeFreezeState, type MergeFreezeStoreInput, type PlanFactoryPrStatusHudInput, type PrPublishArgs, type PrPublishDependencies, PrPublishFollowUpError, type PrPublishFollowUpOutcome, type PrPublishHandoff, type PrPublishResult, type PrReadyArgs, type PrReadyProof, type PrVerifyProof, type PresentFactoryPrStatusHudDependencies, type PresentFactoryPrStatusHudInput, type PreviewDisposition, type PreviewLifecyclePlan, type PreviewTargetPlan, type PublishEpicStructureArgs, type PublishEpicStructureResult, type PublishFollowUpPlan, REVIEW_FOCUS_SECTION, type ReadFactoryPrStatusSourcesDependencies, type ReadFactoryPrStatusSourcesInput, type RefreshFactoryPrStatusHudInput, type RenderFactoryPrStatusHudInput, type ReviewGateNotRequiredProof, type ReviewGateTraceIdentity, 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, appendWithTraceSinks, applyDemandWaiver, assembleReviewPrompt, assertFactoryPrStatusIdentity, assertWorkerCheckoutAllowed, authorizeDemandWaiver, batteryScopeSummaryLines, boundary_manifest_d_exports as boundaryManifest, boundary_review_proof_d_exports as boundaryReviewProof, buildEpicStructureEvent, buildEpicStructurePayload, buildEvidenceEnvelope, buildReviewGateNotRequiredTraceEvent, comment_provenance_d_exports as commentProvenance, createGitHubCheckRunMergeFreezeStore, createLocalJsonlTraceSink, createProgram, createVerificationRunContext, doctorProjectProfile, epicStructureEventId, evidenceEnvelopeFilename, followUpFromArgv, impactStampScopeDecision, isProductionHqUrl, loadProjectProfile, normalizeIssueComments, planFactoryPrStatusHud, 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, presentFactoryPrStatusHud, previewLifecycleTargets, publishEpicStructure, readDemandWaivers, readFactoryPrStatusSources, readPrReadyProof, refreshFactoryPrStatusHud, refreshFactoryPrStatusHudSafely, renderFactoryPrStatusHud, resolveFactoryRepository, resolveTraceWriteSinks, reviewFocusFromIssueBody, reviewPromptSectionSchema, reviewPromptSectionsSchema, run, runBoundaryCheck, runDemandWaive, runEvidenceEmit, runPrPublish, runPrReady, runPrReview, runPrVerify, scanFactoryTraceDiagnostics, scanFactoryTraceEvents, selectWaiversForCandidate, toFactoryTraceEnvelope, tryAppendReviewGateNotRequiredTraceEvent, validateBoundaryCheckProof, validateDagDocument, validateDemandWaiverStore, validateFactoryTraceEvent, validateMergeFreezeState, validatePrReadyProof, validatePrVerifyProof, validatePreviewLifecyclePlan, waivedDemandNotice, waivedDemandSchema, worktree_scratch_files_d_exports as worktreeScratchFiles };