@patronage/software-factory 0.30.0-beta.1 → 0.30.0

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.d.ts CHANGED
@@ -566,6 +566,8 @@ interface PrVerifyProof {
566
566
  }
567
567
  //#endregion
568
568
  //#region src/closeout-artifact.d.ts
569
+ /** Current writer plus retained reader versions accepted at ingest. */
570
+ declare const SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS: readonly [3, 4];
569
571
  /** Strict, bounded runtime transport contract emitted by factory:closeout. */
570
572
  declare const closeoutArtifactSchema: z.ZodObject<{
571
573
  boundaryThermo: z.ZodObject<{
@@ -575,6 +577,9 @@ declare const closeoutArtifactSchema: z.ZodObject<{
575
577
  waiverRationale: z.ZodOptional<z.ZodString>;
576
578
  }, z.core.$strict>;
577
579
  budget: z.ZodObject<{
580
+ note: z.ZodString;
581
+ tier: z.ZodLiteral<"overseer">;
582
+ }, z.core.$strict> | z.ZodObject<{
578
583
  interiorSourcesConsumed: z.ZodNumber;
579
584
  note: z.ZodString;
580
585
  scoping: z.ZodOptional<z.ZodObject<{
@@ -614,12 +619,26 @@ declare const closeoutArtifactSchema: z.ZodObject<{
614
619
  lesson: "lesson";
615
620
  blindspot: "blindspot";
616
621
  }>;
617
- schemaVersion: z.ZodLiteral<3>;
622
+ schemaVersion: z.ZodLiteral<3 | 4>;
618
623
  source: z.ZodString;
619
624
  unit: z.ZodOptional<z.ZodString>;
620
625
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
621
626
  }, z.core.$strict>>;
622
627
  lessons: z.ZodArray<z.ZodObject<{
628
+ id: z.ZodString;
629
+ landingSpot: z.ZodEnum<{
630
+ CLI: "CLI";
631
+ profile: "profile";
632
+ skill: "skill";
633
+ ADR: "ADR";
634
+ }>;
635
+ lesson: z.ZodString;
636
+ rationale: z.ZodOptional<z.ZodString>;
637
+ source: z.ZodOptional<z.ZodObject<{
638
+ detail: z.ZodString;
639
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
640
+ }, z.core.$strict>>;
641
+ }, z.core.$strict> | z.ZodObject<{
623
642
  id: z.ZodString;
624
643
  landingSpot: z.ZodEnum<{
625
644
  CLI: "CLI";
@@ -632,19 +651,156 @@ declare const closeoutArtifactSchema: z.ZodObject<{
632
651
  source: z.ZodOptional<z.ZodObject<{
633
652
  detail: z.ZodString;
634
653
  kind: z.ZodEnum<{
635
- "interior-telemetry": "interior-telemetry";
636
654
  "boundary-thermo-attestation": "boundary-thermo-attestation";
655
+ "interior-telemetry": "interior-telemetry";
637
656
  }>;
638
657
  }, z.core.$strict>>;
639
658
  }, z.core.$strict>>;
640
659
  metrics: z.ZodArray<z.ZodObject<{
660
+ label: z.ZodString;
661
+ metric: z.ZodString;
662
+ source: z.ZodObject<{
663
+ detail: z.ZodString;
664
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
665
+ }, z.core.$strict>;
666
+ unit: z.ZodEnum<{
667
+ boolean: "boolean";
668
+ text: "text";
669
+ count: "count";
670
+ }>;
671
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
672
+ }, z.core.$strict> | z.ZodObject<{
641
673
  label: z.ZodString;
642
674
  metric: z.ZodString;
643
675
  source: z.ZodObject<{
644
676
  detail: z.ZodString;
645
677
  kind: z.ZodEnum<{
678
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
646
679
  "interior-telemetry": "interior-telemetry";
680
+ }>;
681
+ }, z.core.$strict>;
682
+ unit: z.ZodEnum<{
683
+ boolean: "boolean";
684
+ text: "text";
685
+ count: "count";
686
+ tokens: "tokens";
687
+ usd: "usd";
688
+ ratio: "ratio";
689
+ }>;
690
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
691
+ }, z.core.$strict>>;
692
+ repo: z.ZodString;
693
+ schemaVersion: z.ZodLiteral<3 | 4>;
694
+ }, z.core.$strict>;
695
+ /** Reader-only compatibility for closeout artifacts written before #554. */
696
+ declare const legacyCloseoutArtifactSchema: z.ZodObject<{
697
+ boundaryThermo: z.ZodObject<{
698
+ owner: z.ZodString;
699
+ runs: z.ZodNumber;
700
+ waived: z.ZodBoolean;
701
+ waiverRationale: z.ZodOptional<z.ZodString>;
702
+ }, z.core.$strict>;
703
+ budget: z.ZodObject<{
704
+ note: z.ZodString;
705
+ tier: z.ZodLiteral<"overseer">;
706
+ }, z.core.$strict> | z.ZodObject<{
707
+ interiorSourcesConsumed: z.ZodNumber;
708
+ note: z.ZodString;
709
+ scoping: z.ZodOptional<z.ZodObject<{
710
+ epic: z.ZodString;
711
+ issueFilter: z.ZodOptional<z.ZodNumber>;
712
+ prFilter: z.ZodOptional<z.ZodNumber>;
713
+ repo: z.ZodString;
714
+ scopedByEpicIssueSet: z.ZodBoolean;
715
+ window: z.ZodObject<{
716
+ from: z.ZodString;
717
+ to: z.ZodString;
718
+ }, z.core.$strict>;
719
+ }, z.core.$strict>>;
720
+ tier: z.ZodLiteral<"overseer">;
721
+ }, z.core.$strict>;
722
+ couldNotSee: z.ZodArray<z.ZodObject<{
723
+ id: z.ZodString;
724
+ note: z.ZodString;
725
+ reason: z.ZodOptional<z.ZodString>;
726
+ }, z.core.$strict>>;
727
+ epic: z.ZodString;
728
+ generatedAt: z.ZodISODateTime;
729
+ ledgerRows: z.ZodArray<z.ZodObject<{
730
+ detail: z.ZodOptional<z.ZodString>;
731
+ epic: z.ZodString;
732
+ generatedAt: z.ZodISODateTime;
733
+ key: z.ZodString;
734
+ landingSpot: z.ZodOptional<z.ZodEnum<{
735
+ CLI: "CLI";
736
+ profile: "profile";
737
+ skill: "skill";
738
+ ADR: "ADR";
739
+ }>>;
740
+ repo: z.ZodString;
741
+ rowType: z.ZodEnum<{
742
+ metric: "metric";
743
+ lesson: "lesson";
744
+ blindspot: "blindspot";
745
+ }>;
746
+ schemaVersion: z.ZodLiteral<3 | 4>;
747
+ source: z.ZodString;
748
+ unit: z.ZodOptional<z.ZodString>;
749
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
750
+ }, z.core.$strict>>;
751
+ lessons: z.ZodArray<z.ZodObject<{
752
+ id: z.ZodString;
753
+ landingSpot: z.ZodEnum<{
754
+ CLI: "CLI";
755
+ profile: "profile";
756
+ skill: "skill";
757
+ ADR: "ADR";
758
+ }>;
759
+ lesson: z.ZodString;
760
+ rationale: z.ZodOptional<z.ZodString>;
761
+ source: z.ZodOptional<z.ZodObject<{
762
+ detail: z.ZodString;
763
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
764
+ }, z.core.$strict>>;
765
+ }, z.core.$strict> | z.ZodObject<{
766
+ id: z.ZodString;
767
+ landingSpot: z.ZodEnum<{
768
+ CLI: "CLI";
769
+ profile: "profile";
770
+ skill: "skill";
771
+ ADR: "ADR";
772
+ }>;
773
+ lesson: z.ZodString;
774
+ rationale: z.ZodOptional<z.ZodString>;
775
+ source: z.ZodOptional<z.ZodObject<{
776
+ detail: z.ZodString;
777
+ kind: z.ZodEnum<{
778
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
779
+ "interior-telemetry": "interior-telemetry";
780
+ }>;
781
+ }, z.core.$strict>>;
782
+ }, z.core.$strict>>;
783
+ metrics: z.ZodArray<z.ZodObject<{
784
+ label: z.ZodString;
785
+ metric: z.ZodString;
786
+ source: z.ZodObject<{
787
+ detail: z.ZodString;
788
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
789
+ }, z.core.$strict>;
790
+ unit: z.ZodEnum<{
791
+ boolean: "boolean";
792
+ text: "text";
793
+ count: "count";
794
+ }>;
795
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
796
+ }, z.core.$strict> | z.ZodObject<{
797
+ label: z.ZodString;
798
+ metric: z.ZodString;
799
+ source: z.ZodObject<{
800
+ detail: z.ZodString;
801
+ kind: z.ZodEnum<{
647
802
  "boundary-thermo-attestation": "boundary-thermo-attestation";
803
+ "interior-telemetry": "interior-telemetry";
648
804
  }>;
649
805
  }, z.core.$strict>;
650
806
  unit: z.ZodEnum<{
@@ -658,9 +814,256 @@ declare const closeoutArtifactSchema: z.ZodObject<{
658
814
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
659
815
  }, z.core.$strict>>;
660
816
  repo: z.ZodString;
661
- schemaVersion: z.ZodLiteral<3>;
817
+ schemaVersion: z.ZodLiteral<3 | 4>;
662
818
  }, z.core.$strict>;
819
+ /** Accept current output and retained v3 artifacts when reading or replaying. */
820
+ declare const closeoutArtifactReadSchema: z.ZodUnion<readonly [z.ZodObject<{
821
+ boundaryThermo: z.ZodObject<{
822
+ owner: z.ZodString;
823
+ runs: z.ZodNumber;
824
+ waived: z.ZodBoolean;
825
+ waiverRationale: z.ZodOptional<z.ZodString>;
826
+ }, z.core.$strict>;
827
+ budget: z.ZodObject<{
828
+ note: z.ZodString;
829
+ tier: z.ZodLiteral<"overseer">;
830
+ }, z.core.$strict> | z.ZodObject<{
831
+ interiorSourcesConsumed: z.ZodNumber;
832
+ note: z.ZodString;
833
+ scoping: z.ZodOptional<z.ZodObject<{
834
+ epic: z.ZodString;
835
+ issueFilter: z.ZodOptional<z.ZodNumber>;
836
+ prFilter: z.ZodOptional<z.ZodNumber>;
837
+ repo: z.ZodString;
838
+ scopedByEpicIssueSet: z.ZodBoolean;
839
+ window: z.ZodObject<{
840
+ from: z.ZodString;
841
+ to: z.ZodString;
842
+ }, z.core.$strict>;
843
+ }, z.core.$strict>>;
844
+ tier: z.ZodLiteral<"overseer">;
845
+ }, z.core.$strict>;
846
+ couldNotSee: z.ZodArray<z.ZodObject<{
847
+ id: z.ZodString;
848
+ note: z.ZodString;
849
+ reason: z.ZodOptional<z.ZodString>;
850
+ }, z.core.$strict>>;
851
+ epic: z.ZodString;
852
+ generatedAt: z.ZodISODateTime;
853
+ ledgerRows: z.ZodArray<z.ZodObject<{
854
+ detail: z.ZodOptional<z.ZodString>;
855
+ epic: z.ZodString;
856
+ generatedAt: z.ZodISODateTime;
857
+ key: z.ZodString;
858
+ landingSpot: z.ZodOptional<z.ZodEnum<{
859
+ CLI: "CLI";
860
+ profile: "profile";
861
+ skill: "skill";
862
+ ADR: "ADR";
863
+ }>>;
864
+ repo: z.ZodString;
865
+ rowType: z.ZodEnum<{
866
+ metric: "metric";
867
+ lesson: "lesson";
868
+ blindspot: "blindspot";
869
+ }>;
870
+ schemaVersion: z.ZodLiteral<3 | 4>;
871
+ source: z.ZodString;
872
+ unit: z.ZodOptional<z.ZodString>;
873
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
874
+ }, z.core.$strict>>;
875
+ lessons: z.ZodArray<z.ZodObject<{
876
+ id: z.ZodString;
877
+ landingSpot: z.ZodEnum<{
878
+ CLI: "CLI";
879
+ profile: "profile";
880
+ skill: "skill";
881
+ ADR: "ADR";
882
+ }>;
883
+ lesson: z.ZodString;
884
+ rationale: z.ZodOptional<z.ZodString>;
885
+ source: z.ZodOptional<z.ZodObject<{
886
+ detail: z.ZodString;
887
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
888
+ }, z.core.$strict>>;
889
+ }, z.core.$strict> | z.ZodObject<{
890
+ id: z.ZodString;
891
+ landingSpot: z.ZodEnum<{
892
+ CLI: "CLI";
893
+ profile: "profile";
894
+ skill: "skill";
895
+ ADR: "ADR";
896
+ }>;
897
+ lesson: z.ZodString;
898
+ rationale: z.ZodOptional<z.ZodString>;
899
+ source: z.ZodOptional<z.ZodObject<{
900
+ detail: z.ZodString;
901
+ kind: z.ZodEnum<{
902
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
903
+ "interior-telemetry": "interior-telemetry";
904
+ }>;
905
+ }, z.core.$strict>>;
906
+ }, z.core.$strict>>;
907
+ metrics: z.ZodArray<z.ZodObject<{
908
+ label: z.ZodString;
909
+ metric: z.ZodString;
910
+ source: z.ZodObject<{
911
+ detail: z.ZodString;
912
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
913
+ }, z.core.$strict>;
914
+ unit: z.ZodEnum<{
915
+ boolean: "boolean";
916
+ text: "text";
917
+ count: "count";
918
+ }>;
919
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
920
+ }, z.core.$strict> | z.ZodObject<{
921
+ label: z.ZodString;
922
+ metric: z.ZodString;
923
+ source: z.ZodObject<{
924
+ detail: z.ZodString;
925
+ kind: z.ZodEnum<{
926
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
927
+ "interior-telemetry": "interior-telemetry";
928
+ }>;
929
+ }, z.core.$strict>;
930
+ unit: z.ZodEnum<{
931
+ boolean: "boolean";
932
+ text: "text";
933
+ count: "count";
934
+ tokens: "tokens";
935
+ usd: "usd";
936
+ ratio: "ratio";
937
+ }>;
938
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
939
+ }, z.core.$strict>>;
940
+ repo: z.ZodString;
941
+ schemaVersion: z.ZodLiteral<3 | 4>;
942
+ }, z.core.$strict>, z.ZodObject<{
943
+ boundaryThermo: z.ZodObject<{
944
+ owner: z.ZodString;
945
+ runs: z.ZodNumber;
946
+ waived: z.ZodBoolean;
947
+ waiverRationale: z.ZodOptional<z.ZodString>;
948
+ }, z.core.$strict>;
949
+ budget: z.ZodObject<{
950
+ note: z.ZodString;
951
+ tier: z.ZodLiteral<"overseer">;
952
+ }, z.core.$strict> | z.ZodObject<{
953
+ interiorSourcesConsumed: z.ZodNumber;
954
+ note: z.ZodString;
955
+ scoping: z.ZodOptional<z.ZodObject<{
956
+ epic: z.ZodString;
957
+ issueFilter: z.ZodOptional<z.ZodNumber>;
958
+ prFilter: z.ZodOptional<z.ZodNumber>;
959
+ repo: z.ZodString;
960
+ scopedByEpicIssueSet: z.ZodBoolean;
961
+ window: z.ZodObject<{
962
+ from: z.ZodString;
963
+ to: z.ZodString;
964
+ }, z.core.$strict>;
965
+ }, z.core.$strict>>;
966
+ tier: z.ZodLiteral<"overseer">;
967
+ }, z.core.$strict>;
968
+ couldNotSee: z.ZodArray<z.ZodObject<{
969
+ id: z.ZodString;
970
+ note: z.ZodString;
971
+ reason: z.ZodOptional<z.ZodString>;
972
+ }, z.core.$strict>>;
973
+ epic: z.ZodString;
974
+ generatedAt: z.ZodISODateTime;
975
+ ledgerRows: z.ZodArray<z.ZodObject<{
976
+ detail: z.ZodOptional<z.ZodString>;
977
+ epic: z.ZodString;
978
+ generatedAt: z.ZodISODateTime;
979
+ key: z.ZodString;
980
+ landingSpot: z.ZodOptional<z.ZodEnum<{
981
+ CLI: "CLI";
982
+ profile: "profile";
983
+ skill: "skill";
984
+ ADR: "ADR";
985
+ }>>;
986
+ repo: z.ZodString;
987
+ rowType: z.ZodEnum<{
988
+ metric: "metric";
989
+ lesson: "lesson";
990
+ blindspot: "blindspot";
991
+ }>;
992
+ schemaVersion: z.ZodLiteral<3 | 4>;
993
+ source: z.ZodString;
994
+ unit: z.ZodOptional<z.ZodString>;
995
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
996
+ }, z.core.$strict>>;
997
+ lessons: z.ZodArray<z.ZodObject<{
998
+ id: z.ZodString;
999
+ landingSpot: z.ZodEnum<{
1000
+ CLI: "CLI";
1001
+ profile: "profile";
1002
+ skill: "skill";
1003
+ ADR: "ADR";
1004
+ }>;
1005
+ lesson: z.ZodString;
1006
+ rationale: z.ZodOptional<z.ZodString>;
1007
+ source: z.ZodOptional<z.ZodObject<{
1008
+ detail: z.ZodString;
1009
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
1010
+ }, z.core.$strict>>;
1011
+ }, z.core.$strict> | z.ZodObject<{
1012
+ id: z.ZodString;
1013
+ landingSpot: z.ZodEnum<{
1014
+ CLI: "CLI";
1015
+ profile: "profile";
1016
+ skill: "skill";
1017
+ ADR: "ADR";
1018
+ }>;
1019
+ lesson: z.ZodString;
1020
+ rationale: z.ZodOptional<z.ZodString>;
1021
+ source: z.ZodOptional<z.ZodObject<{
1022
+ detail: z.ZodString;
1023
+ kind: z.ZodEnum<{
1024
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
1025
+ "interior-telemetry": "interior-telemetry";
1026
+ }>;
1027
+ }, z.core.$strict>>;
1028
+ }, z.core.$strict>>;
1029
+ metrics: z.ZodArray<z.ZodObject<{
1030
+ label: z.ZodString;
1031
+ metric: z.ZodString;
1032
+ source: z.ZodObject<{
1033
+ detail: z.ZodString;
1034
+ kind: z.ZodLiteral<"boundary-thermo-attestation">;
1035
+ }, z.core.$strict>;
1036
+ unit: z.ZodEnum<{
1037
+ boolean: "boolean";
1038
+ text: "text";
1039
+ count: "count";
1040
+ }>;
1041
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
1042
+ }, z.core.$strict> | z.ZodObject<{
1043
+ label: z.ZodString;
1044
+ metric: z.ZodString;
1045
+ source: z.ZodObject<{
1046
+ detail: z.ZodString;
1047
+ kind: z.ZodEnum<{
1048
+ "boundary-thermo-attestation": "boundary-thermo-attestation";
1049
+ "interior-telemetry": "interior-telemetry";
1050
+ }>;
1051
+ }, z.core.$strict>;
1052
+ unit: z.ZodEnum<{
1053
+ boolean: "boolean";
1054
+ text: "text";
1055
+ count: "count";
1056
+ tokens: "tokens";
1057
+ usd: "usd";
1058
+ ratio: "ratio";
1059
+ }>;
1060
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>;
1061
+ }, z.core.$strict>>;
1062
+ repo: z.ZodString;
1063
+ schemaVersion: z.ZodLiteral<3 | 4>;
1064
+ }, z.core.$strict>]>;
663
1065
  type CloseoutArtifact = z.infer<typeof closeoutArtifactSchema>;
1066
+ type HistoricalCloseoutArtifact = z.infer<typeof legacyCloseoutArtifactSchema>;
664
1067
  //#endregion
665
1068
  //#region src/retro-envelope.d.ts
666
1069
  /**
@@ -1489,4 +1892,4 @@ declare const prReadyProofSchema: z.ZodObject<{
1489
1892
  waivedDemands: z.ZodOptional<z.ZodArray<z.ZodType<WaivedDemand, unknown, z.core.$ZodTypeInternals<WaivedDemand, unknown>>>>;
1490
1893
  }, z.core.$strip>;
1491
1894
  //#endregion
1492
- export { BLOCKED_REASONS_MAX, BLOCKED_REASON_DETAIL_MAX, BOUNDARY_CHECK_SCHEMA_VERSION, BOUNDARY_REVIEW_PROOF_KIND, type BlockedReason, BoundaryCheckProofRecord, type BoundaryReviewProof, type CloseoutArtifact, EVIDENCE_ENVELOPE_SCHEMA_VERSION, type EvidenceEnvelope, PR_READY_SCHEMA_VERSION, PR_REVIEW_SCHEMA_VERSION, type ParsedRetroEnvelope, type PrReadyProof, type PrReviewProof, type PrVerifyProof, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, RETRO_ENVELOPE_WIRE_BOUNDS, type RetroEnvelope, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, type WaivedDemand, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, prReadyProofSchema, prReviewProofSchema, prVerifyProofSchema, retroEnvelopeV1Schema, retroEpicReference, waivedDemandSchema };
1895
+ export { BLOCKED_REASONS_MAX, BLOCKED_REASON_DETAIL_MAX, BOUNDARY_CHECK_SCHEMA_VERSION, BOUNDARY_REVIEW_PROOF_KIND, type BlockedReason, BoundaryCheckProofRecord, type BoundaryReviewProof, type CloseoutArtifact, EVIDENCE_ENVELOPE_SCHEMA_VERSION, type EvidenceEnvelope, type HistoricalCloseoutArtifact, PR_READY_SCHEMA_VERSION, PR_REVIEW_SCHEMA_VERSION, type ParsedRetroEnvelope, type PrReadyProof, type PrReviewProof, type PrVerifyProof, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, RETRO_ENVELOPE_WIRE_BOUNDS, type RetroEnvelope, SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, type WaivedDemand, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactReadSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, legacyCloseoutArtifactSchema, prReadyProofSchema, prReviewProofSchema, prVerifyProofSchema, retroEnvelopeV1Schema, retroEpicReference, waivedDemandSchema };
package/dist/schemas.js CHANGED
@@ -226,6 +226,9 @@ const waivedDemandSchema = z.object({
226
226
  session: z.string().trim().min(1).optional(),
227
227
  unmetReasons: z.array(z.string().min(1)).min(1)
228
228
  });
229
+ const LEGACY_CLOSEOUT_SCHEMA_VERSION = 3;
230
+ /** Current writer plus retained reader versions accepted at ingest. */
231
+ const SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS = [LEGACY_CLOSEOUT_SCHEMA_VERSION, 4];
229
232
  const MAX_CLOSEOUT_ROWS = 1e3;
230
233
  const IdentifierSchema = z.string().min(1).max(500);
231
234
  const NarrativeSchema = z.string().min(1).max(1e4);
@@ -237,11 +240,15 @@ const CloseoutLandingSpotSchema = z.enum([
237
240
  "skill",
238
241
  "ADR"
239
242
  ]);
240
- const CloseoutSourceSchema = z.object({
243
+ const CurrentCloseoutSourceSchema = z.object({
244
+ detail: NarrativeSchema,
245
+ kind: z.literal("boundary-thermo-attestation")
246
+ }).strict();
247
+ const LegacyCloseoutSourceSchema = z.object({
241
248
  detail: NarrativeSchema,
242
249
  kind: z.enum(["interior-telemetry", "boundary-thermo-attestation"])
243
250
  }).strict();
244
- const CloseoutScopingSchema = z.object({
251
+ const LegacyCloseoutScopingSchema = z.object({
245
252
  epic: IdentifierSchema,
246
253
  issueFilter: z.number().int().positive().optional(),
247
254
  prFilter: z.number().int().positive().optional(),
@@ -253,9 +260,13 @@ const CloseoutScopingSchema = z.object({
253
260
  }).strict()
254
261
  }).strict();
255
262
  const CloseoutBudgetSchema = z.object({
263
+ note: NarrativeSchema,
264
+ tier: z.literal("overseer")
265
+ }).strict();
266
+ const LegacyCloseoutBudgetSchema = z.object({
256
267
  interiorSourcesConsumed: z.number().int().nonnegative(),
257
268
  note: NarrativeSchema,
258
- scoping: CloseoutScopingSchema.optional(),
269
+ scoping: LegacyCloseoutScopingSchema.optional(),
259
270
  tier: z.literal("overseer")
260
271
  }).strict();
261
272
  const BoundaryThermoAttestationSchema = z.object({
@@ -267,7 +278,23 @@ const BoundaryThermoAttestationSchema = z.object({
267
278
  const CloseoutMetricRowSchema = z.object({
268
279
  label: IdentifierSchema,
269
280
  metric: IdentifierSchema,
270
- source: CloseoutSourceSchema,
281
+ source: CurrentCloseoutSourceSchema,
282
+ unit: z.enum([
283
+ "count",
284
+ "boolean",
285
+ "text"
286
+ ]),
287
+ value: z.union([
288
+ z.number(),
289
+ NarrativeSchema,
290
+ z.boolean(),
291
+ z.null()
292
+ ])
293
+ }).strict();
294
+ const LegacyCloseoutMetricRowSchema = z.object({
295
+ label: IdentifierSchema,
296
+ metric: IdentifierSchema,
297
+ source: LegacyCloseoutSourceSchema,
271
298
  unit: z.enum([
272
299
  "tokens",
273
300
  "usd",
@@ -288,14 +315,21 @@ const CloseoutLessonSchema = z.object({
288
315
  landingSpot: CloseoutLandingSpotSchema,
289
316
  lesson: NarrativeSchema,
290
317
  rationale: NarrativeSchema.optional(),
291
- source: CloseoutSourceSchema.optional()
318
+ source: CurrentCloseoutSourceSchema.optional()
319
+ }).strict();
320
+ const LegacyCloseoutLessonSchema = z.object({
321
+ id: IdentifierSchema,
322
+ landingSpot: CloseoutLandingSpotSchema,
323
+ lesson: NarrativeSchema,
324
+ rationale: NarrativeSchema.optional(),
325
+ source: LegacyCloseoutSourceSchema.optional()
292
326
  }).strict();
293
327
  const CloseoutBlindspotSchema = z.object({
294
328
  id: IdentifierSchema,
295
329
  note: NarrativeSchema,
296
330
  reason: NarrativeSchema.optional()
297
331
  }).strict();
298
- const CloseoutLedgerRowSchema = z.object({
332
+ const closeoutLedgerRowSchema = (schemaVersion) => z.object({
299
333
  detail: NarrativeSchema.optional(),
300
334
  epic: IdentifierSchema,
301
335
  generatedAt: z.iso.datetime(),
@@ -307,7 +341,7 @@ const CloseoutLedgerRowSchema = z.object({
307
341
  "lesson",
308
342
  "blindspot"
309
343
  ]),
310
- schemaVersion: z.literal(3),
344
+ schemaVersion: z.literal(schemaVersion),
311
345
  source: NarrativeSchema,
312
346
  unit: IdentifierSchema.optional(),
313
347
  value: z.union([
@@ -316,19 +350,38 @@ const CloseoutLedgerRowSchema = z.object({
316
350
  z.null()
317
351
  ])
318
352
  }).strict();
319
- /** Strict, bounded runtime transport contract emitted by factory:closeout. */
320
- const closeoutArtifactSchema = z.object({
353
+ const CloseoutLedgerRowSchema = closeoutLedgerRowSchema(4);
354
+ const LegacyCloseoutLedgerRowSchema = closeoutLedgerRowSchema(LEGACY_CLOSEOUT_SCHEMA_VERSION);
355
+ const closeoutArtifactShape = (input) => z.object({
321
356
  boundaryThermo: BoundaryThermoAttestationSchema,
322
- budget: CloseoutBudgetSchema,
357
+ budget: input.budget,
323
358
  couldNotSee: z.array(CloseoutBlindspotSchema).min(1).max(MAX_CLOSEOUT_ROWS),
324
359
  epic: IdentifierSchema,
325
360
  generatedAt: z.iso.datetime(),
326
- ledgerRows: z.array(CloseoutLedgerRowSchema).max(MAX_CLOSEOUT_ROWS),
327
- lessons: z.array(CloseoutLessonSchema).max(MAX_CLOSEOUT_ROWS),
328
- metrics: z.array(CloseoutMetricRowSchema).max(MAX_CLOSEOUT_ROWS),
361
+ ledgerRows: z.array(input.ledgerRows).max(MAX_CLOSEOUT_ROWS),
362
+ lessons: z.array(input.lessons).max(MAX_CLOSEOUT_ROWS),
363
+ metrics: z.array(input.metrics).max(MAX_CLOSEOUT_ROWS),
329
364
  repo: RepoSchema,
330
- schemaVersion: z.literal(3)
365
+ schemaVersion: z.literal(input.schemaVersion)
331
366
  }).strict();
367
+ /** Strict, bounded runtime transport contract emitted by factory:closeout. */
368
+ const closeoutArtifactSchema = closeoutArtifactShape({
369
+ budget: CloseoutBudgetSchema,
370
+ ledgerRows: CloseoutLedgerRowSchema,
371
+ lessons: CloseoutLessonSchema,
372
+ metrics: CloseoutMetricRowSchema,
373
+ schemaVersion: 4
374
+ });
375
+ /** Reader-only compatibility for closeout artifacts written before #554. */
376
+ const legacyCloseoutArtifactSchema = closeoutArtifactShape({
377
+ budget: LegacyCloseoutBudgetSchema,
378
+ ledgerRows: LegacyCloseoutLedgerRowSchema,
379
+ lessons: LegacyCloseoutLessonSchema,
380
+ metrics: LegacyCloseoutMetricRowSchema,
381
+ schemaVersion: LEGACY_CLOSEOUT_SCHEMA_VERSION
382
+ });
383
+ /** Accept current output and retained v3 artifacts when reading or replaying. */
384
+ const closeoutArtifactReadSchema = z.union([closeoutArtifactSchema, legacyCloseoutArtifactSchema]);
332
385
  //#endregion
333
386
  //#region src/retro-envelope.ts
334
387
  /**
@@ -1178,4 +1231,4 @@ const prReadyProofSchema = z.object({
1178
1231
  for (const issue of blockedReasonIssues({ ...proof })) context.addIssue(issue);
1179
1232
  });
1180
1233
  //#endregion
1181
- 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, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, RETRO_ENVELOPE_WIRE_BOUNDS, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, prReadyProofSchema, prReviewProofSchema, prVerifyProofSchema, retroEnvelopeV1Schema, retroEpicReference, waivedDemandSchema };
1234
+ 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, RETRO_ENVELOPE_SCHEMA_VERSION, RETRO_ENVELOPE_VALIDATORS, RETRO_ENVELOPE_WIRE_BOUNDS, SUPPORTED_CLOSEOUT_SCHEMA_VERSIONS, SUPPORTED_PR_READY_SCHEMA_VERSIONS, SUPPORTED_PR_VERIFY_SCHEMA_VERSIONS, SUPPORTED_RETRO_ENVELOPE_SCHEMA_VERSIONS, blockedReasonSchema, blockedReasonsSchema, boundaryCheckProofSchema, boundaryReviewProofSchema, closeoutArtifactReadSchema, closeoutArtifactSchema, evidenceEnvelopeSchema, legacyCloseoutArtifactSchema, prReadyProofSchema, prReviewProofSchema, prVerifyProofSchema, retroEnvelopeV1Schema, retroEpicReference, waivedDemandSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patronage/software-factory",
3
- "version": "0.30.0-beta.1",
3
+ "version": "0.30.0",
4
4
  "description": "Shared Patronage software factory CLI and project-profile validation tools",
5
5
  "license": "MIT",
6
6
  "repository": {