@patronage/software-factory 1.0.0-alpha.39 → 1.0.0-alpha.40
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 +0 -2
- package/dist/{chunk-DrSxFLj_.js → chunk-pbuEa-1d.js} +0 -1
- package/dist/index.d.ts +80 -938
- package/dist/index.js +15460 -17390
- package/dist/schemas.d.ts +22 -88
- package/dist/schemas.js +242 -226
- package/package.json +2 -8
- package/dist/oxlint-jev/bridge-PMzq2gZh.js +0 -1068
- package/dist/oxlint-jev/index.d.ts +0 -3996
- package/dist/oxlint-jev/index.js +0 -581
- package/dist/oxlint-jev/worker.d.ts +0 -1
- package/dist/oxlint-jev/worker.js +0 -49
package/dist/schemas.js
CHANGED
|
@@ -305,6 +305,11 @@ const authoritativePolicyResolutionSchema = z.object({
|
|
|
305
305
|
const unresolvedPolicyResolutionSchema = z.object({
|
|
306
306
|
/** The base ref whose policy could not be read. */
|
|
307
307
|
baseRefName: z.string().min(1),
|
|
308
|
+
cause: z.enum([
|
|
309
|
+
"no-pull-request",
|
|
310
|
+
"lookup-failed",
|
|
311
|
+
"policy-unreadable"
|
|
312
|
+
]).optional(),
|
|
308
313
|
/** Why the authority is unresolved. */
|
|
309
314
|
reason: z.string().min(1),
|
|
310
315
|
status: z.literal("unresolved")
|
|
@@ -318,16 +323,92 @@ const REVIEW_PROMPT_SECTION_PROVENANCES = [
|
|
|
318
323
|
"prior-review-ledger",
|
|
319
324
|
"issue-review-focus"
|
|
320
325
|
];
|
|
321
|
-
const nonBlankString$
|
|
326
|
+
const nonBlankString$2 = z.string().refine((value) => value.trim().length > 0, { message: "must not be blank" });
|
|
322
327
|
const reviewPromptSectionSchema = z.object({
|
|
323
328
|
provenance: z.enum(REVIEW_PROMPT_SECTION_PROVENANCES),
|
|
324
|
-
source: nonBlankString$
|
|
325
|
-
text: nonBlankString$
|
|
329
|
+
source: nonBlankString$2,
|
|
330
|
+
text: nonBlankString$2
|
|
326
331
|
}).strict();
|
|
327
332
|
const promptSectionRank = (section) => REVIEW_PROMPT_SECTION_PROVENANCES.indexOf(section.provenance);
|
|
328
333
|
const hasDuplicateProvenance = (sections) => new Set(sections.map((section) => section.provenance)).size !== sections.length;
|
|
329
334
|
const isOutOfAssemblyOrder = (sections) => sections.some((section, index) => index > 0 && promptSectionRank(section) < promptSectionRank(sections[index - 1]));
|
|
330
335
|
const reviewPromptSectionsSchema = z.array(reviewPromptSectionSchema).min(1).refine((sections) => !hasDuplicateProvenance(sections) && !isOutOfAssemblyOrder(sections), { message: "prompt sections must be in assembly order without duplicates" });
|
|
336
|
+
new Uint32Array([
|
|
337
|
+
1116352408,
|
|
338
|
+
1899447441,
|
|
339
|
+
3049323471,
|
|
340
|
+
3921009573,
|
|
341
|
+
961987163,
|
|
342
|
+
1508970993,
|
|
343
|
+
2453635748,
|
|
344
|
+
2870763221,
|
|
345
|
+
3624381080,
|
|
346
|
+
310598401,
|
|
347
|
+
607225278,
|
|
348
|
+
1426881987,
|
|
349
|
+
1925078388,
|
|
350
|
+
2162078206,
|
|
351
|
+
2614888103,
|
|
352
|
+
3248222580,
|
|
353
|
+
3835390401,
|
|
354
|
+
4022224774,
|
|
355
|
+
264347078,
|
|
356
|
+
604807628,
|
|
357
|
+
770255983,
|
|
358
|
+
1249150122,
|
|
359
|
+
1555081692,
|
|
360
|
+
1996064986,
|
|
361
|
+
2554220882,
|
|
362
|
+
2821834349,
|
|
363
|
+
2952996808,
|
|
364
|
+
3210313671,
|
|
365
|
+
3336571891,
|
|
366
|
+
3584528711,
|
|
367
|
+
113926993,
|
|
368
|
+
338241895,
|
|
369
|
+
666307205,
|
|
370
|
+
773529912,
|
|
371
|
+
1294757372,
|
|
372
|
+
1396182291,
|
|
373
|
+
1695183700,
|
|
374
|
+
1986661051,
|
|
375
|
+
2177026350,
|
|
376
|
+
2456956037,
|
|
377
|
+
2730485921,
|
|
378
|
+
2820302411,
|
|
379
|
+
3259730800,
|
|
380
|
+
3345764771,
|
|
381
|
+
3516065817,
|
|
382
|
+
3600352804,
|
|
383
|
+
4094571909,
|
|
384
|
+
275423344,
|
|
385
|
+
430227734,
|
|
386
|
+
506948616,
|
|
387
|
+
659060556,
|
|
388
|
+
883997877,
|
|
389
|
+
958139571,
|
|
390
|
+
1322822218,
|
|
391
|
+
1537002063,
|
|
392
|
+
1747873779,
|
|
393
|
+
1955562222,
|
|
394
|
+
2024104815,
|
|
395
|
+
2227730452,
|
|
396
|
+
2361852424,
|
|
397
|
+
2428436474,
|
|
398
|
+
2756734187,
|
|
399
|
+
3204031479,
|
|
400
|
+
3329325298
|
|
401
|
+
]);
|
|
402
|
+
new Uint32Array([
|
|
403
|
+
1779033703,
|
|
404
|
+
3144134277,
|
|
405
|
+
1013904242,
|
|
406
|
+
2773480762,
|
|
407
|
+
1359893119,
|
|
408
|
+
2600822924,
|
|
409
|
+
528734635,
|
|
410
|
+
1541459225
|
|
411
|
+
]);
|
|
331
412
|
//#endregion
|
|
332
413
|
//#region src/review-ladder-policy.ts
|
|
333
414
|
const REVIEW_CATEGORIES = [
|
|
@@ -343,11 +424,7 @@ const OCCURRENCE_ADDRESS_PATTERN = /^c[1-9][0-9]*f[1-9][0-9]*$/u;
|
|
|
343
424
|
const occurrenceAddress = (cycle, finding) => `c${cycle}f${finding}`;
|
|
344
425
|
/** The 1-based recording position an address names. */
|
|
345
426
|
const cycleOfAddress = (address) => Number(/^c(?<cycle>\d+)f/u.exec(address)?.groups?.cycle);
|
|
346
|
-
const POLICY_DECLARATION_RULES = [
|
|
347
|
-
"cycle-2-severity-floor",
|
|
348
|
-
"identity-repeat",
|
|
349
|
-
"schema-2-import"
|
|
350
|
-
];
|
|
427
|
+
const POLICY_DECLARATION_RULES = ["cycle-2-severity-floor", "identity-repeat"];
|
|
351
428
|
const definedAttributes = (finding) => Object.fromEntries([
|
|
352
429
|
"blockingAfterCap",
|
|
353
430
|
"category",
|
|
@@ -452,117 +529,6 @@ const foldLedger = (cycles, refs) => {
|
|
|
452
529
|
occurrences: [...occurrences.values()]
|
|
453
530
|
};
|
|
454
531
|
};
|
|
455
|
-
new Uint32Array([
|
|
456
|
-
1116352408,
|
|
457
|
-
1899447441,
|
|
458
|
-
3049323471,
|
|
459
|
-
3921009573,
|
|
460
|
-
961987163,
|
|
461
|
-
1508970993,
|
|
462
|
-
2453635748,
|
|
463
|
-
2870763221,
|
|
464
|
-
3624381080,
|
|
465
|
-
310598401,
|
|
466
|
-
607225278,
|
|
467
|
-
1426881987,
|
|
468
|
-
1925078388,
|
|
469
|
-
2162078206,
|
|
470
|
-
2614888103,
|
|
471
|
-
3248222580,
|
|
472
|
-
3835390401,
|
|
473
|
-
4022224774,
|
|
474
|
-
264347078,
|
|
475
|
-
604807628,
|
|
476
|
-
770255983,
|
|
477
|
-
1249150122,
|
|
478
|
-
1555081692,
|
|
479
|
-
1996064986,
|
|
480
|
-
2554220882,
|
|
481
|
-
2821834349,
|
|
482
|
-
2952996808,
|
|
483
|
-
3210313671,
|
|
484
|
-
3336571891,
|
|
485
|
-
3584528711,
|
|
486
|
-
113926993,
|
|
487
|
-
338241895,
|
|
488
|
-
666307205,
|
|
489
|
-
773529912,
|
|
490
|
-
1294757372,
|
|
491
|
-
1396182291,
|
|
492
|
-
1695183700,
|
|
493
|
-
1986661051,
|
|
494
|
-
2177026350,
|
|
495
|
-
2456956037,
|
|
496
|
-
2730485921,
|
|
497
|
-
2820302411,
|
|
498
|
-
3259730800,
|
|
499
|
-
3345764771,
|
|
500
|
-
3516065817,
|
|
501
|
-
3600352804,
|
|
502
|
-
4094571909,
|
|
503
|
-
275423344,
|
|
504
|
-
430227734,
|
|
505
|
-
506948616,
|
|
506
|
-
659060556,
|
|
507
|
-
883997877,
|
|
508
|
-
958139571,
|
|
509
|
-
1322822218,
|
|
510
|
-
1537002063,
|
|
511
|
-
1747873779,
|
|
512
|
-
1955562222,
|
|
513
|
-
2024104815,
|
|
514
|
-
2227730452,
|
|
515
|
-
2361852424,
|
|
516
|
-
2428436474,
|
|
517
|
-
2756734187,
|
|
518
|
-
3204031479,
|
|
519
|
-
3329325298
|
|
520
|
-
]);
|
|
521
|
-
new Uint32Array([
|
|
522
|
-
1779033703,
|
|
523
|
-
3144134277,
|
|
524
|
-
1013904242,
|
|
525
|
-
2773480762,
|
|
526
|
-
1359893119,
|
|
527
|
-
2600822924,
|
|
528
|
-
528734635,
|
|
529
|
-
1541459225
|
|
530
|
-
]);
|
|
531
|
-
//#endregion
|
|
532
|
-
//#region src/review-ladder.ts
|
|
533
|
-
const LADDER_NEXT_ACTION_KINDS = [
|
|
534
|
-
"run-interior-cycle",
|
|
535
|
-
"advance-to-gate",
|
|
536
|
-
"run-gate-cycle",
|
|
537
|
-
"accept-nonblocking-findings",
|
|
538
|
-
"escalate-to-triage",
|
|
539
|
-
"ready-for-human"
|
|
540
|
-
];
|
|
541
|
-
const LADDER_STAGES = [
|
|
542
|
-
"interior",
|
|
543
|
-
"interior-complete",
|
|
544
|
-
"gate"
|
|
545
|
-
];
|
|
546
|
-
const LADDER_FORCED_TRANSITION_KINDS = ["gate-cap-exhausted", "interior-cap-reached"];
|
|
547
|
-
const ladderCycleRefsFor = (cycles) => {
|
|
548
|
-
let interior = 0;
|
|
549
|
-
let gate = 0;
|
|
550
|
-
return cycles.map((entry) => {
|
|
551
|
-
if (entry.stage === "interior") {
|
|
552
|
-
if (gate > 0) throw new TypeError("Invalid ladder history: interior cycle recorded after the gate stage began.");
|
|
553
|
-
interior += 1;
|
|
554
|
-
return {
|
|
555
|
-
cycle: interior,
|
|
556
|
-
stage: "interior"
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
gate += 1;
|
|
560
|
-
return {
|
|
561
|
-
cycle: gate,
|
|
562
|
-
stage: "gate"
|
|
563
|
-
};
|
|
564
|
-
});
|
|
565
|
-
};
|
|
566
532
|
//#endregion
|
|
567
533
|
//#region src/review-recording-schema.ts
|
|
568
534
|
const ABSENT_PROOF_DIGEST = "absent";
|
|
@@ -591,7 +557,7 @@ const recordsShape = {
|
|
|
591
557
|
repeatOf: occurrenceAddressSchema$1.optional()
|
|
592
558
|
}).strict())
|
|
593
559
|
};
|
|
594
|
-
const reviewCycleRecordingSchema = z.
|
|
560
|
+
const reviewCycleRecordingSchema = z.object({
|
|
595
561
|
...recordsShape,
|
|
596
562
|
appliedTo: z.union([z.string().regex(sha256Pattern), z.literal(ABSENT_PROOF_DIGEST)]),
|
|
597
563
|
base: z.object({
|
|
@@ -601,13 +567,7 @@ const reviewCycleRecordingSchema = z.union([z.object({
|
|
|
601
567
|
dispositionsDigest: z.string().regex(sha256Pattern).optional(),
|
|
602
568
|
findingsDigest: z.string().regex(sha256Pattern),
|
|
603
569
|
recordingId: z.string().regex(sha256Pattern)
|
|
604
|
-
}).strict()
|
|
605
|
-
...recordsShape,
|
|
606
|
-
imported: z.object({
|
|
607
|
-
proofDigest: z.string().regex(sha256Pattern),
|
|
608
|
-
schemaVersion: z.literal(2)
|
|
609
|
-
}).strict()
|
|
610
|
-
}).strict()]);
|
|
570
|
+
}).strict();
|
|
611
571
|
//#endregion
|
|
612
572
|
//#region src/review-recording.ts
|
|
613
573
|
const occurrenceAddressSchema = z.string().regex(OCCURRENCE_ADDRESS_PATTERN);
|
|
@@ -628,50 +588,150 @@ z.array(z.union([z.object({
|
|
|
628
588
|
}).strict(),
|
|
629
589
|
reference: z.string().min(1).optional()
|
|
630
590
|
}).strict()]));
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
591
|
+
const REVIEW_LOWER_FINDING_PRIORITIES = [
|
|
592
|
+
"P2",
|
|
593
|
+
"P3",
|
|
594
|
+
"P4"
|
|
595
|
+
];
|
|
596
|
+
const nonBlankString$1 = z.string().trim().min(1);
|
|
597
|
+
const reviewFindingSchema = z.object({
|
|
634
598
|
blockingAfterCap: z.boolean().optional(),
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
599
|
+
body: nonBlankString$1,
|
|
600
|
+
category: nonBlankString$1.optional(),
|
|
601
|
+
citedSpan: nonBlankString$1.optional(),
|
|
602
|
+
file: nonBlankString$1.optional(),
|
|
603
|
+
line: z.number().int().positive().optional(),
|
|
604
|
+
prescribedAction: nonBlankString$1.optional(),
|
|
605
|
+
priority: nonBlankString$1.optional(),
|
|
640
606
|
supersedes: z.object({
|
|
641
|
-
file:
|
|
642
|
-
title:
|
|
643
|
-
}).
|
|
644
|
-
title:
|
|
645
|
-
}).
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
607
|
+
file: nonBlankString$1.optional(),
|
|
608
|
+
title: nonBlankString$1
|
|
609
|
+
}).strict().optional(),
|
|
610
|
+
title: nonBlankString$1
|
|
611
|
+
}).strict();
|
|
612
|
+
const findingsReviewSchema = z.object({
|
|
613
|
+
findings: z.array(reviewFindingSchema),
|
|
614
|
+
issuesFlagged: z.number().int().nonnegative(),
|
|
615
|
+
kind: z.enum(["correctness", "security"]),
|
|
616
|
+
lowerFindings: z.array(reviewFindingSchema.extend({ priority: z.enum(REVIEW_LOWER_FINDING_PRIORITIES) })).optional(),
|
|
617
|
+
outcome: z.enum(["passed", "failed"]),
|
|
618
|
+
summary: nonBlankString$1
|
|
619
|
+
}).strict().superRefine((review, context) => {
|
|
620
|
+
for (const [index, finding] of review.findings.entries()) if (REVIEW_LOWER_FINDING_PRIORITIES.some((priority) => priority === finding.priority?.trim().toUpperCase())) context.addIssue({
|
|
621
|
+
code: "custom",
|
|
622
|
+
message: "Below-floor finding: move it to lowerFindings",
|
|
623
|
+
path: [
|
|
624
|
+
"findings",
|
|
625
|
+
index,
|
|
626
|
+
"priority"
|
|
627
|
+
]
|
|
628
|
+
});
|
|
629
|
+
if (review.issuesFlagged !== review.findings.length) context.addIssue({
|
|
630
|
+
code: "custom",
|
|
631
|
+
message: "issuesFlagged must match findings length",
|
|
632
|
+
path: ["issuesFlagged"]
|
|
633
|
+
});
|
|
634
|
+
if (review.outcome === "passed" && review.findings.length > 0) context.addIssue({
|
|
635
|
+
code: "custom",
|
|
636
|
+
message: "passed reviews must not include findings",
|
|
637
|
+
path: ["findings"]
|
|
638
|
+
});
|
|
639
|
+
if (review.outcome === "failed" && review.findings.length === 0) context.addIssue({
|
|
640
|
+
code: "custom",
|
|
641
|
+
message: "failed reviews must include findings",
|
|
642
|
+
path: ["findings"]
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
const reviewResolutionSchema = z.object({
|
|
646
|
+
reference: nonBlankString$1,
|
|
647
|
+
target: z.string().regex(OCCURRENCE_ADDRESS_PATTERN)
|
|
648
|
+
}).strict();
|
|
649
|
+
z.object({
|
|
650
|
+
model: nonBlankString$1,
|
|
651
|
+
patchId: nonBlankString$1,
|
|
652
|
+
producer: nonBlankString$1.optional(),
|
|
653
|
+
resolutions: z.array(reviewResolutionSchema).optional(),
|
|
654
|
+
reviews: z.array(findingsReviewSchema),
|
|
655
|
+
rung: z.enum(EVIDENCE_REVIEW_RUNGS).optional(),
|
|
656
|
+
schemaVersion: z.union([
|
|
657
|
+
z.literal(1),
|
|
658
|
+
z.literal(2),
|
|
659
|
+
z.literal(3)
|
|
651
660
|
]),
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}
|
|
674
|
-
|
|
661
|
+
sessionId: nonBlankString$1
|
|
662
|
+
}).strict().superRefine((file, context) => {
|
|
663
|
+
if (file.schemaVersion === 1) {
|
|
664
|
+
if (file.producer !== void 0) context.addIssue({
|
|
665
|
+
code: "custom",
|
|
666
|
+
message: "producer is a schemaVersion 2 field",
|
|
667
|
+
path: ["producer"]
|
|
668
|
+
});
|
|
669
|
+
if (file.rung !== void 0) context.addIssue({
|
|
670
|
+
code: "custom",
|
|
671
|
+
message: "rung is a schemaVersion 2 field",
|
|
672
|
+
path: ["rung"]
|
|
673
|
+
});
|
|
674
|
+
} else {
|
|
675
|
+
if (file.producer === void 0) context.addIssue({
|
|
676
|
+
code: "custom",
|
|
677
|
+
message: `schemaVersion ${file.schemaVersion} findings require producer`,
|
|
678
|
+
path: ["producer"]
|
|
679
|
+
});
|
|
680
|
+
if (file.rung === void 0) context.addIssue({
|
|
681
|
+
code: "custom",
|
|
682
|
+
message: `schemaVersion ${file.schemaVersion} findings require rung`,
|
|
683
|
+
path: ["rung"]
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
const seen = /* @__PURE__ */ new Set();
|
|
687
|
+
for (const [index, review] of file.reviews.entries()) {
|
|
688
|
+
if (seen.has(review.kind)) context.addIssue({
|
|
689
|
+
code: "custom",
|
|
690
|
+
message: `duplicate review kind: ${review.kind}`,
|
|
691
|
+
path: [
|
|
692
|
+
"reviews",
|
|
693
|
+
index,
|
|
694
|
+
"kind"
|
|
695
|
+
]
|
|
696
|
+
});
|
|
697
|
+
seen.add(review.kind);
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region src/review-ladder.ts
|
|
702
|
+
const LADDER_NEXT_ACTION_KINDS = [
|
|
703
|
+
"run-interior-cycle",
|
|
704
|
+
"advance-to-gate",
|
|
705
|
+
"run-gate-cycle",
|
|
706
|
+
"accept-nonblocking-findings",
|
|
707
|
+
"escalate-to-triage",
|
|
708
|
+
"ready-for-human"
|
|
709
|
+
];
|
|
710
|
+
const LADDER_STAGES = [
|
|
711
|
+
"interior",
|
|
712
|
+
"interior-complete",
|
|
713
|
+
"gate"
|
|
714
|
+
];
|
|
715
|
+
const LADDER_FORCED_TRANSITION_KINDS = ["gate-cap-exhausted", "interior-cap-reached"];
|
|
716
|
+
const ladderCycleRefsFor = (cycles) => {
|
|
717
|
+
let interior = 0;
|
|
718
|
+
let gate = 0;
|
|
719
|
+
return cycles.map((entry) => {
|
|
720
|
+
if (entry.stage === "interior") {
|
|
721
|
+
if (gate > 0) throw new TypeError("Invalid ladder history: interior cycle recorded after the gate stage began.");
|
|
722
|
+
interior += 1;
|
|
723
|
+
return {
|
|
724
|
+
cycle: interior,
|
|
725
|
+
stage: "interior"
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
gate += 1;
|
|
729
|
+
return {
|
|
730
|
+
cycle: gate,
|
|
731
|
+
stage: "gate"
|
|
732
|
+
};
|
|
733
|
+
});
|
|
734
|
+
};
|
|
675
735
|
//#endregion
|
|
676
736
|
//#region src/pr-readiness/ladder-proof-state.ts
|
|
677
737
|
const persistedCycleSchema = z.custom((cycle) => typeof cycle === "object" && cycle !== null, "ladder cycle must be an object").superRefine((cycle, context) => {
|
|
@@ -721,6 +781,7 @@ const prReviewResultSchema = z.object({
|
|
|
721
781
|
findings: z.array(prReviewFindingSchema),
|
|
722
782
|
issuesFlagged: z.number().int().nonnegative(),
|
|
723
783
|
kind: z.enum(["correctness", "security"]),
|
|
784
|
+
lowerFindings: z.array(z.intersection(prReviewFindingSchema, z.object({ priority: z.enum(REVIEW_LOWER_FINDING_PRIORITIES) }))).optional(),
|
|
724
785
|
model: nonBlankString.optional(),
|
|
725
786
|
outcome: z.enum([
|
|
726
787
|
"passed",
|
|
@@ -766,35 +827,23 @@ const prReviewResultSchema = z.object({
|
|
|
766
827
|
path: [review.producer === void 0 ? "producer" : "rung"]
|
|
767
828
|
});
|
|
768
829
|
});
|
|
830
|
+
const convertedProofMessage = (value) => {
|
|
831
|
+
if (typeof value !== "object" || value === null) return;
|
|
832
|
+
const { importedFrom, recoveryRequired } = value;
|
|
833
|
+
if (importedFrom === void 0 && recoveryRequired === void 0) return;
|
|
834
|
+
const proofDigest = importedFrom?.proofDigest;
|
|
835
|
+
return `Unsupported pr:review proof: it was converted from schema 2 by the retired import, and its schema-2 recovery is no longer read. The original schema-2 bytes are retained at .factory-memory/review-proof-imports/${typeof proofDigest === "string" && /^[0-9a-f]{64}$/u.test(proofDigest) ? proofDigest : "<digest>"}.json; move this proof aside unedited and record a fresh review at the current head.`;
|
|
836
|
+
};
|
|
769
837
|
const prReviewProofSchema = z.object({
|
|
770
838
|
base: z.string(),
|
|
771
839
|
changedFiles: z.array(z.string()),
|
|
772
840
|
cleanedPaths: z.array(z.string()),
|
|
773
841
|
findingProvenanceVersion: z.literal(1),
|
|
774
842
|
headSha: z.string().regex(/^[0-9a-f]{40}$/u),
|
|
775
|
-
importedFrom: z.object({
|
|
776
|
-
proofDigest: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
777
|
-
schemaVersion: z.literal(2)
|
|
778
|
-
}).strict().optional(),
|
|
779
843
|
ladder: prReviewLadderStateSchema.optional(),
|
|
780
844
|
maxReviewCycles: z.number().int().positive().optional(),
|
|
781
845
|
patchId: z.string().regex(/^[0-9a-f]{40,64}$/u),
|
|
782
846
|
policyResolution: policyResolutionSchema.optional(),
|
|
783
|
-
recoveryRequired: z.array(z.object({
|
|
784
|
-
candidates: z.array(z.string().regex(OCCURRENCE_ADDRESS_PATTERN)),
|
|
785
|
-
cycle: z.number().int().positive(),
|
|
786
|
-
declaration: z.object({
|
|
787
|
-
disposition: z.enum([
|
|
788
|
-
"fixed-in-thread",
|
|
789
|
-
"follow-up-filed",
|
|
790
|
-
"waived"
|
|
791
|
-
]),
|
|
792
|
-
file: z.string().optional(),
|
|
793
|
-
reference: z.string().optional(),
|
|
794
|
-
title: z.string()
|
|
795
|
-
}).strict(),
|
|
796
|
-
reason: z.string().min(1)
|
|
797
|
-
}).strict()).optional(),
|
|
798
847
|
reviewCycle: z.number().int().positive().optional(),
|
|
799
848
|
reviewRequirement: z.object({
|
|
800
849
|
reason: z.enum(["no-applicable-mode", "faithful-merge"]),
|
|
@@ -803,10 +852,11 @@ const prReviewProofSchema = z.object({
|
|
|
803
852
|
reviews: z.array(prReviewResultSchema),
|
|
804
853
|
schemaVersion: z.literal(3)
|
|
805
854
|
}).passthrough().superRefine((proof, context) => {
|
|
806
|
-
|
|
855
|
+
const converted = convertedProofMessage(proof);
|
|
856
|
+
if (converted !== void 0) context.addIssue({
|
|
807
857
|
code: "custom",
|
|
808
|
-
message:
|
|
809
|
-
path: ["recoveryRequired"]
|
|
858
|
+
message: converted,
|
|
859
|
+
path: ["importedFrom" in proof ? "importedFrom" : "recoveryRequired"]
|
|
810
860
|
});
|
|
811
861
|
if (proof.reviewRequirement && proof.reviews.length > 0) context.addIssue({
|
|
812
862
|
code: "custom",
|
|
@@ -1448,11 +1498,7 @@ const boundaryCheckProofSchema = z.object({
|
|
|
1448
1498
|
});
|
|
1449
1499
|
const readinessRepairSchema = z.object({
|
|
1450
1500
|
action: z.string().min(1),
|
|
1451
|
-
code: z.enum([
|
|
1452
|
-
"undraft-pr",
|
|
1453
|
-
"render-pr-body-sections",
|
|
1454
|
-
"await-post-undraft-checks"
|
|
1455
|
-
]),
|
|
1501
|
+
code: z.enum(["undraft-pr", "await-post-undraft-checks"]),
|
|
1456
1502
|
command: z.string().min(1)
|
|
1457
1503
|
});
|
|
1458
1504
|
const reviewStateSchema = z.object({
|
|
@@ -1465,18 +1511,6 @@ const reviewStateSchema = z.object({
|
|
|
1465
1511
|
});
|
|
1466
1512
|
const verifyCommandSchema = z.literal("patronage-factory pr:verify");
|
|
1467
1513
|
const verifiedShaSchema = z.string().min(1);
|
|
1468
|
-
const historicalPostReadinessCommentSchema = z.object({
|
|
1469
|
-
author: z.string().min(1),
|
|
1470
|
-
createdAt: z.string().min(1),
|
|
1471
|
-
summary: z.string().min(1),
|
|
1472
|
-
url: z.string().min(1)
|
|
1473
|
-
});
|
|
1474
|
-
const historicalHandledHumanCommentSchema = z.object({
|
|
1475
|
-
clearedAt: z.string().min(1).optional(),
|
|
1476
|
-
sessionId: z.string().min(1).optional(),
|
|
1477
|
-
source: z.enum(["check-run", "cli"]),
|
|
1478
|
-
url: z.string().min(1)
|
|
1479
|
-
});
|
|
1480
1514
|
const managedReadinessLedgerSchema = z.object({
|
|
1481
1515
|
baseSha: z.string().regex(/^[0-9a-f]{40}$/u),
|
|
1482
1516
|
blockingReasons: z.array(z.string()),
|
|
@@ -1493,7 +1527,6 @@ const managedReadinessLedgerSchema = z.object({
|
|
|
1493
1527
|
"out-of-scope"
|
|
1494
1528
|
])
|
|
1495
1529
|
})).optional(),
|
|
1496
|
-
finalReviewPoint: z.boolean().optional(),
|
|
1497
1530
|
github: z.object({
|
|
1498
1531
|
draft: z.boolean(),
|
|
1499
1532
|
mergeStateStatus: z.string(),
|
|
@@ -1508,16 +1541,9 @@ const managedReadinessLedgerSchema = z.object({
|
|
|
1508
1541
|
reviewDecision: z.string().nullable().optional(),
|
|
1509
1542
|
unresolvedReviewThreads: z.number().int().nonnegative()
|
|
1510
1543
|
}),
|
|
1511
|
-
handledCommentsProducer: z.object({
|
|
1512
|
-
identity: z.string().min(1),
|
|
1513
|
-
mode: z.enum(["app", "commit-status"])
|
|
1514
|
-
}).optional(),
|
|
1515
|
-
handledHumanComments: z.array(historicalHandledHumanCommentSchema).optional(),
|
|
1516
1544
|
headSha: z.string().regex(/^[0-9a-f]{40}$/u),
|
|
1517
1545
|
mergeBaseSha: z.string().regex(/^[0-9a-f]{40}$/u).optional(),
|
|
1518
1546
|
patchId: z.string().regex(/^[0-9a-f]{40,64}$/u),
|
|
1519
|
-
postReadinessHumanComments: z.array(historicalPostReadinessCommentSchema).optional(),
|
|
1520
|
-
postReadinessHumanReviews: z.array(historicalPostReadinessCommentSchema).optional(),
|
|
1521
1547
|
pr: z.number().int().positive(),
|
|
1522
1548
|
repairs: z.array(readinessRepairSchema).default([]),
|
|
1523
1549
|
reviewCycleState: z.object({
|
|
@@ -1570,12 +1596,6 @@ const managedReadinessLedgerSchema = z.object({
|
|
|
1570
1596
|
security: reviewStateSchema.optional()
|
|
1571
1597
|
}),
|
|
1572
1598
|
schemaVersion: z.literal(2),
|
|
1573
|
-
stackRole: z.enum([
|
|
1574
|
-
"single",
|
|
1575
|
-
"slice",
|
|
1576
|
-
"rollup",
|
|
1577
|
-
"merge-gate prerequisite"
|
|
1578
|
-
]).optional(),
|
|
1579
1599
|
verification: z.discriminatedUnion("prVerify", [
|
|
1580
1600
|
z.object({
|
|
1581
1601
|
command: verifyCommandSchema,
|
|
@@ -1641,11 +1661,7 @@ const prReadyProofSchema = z.object({
|
|
|
1641
1661
|
repairs: z.array(readinessRepairSchema).default([]),
|
|
1642
1662
|
repository: z.string().regex(/^[^/\s]+\/[^/\s]+$/u).optional(),
|
|
1643
1663
|
schemaVersion: prReadySchemaVersionSchema,
|
|
1644
|
-
status: z.enum([
|
|
1645
|
-
"ready",
|
|
1646
|
-
"blocked",
|
|
1647
|
-
"slice-ready/not-final"
|
|
1648
|
-
]),
|
|
1664
|
+
status: z.enum(["ready", "blocked"]),
|
|
1649
1665
|
waivedDemands: z.array(waivedDemandSchema).optional()
|
|
1650
1666
|
}).superRefine((proof, context) => {
|
|
1651
1667
|
for (const issue of blockedReasonIssues({ ...proof })) context.addIssue(issue);
|
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.40",
|
|
4
4
|
"description": "Shared Patronage software factory CLI and project-profile validation tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,10 +23,6 @@
|
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"default": "./dist/index.js"
|
|
25
25
|
},
|
|
26
|
-
"./oxlint-jev": {
|
|
27
|
-
"types": "./dist/oxlint-jev/index.d.ts",
|
|
28
|
-
"default": "./dist/oxlint-jev/index.js"
|
|
29
|
-
},
|
|
30
26
|
"./schemas": {
|
|
31
27
|
"types": "./dist/schemas.d.ts",
|
|
32
28
|
"default": "./dist/schemas.js"
|
|
@@ -37,15 +33,13 @@
|
|
|
37
33
|
"tag": "next"
|
|
38
34
|
},
|
|
39
35
|
"dependencies": {
|
|
40
|
-
"@typesafe-ai/sdk": "0.6.0",
|
|
41
36
|
"commander": "14.0.3",
|
|
42
37
|
"picomatch": "^4.0.5",
|
|
43
38
|
"yaml": "^2.9.0",
|
|
44
39
|
"zod": "4.4.3",
|
|
45
|
-
"@patronage/factory-ci": "1.0.0-alpha.
|
|
40
|
+
"@patronage/factory-ci": "1.0.0-alpha.40"
|
|
46
41
|
},
|
|
47
42
|
"devDependencies": {
|
|
48
|
-
"@oxlint/plugins": "1.76.0",
|
|
49
43
|
"@types/node": "24.13.3",
|
|
50
44
|
"@types/picomatch": "^4.0.3",
|
|
51
45
|
"@vitest/coverage-v8": "4.1.10",
|