@patronage/software-factory 1.0.0-alpha.44 → 1.0.0-alpha.46

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/schemas.js CHANGED
@@ -1,15 +1,14 @@
1
1
  import { z } from "zod";
2
2
  import "yaml";
3
3
  import "picomatch";
4
- //#region src/review-rungs.ts
4
+ // src/review-rungs.ts
5
5
  const EVIDENCE_REVIEW_RUNGS = [
6
6
  "independent-model",
7
7
  "oracle",
8
8
  "human"
9
9
  ];
10
10
  Object.fromEntries(EVIDENCE_REVIEW_RUNGS.map((rung, index) => [rung, index]));
11
- //#endregion
12
- //#region src/demand-keys.ts
11
+ // src/demand-keys.ts
13
12
  /** The demands that exist at most once per candidate. */
14
13
  const DEMAND_KEYS = {
15
14
  /**
@@ -169,8 +168,7 @@ const demandKeySchema = z.string().refine((value) => {
169
168
  * reports it as an unapplied waiver — so nothing is admitted by accepting it.
170
169
  */
171
170
  const waiverDemandKeySchema = z.string().regex(/^[a-z][a-z0-9-]*(?::[A-Za-z0-9._%/-]+)?$/u, "A demand key is a lowercase family, optionally qualified by its resolved value (e.g. review-rung:human).");
172
- //#endregion
173
- //#region src/blocked-reasons.ts
171
+ // src/blocked-reasons.ts
174
172
  /**
175
173
  * The wire bound on one `detail`. A blocked proof carries one short sentence
176
174
  * per demand, never a transcript: HQ's ingest cap is 256 KB and this field
@@ -224,8 +222,7 @@ const blockedReasonIssues = (proof) => {
224
222
  const drifted = named.findIndex((reason, index) => reason.detail !== blockedReasonDetail(reasons[index]));
225
223
  return drifted === -1 ? [] : blockedReasonIssue(`blockedReasons[${drifted}] does not carry blocking reason ${drifted}; the two projections must tell one story`);
226
224
  };
227
- //#endregion
228
- //#region src/demand-waiver.ts
225
+ // src/demand-waiver.ts
229
226
  const DEMAND_WAIVER_SCHEMA_VERSION = 1;
230
227
  const shaSchema = z.string().regex(/^[0-9a-f]{40}$/u);
231
228
  const demandWaiverSchema = z.object({
@@ -253,15 +250,13 @@ const waivedDemandSchema = z.object({
253
250
  unmetReasons: z.array(z.string().min(1)).min(1)
254
251
  });
255
252
  DEMAND_KEYS.mergeFreeze, DEMAND_KEYS.reviewRoundLimit, DEMAND_KEYS.childIssueOpen;
256
- //#endregion
257
- //#region src/diff-classification.ts
253
+ // src/diff-classification.ts
258
254
  const DIFF_CLASSIFICATIONS = [
259
255
  "docs/process-only",
260
256
  "trivial",
261
257
  "non-trivial"
262
258
  ];
263
- //#endregion
264
- //#region src/policy-resolution.ts
259
+ // src/policy-resolution.ts
265
260
  const COMMIT_SHA_PATTERN = /^[0-9a-f]{40}$/u;
266
261
  const digestSchema = z.string().regex(/^[0-9a-f]{64}$/u);
267
262
  /**
@@ -317,8 +312,7 @@ const unresolvedPolicyResolutionSchema = z.object({
317
312
  }).strict();
318
313
  /** How a gate resolved the review policy it evaluated a candidate under. */
319
314
  const policyResolutionSchema = z.discriminatedUnion("status", [authoritativePolicyResolutionSchema, unresolvedPolicyResolutionSchema]);
320
- //#endregion
321
- //#region src/packages/review-prompt-sections/schema.ts
315
+ // src/packages/review-prompt-sections/schema.ts
322
316
  const REVIEW_PROMPT_SECTION_PROVENANCES = [
323
317
  "coding-standards",
324
318
  "prior-review-ledger",
@@ -410,8 +404,7 @@ new Uint32Array([
410
404
  528734635,
411
405
  1541459225
412
406
  ]);
413
- //#endregion
414
- //#region src/review-ladder-policy.ts
407
+ // src/review-ladder-policy.ts
415
408
  const REVIEW_CATEGORIES = [
416
409
  "correctness",
417
410
  "safety",
@@ -419,8 +412,7 @@ const REVIEW_CATEGORIES = [
419
412
  "maintainability",
420
413
  "unknown"
421
414
  ];
422
- //#endregion
423
- //#region src/review-ladder-ledger.ts
415
+ // src/review-ladder-ledger.ts
424
416
  const OCCURRENCE_ADDRESS_PATTERN = /^c[1-9][0-9]*f[1-9][0-9]*$/u;
425
417
  const occurrenceAddress = (cycle, finding) => `c${cycle}f${finding}`;
426
418
  /** The 1-based recording position an address names. */
@@ -530,8 +522,7 @@ const foldLedger = (cycles, refs) => {
530
522
  occurrences: [...occurrences.values()]
531
523
  };
532
524
  };
533
- //#endregion
534
- //#region src/review-recording-schema.ts
525
+ // src/review-recording-schema.ts
535
526
  const ABSENT_PROOF_DIGEST = "absent";
536
527
  const sha256Pattern = /^[0-9a-f]{64}$/u;
537
528
  const occurrenceAddressSchema$1 = z.string().regex(OCCURRENCE_ADDRESS_PATTERN);
@@ -569,8 +560,7 @@ const reviewCycleRecordingSchema = z.object({
569
560
  findingsDigest: z.string().regex(sha256Pattern),
570
561
  recordingId: z.string().regex(sha256Pattern)
571
562
  }).strict();
572
- //#endregion
573
- //#region src/review-recording.ts
563
+ // src/review-recording.ts
574
564
  const occurrenceAddressSchema = z.string().regex(OCCURRENCE_ADDRESS_PATTERN);
575
565
  const declarableDisposition = z.enum([
576
566
  "fixed-in-thread",
@@ -698,8 +688,7 @@ z.object({
698
688
  seen.add(review.kind);
699
689
  }
700
690
  });
701
- //#endregion
702
- //#region src/review-ladder.ts
691
+ // src/review-ladder.ts
703
692
  const LADDER_NEXT_ACTION_KINDS = [
704
693
  "run-interior-cycle",
705
694
  "advance-to-gate",
@@ -733,8 +722,7 @@ const ladderCycleRefsFor = (cycles) => {
733
722
  };
734
723
  });
735
724
  };
736
- //#endregion
737
- //#region src/pr-readiness/ladder-proof-state.ts
725
+ // src/pr-readiness/ladder-proof-state.ts
738
726
  const persistedCycleSchema = z.custom((cycle) => typeof cycle === "object" && cycle !== null, "ladder cycle must be an object").superRefine((cycle, context) => {
739
727
  const parsed = reviewCycleRecordingSchema.safeParse(cycle.recording);
740
728
  if (!parsed.success) context.addIssue({
@@ -754,8 +742,7 @@ const prReviewLadderStateSchema = z.object({ cycles: z.array(persistedCycleSchem
754
742
  }
755
743
  });
756
744
  const ladderLedgerFor = (ladder) => [...foldLedger(ladder.cycles, ladderCycleRefsFor(ladder.cycles)).ledger.values()];
757
- //#endregion
758
- //#region src/pr-readiness/review-proof.ts
745
+ // src/pr-readiness/review-proof.ts
759
746
  const PR_REVIEW_SCHEMA_VERSION = 3;
760
747
  const nonBlankString = z.string().refine((value) => value.trim().length > 0, { message: "must not be blank" });
761
748
  const parseableDateString = z.string().refine((value) => Number.isFinite(Date.parse(value)), { message: "must be a parseable date string" });
@@ -870,8 +857,7 @@ const prReviewProofSchema = z.object({
870
857
  path: ["reviewCycle"]
871
858
  });
872
859
  });
873
- //#endregion
874
- //#region src/required-check-policy.ts
860
+ // src/required-check-policy.ts
875
861
  const EVIDENCE_CHECK_TYPES = ["review", "verify"];
876
862
  const requiredCheckScopeSchema = z.object({ classifications: z.array(z.enum(DIFF_CLASSIFICATIONS)).min(1) }).strict();
877
863
  const reviewStatusSchema = z.enum([
@@ -881,8 +867,7 @@ const reviewStatusSchema = z.enum([
881
867
  "missing",
882
868
  "blocked"
883
869
  ]);
884
- //#endregion
885
- //#region src/review-state.ts
870
+ // src/review-state.ts
886
871
  const reviewStateIssue = (message, field) => [{
887
872
  code: "custom",
888
873
  message,
@@ -907,8 +892,7 @@ const reviewStateIssues = (state) => {
907
892
  if (state.status === "missing" && hasIdentity) return reviewStateIssue("a missing review state must record no reviewed head sha or patch id", "status");
908
893
  return [];
909
894
  };
910
- //#endregion
911
- //#region src/catch-up-recognition-record.ts
895
+ // src/catch-up-recognition-record.ts
912
896
  const objectShaSchema = z.string().regex(/^[0-9a-f]{40}$/u);
913
897
  const catchUpRecognitionSchema = z.object({
914
898
  baseRef: z.string().min(1),
@@ -1026,8 +1010,7 @@ z.looseObject({
1026
1010
  packages: z.record(z.string(), z.unknown()).optional(),
1027
1011
  snapshots: z.record(z.string(), snapshotSectionSchema).optional()
1028
1012
  });
1029
- //#endregion
1030
- //#region src/verification-battery.ts
1013
+ // src/verification-battery.ts
1031
1014
  /**
1032
1015
  * The completeness invariant as an enforceable control (ADR 0024: controls
1033
1016
  * fail loudly), shared by both pr:verify proof schemas so they cannot drift.
@@ -1086,7 +1069,7 @@ const assertBatteryCompleteness = (proof, context) => {
1086
1069
  seen.add(entry.name);
1087
1070
  }
1088
1071
  if (proof.outcome !== "passed") return;
1089
- const disposed = new Set([...executed, ...seen]);
1072
+ const disposed = /* @__PURE__ */ new Set([...executed, ...seen]);
1090
1073
  const undisposed = selected.filter((name) => !disposed.has(name));
1091
1074
  if (undisposed.length > 0) context.addIssue({
1092
1075
  code: "custom",
@@ -1179,8 +1162,7 @@ const assertNotRequiredStampAuthorization = (proof, context) => {
1179
1162
  });
1180
1163
  }
1181
1164
  };
1182
- //#endregion
1183
- //#region src/pr-verify-proof-rules.ts
1165
+ // src/pr-verify-proof-rules.ts
1184
1166
  const assertPrVerifyProofRules = (proof, context) => {
1185
1167
  if (proof.notDemandedRecords !== void 0 && proof.impactStamp === void 0) context.addIssue({
1186
1168
  code: "custom",
@@ -1199,6 +1181,12 @@ const assertPrVerifyProofRules = (proof, context) => {
1199
1181
  * factory must adopt this release before HQ ingests its pr:verify proofs.
1200
1182
  */
1201
1183
  const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS = [4];
1184
+ /** Where a verification battery ran (#1570). */
1185
+ const PR_VERIFY_RUNNER_KINDS = [
1186
+ "ci",
1187
+ "cloud",
1188
+ "local"
1189
+ ];
1202
1190
  const prVerifyTestFailureSchema = z.object({
1203
1191
  file: z.string().min(1),
1204
1192
  kind: z.enum([
@@ -1233,6 +1221,17 @@ const notDemandedRecordSchema = z.object({
1233
1221
  basis: z.string().min(1),
1234
1222
  name: z.string().min(1)
1235
1223
  });
1224
+ const runnerSchema = z.object({
1225
+ arch: z.string().min(1).max(32),
1226
+ cpuCount: z.number().int().positive(),
1227
+ kind: z.enum(PR_VERIFY_RUNNER_KINDS),
1228
+ os: z.string().min(1).max(32),
1229
+ provider: z.enum([
1230
+ "claude-code",
1231
+ "cursor",
1232
+ "github-actions"
1233
+ ]).optional()
1234
+ });
1236
1235
  const prVerifySchemaVersionSchema = z.literal(4);
1237
1236
  const prVerifyProofSchema = z.object({
1238
1237
  authoringSession: z.string().trim().min(1),
@@ -1274,6 +1273,7 @@ const prVerifyProofSchema = z.object({
1274
1273
  profilePath: z.string().min(1),
1275
1274
  projectKey: z.string().min(1),
1276
1275
  repository: z.string().min(1),
1276
+ runner: runnerSchema.optional(),
1277
1277
  schemaVersion: prVerifySchemaVersionSchema,
1278
1278
  startedAt: z.iso.datetime(),
1279
1279
  verificationCommands: z.array(z.object({
@@ -1360,8 +1360,7 @@ const gateTimingRecordSchema = z.object({
1360
1360
  /** Wall-clock start of this gate invocation (ISO 8601). */
1361
1361
  startedAt: z.iso.datetime()
1362
1362
  }).strict();
1363
- //#endregion
1364
- //#region src/schemas.ts
1363
+ // src/schemas.ts
1365
1364
  const evidenceCheckTypeSchema = z.enum(EVIDENCE_CHECK_TYPES);
1366
1365
  const evidenceReviewRungSchema = z.enum(EVIDENCE_REVIEW_RUNGS);
1367
1366
  const diffClassificationSchema = z.enum(DIFF_CLASSIFICATIONS);
@@ -1667,5 +1666,4 @@ const prReadyProofSchema = z.object({
1667
1666
  }).superRefine((proof, context) => {
1668
1667
  for (const issue of blockedReasonIssues({ ...proof })) context.addIssue(issue);
1669
1668
  });
1670
- //#endregion
1671
1669
  export { BLOCKED_REASONS_MAX, BLOCKED_REASON_DETAIL_MAX, BOUNDARY_CHECK_SCHEMA_VERSION, BOUNDARY_REVIEW_PROOF_KIND, EVIDENCE_ENVELOPE_SCHEMA_VERSION, PR_READY_SCHEMA_VERSION, PR_REVIEW_SCHEMA_VERSION, SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, gateTimingRecordSchema, prReadyProofSchema, prReviewFindingSchema, prReviewProofSchema, prReviewResultSchema, prVerifyProofSchema, reviewPromptSectionSchema, reviewPromptSectionsSchema, waivedDemandSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patronage/software-factory",
3
- "version": "1.0.0-alpha.44",
3
+ "version": "1.0.0-alpha.46",
4
4
  "description": "Shared Patronage software factory CLI and project-profile validation tools",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,26 +33,27 @@
33
33
  "tag": "next"
34
34
  },
35
35
  "dependencies": {
36
- "commander": "14.0.3",
37
- "picomatch": "^4.0.5",
38
- "yaml": "^2.9.0",
39
- "zod": "4.4.3",
40
- "@patronage/factory-ci": "1.0.0-alpha.44"
36
+ "@patronage/factory-ci": "1.0.0-alpha.46",
37
+ "commander": "15.0.0",
38
+ "picomatch": "^4.0.7",
39
+ "yaml": "^2.9.1",
40
+ "zod": "4.6.7"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "24.13.3",
43
+ "@types/node": "24.19.2",
44
44
  "@types/picomatch": "^4.0.3",
45
- "@vitest/coverage-v8": "4.1.10",
46
- "dependency-cruiser": "18.1.0",
47
- "knip": "6.27.0",
48
- "oxfmt": "0.59.0",
49
- "oxlint": "1.76.0",
50
- "oxlint-tsgolint": "7.0.2001",
51
- "tsdown": "0.21.10",
52
- "tsx": "4.23.1",
53
- "typescript": "5.9.3",
54
- "ultracite": "7.10.5",
55
- "vitest": "4.1.10"
45
+ "@vitest/coverage-v8": "5.0.5",
46
+ "dependency-cruiser": "18.8.0-beta-1",
47
+ "knip": "6.43.0",
48
+ "oxfmt": "0.75.0",
49
+ "oxlint": "1.90.0",
50
+ "oxlint-tsgolint": "7.0.2005",
51
+ "tsdown": "0.23.2",
52
+ "tsx": "4.23.15",
53
+ "typescript": "7.1.0-beta",
54
+ "typescript-api": "npm:typescript@5.9.3",
55
+ "ultracite": "8.1.0",
56
+ "vitest": "5.0.5"
56
57
  },
57
58
  "engines": {
58
59
  "node": "^24.0.0"
@@ -73,6 +74,8 @@
73
74
  "profile:schema": "tsx scripts/generate-profile-schema.ts",
74
75
  "pretest": "bash ../scripts/ensure-worktree-bootstrap.sh",
75
76
  "test": "vitest run",
77
+ "pretest:affected": "bash ../scripts/ensure-worktree-bootstrap.sh",
78
+ "test:affected": "tsx src/cli.ts affected --vitest --profile ../software-factory.profile.json --always-file vitest.always-run.json",
76
79
  "pretest:profile": "bash ../scripts/ensure-worktree-bootstrap.sh",
77
80
  "test:profile": "tsx scripts/vitest-profile.ts",
78
81
  "pretest:stress": "bash ../scripts/ensure-worktree-bootstrap.sh",