@patronage/software-factory 1.0.0-alpha.45 → 1.0.0-alpha.47
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 +27 -2
- package/dist/cli.js +1 -2
- package/dist/cloud/credentials.d.mts +21 -0
- package/dist/cloud/credentials.mjs +136 -0
- package/dist/cloud/install-tools.sh +59 -0
- package/dist/index.d.ts +2607 -2462
- package/dist/index.js +593 -639
- package/dist/{chunk-pbuEa-1d.js → rolldown-runtime-D8jQpDG7.js} +1 -2
- package/dist/schemas.d.ts +543 -532
- package/dist/schemas.js +46 -48
- package/package.json +25 -19
package/dist/schemas.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import "yaml";
|
|
3
3
|
import "picomatch";
|
|
4
|
-
|
|
4
|
+
// src/arming-outcome.ts
|
|
5
|
+
const ARMING_OUTCOMES = [
|
|
6
|
+
"armed",
|
|
7
|
+
"merged",
|
|
8
|
+
"not-armed"
|
|
9
|
+
];
|
|
10
|
+
// src/review-rungs.ts
|
|
5
11
|
const EVIDENCE_REVIEW_RUNGS = [
|
|
6
12
|
"independent-model",
|
|
7
13
|
"oracle",
|
|
8
14
|
"human"
|
|
9
15
|
];
|
|
10
16
|
Object.fromEntries(EVIDENCE_REVIEW_RUNGS.map((rung, index) => [rung, index]));
|
|
11
|
-
|
|
12
|
-
//#region src/demand-keys.ts
|
|
17
|
+
// src/demand-keys.ts
|
|
13
18
|
/** The demands that exist at most once per candidate. */
|
|
14
19
|
const DEMAND_KEYS = {
|
|
15
20
|
/**
|
|
@@ -169,8 +174,7 @@ const demandKeySchema = z.string().refine((value) => {
|
|
|
169
174
|
* reports it as an unapplied waiver — so nothing is admitted by accepting it.
|
|
170
175
|
*/
|
|
171
176
|
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
|
-
|
|
173
|
-
//#region src/blocked-reasons.ts
|
|
177
|
+
// src/blocked-reasons.ts
|
|
174
178
|
/**
|
|
175
179
|
* The wire bound on one `detail`. A blocked proof carries one short sentence
|
|
176
180
|
* per demand, never a transcript: HQ's ingest cap is 256 KB and this field
|
|
@@ -224,8 +228,7 @@ const blockedReasonIssues = (proof) => {
|
|
|
224
228
|
const drifted = named.findIndex((reason, index) => reason.detail !== blockedReasonDetail(reasons[index]));
|
|
225
229
|
return drifted === -1 ? [] : blockedReasonIssue(`blockedReasons[${drifted}] does not carry blocking reason ${drifted}; the two projections must tell one story`);
|
|
226
230
|
};
|
|
227
|
-
|
|
228
|
-
//#region src/demand-waiver.ts
|
|
231
|
+
// src/demand-waiver.ts
|
|
229
232
|
const DEMAND_WAIVER_SCHEMA_VERSION = 1;
|
|
230
233
|
const shaSchema = z.string().regex(/^[0-9a-f]{40}$/u);
|
|
231
234
|
const demandWaiverSchema = z.object({
|
|
@@ -253,15 +256,13 @@ const waivedDemandSchema = z.object({
|
|
|
253
256
|
unmetReasons: z.array(z.string().min(1)).min(1)
|
|
254
257
|
});
|
|
255
258
|
DEMAND_KEYS.mergeFreeze, DEMAND_KEYS.reviewRoundLimit, DEMAND_KEYS.childIssueOpen;
|
|
256
|
-
|
|
257
|
-
//#region src/diff-classification.ts
|
|
259
|
+
// src/diff-classification.ts
|
|
258
260
|
const DIFF_CLASSIFICATIONS = [
|
|
259
261
|
"docs/process-only",
|
|
260
262
|
"trivial",
|
|
261
263
|
"non-trivial"
|
|
262
264
|
];
|
|
263
|
-
|
|
264
|
-
//#region src/policy-resolution.ts
|
|
265
|
+
// src/policy-resolution.ts
|
|
265
266
|
const COMMIT_SHA_PATTERN = /^[0-9a-f]{40}$/u;
|
|
266
267
|
const digestSchema = z.string().regex(/^[0-9a-f]{64}$/u);
|
|
267
268
|
/**
|
|
@@ -317,8 +318,7 @@ const unresolvedPolicyResolutionSchema = z.object({
|
|
|
317
318
|
}).strict();
|
|
318
319
|
/** How a gate resolved the review policy it evaluated a candidate under. */
|
|
319
320
|
const policyResolutionSchema = z.discriminatedUnion("status", [authoritativePolicyResolutionSchema, unresolvedPolicyResolutionSchema]);
|
|
320
|
-
|
|
321
|
-
//#region src/packages/review-prompt-sections/schema.ts
|
|
321
|
+
// src/packages/review-prompt-sections/schema.ts
|
|
322
322
|
const REVIEW_PROMPT_SECTION_PROVENANCES = [
|
|
323
323
|
"coding-standards",
|
|
324
324
|
"prior-review-ledger",
|
|
@@ -410,8 +410,7 @@ new Uint32Array([
|
|
|
410
410
|
528734635,
|
|
411
411
|
1541459225
|
|
412
412
|
]);
|
|
413
|
-
|
|
414
|
-
//#region src/review-ladder-policy.ts
|
|
413
|
+
// src/review-ladder-policy.ts
|
|
415
414
|
const REVIEW_CATEGORIES = [
|
|
416
415
|
"correctness",
|
|
417
416
|
"safety",
|
|
@@ -419,8 +418,7 @@ const REVIEW_CATEGORIES = [
|
|
|
419
418
|
"maintainability",
|
|
420
419
|
"unknown"
|
|
421
420
|
];
|
|
422
|
-
|
|
423
|
-
//#region src/review-ladder-ledger.ts
|
|
421
|
+
// src/review-ladder-ledger.ts
|
|
424
422
|
const OCCURRENCE_ADDRESS_PATTERN = /^c[1-9][0-9]*f[1-9][0-9]*$/u;
|
|
425
423
|
const occurrenceAddress = (cycle, finding) => `c${cycle}f${finding}`;
|
|
426
424
|
/** The 1-based recording position an address names. */
|
|
@@ -530,8 +528,7 @@ const foldLedger = (cycles, refs) => {
|
|
|
530
528
|
occurrences: [...occurrences.values()]
|
|
531
529
|
};
|
|
532
530
|
};
|
|
533
|
-
|
|
534
|
-
//#region src/review-recording-schema.ts
|
|
531
|
+
// src/review-recording-schema.ts
|
|
535
532
|
const ABSENT_PROOF_DIGEST = "absent";
|
|
536
533
|
const sha256Pattern = /^[0-9a-f]{64}$/u;
|
|
537
534
|
const occurrenceAddressSchema$1 = z.string().regex(OCCURRENCE_ADDRESS_PATTERN);
|
|
@@ -569,8 +566,7 @@ const reviewCycleRecordingSchema = z.object({
|
|
|
569
566
|
findingsDigest: z.string().regex(sha256Pattern),
|
|
570
567
|
recordingId: z.string().regex(sha256Pattern)
|
|
571
568
|
}).strict();
|
|
572
|
-
|
|
573
|
-
//#region src/review-recording.ts
|
|
569
|
+
// src/review-recording.ts
|
|
574
570
|
const occurrenceAddressSchema = z.string().regex(OCCURRENCE_ADDRESS_PATTERN);
|
|
575
571
|
const declarableDisposition = z.enum([
|
|
576
572
|
"fixed-in-thread",
|
|
@@ -698,8 +694,7 @@ z.object({
|
|
|
698
694
|
seen.add(review.kind);
|
|
699
695
|
}
|
|
700
696
|
});
|
|
701
|
-
|
|
702
|
-
//#region src/review-ladder.ts
|
|
697
|
+
// src/review-ladder.ts
|
|
703
698
|
const LADDER_NEXT_ACTION_KINDS = [
|
|
704
699
|
"run-interior-cycle",
|
|
705
700
|
"advance-to-gate",
|
|
@@ -733,8 +728,7 @@ const ladderCycleRefsFor = (cycles) => {
|
|
|
733
728
|
};
|
|
734
729
|
});
|
|
735
730
|
};
|
|
736
|
-
|
|
737
|
-
//#region src/pr-readiness/ladder-proof-state.ts
|
|
731
|
+
// src/pr-readiness/ladder-proof-state.ts
|
|
738
732
|
const persistedCycleSchema = z.custom((cycle) => typeof cycle === "object" && cycle !== null, "ladder cycle must be an object").superRefine((cycle, context) => {
|
|
739
733
|
const parsed = reviewCycleRecordingSchema.safeParse(cycle.recording);
|
|
740
734
|
if (!parsed.success) context.addIssue({
|
|
@@ -754,8 +748,7 @@ const prReviewLadderStateSchema = z.object({ cycles: z.array(persistedCycleSchem
|
|
|
754
748
|
}
|
|
755
749
|
});
|
|
756
750
|
const ladderLedgerFor = (ladder) => [...foldLedger(ladder.cycles, ladderCycleRefsFor(ladder.cycles)).ledger.values()];
|
|
757
|
-
|
|
758
|
-
//#region src/pr-readiness/review-proof.ts
|
|
751
|
+
// src/pr-readiness/review-proof.ts
|
|
759
752
|
const PR_REVIEW_SCHEMA_VERSION = 3;
|
|
760
753
|
const nonBlankString = z.string().refine((value) => value.trim().length > 0, { message: "must not be blank" });
|
|
761
754
|
const parseableDateString = z.string().refine((value) => Number.isFinite(Date.parse(value)), { message: "must be a parseable date string" });
|
|
@@ -870,9 +863,7 @@ const prReviewProofSchema = z.object({
|
|
|
870
863
|
path: ["reviewCycle"]
|
|
871
864
|
});
|
|
872
865
|
});
|
|
873
|
-
|
|
874
|
-
//#region src/required-check-policy.ts
|
|
875
|
-
const EVIDENCE_CHECK_TYPES = ["review", "verify"];
|
|
866
|
+
const evidenceCheckTypeSchema = z.enum(["review", "verify"]);
|
|
876
867
|
const requiredCheckScopeSchema = z.object({ classifications: z.array(z.enum(DIFF_CLASSIFICATIONS)).min(1) }).strict();
|
|
877
868
|
const reviewStatusSchema = z.enum([
|
|
878
869
|
"not-required",
|
|
@@ -881,8 +872,7 @@ const reviewStatusSchema = z.enum([
|
|
|
881
872
|
"missing",
|
|
882
873
|
"blocked"
|
|
883
874
|
]);
|
|
884
|
-
|
|
885
|
-
//#region src/review-state.ts
|
|
875
|
+
// src/review-state.ts
|
|
886
876
|
const reviewStateIssue = (message, field) => [{
|
|
887
877
|
code: "custom",
|
|
888
878
|
message,
|
|
@@ -907,8 +897,7 @@ const reviewStateIssues = (state) => {
|
|
|
907
897
|
if (state.status === "missing" && hasIdentity) return reviewStateIssue("a missing review state must record no reviewed head sha or patch id", "status");
|
|
908
898
|
return [];
|
|
909
899
|
};
|
|
910
|
-
|
|
911
|
-
//#region src/catch-up-recognition-record.ts
|
|
900
|
+
// src/catch-up-recognition-record.ts
|
|
912
901
|
const objectShaSchema = z.string().regex(/^[0-9a-f]{40}$/u);
|
|
913
902
|
const catchUpRecognitionSchema = z.object({
|
|
914
903
|
baseRef: z.string().min(1),
|
|
@@ -1026,8 +1015,7 @@ z.looseObject({
|
|
|
1026
1015
|
packages: z.record(z.string(), z.unknown()).optional(),
|
|
1027
1016
|
snapshots: z.record(z.string(), snapshotSectionSchema).optional()
|
|
1028
1017
|
});
|
|
1029
|
-
|
|
1030
|
-
//#region src/verification-battery.ts
|
|
1018
|
+
// src/verification-battery.ts
|
|
1031
1019
|
/**
|
|
1032
1020
|
* The completeness invariant as an enforceable control (ADR 0024: controls
|
|
1033
1021
|
* fail loudly), shared by both pr:verify proof schemas so they cannot drift.
|
|
@@ -1086,7 +1074,7 @@ const assertBatteryCompleteness = (proof, context) => {
|
|
|
1086
1074
|
seen.add(entry.name);
|
|
1087
1075
|
}
|
|
1088
1076
|
if (proof.outcome !== "passed") return;
|
|
1089
|
-
const disposed = new Set([...executed, ...seen]);
|
|
1077
|
+
const disposed = /* @__PURE__ */ new Set([...executed, ...seen]);
|
|
1090
1078
|
const undisposed = selected.filter((name) => !disposed.has(name));
|
|
1091
1079
|
if (undisposed.length > 0) context.addIssue({
|
|
1092
1080
|
code: "custom",
|
|
@@ -1179,8 +1167,7 @@ const assertNotRequiredStampAuthorization = (proof, context) => {
|
|
|
1179
1167
|
});
|
|
1180
1168
|
}
|
|
1181
1169
|
};
|
|
1182
|
-
|
|
1183
|
-
//#region src/pr-verify-proof-rules.ts
|
|
1170
|
+
// src/pr-verify-proof-rules.ts
|
|
1184
1171
|
const assertPrVerifyProofRules = (proof, context) => {
|
|
1185
1172
|
if (proof.notDemandedRecords !== void 0 && proof.impactStamp === void 0) context.addIssue({
|
|
1186
1173
|
code: "custom",
|
|
@@ -1199,6 +1186,12 @@ const assertPrVerifyProofRules = (proof, context) => {
|
|
|
1199
1186
|
* factory must adopt this release before HQ ingests its pr:verify proofs.
|
|
1200
1187
|
*/
|
|
1201
1188
|
const SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS = [4];
|
|
1189
|
+
/** Where a verification battery ran (#1570). */
|
|
1190
|
+
const PR_VERIFY_RUNNER_KINDS = [
|
|
1191
|
+
"ci",
|
|
1192
|
+
"cloud",
|
|
1193
|
+
"local"
|
|
1194
|
+
];
|
|
1202
1195
|
const prVerifyTestFailureSchema = z.object({
|
|
1203
1196
|
file: z.string().min(1),
|
|
1204
1197
|
kind: z.enum([
|
|
@@ -1233,6 +1226,17 @@ const notDemandedRecordSchema = z.object({
|
|
|
1233
1226
|
basis: z.string().min(1),
|
|
1234
1227
|
name: z.string().min(1)
|
|
1235
1228
|
});
|
|
1229
|
+
const runnerSchema = z.object({
|
|
1230
|
+
arch: z.string().min(1).max(32),
|
|
1231
|
+
cpuCount: z.number().int().positive(),
|
|
1232
|
+
kind: z.enum(PR_VERIFY_RUNNER_KINDS),
|
|
1233
|
+
os: z.string().min(1).max(32),
|
|
1234
|
+
provider: z.enum([
|
|
1235
|
+
"claude-code",
|
|
1236
|
+
"cursor",
|
|
1237
|
+
"github-actions"
|
|
1238
|
+
]).optional()
|
|
1239
|
+
});
|
|
1236
1240
|
const prVerifySchemaVersionSchema = z.literal(4);
|
|
1237
1241
|
const prVerifyProofSchema = z.object({
|
|
1238
1242
|
authoringSession: z.string().trim().min(1),
|
|
@@ -1274,6 +1278,7 @@ const prVerifyProofSchema = z.object({
|
|
|
1274
1278
|
profilePath: z.string().min(1),
|
|
1275
1279
|
projectKey: z.string().min(1),
|
|
1276
1280
|
repository: z.string().min(1),
|
|
1281
|
+
runner: runnerSchema.optional(),
|
|
1277
1282
|
schemaVersion: prVerifySchemaVersionSchema,
|
|
1278
1283
|
startedAt: z.iso.datetime(),
|
|
1279
1284
|
verificationCommands: z.array(z.object({
|
|
@@ -1360,9 +1365,7 @@ const gateTimingRecordSchema = z.object({
|
|
|
1360
1365
|
/** Wall-clock start of this gate invocation (ISO 8601). */
|
|
1361
1366
|
startedAt: z.iso.datetime()
|
|
1362
1367
|
}).strict();
|
|
1363
|
-
|
|
1364
|
-
//#region src/schemas.ts
|
|
1365
|
-
const evidenceCheckTypeSchema = z.enum(EVIDENCE_CHECK_TYPES);
|
|
1368
|
+
// src/schemas.ts
|
|
1366
1369
|
const evidenceReviewRungSchema = z.enum(EVIDENCE_REVIEW_RUNGS);
|
|
1367
1370
|
const diffClassificationSchema = z.enum(DIFF_CLASSIFICATIONS);
|
|
1368
1371
|
const ladderStageSchema = z.enum(LADDER_STAGES);
|
|
@@ -1642,11 +1645,7 @@ const prReadyProofSchema = z.object({
|
|
|
1642
1645
|
arming: z.object({
|
|
1643
1646
|
detail: z.string().min(1).optional(),
|
|
1644
1647
|
headSha: z.string().regex(/^[0-9a-f]{40}$/u),
|
|
1645
|
-
outcome: z.enum(
|
|
1646
|
-
"armed",
|
|
1647
|
-
"merged",
|
|
1648
|
-
"not-armed"
|
|
1649
|
-
])
|
|
1648
|
+
outcome: z.enum(ARMING_OUTCOMES)
|
|
1650
1649
|
}).optional(),
|
|
1651
1650
|
authoringSession: z.string().min(1).optional(),
|
|
1652
1651
|
blockedReasons: blockedReasonsSchema.optional(),
|
|
@@ -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.
|
|
3
|
+
"version": "1.0.0-alpha.47",
|
|
4
4
|
"description": "Shared Patronage software factory CLI and project-profile validation tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,33 +26,39 @@
|
|
|
26
26
|
"./schemas": {
|
|
27
27
|
"types": "./dist/schemas.d.ts",
|
|
28
28
|
"default": "./dist/schemas.js"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"./cloud": {
|
|
31
|
+
"types": "./dist/cloud/credentials.d.mts",
|
|
32
|
+
"default": "./dist/cloud/credentials.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./cloud/install-tools.sh": "./dist/cloud/install-tools.sh"
|
|
30
35
|
},
|
|
31
36
|
"publishConfig": {
|
|
32
37
|
"access": "public",
|
|
33
38
|
"tag": "next"
|
|
34
39
|
},
|
|
35
40
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
+
"@patronage/factory-ci": "1.0.0-alpha.47",
|
|
42
|
+
"commander": "15.0.0",
|
|
43
|
+
"picomatch": "^4.0.7",
|
|
44
|
+
"yaml": "^2.9.1",
|
|
45
|
+
"zod": "4.6.7"
|
|
41
46
|
},
|
|
42
47
|
"devDependencies": {
|
|
43
|
-
"@types/node": "24.
|
|
48
|
+
"@types/node": "24.19.2",
|
|
44
49
|
"@types/picomatch": "^4.0.3",
|
|
45
|
-
"@vitest/coverage-v8": "
|
|
46
|
-
"dependency-cruiser": "18.
|
|
47
|
-
"knip": "6.
|
|
48
|
-
"oxfmt": "0.
|
|
49
|
-
"oxlint": "1.
|
|
50
|
-
"oxlint-tsgolint": "7.0.
|
|
51
|
-
"tsdown": "0.
|
|
52
|
-
"tsx": "4.23.
|
|
53
|
-
"typescript": "
|
|
54
|
-
"
|
|
55
|
-
"
|
|
50
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
51
|
+
"dependency-cruiser": "18.8.0-beta-1",
|
|
52
|
+
"knip": "6.43.0",
|
|
53
|
+
"oxfmt": "0.75.0",
|
|
54
|
+
"oxlint": "1.90.0",
|
|
55
|
+
"oxlint-tsgolint": "7.0.2005",
|
|
56
|
+
"tsdown": "0.23.2",
|
|
57
|
+
"tsx": "4.23.15",
|
|
58
|
+
"typescript": "7.1.0-beta",
|
|
59
|
+
"typescript-api": "npm:typescript@5.9.3",
|
|
60
|
+
"ultracite": "8.1.0",
|
|
61
|
+
"vitest": "5.0.5"
|
|
56
62
|
},
|
|
57
63
|
"engines": {
|
|
58
64
|
"node": "^24.0.0"
|