@mmnto/totem 1.78.0 → 1.79.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.
Files changed (54) hide show
  1. package/dist/artifacts/panel.d.ts +48 -48
  2. package/dist/artifacts/schema.d.ts +40 -40
  3. package/dist/compiler-schema.d.ts +1048 -7
  4. package/dist/compiler-schema.d.ts.map +1 -1
  5. package/dist/compiler-schema.js +129 -1
  6. package/dist/compiler-schema.js.map +1 -1
  7. package/dist/compiler-schema.test.js +92 -2
  8. package/dist/compiler-schema.test.js.map +1 -1
  9. package/dist/compiler.d.ts +2 -2
  10. package/dist/compiler.d.ts.map +1 -1
  11. package/dist/compiler.js +1 -1
  12. package/dist/compiler.js.map +1 -1
  13. package/dist/index.d.ts +8 -4
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +3 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/spine/authored-rule.d.ts +360 -0
  18. package/dist/spine/authored-rule.d.ts.map +1 -0
  19. package/dist/spine/authored-rule.js +199 -0
  20. package/dist/spine/authored-rule.js.map +1 -0
  21. package/dist/spine/authored-rule.test.d.ts +2 -0
  22. package/dist/spine/authored-rule.test.d.ts.map +1 -0
  23. package/dist/spine/authored-rule.test.js +220 -0
  24. package/dist/spine/authored-rule.test.js.map +1 -0
  25. package/dist/spine/candidate-rule.d.ts +32 -0
  26. package/dist/spine/candidate-rule.d.ts.map +1 -1
  27. package/dist/spine/candidate-rule.js +2 -2
  28. package/dist/spine/candidate-rule.js.map +1 -1
  29. package/dist/spine/classify.d.ts +5 -5
  30. package/dist/spine/compile.d.ts +16 -4
  31. package/dist/spine/compile.d.ts.map +1 -1
  32. package/dist/spine/compile.js +23 -0
  33. package/dist/spine/compile.js.map +1 -1
  34. package/dist/spine/compile.test.js +69 -0
  35. package/dist/spine/compile.test.js.map +1 -1
  36. package/dist/spine/corpus-dispositions.d.ts +18 -18
  37. package/dist/spine/extract.d.ts +2 -2
  38. package/dist/spine/extract.d.ts.map +1 -1
  39. package/dist/spine/extract.js +5 -4
  40. package/dist/spine/extract.js.map +1 -1
  41. package/dist/spine/ledgers.d.ts +46 -21
  42. package/dist/spine/ledgers.d.ts.map +1 -1
  43. package/dist/spine/ledgers.js +16 -8
  44. package/dist/spine/ledgers.js.map +1 -1
  45. package/dist/spine/rule-policy.d.ts +27 -0
  46. package/dist/spine/rule-policy.d.ts.map +1 -0
  47. package/dist/spine/rule-policy.js +43 -0
  48. package/dist/spine/rule-policy.js.map +1 -0
  49. package/dist/spine/rule-policy.test.d.ts +2 -0
  50. package/dist/spine/rule-policy.test.d.ts.map +1 -0
  51. package/dist/spine/rule-policy.test.js +31 -0
  52. package/dist/spine/rule-policy.test.js.map +1 -0
  53. package/dist/spine/windtunnel-lock.d.ts +8 -8
  54. package/package.json +1 -1
@@ -45,8 +45,25 @@ export type AstGrepYamlRule = NapiConfig;
45
45
  * zero-trust), the single source of truth `deriveRuleClass` reads. Control
46
46
  * *evidence* (which PRs/fixtures proved each control) rides the wind-tunnel
47
47
  * manifest (ADR-110 §6), not the per-rule marker.
48
+ *
49
+ * **ADR-112 — this is the MINED variant of the `ProvenanceRecord` union.** The
50
+ * wire shape is otherwise UNCHANGED: `kind` is OPTIONAL and absent on every
51
+ * pre-ADR-112 record, so a legacy mined provenance parses + reserializes
52
+ * BYTE-IDENTICAL (no added key — `canonicalStringify` omits the undefined
53
+ * discriminator exactly as it omits an absent `unverified`), preserving the
54
+ * non-mutating-refine manifest-hash discipline. Absence ⇒ `'mined'` via
55
+ * `provenanceKind()`; the miner path types its provenance as
56
+ * `MinedProvenanceRecord` (the documented mining-only boundary), so its readers
57
+ * of `mergedPr` / `commitSha` stay type-safe without narrowing.
48
58
  */
49
- export declare const ProvenanceRecordSchema: z.ZodObject<{
59
+ export declare const MinedProvenanceWireSchema: z.ZodObject<{
60
+ /**
61
+ * ADR-112 discriminator. OPTIONAL on the mined wire so legacy records (which
62
+ * have no `kind`) round-trip byte-identical; absence is read as `'mined'` by
63
+ * `provenanceKind()`. A new mined artifact MAY carry `kind: 'mined'` only
64
+ * where the resulting hash churn is intentional.
65
+ */
66
+ kind: z.ZodOptional<z.ZodLiteral<"mined">>;
50
67
  /** Merged PR the rule was mined from (positive integer PR number). */
51
68
  mergedPr: z.ZodNumber;
52
69
  /**
@@ -64,12 +81,333 @@ export declare const ProvenanceRecordSchema: z.ZodObject<{
64
81
  mergedPr: number;
65
82
  reviewThread: string;
66
83
  commitSha: string;
84
+ kind?: "mined" | undefined;
67
85
  }, {
68
86
  mergedPr: number;
69
87
  reviewThread: string;
70
88
  commitSha: string;
89
+ kind?: "mined" | undefined;
71
90
  }>;
91
+ export type MinedProvenanceRecord = z.infer<typeof MinedProvenanceWireSchema>;
92
+ /**
93
+ * ADR-112 §3 — one real lc instance an authored rule claims to catch. ALL such
94
+ * fixtures are TRAIN-side (the §5 leakage guard); the preimage-differential
95
+ * (§4) is evaluated in slice C/D, but the record must CARRY both commits + the
96
+ * defect locus here so derivation is possible. `matchedSpan` + `contentHash`
97
+ * are the line-drift-stable locus (cf. `firingLabelId`), not just the file.
98
+ */
99
+ export declare const AuthoredFixtureSchema: z.ZodObject<{
100
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
101
+ pr: z.ZodNumber;
102
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
103
+ mergeCommitSha: z.ZodString;
104
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
105
+ preimageCommitSha: z.ZodString;
106
+ /** File the defect locus lives in. */
107
+ filePath: z.ZodEffects<z.ZodString, string, string>;
108
+ /** Line-range or AST-node path — the defect locus, not just the file. */
109
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
110
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
111
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ pr: number;
114
+ mergeCommitSha: string;
115
+ preimageCommitSha: string;
116
+ filePath: string;
117
+ matchedSpan: string;
118
+ contentHash: string;
119
+ }, {
120
+ pr: number;
121
+ mergeCommitSha: string;
122
+ preimageCommitSha: string;
123
+ filePath: string;
124
+ matchedSpan: string;
125
+ contentHash: string;
126
+ }>;
127
+ export type AuthoredFixture = z.infer<typeof AuthoredFixtureSchema>;
128
+ /**
129
+ * ADR-112 §3 — the AUTHORED variant of the `ProvenanceRecord` union. A
130
+ * hand-authored rule is anchored to a real historical DEFECT (the pre-image,
131
+ * NOT its fix — ADR-110 §4 TP-def) via ≥1 train-side `positiveFixtures` entry.
132
+ * `kind: 'authored'` is REQUIRED (the discriminator), so this can never be
133
+ * mistaken for a mined record and an authored record can never round-trip as
134
+ * mined. Attributable (`author` never anonymous); the embargo/ledger
135
+ * attestations ride the §8 authoring-ledger, not this marker.
136
+ */
137
+ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
138
+ kind: z.ZodLiteral<"authored">;
139
+ /** Agent-id or operator handle — attributable, never anonymous. */
140
+ author: z.ZodEffects<z.ZodString, string, string>;
141
+ /** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
142
+ authoredAt: z.ZodEffects<z.ZodString, string, string>;
143
+ /** The declared DEFECT the rule targets — the pre-image, not its fix. */
144
+ targetDefect: z.ZodEffects<z.ZodString, string, string>;
145
+ /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
146
+ positiveFixtures: z.ZodArray<z.ZodObject<{
147
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
148
+ pr: z.ZodNumber;
149
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
150
+ mergeCommitSha: z.ZodString;
151
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
152
+ preimageCommitSha: z.ZodString;
153
+ /** File the defect locus lives in. */
154
+ filePath: z.ZodEffects<z.ZodString, string, string>;
155
+ /** Line-range or AST-node path — the defect locus, not just the file. */
156
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
157
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
158
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ pr: number;
161
+ mergeCommitSha: string;
162
+ preimageCommitSha: string;
163
+ filePath: string;
164
+ matchedSpan: string;
165
+ contentHash: string;
166
+ }, {
167
+ pr: number;
168
+ mergeCommitSha: string;
169
+ preimageCommitSha: string;
170
+ filePath: string;
171
+ matchedSpan: string;
172
+ contentHash: string;
173
+ }>, "many">;
174
+ /** Declared near-misses the rule must stay silent on (feeds §6 negative controls). */
175
+ negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
176
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
177
+ pr: z.ZodNumber;
178
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
179
+ mergeCommitSha: z.ZodString;
180
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
181
+ preimageCommitSha: z.ZodString;
182
+ /** File the defect locus lives in. */
183
+ filePath: z.ZodEffects<z.ZodString, string, string>;
184
+ /** Line-range or AST-node path — the defect locus, not just the file. */
185
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
186
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
187
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
188
+ }, "strip", z.ZodTypeAny, {
189
+ pr: number;
190
+ mergeCommitSha: string;
191
+ preimageCommitSha: string;
192
+ filePath: string;
193
+ matchedSpan: string;
194
+ contentHash: string;
195
+ }, {
196
+ pr: number;
197
+ mergeCommitSha: string;
198
+ preimageCommitSha: string;
199
+ filePath: string;
200
+ matchedSpan: string;
201
+ contentHash: string;
202
+ }>, "many">>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ kind: "authored";
205
+ author: string;
206
+ authoredAt: string;
207
+ targetDefect: string;
208
+ positiveFixtures: {
209
+ pr: number;
210
+ mergeCommitSha: string;
211
+ preimageCommitSha: string;
212
+ filePath: string;
213
+ matchedSpan: string;
214
+ contentHash: string;
215
+ }[];
216
+ negativeFixtures?: {
217
+ pr: number;
218
+ mergeCommitSha: string;
219
+ preimageCommitSha: string;
220
+ filePath: string;
221
+ matchedSpan: string;
222
+ contentHash: string;
223
+ }[] | undefined;
224
+ }, {
225
+ kind: "authored";
226
+ author: string;
227
+ authoredAt: string;
228
+ targetDefect: string;
229
+ positiveFixtures: {
230
+ pr: number;
231
+ mergeCommitSha: string;
232
+ preimageCommitSha: string;
233
+ filePath: string;
234
+ matchedSpan: string;
235
+ contentHash: string;
236
+ }[];
237
+ negativeFixtures?: {
238
+ pr: number;
239
+ mergeCommitSha: string;
240
+ preimageCommitSha: string;
241
+ filePath: string;
242
+ matchedSpan: string;
243
+ contentHash: string;
244
+ }[] | undefined;
245
+ }>;
246
+ export type AuthoredProvenanceRecord = z.infer<typeof AuthoredProvenanceRecordSchema>;
247
+ /**
248
+ * ADR-112 §3 — `provenance` is a discriminated UNION on `kind`
249
+ * (`mined | authored`), the first multi-producer attribute on a rule
250
+ * (Consequence 3). Built as a `z.union` (NOT `z.discriminatedUnion`) on
251
+ * purpose: the mined wire keeps `kind` OPTIONAL for byte-identical legacy
252
+ * round-trip, which a required-discriminator schema cannot express. The two
253
+ * branches are disjoint on their required fields (`authored` requires
254
+ * `kind:'authored'` + author/targetDefect/fixtures; the mined branch is the
255
+ * only one a legacy `{mergedPr, reviewThread, commitSha}` record satisfies), so
256
+ * the union is unambiguous. `Authored` is listed FIRST so a record carrying
257
+ * `kind:'authored'` never matches the mined branch.
258
+ */
259
+ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
260
+ kind: z.ZodLiteral<"authored">;
261
+ /** Agent-id or operator handle — attributable, never anonymous. */
262
+ author: z.ZodEffects<z.ZodString, string, string>;
263
+ /** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
264
+ authoredAt: z.ZodEffects<z.ZodString, string, string>;
265
+ /** The declared DEFECT the rule targets — the pre-image, not its fix. */
266
+ targetDefect: z.ZodEffects<z.ZodString, string, string>;
267
+ /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
268
+ positiveFixtures: z.ZodArray<z.ZodObject<{
269
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
270
+ pr: z.ZodNumber;
271
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
272
+ mergeCommitSha: z.ZodString;
273
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
274
+ preimageCommitSha: z.ZodString;
275
+ /** File the defect locus lives in. */
276
+ filePath: z.ZodEffects<z.ZodString, string, string>;
277
+ /** Line-range or AST-node path — the defect locus, not just the file. */
278
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
279
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
280
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
281
+ }, "strip", z.ZodTypeAny, {
282
+ pr: number;
283
+ mergeCommitSha: string;
284
+ preimageCommitSha: string;
285
+ filePath: string;
286
+ matchedSpan: string;
287
+ contentHash: string;
288
+ }, {
289
+ pr: number;
290
+ mergeCommitSha: string;
291
+ preimageCommitSha: string;
292
+ filePath: string;
293
+ matchedSpan: string;
294
+ contentHash: string;
295
+ }>, "many">;
296
+ /** Declared near-misses the rule must stay silent on (feeds §6 negative controls). */
297
+ negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
298
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
299
+ pr: z.ZodNumber;
300
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
301
+ mergeCommitSha: z.ZodString;
302
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
303
+ preimageCommitSha: z.ZodString;
304
+ /** File the defect locus lives in. */
305
+ filePath: z.ZodEffects<z.ZodString, string, string>;
306
+ /** Line-range or AST-node path — the defect locus, not just the file. */
307
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
308
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
309
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ pr: number;
312
+ mergeCommitSha: string;
313
+ preimageCommitSha: string;
314
+ filePath: string;
315
+ matchedSpan: string;
316
+ contentHash: string;
317
+ }, {
318
+ pr: number;
319
+ mergeCommitSha: string;
320
+ preimageCommitSha: string;
321
+ filePath: string;
322
+ matchedSpan: string;
323
+ contentHash: string;
324
+ }>, "many">>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ kind: "authored";
327
+ author: string;
328
+ authoredAt: string;
329
+ targetDefect: string;
330
+ positiveFixtures: {
331
+ pr: number;
332
+ mergeCommitSha: string;
333
+ preimageCommitSha: string;
334
+ filePath: string;
335
+ matchedSpan: string;
336
+ contentHash: string;
337
+ }[];
338
+ negativeFixtures?: {
339
+ pr: number;
340
+ mergeCommitSha: string;
341
+ preimageCommitSha: string;
342
+ filePath: string;
343
+ matchedSpan: string;
344
+ contentHash: string;
345
+ }[] | undefined;
346
+ }, {
347
+ kind: "authored";
348
+ author: string;
349
+ authoredAt: string;
350
+ targetDefect: string;
351
+ positiveFixtures: {
352
+ pr: number;
353
+ mergeCommitSha: string;
354
+ preimageCommitSha: string;
355
+ filePath: string;
356
+ matchedSpan: string;
357
+ contentHash: string;
358
+ }[];
359
+ negativeFixtures?: {
360
+ pr: number;
361
+ mergeCommitSha: string;
362
+ preimageCommitSha: string;
363
+ filePath: string;
364
+ matchedSpan: string;
365
+ contentHash: string;
366
+ }[] | undefined;
367
+ }>, z.ZodObject<{
368
+ /**
369
+ * ADR-112 discriminator. OPTIONAL on the mined wire so legacy records (which
370
+ * have no `kind`) round-trip byte-identical; absence is read as `'mined'` by
371
+ * `provenanceKind()`. A new mined artifact MAY carry `kind: 'mined'` only
372
+ * where the resulting hash churn is intentional.
373
+ */
374
+ kind: z.ZodOptional<z.ZodLiteral<"mined">>;
375
+ /** Merged PR the rule was mined from (positive integer PR number). */
376
+ mergedPr: z.ZodNumber;
377
+ /**
378
+ * Reference to the review thread that adjudicated the rule. Rejects empty and
379
+ * whitespace-only via a NON-MUTATING refinement (greptile/CR #2186): a
380
+ * `.trim()` transform would silently normalize a padded value on parse, so a
381
+ * stamped rule's on-disk JSON could differ from its parsed form and churn the
382
+ * manifest hash on the next `verify-manifest`. `.refine` validates without
383
+ * mutating, so the stored value round-trips byte-identically.
384
+ */
385
+ reviewThread: z.ZodEffects<z.ZodString, string, string>;
386
+ /** Full 40-hex git commit SHA the rule was frozen at. */
387
+ commitSha: z.ZodString;
388
+ }, "strip", z.ZodTypeAny, {
389
+ mergedPr: number;
390
+ reviewThread: string;
391
+ commitSha: string;
392
+ kind?: "mined" | undefined;
393
+ }, {
394
+ mergedPr: number;
395
+ reviewThread: string;
396
+ commitSha: string;
397
+ kind?: "mined" | undefined;
398
+ }>]>;
72
399
  export type ProvenanceRecord = z.infer<typeof ProvenanceRecordSchema>;
400
+ /**
401
+ * ADR-112 — the canonical reader of a provenance record's producer kind. An
402
+ * absent discriminator (every legacy mined record) reads as `'mined'`. Use this
403
+ * + the guards below instead of touching `.kind` directly, so the
404
+ * absent-⇒-mined default lives in exactly one place (Tenet 20).
405
+ */
406
+ export declare function provenanceKind(p: ProvenanceRecord): 'mined' | 'authored';
407
+ /** ADR-112 — type-narrowing guard for the mined branch (mined-only field reads). */
408
+ export declare function isMinedProvenance(p: ProvenanceRecord): p is MinedProvenanceRecord;
409
+ /** ADR-112 — type-narrowing guard for the authored branch. */
410
+ export declare function isAuthoredProvenance(p: ProvenanceRecord): p is AuthoredProvenanceRecord;
73
411
  /**
74
412
  * mmnto-ai/totem#2183 — the three **peer** legs of the ADR-110 §3 legitimacy
75
413
  * bar, mapping 1:1 onto the strategy#666 Tenet-9 three-check so the Gate-1
@@ -80,7 +418,122 @@ export type ProvenanceRecord = z.infer<typeof ProvenanceRecordSchema>;
80
418
  * failed one); the evidence behind each pass lives in the wind-tunnel manifest.
81
419
  */
82
420
  export declare const LegitimacySchema: z.ZodObject<{
83
- provenance: z.ZodObject<{
421
+ provenance: z.ZodUnion<[z.ZodObject<{
422
+ kind: z.ZodLiteral<"authored">;
423
+ /** Agent-id or operator handle — attributable, never anonymous. */
424
+ author: z.ZodEffects<z.ZodString, string, string>;
425
+ /** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
426
+ authoredAt: z.ZodEffects<z.ZodString, string, string>;
427
+ /** The declared DEFECT the rule targets — the pre-image, not its fix. */
428
+ targetDefect: z.ZodEffects<z.ZodString, string, string>;
429
+ /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
430
+ positiveFixtures: z.ZodArray<z.ZodObject<{
431
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
432
+ pr: z.ZodNumber;
433
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
434
+ mergeCommitSha: z.ZodString;
435
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
436
+ preimageCommitSha: z.ZodString;
437
+ /** File the defect locus lives in. */
438
+ filePath: z.ZodEffects<z.ZodString, string, string>;
439
+ /** Line-range or AST-node path — the defect locus, not just the file. */
440
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
441
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
442
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
443
+ }, "strip", z.ZodTypeAny, {
444
+ pr: number;
445
+ mergeCommitSha: string;
446
+ preimageCommitSha: string;
447
+ filePath: string;
448
+ matchedSpan: string;
449
+ contentHash: string;
450
+ }, {
451
+ pr: number;
452
+ mergeCommitSha: string;
453
+ preimageCommitSha: string;
454
+ filePath: string;
455
+ matchedSpan: string;
456
+ contentHash: string;
457
+ }>, "many">;
458
+ /** Declared near-misses the rule must stay silent on (feeds §6 negative controls). */
459
+ negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
460
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
461
+ pr: z.ZodNumber;
462
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
463
+ mergeCommitSha: z.ZodString;
464
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
465
+ preimageCommitSha: z.ZodString;
466
+ /** File the defect locus lives in. */
467
+ filePath: z.ZodEffects<z.ZodString, string, string>;
468
+ /** Line-range or AST-node path — the defect locus, not just the file. */
469
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
470
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
471
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
472
+ }, "strip", z.ZodTypeAny, {
473
+ pr: number;
474
+ mergeCommitSha: string;
475
+ preimageCommitSha: string;
476
+ filePath: string;
477
+ matchedSpan: string;
478
+ contentHash: string;
479
+ }, {
480
+ pr: number;
481
+ mergeCommitSha: string;
482
+ preimageCommitSha: string;
483
+ filePath: string;
484
+ matchedSpan: string;
485
+ contentHash: string;
486
+ }>, "many">>;
487
+ }, "strip", z.ZodTypeAny, {
488
+ kind: "authored";
489
+ author: string;
490
+ authoredAt: string;
491
+ targetDefect: string;
492
+ positiveFixtures: {
493
+ pr: number;
494
+ mergeCommitSha: string;
495
+ preimageCommitSha: string;
496
+ filePath: string;
497
+ matchedSpan: string;
498
+ contentHash: string;
499
+ }[];
500
+ negativeFixtures?: {
501
+ pr: number;
502
+ mergeCommitSha: string;
503
+ preimageCommitSha: string;
504
+ filePath: string;
505
+ matchedSpan: string;
506
+ contentHash: string;
507
+ }[] | undefined;
508
+ }, {
509
+ kind: "authored";
510
+ author: string;
511
+ authoredAt: string;
512
+ targetDefect: string;
513
+ positiveFixtures: {
514
+ pr: number;
515
+ mergeCommitSha: string;
516
+ preimageCommitSha: string;
517
+ filePath: string;
518
+ matchedSpan: string;
519
+ contentHash: string;
520
+ }[];
521
+ negativeFixtures?: {
522
+ pr: number;
523
+ mergeCommitSha: string;
524
+ preimageCommitSha: string;
525
+ filePath: string;
526
+ matchedSpan: string;
527
+ contentHash: string;
528
+ }[] | undefined;
529
+ }>, z.ZodObject<{
530
+ /**
531
+ * ADR-112 discriminator. OPTIONAL on the mined wire so legacy records (which
532
+ * have no `kind`) round-trip byte-identical; absence is read as `'mined'` by
533
+ * `provenanceKind()`. A new mined artifact MAY carry `kind: 'mined'` only
534
+ * where the resulting hash churn is intentional.
535
+ */
536
+ kind: z.ZodOptional<z.ZodLiteral<"mined">>;
84
537
  /** Merged PR the rule was mined from (positive integer PR number). */
85
538
  mergedPr: z.ZodNumber;
86
539
  /**
@@ -98,11 +551,13 @@ export declare const LegitimacySchema: z.ZodObject<{
98
551
  mergedPr: number;
99
552
  reviewThread: string;
100
553
  commitSha: string;
554
+ kind?: "mined" | undefined;
101
555
  }, {
102
556
  mergedPr: number;
103
557
  reviewThread: string;
104
558
  commitSha: string;
105
- }>;
559
+ kind?: "mined" | undefined;
560
+ }>]>;
106
561
  positiveControl: z.ZodBoolean;
107
562
  negativeControl: z.ZodBoolean;
108
563
  }, "strip", z.ZodTypeAny, {
@@ -110,6 +565,28 @@ export declare const LegitimacySchema: z.ZodObject<{
110
565
  mergedPr: number;
111
566
  reviewThread: string;
112
567
  commitSha: string;
568
+ kind?: "mined" | undefined;
569
+ } | {
570
+ kind: "authored";
571
+ author: string;
572
+ authoredAt: string;
573
+ targetDefect: string;
574
+ positiveFixtures: {
575
+ pr: number;
576
+ mergeCommitSha: string;
577
+ preimageCommitSha: string;
578
+ filePath: string;
579
+ matchedSpan: string;
580
+ contentHash: string;
581
+ }[];
582
+ negativeFixtures?: {
583
+ pr: number;
584
+ mergeCommitSha: string;
585
+ preimageCommitSha: string;
586
+ filePath: string;
587
+ matchedSpan: string;
588
+ contentHash: string;
589
+ }[] | undefined;
113
590
  };
114
591
  positiveControl: boolean;
115
592
  negativeControl: boolean;
@@ -118,6 +595,28 @@ export declare const LegitimacySchema: z.ZodObject<{
118
595
  mergedPr: number;
119
596
  reviewThread: string;
120
597
  commitSha: string;
598
+ kind?: "mined" | undefined;
599
+ } | {
600
+ kind: "authored";
601
+ author: string;
602
+ authoredAt: string;
603
+ targetDefect: string;
604
+ positiveFixtures: {
605
+ pr: number;
606
+ mergeCommitSha: string;
607
+ preimageCommitSha: string;
608
+ filePath: string;
609
+ matchedSpan: string;
610
+ contentHash: string;
611
+ }[];
612
+ negativeFixtures?: {
613
+ pr: number;
614
+ mergeCommitSha: string;
615
+ preimageCommitSha: string;
616
+ filePath: string;
617
+ matchedSpan: string;
618
+ contentHash: string;
619
+ }[] | undefined;
121
620
  };
122
621
  positiveControl: boolean;
123
622
  negativeControl: boolean;
@@ -309,7 +808,122 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
309
808
  * signal and preserves pre-#2183 manifest hashes via canonicalStringify.
310
809
  */
311
810
  legitimacy: z.ZodOptional<z.ZodObject<{
312
- provenance: z.ZodObject<{
811
+ provenance: z.ZodUnion<[z.ZodObject<{
812
+ kind: z.ZodLiteral<"authored">;
813
+ /** Agent-id or operator handle — attributable, never anonymous. */
814
+ author: z.ZodEffects<z.ZodString, string, string>;
815
+ /** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
816
+ authoredAt: z.ZodEffects<z.ZodString, string, string>;
817
+ /** The declared DEFECT the rule targets — the pre-image, not its fix. */
818
+ targetDefect: z.ZodEffects<z.ZodString, string, string>;
819
+ /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
820
+ positiveFixtures: z.ZodArray<z.ZodObject<{
821
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
822
+ pr: z.ZodNumber;
823
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
824
+ mergeCommitSha: z.ZodString;
825
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
826
+ preimageCommitSha: z.ZodString;
827
+ /** File the defect locus lives in. */
828
+ filePath: z.ZodEffects<z.ZodString, string, string>;
829
+ /** Line-range or AST-node path — the defect locus, not just the file. */
830
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
831
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
832
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
833
+ }, "strip", z.ZodTypeAny, {
834
+ pr: number;
835
+ mergeCommitSha: string;
836
+ preimageCommitSha: string;
837
+ filePath: string;
838
+ matchedSpan: string;
839
+ contentHash: string;
840
+ }, {
841
+ pr: number;
842
+ mergeCommitSha: string;
843
+ preimageCommitSha: string;
844
+ filePath: string;
845
+ matchedSpan: string;
846
+ contentHash: string;
847
+ }>, "many">;
848
+ /** Declared near-misses the rule must stay silent on (feeds §6 negative controls). */
849
+ negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
850
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
851
+ pr: z.ZodNumber;
852
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
853
+ mergeCommitSha: z.ZodString;
854
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
855
+ preimageCommitSha: z.ZodString;
856
+ /** File the defect locus lives in. */
857
+ filePath: z.ZodEffects<z.ZodString, string, string>;
858
+ /** Line-range or AST-node path — the defect locus, not just the file. */
859
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
860
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
861
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
862
+ }, "strip", z.ZodTypeAny, {
863
+ pr: number;
864
+ mergeCommitSha: string;
865
+ preimageCommitSha: string;
866
+ filePath: string;
867
+ matchedSpan: string;
868
+ contentHash: string;
869
+ }, {
870
+ pr: number;
871
+ mergeCommitSha: string;
872
+ preimageCommitSha: string;
873
+ filePath: string;
874
+ matchedSpan: string;
875
+ contentHash: string;
876
+ }>, "many">>;
877
+ }, "strip", z.ZodTypeAny, {
878
+ kind: "authored";
879
+ author: string;
880
+ authoredAt: string;
881
+ targetDefect: string;
882
+ positiveFixtures: {
883
+ pr: number;
884
+ mergeCommitSha: string;
885
+ preimageCommitSha: string;
886
+ filePath: string;
887
+ matchedSpan: string;
888
+ contentHash: string;
889
+ }[];
890
+ negativeFixtures?: {
891
+ pr: number;
892
+ mergeCommitSha: string;
893
+ preimageCommitSha: string;
894
+ filePath: string;
895
+ matchedSpan: string;
896
+ contentHash: string;
897
+ }[] | undefined;
898
+ }, {
899
+ kind: "authored";
900
+ author: string;
901
+ authoredAt: string;
902
+ targetDefect: string;
903
+ positiveFixtures: {
904
+ pr: number;
905
+ mergeCommitSha: string;
906
+ preimageCommitSha: string;
907
+ filePath: string;
908
+ matchedSpan: string;
909
+ contentHash: string;
910
+ }[];
911
+ negativeFixtures?: {
912
+ pr: number;
913
+ mergeCommitSha: string;
914
+ preimageCommitSha: string;
915
+ filePath: string;
916
+ matchedSpan: string;
917
+ contentHash: string;
918
+ }[] | undefined;
919
+ }>, z.ZodObject<{
920
+ /**
921
+ * ADR-112 discriminator. OPTIONAL on the mined wire so legacy records (which
922
+ * have no `kind`) round-trip byte-identical; absence is read as `'mined'` by
923
+ * `provenanceKind()`. A new mined artifact MAY carry `kind: 'mined'` only
924
+ * where the resulting hash churn is intentional.
925
+ */
926
+ kind: z.ZodOptional<z.ZodLiteral<"mined">>;
313
927
  /** Merged PR the rule was mined from (positive integer PR number). */
314
928
  mergedPr: z.ZodNumber;
315
929
  /**
@@ -327,11 +941,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
327
941
  mergedPr: number;
328
942
  reviewThread: string;
329
943
  commitSha: string;
944
+ kind?: "mined" | undefined;
330
945
  }, {
331
946
  mergedPr: number;
332
947
  reviewThread: string;
333
948
  commitSha: string;
334
- }>;
949
+ kind?: "mined" | undefined;
950
+ }>]>;
335
951
  positiveControl: z.ZodBoolean;
336
952
  negativeControl: z.ZodBoolean;
337
953
  }, "strip", z.ZodTypeAny, {
@@ -339,6 +955,28 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
339
955
  mergedPr: number;
340
956
  reviewThread: string;
341
957
  commitSha: string;
958
+ kind?: "mined" | undefined;
959
+ } | {
960
+ kind: "authored";
961
+ author: string;
962
+ authoredAt: string;
963
+ targetDefect: string;
964
+ positiveFixtures: {
965
+ pr: number;
966
+ mergeCommitSha: string;
967
+ preimageCommitSha: string;
968
+ filePath: string;
969
+ matchedSpan: string;
970
+ contentHash: string;
971
+ }[];
972
+ negativeFixtures?: {
973
+ pr: number;
974
+ mergeCommitSha: string;
975
+ preimageCommitSha: string;
976
+ filePath: string;
977
+ matchedSpan: string;
978
+ contentHash: string;
979
+ }[] | undefined;
342
980
  };
343
981
  positiveControl: boolean;
344
982
  negativeControl: boolean;
@@ -347,6 +985,28 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
347
985
  mergedPr: number;
348
986
  reviewThread: string;
349
987
  commitSha: string;
988
+ kind?: "mined" | undefined;
989
+ } | {
990
+ kind: "authored";
991
+ author: string;
992
+ authoredAt: string;
993
+ targetDefect: string;
994
+ positiveFixtures: {
995
+ pr: number;
996
+ mergeCommitSha: string;
997
+ preimageCommitSha: string;
998
+ filePath: string;
999
+ matchedSpan: string;
1000
+ contentHash: string;
1001
+ }[];
1002
+ negativeFixtures?: {
1003
+ pr: number;
1004
+ mergeCommitSha: string;
1005
+ preimageCommitSha: string;
1006
+ filePath: string;
1007
+ matchedSpan: string;
1008
+ contentHash: string;
1009
+ }[] | undefined;
350
1010
  };
351
1011
  positiveControl: boolean;
352
1012
  negativeControl: boolean;
@@ -392,6 +1052,28 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
392
1052
  mergedPr: number;
393
1053
  reviewThread: string;
394
1054
  commitSha: string;
1055
+ kind?: "mined" | undefined;
1056
+ } | {
1057
+ kind: "authored";
1058
+ author: string;
1059
+ authoredAt: string;
1060
+ targetDefect: string;
1061
+ positiveFixtures: {
1062
+ pr: number;
1063
+ mergeCommitSha: string;
1064
+ preimageCommitSha: string;
1065
+ filePath: string;
1066
+ matchedSpan: string;
1067
+ contentHash: string;
1068
+ }[];
1069
+ negativeFixtures?: {
1070
+ pr: number;
1071
+ mergeCommitSha: string;
1072
+ preimageCommitSha: string;
1073
+ filePath: string;
1074
+ matchedSpan: string;
1075
+ contentHash: string;
1076
+ }[] | undefined;
395
1077
  };
396
1078
  positiveControl: boolean;
397
1079
  negativeControl: boolean;
@@ -427,6 +1109,28 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
427
1109
  mergedPr: number;
428
1110
  reviewThread: string;
429
1111
  commitSha: string;
1112
+ kind?: "mined" | undefined;
1113
+ } | {
1114
+ kind: "authored";
1115
+ author: string;
1116
+ authoredAt: string;
1117
+ targetDefect: string;
1118
+ positiveFixtures: {
1119
+ pr: number;
1120
+ mergeCommitSha: string;
1121
+ preimageCommitSha: string;
1122
+ filePath: string;
1123
+ matchedSpan: string;
1124
+ contentHash: string;
1125
+ }[];
1126
+ negativeFixtures?: {
1127
+ pr: number;
1128
+ mergeCommitSha: string;
1129
+ preimageCommitSha: string;
1130
+ filePath: string;
1131
+ matchedSpan: string;
1132
+ contentHash: string;
1133
+ }[] | undefined;
430
1134
  };
431
1135
  positiveControl: boolean;
432
1136
  negativeControl: boolean;
@@ -462,6 +1166,28 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
462
1166
  mergedPr: number;
463
1167
  reviewThread: string;
464
1168
  commitSha: string;
1169
+ kind?: "mined" | undefined;
1170
+ } | {
1171
+ kind: "authored";
1172
+ author: string;
1173
+ authoredAt: string;
1174
+ targetDefect: string;
1175
+ positiveFixtures: {
1176
+ pr: number;
1177
+ mergeCommitSha: string;
1178
+ preimageCommitSha: string;
1179
+ filePath: string;
1180
+ matchedSpan: string;
1181
+ contentHash: string;
1182
+ }[];
1183
+ negativeFixtures?: {
1184
+ pr: number;
1185
+ mergeCommitSha: string;
1186
+ preimageCommitSha: string;
1187
+ filePath: string;
1188
+ matchedSpan: string;
1189
+ contentHash: string;
1190
+ }[] | undefined;
465
1191
  };
466
1192
  positiveControl: boolean;
467
1193
  negativeControl: boolean;
@@ -497,6 +1223,28 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
497
1223
  mergedPr: number;
498
1224
  reviewThread: string;
499
1225
  commitSha: string;
1226
+ kind?: "mined" | undefined;
1227
+ } | {
1228
+ kind: "authored";
1229
+ author: string;
1230
+ authoredAt: string;
1231
+ targetDefect: string;
1232
+ positiveFixtures: {
1233
+ pr: number;
1234
+ mergeCommitSha: string;
1235
+ preimageCommitSha: string;
1236
+ filePath: string;
1237
+ matchedSpan: string;
1238
+ contentHash: string;
1239
+ }[];
1240
+ negativeFixtures?: {
1241
+ pr: number;
1242
+ mergeCommitSha: string;
1243
+ preimageCommitSha: string;
1244
+ filePath: string;
1245
+ matchedSpan: string;
1246
+ contentHash: string;
1247
+ }[] | undefined;
500
1248
  };
501
1249
  positiveControl: boolean;
502
1250
  negativeControl: boolean;
@@ -794,7 +1542,122 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
794
1542
  * signal and preserves pre-#2183 manifest hashes via canonicalStringify.
795
1543
  */
796
1544
  legitimacy: z.ZodOptional<z.ZodObject<{
797
- provenance: z.ZodObject<{
1545
+ provenance: z.ZodUnion<[z.ZodObject<{
1546
+ kind: z.ZodLiteral<"authored">;
1547
+ /** Agent-id or operator handle — attributable, never anonymous. */
1548
+ author: z.ZodEffects<z.ZodString, string, string>;
1549
+ /** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
1550
+ authoredAt: z.ZodEffects<z.ZodString, string, string>;
1551
+ /** The declared DEFECT the rule targets — the pre-image, not its fix. */
1552
+ targetDefect: z.ZodEffects<z.ZodString, string, string>;
1553
+ /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
1554
+ positiveFixtures: z.ZodArray<z.ZodObject<{
1555
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
1556
+ pr: z.ZodNumber;
1557
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
1558
+ mergeCommitSha: z.ZodString;
1559
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
1560
+ preimageCommitSha: z.ZodString;
1561
+ /** File the defect locus lives in. */
1562
+ filePath: z.ZodEffects<z.ZodString, string, string>;
1563
+ /** Line-range or AST-node path — the defect locus, not just the file. */
1564
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
1565
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
1566
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
1567
+ }, "strip", z.ZodTypeAny, {
1568
+ pr: number;
1569
+ mergeCommitSha: string;
1570
+ preimageCommitSha: string;
1571
+ filePath: string;
1572
+ matchedSpan: string;
1573
+ contentHash: string;
1574
+ }, {
1575
+ pr: number;
1576
+ mergeCommitSha: string;
1577
+ preimageCommitSha: string;
1578
+ filePath: string;
1579
+ matchedSpan: string;
1580
+ contentHash: string;
1581
+ }>, "many">;
1582
+ /** Declared near-misses the rule must stay silent on (feeds §6 negative controls). */
1583
+ negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
1584
+ /** The PR whose merge introduced the fix (the in-corpus anchor). */
1585
+ pr: z.ZodNumber;
1586
+ /** The PR's merge/squash commit — the post-fix (defect-absent) anchor. */
1587
+ mergeCommitSha: z.ZodString;
1588
+ /** The PARENT (pre-fix) commit where the DEFECT is present (ADR-112 §4). */
1589
+ preimageCommitSha: z.ZodString;
1590
+ /** File the defect locus lives in. */
1591
+ filePath: z.ZodEffects<z.ZodString, string, string>;
1592
+ /** Line-range or AST-node path — the defect locus, not just the file. */
1593
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
1594
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
1595
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
1596
+ }, "strip", z.ZodTypeAny, {
1597
+ pr: number;
1598
+ mergeCommitSha: string;
1599
+ preimageCommitSha: string;
1600
+ filePath: string;
1601
+ matchedSpan: string;
1602
+ contentHash: string;
1603
+ }, {
1604
+ pr: number;
1605
+ mergeCommitSha: string;
1606
+ preimageCommitSha: string;
1607
+ filePath: string;
1608
+ matchedSpan: string;
1609
+ contentHash: string;
1610
+ }>, "many">>;
1611
+ }, "strip", z.ZodTypeAny, {
1612
+ kind: "authored";
1613
+ author: string;
1614
+ authoredAt: string;
1615
+ targetDefect: string;
1616
+ positiveFixtures: {
1617
+ pr: number;
1618
+ mergeCommitSha: string;
1619
+ preimageCommitSha: string;
1620
+ filePath: string;
1621
+ matchedSpan: string;
1622
+ contentHash: string;
1623
+ }[];
1624
+ negativeFixtures?: {
1625
+ pr: number;
1626
+ mergeCommitSha: string;
1627
+ preimageCommitSha: string;
1628
+ filePath: string;
1629
+ matchedSpan: string;
1630
+ contentHash: string;
1631
+ }[] | undefined;
1632
+ }, {
1633
+ kind: "authored";
1634
+ author: string;
1635
+ authoredAt: string;
1636
+ targetDefect: string;
1637
+ positiveFixtures: {
1638
+ pr: number;
1639
+ mergeCommitSha: string;
1640
+ preimageCommitSha: string;
1641
+ filePath: string;
1642
+ matchedSpan: string;
1643
+ contentHash: string;
1644
+ }[];
1645
+ negativeFixtures?: {
1646
+ pr: number;
1647
+ mergeCommitSha: string;
1648
+ preimageCommitSha: string;
1649
+ filePath: string;
1650
+ matchedSpan: string;
1651
+ contentHash: string;
1652
+ }[] | undefined;
1653
+ }>, z.ZodObject<{
1654
+ /**
1655
+ * ADR-112 discriminator. OPTIONAL on the mined wire so legacy records (which
1656
+ * have no `kind`) round-trip byte-identical; absence is read as `'mined'` by
1657
+ * `provenanceKind()`. A new mined artifact MAY carry `kind: 'mined'` only
1658
+ * where the resulting hash churn is intentional.
1659
+ */
1660
+ kind: z.ZodOptional<z.ZodLiteral<"mined">>;
798
1661
  /** Merged PR the rule was mined from (positive integer PR number). */
799
1662
  mergedPr: z.ZodNumber;
800
1663
  /**
@@ -812,11 +1675,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
812
1675
  mergedPr: number;
813
1676
  reviewThread: string;
814
1677
  commitSha: string;
1678
+ kind?: "mined" | undefined;
815
1679
  }, {
816
1680
  mergedPr: number;
817
1681
  reviewThread: string;
818
1682
  commitSha: string;
819
- }>;
1683
+ kind?: "mined" | undefined;
1684
+ }>]>;
820
1685
  positiveControl: z.ZodBoolean;
821
1686
  negativeControl: z.ZodBoolean;
822
1687
  }, "strip", z.ZodTypeAny, {
@@ -824,6 +1689,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
824
1689
  mergedPr: number;
825
1690
  reviewThread: string;
826
1691
  commitSha: string;
1692
+ kind?: "mined" | undefined;
1693
+ } | {
1694
+ kind: "authored";
1695
+ author: string;
1696
+ authoredAt: string;
1697
+ targetDefect: string;
1698
+ positiveFixtures: {
1699
+ pr: number;
1700
+ mergeCommitSha: string;
1701
+ preimageCommitSha: string;
1702
+ filePath: string;
1703
+ matchedSpan: string;
1704
+ contentHash: string;
1705
+ }[];
1706
+ negativeFixtures?: {
1707
+ pr: number;
1708
+ mergeCommitSha: string;
1709
+ preimageCommitSha: string;
1710
+ filePath: string;
1711
+ matchedSpan: string;
1712
+ contentHash: string;
1713
+ }[] | undefined;
827
1714
  };
828
1715
  positiveControl: boolean;
829
1716
  negativeControl: boolean;
@@ -832,6 +1719,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
832
1719
  mergedPr: number;
833
1720
  reviewThread: string;
834
1721
  commitSha: string;
1722
+ kind?: "mined" | undefined;
1723
+ } | {
1724
+ kind: "authored";
1725
+ author: string;
1726
+ authoredAt: string;
1727
+ targetDefect: string;
1728
+ positiveFixtures: {
1729
+ pr: number;
1730
+ mergeCommitSha: string;
1731
+ preimageCommitSha: string;
1732
+ filePath: string;
1733
+ matchedSpan: string;
1734
+ contentHash: string;
1735
+ }[];
1736
+ negativeFixtures?: {
1737
+ pr: number;
1738
+ mergeCommitSha: string;
1739
+ preimageCommitSha: string;
1740
+ filePath: string;
1741
+ matchedSpan: string;
1742
+ contentHash: string;
1743
+ }[] | undefined;
835
1744
  };
836
1745
  positiveControl: boolean;
837
1746
  negativeControl: boolean;
@@ -877,6 +1786,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
877
1786
  mergedPr: number;
878
1787
  reviewThread: string;
879
1788
  commitSha: string;
1789
+ kind?: "mined" | undefined;
1790
+ } | {
1791
+ kind: "authored";
1792
+ author: string;
1793
+ authoredAt: string;
1794
+ targetDefect: string;
1795
+ positiveFixtures: {
1796
+ pr: number;
1797
+ mergeCommitSha: string;
1798
+ preimageCommitSha: string;
1799
+ filePath: string;
1800
+ matchedSpan: string;
1801
+ contentHash: string;
1802
+ }[];
1803
+ negativeFixtures?: {
1804
+ pr: number;
1805
+ mergeCommitSha: string;
1806
+ preimageCommitSha: string;
1807
+ filePath: string;
1808
+ matchedSpan: string;
1809
+ contentHash: string;
1810
+ }[] | undefined;
880
1811
  };
881
1812
  positiveControl: boolean;
882
1813
  negativeControl: boolean;
@@ -912,6 +1843,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
912
1843
  mergedPr: number;
913
1844
  reviewThread: string;
914
1845
  commitSha: string;
1846
+ kind?: "mined" | undefined;
1847
+ } | {
1848
+ kind: "authored";
1849
+ author: string;
1850
+ authoredAt: string;
1851
+ targetDefect: string;
1852
+ positiveFixtures: {
1853
+ pr: number;
1854
+ mergeCommitSha: string;
1855
+ preimageCommitSha: string;
1856
+ filePath: string;
1857
+ matchedSpan: string;
1858
+ contentHash: string;
1859
+ }[];
1860
+ negativeFixtures?: {
1861
+ pr: number;
1862
+ mergeCommitSha: string;
1863
+ preimageCommitSha: string;
1864
+ filePath: string;
1865
+ matchedSpan: string;
1866
+ contentHash: string;
1867
+ }[] | undefined;
915
1868
  };
916
1869
  positiveControl: boolean;
917
1870
  negativeControl: boolean;
@@ -947,6 +1900,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
947
1900
  mergedPr: number;
948
1901
  reviewThread: string;
949
1902
  commitSha: string;
1903
+ kind?: "mined" | undefined;
1904
+ } | {
1905
+ kind: "authored";
1906
+ author: string;
1907
+ authoredAt: string;
1908
+ targetDefect: string;
1909
+ positiveFixtures: {
1910
+ pr: number;
1911
+ mergeCommitSha: string;
1912
+ preimageCommitSha: string;
1913
+ filePath: string;
1914
+ matchedSpan: string;
1915
+ contentHash: string;
1916
+ }[];
1917
+ negativeFixtures?: {
1918
+ pr: number;
1919
+ mergeCommitSha: string;
1920
+ preimageCommitSha: string;
1921
+ filePath: string;
1922
+ matchedSpan: string;
1923
+ contentHash: string;
1924
+ }[] | undefined;
950
1925
  };
951
1926
  positiveControl: boolean;
952
1927
  negativeControl: boolean;
@@ -982,6 +1957,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
982
1957
  mergedPr: number;
983
1958
  reviewThread: string;
984
1959
  commitSha: string;
1960
+ kind?: "mined" | undefined;
1961
+ } | {
1962
+ kind: "authored";
1963
+ author: string;
1964
+ authoredAt: string;
1965
+ targetDefect: string;
1966
+ positiveFixtures: {
1967
+ pr: number;
1968
+ mergeCommitSha: string;
1969
+ preimageCommitSha: string;
1970
+ filePath: string;
1971
+ matchedSpan: string;
1972
+ contentHash: string;
1973
+ }[];
1974
+ negativeFixtures?: {
1975
+ pr: number;
1976
+ mergeCommitSha: string;
1977
+ preimageCommitSha: string;
1978
+ filePath: string;
1979
+ matchedSpan: string;
1980
+ contentHash: string;
1981
+ }[] | undefined;
985
1982
  };
986
1983
  positiveControl: boolean;
987
1984
  negativeControl: boolean;
@@ -1067,6 +2064,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
1067
2064
  mergedPr: number;
1068
2065
  reviewThread: string;
1069
2066
  commitSha: string;
2067
+ kind?: "mined" | undefined;
2068
+ } | {
2069
+ kind: "authored";
2070
+ author: string;
2071
+ authoredAt: string;
2072
+ targetDefect: string;
2073
+ positiveFixtures: {
2074
+ pr: number;
2075
+ mergeCommitSha: string;
2076
+ preimageCommitSha: string;
2077
+ filePath: string;
2078
+ matchedSpan: string;
2079
+ contentHash: string;
2080
+ }[];
2081
+ negativeFixtures?: {
2082
+ pr: number;
2083
+ mergeCommitSha: string;
2084
+ preimageCommitSha: string;
2085
+ filePath: string;
2086
+ matchedSpan: string;
2087
+ contentHash: string;
2088
+ }[] | undefined;
1070
2089
  };
1071
2090
  positiveControl: boolean;
1072
2091
  negativeControl: boolean;
@@ -1111,6 +2130,28 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
1111
2130
  mergedPr: number;
1112
2131
  reviewThread: string;
1113
2132
  commitSha: string;
2133
+ kind?: "mined" | undefined;
2134
+ } | {
2135
+ kind: "authored";
2136
+ author: string;
2137
+ authoredAt: string;
2138
+ targetDefect: string;
2139
+ positiveFixtures: {
2140
+ pr: number;
2141
+ mergeCommitSha: string;
2142
+ preimageCommitSha: string;
2143
+ filePath: string;
2144
+ matchedSpan: string;
2145
+ contentHash: string;
2146
+ }[];
2147
+ negativeFixtures?: {
2148
+ pr: number;
2149
+ mergeCommitSha: string;
2150
+ preimageCommitSha: string;
2151
+ filePath: string;
2152
+ matchedSpan: string;
2153
+ contentHash: string;
2154
+ }[] | undefined;
1114
2155
  };
1115
2156
  positiveControl: boolean;
1116
2157
  negativeControl: boolean;