@patronage/software-factory 1.0.0-alpha.30 → 1.0.0-alpha.32
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 +4 -4
- package/dist/index.d.ts +253 -49
- package/dist/index.js +3103 -1051
- package/dist/schemas.d.ts +109 -14
- package/dist/schemas.js +266 -298
- package/package.json +2 -2
package/dist/schemas.d.ts
CHANGED
|
@@ -40,8 +40,6 @@ type PolicyResolution = z.infer<typeof policyResolutionSchema>;
|
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/review-ladder-policy.d.ts
|
|
42
42
|
type ReviewFindingCategory = "correctness" | "safety" | "coordination" | "maintainability" | "unknown";
|
|
43
|
-
declare const FINDING_DISPOSITIONS: readonly ["open", "fixed-in-thread", "follow-up-filed", "waived", "stale-repeat", "rerun-noise"];
|
|
44
|
-
type FindingDisposition = (typeof FINDING_DISPOSITIONS)[number];
|
|
45
43
|
interface ReviewFindingAttributes {
|
|
46
44
|
blockingAfterCap?: boolean;
|
|
47
45
|
category?: string;
|
|
@@ -56,6 +54,26 @@ interface ReviewFindingAttributes {
|
|
|
56
54
|
title: string;
|
|
57
55
|
}
|
|
58
56
|
//#endregion
|
|
57
|
+
//#region src/review-recovery-item.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* A schema-2 declaration the bounded import could not convert (ADR 0004
|
|
60
|
+
* decision 7): the declaration as stored, the cycle that recorded it, why it
|
|
61
|
+
* was refused and the occurrence addresses it could have meant. While any
|
|
62
|
+
* item is present the proof admits nothing; an operator re-declares by
|
|
63
|
+
* address on the next recording.
|
|
64
|
+
*/
|
|
65
|
+
interface ReviewRecoveryItem {
|
|
66
|
+
candidates: string[];
|
|
67
|
+
cycle: number;
|
|
68
|
+
declaration: {
|
|
69
|
+
disposition: "fixed-in-thread" | "follow-up-filed" | "waived";
|
|
70
|
+
file?: string;
|
|
71
|
+
reference?: string;
|
|
72
|
+
title: string;
|
|
73
|
+
};
|
|
74
|
+
reason: string;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
59
77
|
//#region src/review-rungs.d.ts
|
|
60
78
|
declare const EVIDENCE_REVIEW_RUNGS: readonly ["independent-model", "oracle", "human"];
|
|
61
79
|
type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
|
|
@@ -63,16 +81,72 @@ type EvidenceReviewRung = (typeof EVIDENCE_REVIEW_RUNGS)[number];
|
|
|
63
81
|
//#region src/review-ladder-ledger.d.ts
|
|
64
82
|
type LadderCycleStage = "interior" | "gate";
|
|
65
83
|
type LadderFindingReport = ReviewFindingAttributes;
|
|
66
|
-
|
|
67
|
-
interface
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
/** One finding as recorded in one cycle (CONTEXT.md: finding occurrence). */
|
|
85
|
+
interface ReviewOccurrenceRecord {
|
|
86
|
+
address: string;
|
|
87
|
+
/** The ladder-assigned cycle number the occurrence was recorded in. */
|
|
88
|
+
declaredCycle: number;
|
|
89
|
+
/**
|
|
90
|
+
* The root occurrence this one repeats: exact `findingKey` equality with an
|
|
91
|
+
* earlier occurrence, or the earlier occurrence an explicit `supersedes`
|
|
92
|
+
* names (decision 3), computed once at recording time. Points at the root
|
|
93
|
+
* of the group, never at an intermediate repeat.
|
|
94
|
+
*/
|
|
95
|
+
repeatOf?: string;
|
|
96
|
+
}
|
|
97
|
+
declare const POLICY_DECLARATION_RULES: readonly ["cycle-2-severity-floor", "identity-repeat", "schema-2-import"];
|
|
98
|
+
type PolicyDeclarationRule = (typeof POLICY_DECLARATION_RULES)[number];
|
|
99
|
+
/**
|
|
100
|
+
* A disposition declaration as stored (CONTEXT.md: disposition declaration):
|
|
101
|
+
* one occurrence, one disposition, the authority that made it and its
|
|
102
|
+
* reference (operator, reviewer) or rule (policy).
|
|
103
|
+
*/
|
|
104
|
+
type ReviewDeclarationRecord = {
|
|
105
|
+
authority: "operator" | "reviewer";
|
|
106
|
+
disposition: "fixed-in-thread" | "follow-up-filed" | "waived";
|
|
74
107
|
reference?: string;
|
|
108
|
+
target: string;
|
|
109
|
+
} | {
|
|
110
|
+
authority: "policy";
|
|
111
|
+
disposition: "policy-accepted" | "stale-repeat";
|
|
112
|
+
rule: PolicyDeclarationRule;
|
|
113
|
+
target: string;
|
|
114
|
+
};
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/review-recording-schema.d.ts
|
|
117
|
+
interface ReviewRecordedCycleIdentity {
|
|
118
|
+
/**
|
|
119
|
+
* SHA-256 of the proof file bytes this recording was applied to, or
|
|
120
|
+
* `absent` when no proof existed. The compare-and-swap at write time
|
|
121
|
+
* refuses to replace a proof whose bytes no longer digest to this value.
|
|
122
|
+
*/
|
|
123
|
+
appliedTo: string;
|
|
124
|
+
base: {
|
|
125
|
+
ref: string;
|
|
126
|
+
sha: string;
|
|
127
|
+
};
|
|
128
|
+
/** SHA-256 of the dispositions file bytes; absent when none was given. */
|
|
129
|
+
dispositionsDigest?: string;
|
|
130
|
+
/** SHA-256 of the findings file bytes; names the retained copy. */
|
|
131
|
+
findingsDigest: string;
|
|
132
|
+
recordingId: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A cycle the bounded importer converted from a schema-2 proof (decision 7).
|
|
136
|
+
* No bytes were read for it, so it carries the digest of the retained source
|
|
137
|
+
* proof instead of a recording identity; it can never answer a retry as
|
|
138
|
+
* `already-recorded`.
|
|
139
|
+
*/
|
|
140
|
+
interface ReviewImportedCycleIdentity {
|
|
141
|
+
imported: {
|
|
142
|
+
proofDigest: string;
|
|
143
|
+
schemaVersion: 2;
|
|
144
|
+
};
|
|
75
145
|
}
|
|
146
|
+
type ReviewCycleRecording = {
|
|
147
|
+
declarations: ReviewDeclarationRecord[]; /** Index-aligned with the cycle's `findings`. */
|
|
148
|
+
occurrences: ReviewOccurrenceRecord[];
|
|
149
|
+
} & (ReviewRecordedCycleIdentity | ReviewImportedCycleIdentity);
|
|
76
150
|
//#endregion
|
|
77
151
|
//#region src/review-ladder.d.ts
|
|
78
152
|
interface LadderSessionAttribution {
|
|
@@ -87,7 +161,6 @@ interface LadderUsageReport {
|
|
|
87
161
|
totalTokens?: number;
|
|
88
162
|
}
|
|
89
163
|
interface ReviewLadderCycle {
|
|
90
|
-
dispositions?: LadderDispositionDeclaration[];
|
|
91
164
|
engine?: string;
|
|
92
165
|
findings: LadderFindingReport[];
|
|
93
166
|
identity?: {
|
|
@@ -96,7 +169,7 @@ interface ReviewLadderCycle {
|
|
|
96
169
|
};
|
|
97
170
|
historical?: true;
|
|
98
171
|
model?: string;
|
|
99
|
-
|
|
172
|
+
recording: ReviewCycleRecording;
|
|
100
173
|
session?: LadderSessionAttribution;
|
|
101
174
|
stage: LadderCycleStage;
|
|
102
175
|
usage?: LadderUsageReport;
|
|
@@ -136,7 +209,7 @@ interface PrReviewResult {
|
|
|
136
209
|
promptSections?: ReviewPromptSection[];
|
|
137
210
|
}
|
|
138
211
|
interface PrReviewProof {
|
|
139
|
-
schemaVersion:
|
|
212
|
+
schemaVersion: 3;
|
|
140
213
|
findingProvenanceVersion: 1;
|
|
141
214
|
base: string;
|
|
142
215
|
headSha: string;
|
|
@@ -146,6 +219,21 @@ interface PrReviewProof {
|
|
|
146
219
|
changedFiles: string[];
|
|
147
220
|
cleanedPaths: string[];
|
|
148
221
|
ladder?: PrReviewLadderState;
|
|
222
|
+
/**
|
|
223
|
+
* Present when the ladder's earlier cycles were converted from a schema-2
|
|
224
|
+
* proof by the bounded import (#1068): the digest of the original bytes,
|
|
225
|
+
* retained content-addressed for audit before the converted proof is
|
|
226
|
+
* written.
|
|
227
|
+
*/
|
|
228
|
+
importedFrom?: {
|
|
229
|
+
proofDigest: string;
|
|
230
|
+
schemaVersion: 2;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Schema-2 declarations the bounded import refused (#1068). Empty is never
|
|
234
|
+
* written; absent means nothing awaits recovery.
|
|
235
|
+
*/
|
|
236
|
+
recoveryRequired?: ReviewRecoveryItem[];
|
|
149
237
|
/**
|
|
150
238
|
* The policy identity this review run resolved its demanded kinds under
|
|
151
239
|
* (#922 Slice B). Optional: a run that could not reach the authority records
|
|
@@ -603,6 +691,12 @@ interface PrVerifyProof {
|
|
|
603
691
|
schemaVersion: PrVerifySchemaVersion;
|
|
604
692
|
authoringSession: string;
|
|
605
693
|
base: string;
|
|
694
|
+
/**
|
|
695
|
+
* The commit `base` resolved to when this proof was written (#1132): the
|
|
696
|
+
* live pull request base tip, or the freshly fetched ref. Optional and
|
|
697
|
+
* additive; a proof written before it existed parses unchanged.
|
|
698
|
+
*/
|
|
699
|
+
baseSha?: string;
|
|
606
700
|
baselineFullProofs?: {
|
|
607
701
|
base: string;
|
|
608
702
|
changedFiles: string[];
|
|
@@ -646,6 +740,7 @@ interface PrVerifyProof {
|
|
|
646
740
|
declare const prVerifyProofSchema: z.ZodObject<{
|
|
647
741
|
authoringSession: z.ZodString;
|
|
648
742
|
base: z.ZodString;
|
|
743
|
+
baseSha: z.ZodOptional<z.ZodString>;
|
|
649
744
|
baselineFullProofs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
650
745
|
base: z.ZodString;
|
|
651
746
|
changedFiles: z.ZodArray<z.ZodString>;
|
|
@@ -873,7 +968,7 @@ declare const evidenceEnvelopeBaseSchema: z.ZodObject<{
|
|
|
873
968
|
type EvidenceEnvelope = z.infer<typeof evidenceEnvelopeBaseSchema>;
|
|
874
969
|
//#endregion
|
|
875
970
|
//#region src/pr-readiness/review-proof.d.ts
|
|
876
|
-
declare const PR_REVIEW_SCHEMA_VERSION =
|
|
971
|
+
declare const PR_REVIEW_SCHEMA_VERSION = 3;
|
|
877
972
|
declare const prReviewFindingSchema: z.ZodType<PrReviewFinding>;
|
|
878
973
|
declare const prReviewResultSchema: z.ZodType<PrReviewResult>;
|
|
879
974
|
declare const prReviewProofSchema: z.ZodType<PrReviewProof>;
|