@mmnto/totem 1.67.1 → 1.68.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 (90) hide show
  1. package/dist/capability/falsification.d.ts +18 -0
  2. package/dist/capability/falsification.d.ts.map +1 -0
  3. package/dist/capability/falsification.js +56 -0
  4. package/dist/capability/falsification.js.map +1 -0
  5. package/dist/capability/falsification.test.d.ts +2 -0
  6. package/dist/capability/falsification.test.d.ts.map +1 -0
  7. package/dist/capability/falsification.test.js +112 -0
  8. package/dist/capability/falsification.test.js.map +1 -0
  9. package/dist/capability/regenerate.d.ts +20 -0
  10. package/dist/capability/regenerate.d.ts.map +1 -0
  11. package/dist/capability/regenerate.js +0 -0
  12. package/dist/capability/regenerate.js.map +1 -0
  13. package/dist/capability/regenerate.test.d.ts +2 -0
  14. package/dist/capability/regenerate.test.d.ts.map +1 -0
  15. package/dist/capability/regenerate.test.js +136 -0
  16. package/dist/capability/regenerate.test.js.map +1 -0
  17. package/dist/capability/review-catch.d.ts +53 -0
  18. package/dist/capability/review-catch.d.ts.map +1 -0
  19. package/dist/capability/review-catch.js +92 -0
  20. package/dist/capability/review-catch.js.map +1 -0
  21. package/dist/capability/review-catch.test.d.ts +2 -0
  22. package/dist/capability/review-catch.test.d.ts.map +1 -0
  23. package/dist/capability/review-catch.test.js +90 -0
  24. package/dist/capability/review-catch.test.js.map +1 -0
  25. package/dist/capability/schema.d.ts +244 -0
  26. package/dist/capability/schema.d.ts.map +1 -0
  27. package/dist/capability/schema.js +141 -0
  28. package/dist/capability/schema.js.map +1 -0
  29. package/dist/capability/schema.test.d.ts +2 -0
  30. package/dist/capability/schema.test.d.ts.map +1 -0
  31. package/dist/capability/schema.test.js +93 -0
  32. package/dist/capability/schema.test.js.map +1 -0
  33. package/dist/index.d.ts +20 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +10 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/spine/candidate-rule.d.ts +84 -0
  38. package/dist/spine/candidate-rule.d.ts.map +1 -0
  39. package/dist/spine/candidate-rule.js +68 -0
  40. package/dist/spine/candidate-rule.js.map +1 -0
  41. package/dist/spine/candidate-rule.test.d.ts +2 -0
  42. package/dist/spine/candidate-rule.test.d.ts.map +1 -0
  43. package/dist/spine/candidate-rule.test.js +40 -0
  44. package/dist/spine/candidate-rule.test.js.map +1 -0
  45. package/dist/spine/classify.d.ts +93 -0
  46. package/dist/spine/classify.d.ts.map +1 -0
  47. package/dist/spine/classify.js +190 -0
  48. package/dist/spine/classify.js.map +1 -0
  49. package/dist/spine/classify.test.d.ts +2 -0
  50. package/dist/spine/classify.test.d.ts.map +1 -0
  51. package/dist/spine/classify.test.js +302 -0
  52. package/dist/spine/classify.test.js.map +1 -0
  53. package/dist/spine/compile.d.ts +62 -0
  54. package/dist/spine/compile.d.ts.map +1 -0
  55. package/dist/spine/compile.js +204 -0
  56. package/dist/spine/compile.js.map +1 -0
  57. package/dist/spine/compile.test.d.ts +2 -0
  58. package/dist/spine/compile.test.d.ts.map +1 -0
  59. package/dist/spine/compile.test.js +327 -0
  60. package/dist/spine/compile.test.js.map +1 -0
  61. package/dist/spine/extract.d.ts +146 -0
  62. package/dist/spine/extract.d.ts.map +1 -0
  63. package/dist/spine/extract.js +227 -0
  64. package/dist/spine/extract.js.map +1 -0
  65. package/dist/spine/extract.test.d.ts +2 -0
  66. package/dist/spine/extract.test.d.ts.map +1 -0
  67. package/dist/spine/extract.test.js +382 -0
  68. package/dist/spine/extract.test.js.map +1 -0
  69. package/dist/spine/ledgers.d.ts +1102 -0
  70. package/dist/spine/ledgers.d.ts.map +1 -0
  71. package/dist/spine/ledgers.js +209 -0
  72. package/dist/spine/ledgers.js.map +1 -0
  73. package/dist/spine/miner-harness.d.ts +30 -0
  74. package/dist/spine/miner-harness.d.ts.map +1 -0
  75. package/dist/spine/miner-harness.js +214 -0
  76. package/dist/spine/miner-harness.js.map +1 -0
  77. package/dist/spine/miner-harness.test.d.ts +2 -0
  78. package/dist/spine/miner-harness.test.d.ts.map +1 -0
  79. package/dist/spine/miner-harness.test.js +231 -0
  80. package/dist/spine/miner-harness.test.js.map +1 -0
  81. package/dist/spine/split.d.ts +149 -0
  82. package/dist/spine/split.d.ts.map +1 -0
  83. package/dist/spine/split.js +235 -0
  84. package/dist/spine/split.js.map +1 -0
  85. package/dist/spine/split.test.d.ts +2 -0
  86. package/dist/spine/split.test.d.ts.map +1 -0
  87. package/dist/spine/split.test.js +142 -0
  88. package/dist/spine/split.test.js.map +1 -0
  89. package/dist/spine/windtunnel-lock.d.ts +8 -8
  90. package/package.json +1 -1
@@ -0,0 +1,90 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { regenerateCapabilityLedger } from './regenerate.js';
3
+ import { mineReviewCatch, resolveActorId } from './review-catch.js';
4
+ const sha = (n) => String(n).padStart(40, '0');
5
+ const HORIZON = '2026-06-21T00:00:00.000Z';
6
+ function finding(overrides) {
7
+ return {
8
+ author: 'coderabbitai[bot]',
9
+ prRef: 'mmnto-ai/totem#2205',
10
+ commitSha: sha(1),
11
+ assertedAt: '2026-06-20T00:00:00.000Z',
12
+ ...overrides,
13
+ };
14
+ }
15
+ describe('resolveActorId — couple to the registries, do not mint', () => {
16
+ it('maps the three active review-bot logins to their stable actor-ids', () => {
17
+ expect(resolveActorId('coderabbitai[bot]')).toBe('coderabbit');
18
+ expect(resolveActorId('gemini-code-assist[bot]')).toBe('gemini-code-assist');
19
+ expect(resolveActorId('greptile-apps[bot]')).toBe('greptile');
20
+ });
21
+ it('does NOT specially map dropped/research-only backends (pr-agent/qodo)', () => {
22
+ // No shipped #670 registry to couple to — they fall through to the raw login.
23
+ expect(resolveActorId('pr-agent[bot]')).toBe('pr-agent[bot]');
24
+ expect(resolveActorId('qodo[bot]')).toBe('qodo[bot]');
25
+ });
26
+ it('does NOT collapse an unknown bot variant into a shipped actor-id — exact match (greptile P2)', () => {
27
+ // A future `greptile-enterprise[bot]` must NOT become `greptile` (would mix hit-rates).
28
+ expect(resolveActorId('greptile-enterprise[bot]')).toBe('greptile-enterprise[bot]');
29
+ expect(resolveActorId('coderabbit-premium[bot]')).toBe('coderabbit-premium[bot]');
30
+ });
31
+ it('throws on an empty/whitespace author login (fail loud — GCA)', () => {
32
+ expect(() => resolveActorId('')).toThrow(/non-empty/);
33
+ expect(() => resolveActorId(' ')).toThrow(/non-empty/);
34
+ });
35
+ it('keeps a cohort seat login as its own actor-id', () => {
36
+ expect(resolveActorId('totem-claude')).toBe('totem-claude');
37
+ expect(resolveActorId('strategy-codex')).toBe('strategy-codex');
38
+ });
39
+ });
40
+ describe('mineReviewCatch — held/wrong/silence', () => {
41
+ it('accepted → a correct resolution; declined → a wrong resolution', () => {
42
+ const { claims, resolutions } = mineReviewCatch([
43
+ finding({ commentId: 111, disposition: 'accepted' }),
44
+ finding({ commentId: 222, disposition: 'declined' }),
45
+ ]);
46
+ expect(claims).toHaveLength(2);
47
+ expect(resolutions).toHaveLength(2);
48
+ expect(resolutions.find((r) => r.evidenceRef.includes('111') || r.claimId === claims[0].claimId)
49
+ ?.outcome).toBe('correct');
50
+ expect(resolutions.every((r) => r.resolutionSource === 'disposition-thread')).toBe(true); // FM-b
51
+ });
52
+ it('silence (no disposition) emits NO resolution → unresolved by absence', () => {
53
+ const { claims, resolutions } = mineReviewCatch([finding({ commentId: 333 })]);
54
+ expect(claims).toHaveLength(1);
55
+ expect(resolutions).toHaveLength(0);
56
+ const ledger = regenerateCapabilityLedger(claims, resolutions, { resolutionHorizon: HORIZON });
57
+ expect(ledger.rows[0].unresolvedN).toBe(1);
58
+ expect(ledger.rows[0].decisiveN).toBe(0);
59
+ });
60
+ it('claimId is stable across re-mining and independent of assertedAt (identity ≠ content)', () => {
61
+ const a = mineReviewCatch([
62
+ finding({ commentId: 111, assertedAt: '2026-06-20T00:00:00.000Z' }),
63
+ ]);
64
+ const b = mineReviewCatch([
65
+ finding({ commentId: 111, assertedAt: '2026-06-25T09:09:09.000Z' }),
66
+ ]);
67
+ expect(a.claims[0].claimId).toBe(b.claims[0].claimId); // assertedAt excluded from claimId
68
+ });
69
+ it('two findings on the same PR get distinct claims (nativeKey discriminator)', () => {
70
+ const { claims } = mineReviewCatch([finding({ commentId: 111 }), finding({ commentId: 222 })]);
71
+ expect(claims[0].claimId).not.toBe(claims[1].claimId);
72
+ });
73
+ });
74
+ describe('mineReviewCatch → regenerate — end-to-end division', () => {
75
+ it('produces a per-actor hit-rate division from review findings', () => {
76
+ const { claims, resolutions } = mineReviewCatch([
77
+ finding({ commentId: 1, author: 'coderabbitai[bot]', disposition: 'accepted' }),
78
+ finding({ commentId: 2, author: 'coderabbitai[bot]', disposition: 'accepted' }),
79
+ finding({ commentId: 3, author: 'gemini-code-assist[bot]', disposition: 'accepted' }),
80
+ finding({ commentId: 4, author: 'gemini-code-assist[bot]', disposition: 'declined' }),
81
+ finding({ commentId: 5, author: 'totem-claude', disposition: 'accepted' }),
82
+ ]);
83
+ const ledger = regenerateCapabilityLedger(claims, resolutions, { resolutionHorizon: HORIZON });
84
+ const byAgent = Object.fromEntries(ledger.rows.map((r) => [r.agentSource, r.hitRate]));
85
+ expect(byAgent.coderabbit).toBe(1); // 2/2
86
+ expect(byAgent['gemini-code-assist']).toBe(0.5); // 1/2
87
+ expect(byAgent['totem-claude']).toBe(1); // 1/1
88
+ });
89
+ });
90
+ //# sourceMappingURL=review-catch.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-catch.test.js","sourceRoot":"","sources":["../../src/capability/review-catch.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAA2B,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7F,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC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GAAG,0BAA0B,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/F,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvF,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;QAC1C,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM;QACvD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,244 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Task-types (closed-but-append-extensible, #697 axis 5). Only `review-catch` is
4
+ * mined in the first column; the other five are reserved for follow-on columns and
5
+ * carried in the enum so the ledger shape is stable as columns are added.
6
+ */
7
+ export declare const TaskTypeSchema: z.ZodEnum<["review-catch", "bug-localization", "diagnostic-harness", "diagnostic-screenshot", "layout-design", "code-impl"]>;
8
+ export type TaskType = z.infer<typeof TaskTypeSchema>;
9
+ /**
10
+ * Resolution outcome (#697). `partial` is its OWN bucket — never half-credited (a
11
+ * `0.5` is an invented score that smuggles quality-synthesis back in, violating FM-b);
12
+ * `unresolved` is the derived absence of an effective resolution by horizon.
13
+ */
14
+ export declare const OutcomeSchema: z.ZodEnum<["correct", "wrong", "partial", "unresolved"]>;
15
+ export type Outcome = z.infer<typeof OutcomeSchema>;
16
+ /**
17
+ * Closed resolution-source enum (#697 fold 3). There is deliberately NO `llm-judge`
18
+ * member — that makes **FM-b (no LLM-judge in the resolution path) STRUCTURAL**: an
19
+ * LLM-judged resolution is unconstructible at the type/parse boundary, not merely
20
+ * checked. The blind model-diverse head-to-head escape-hatch enters only as a frozen
21
+ * `frozen-label` (a frozen graded result, never a live judge).
22
+ */
23
+ export declare const ResolutionSourceSchema: z.ZodEnum<["deterministic-event", "disposition-thread", "frozen-label", "operator-tiebreak"]>;
24
+ export type ResolutionSource = z.infer<typeof ResolutionSourceSchema>;
25
+ /**
26
+ * Layer-B attribution provenance (#697 `{ ref, commitSha }`) — DISTINCT from the spine
27
+ * miner's `ProvenanceRecord` (which keys on a PR number); a capability claim references
28
+ * a thread/primitive `ref` + the commit it was asserted against.
29
+ */
30
+ export declare const CapabilityProvenanceSchema: z.ZodObject<{
31
+ ref: z.ZodEffects<z.ZodString, string, string>;
32
+ commitSha: z.ZodString;
33
+ }, "strip", z.ZodTypeAny, {
34
+ commitSha: string;
35
+ ref: string;
36
+ }, {
37
+ commitSha: string;
38
+ ref: string;
39
+ }>;
40
+ export type CapabilityProvenance = z.infer<typeof CapabilityProvenanceSchema>;
41
+ /**
42
+ * An append-only output-time claim. `agentSource` is a STABLE Layer-B actor-id (a
43
+ * cohort seat id or a review-backend catalog id); model/backend identity is NEVER
44
+ * folded into it (kept as separate optional `payload` metadata) so the hit-rate
45
+ * aggregates across model swaps (#697 fold 5; ADR-078 `agent_source` is NOT amended).
46
+ */
47
+ export declare const CapabilityClaimSchema: z.ZodObject<{
48
+ claimId: z.ZodEffects<z.ZodString, string, string>;
49
+ agentSource: z.ZodEffects<z.ZodString, string, string>;
50
+ taskType: z.ZodEnum<["review-catch", "bug-localization", "diagnostic-harness", "diagnostic-screenshot", "layout-design", "code-impl"]>;
51
+ claimKind: z.ZodEffects<z.ZodString, string, string>;
52
+ provenance: z.ZodObject<{
53
+ ref: z.ZodEffects<z.ZodString, string, string>;
54
+ commitSha: z.ZodString;
55
+ }, "strip", z.ZodTypeAny, {
56
+ commitSha: string;
57
+ ref: string;
58
+ }, {
59
+ commitSha: string;
60
+ ref: string;
61
+ }>;
62
+ /** The source primitive's stable native id — the `claimId` discriminator that survives re-enumeration. */
63
+ nativeKey: z.ZodEffects<z.ZodString, string, string>;
64
+ assertedAt: z.ZodString;
65
+ /** Descriptive metadata (incl. model/backend) — NEVER part of `claimId` (identity ≠ content). */
66
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ provenance: {
69
+ commitSha: string;
70
+ ref: string;
71
+ };
72
+ claimId: string;
73
+ agentSource: string;
74
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
75
+ claimKind: string;
76
+ nativeKey: string;
77
+ assertedAt: string;
78
+ payload?: Record<string, unknown> | undefined;
79
+ }, {
80
+ provenance: {
81
+ commitSha: string;
82
+ ref: string;
83
+ };
84
+ claimId: string;
85
+ agentSource: string;
86
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
87
+ claimKind: string;
88
+ nativeKey: string;
89
+ assertedAt: string;
90
+ payload?: Record<string, unknown> | undefined;
91
+ }>;
92
+ export type CapabilityClaim = z.infer<typeof CapabilityClaimSchema>;
93
+ /**
94
+ * An append-only ground-truth-time resolution. The log may carry N resolutions per
95
+ * claim (accept → walked back → operator-adjudicated); the regenerator selects exactly
96
+ * one effective terminal per `resolutionHorizon` (#697 fold 2).
97
+ */
98
+ export declare const CapabilityResolutionSchema: z.ZodObject<{
99
+ resolutionId: z.ZodEffects<z.ZodString, string, string>;
100
+ claimId: z.ZodEffects<z.ZodString, string, string>;
101
+ outcome: z.ZodEnum<["correct", "wrong", "partial", "unresolved"]>;
102
+ resolutionSource: z.ZodEnum<["deterministic-event", "disposition-thread", "frozen-label", "operator-tiebreak"]>;
103
+ evidenceRef: z.ZodEffects<z.ZodString, string, string>;
104
+ resolvedAt: z.ZodString;
105
+ /**
106
+ * Explicit supersession chain — preferred over `resolvedAt` ordering when present.
107
+ * `nonEmpty` (not bare `z.string()`): a `""` pointer would be neither `undefined` nor a
108
+ * real resolutionId, silently activating chain logic on a ghost target (CR).
109
+ */
110
+ supersedesResolutionId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ outcome: "partial" | "unresolved" | "correct" | "wrong";
113
+ claimId: string;
114
+ resolutionId: string;
115
+ resolutionSource: "deterministic-event" | "disposition-thread" | "frozen-label" | "operator-tiebreak";
116
+ evidenceRef: string;
117
+ resolvedAt: string;
118
+ supersedesResolutionId?: string | undefined;
119
+ }, {
120
+ outcome: "partial" | "unresolved" | "correct" | "wrong";
121
+ claimId: string;
122
+ resolutionId: string;
123
+ resolutionSource: "deterministic-event" | "disposition-thread" | "frozen-label" | "operator-tiebreak";
124
+ evidenceRef: string;
125
+ resolvedAt: string;
126
+ supersedesResolutionId?: string | undefined;
127
+ }>;
128
+ export type CapabilityResolution = z.infer<typeof CapabilityResolutionSchema>;
129
+ /**
130
+ * One derived row of the regenerable cache. `hitRate = correctN / decisiveN` where
131
+ * `decisiveN = correctN + wrongN`; `partial` and `unresolved` are BOTH excluded from
132
+ * the rate (reported as their own counts). `hitRate` is `null` when `decisiveN === 0`
133
+ * (no decisive evidence yet — never `0/0` NaN). The full distribution is always present.
134
+ */
135
+ export declare const CapabilityLedgerRowSchema: z.ZodObject<{
136
+ agentSource: z.ZodString;
137
+ taskType: z.ZodEnum<["review-catch", "bug-localization", "diagnostic-harness", "diagnostic-screenshot", "layout-design", "code-impl"]>;
138
+ correctN: z.ZodNumber;
139
+ wrongN: z.ZodNumber;
140
+ partialN: z.ZodNumber;
141
+ unresolvedN: z.ZodNumber;
142
+ decisiveN: z.ZodNumber;
143
+ hitRate: z.ZodNullable<z.ZodNumber>;
144
+ lastResolved: z.ZodNullable<z.ZodString>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ agentSource: string;
147
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
148
+ correctN: number;
149
+ wrongN: number;
150
+ partialN: number;
151
+ unresolvedN: number;
152
+ decisiveN: number;
153
+ hitRate: number | null;
154
+ lastResolved: string | null;
155
+ }, {
156
+ agentSource: string;
157
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
158
+ correctN: number;
159
+ wrongN: number;
160
+ partialN: number;
161
+ unresolvedN: number;
162
+ decisiveN: number;
163
+ hitRate: number | null;
164
+ lastResolved: string | null;
165
+ }>;
166
+ export type CapabilityLedgerRow = z.infer<typeof CapabilityLedgerRowSchema>;
167
+ export declare const CapabilityLedgerSchema: z.ZodObject<{
168
+ /** The asOf bound for "settled" resolutions — the back-mining analog of the frozen corpus. */
169
+ resolutionHorizon: z.ZodEffects<z.ZodString, string, string>;
170
+ rows: z.ZodArray<z.ZodObject<{
171
+ agentSource: z.ZodString;
172
+ taskType: z.ZodEnum<["review-catch", "bug-localization", "diagnostic-harness", "diagnostic-screenshot", "layout-design", "code-impl"]>;
173
+ correctN: z.ZodNumber;
174
+ wrongN: z.ZodNumber;
175
+ partialN: z.ZodNumber;
176
+ unresolvedN: z.ZodNumber;
177
+ decisiveN: z.ZodNumber;
178
+ hitRate: z.ZodNullable<z.ZodNumber>;
179
+ lastResolved: z.ZodNullable<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ agentSource: string;
182
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
183
+ correctN: number;
184
+ wrongN: number;
185
+ partialN: number;
186
+ unresolvedN: number;
187
+ decisiveN: number;
188
+ hitRate: number | null;
189
+ lastResolved: string | null;
190
+ }, {
191
+ agentSource: string;
192
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
193
+ correctN: number;
194
+ wrongN: number;
195
+ partialN: number;
196
+ unresolvedN: number;
197
+ decisiveN: number;
198
+ hitRate: number | null;
199
+ lastResolved: string | null;
200
+ }>, "many">;
201
+ }, "strip", z.ZodTypeAny, {
202
+ resolutionHorizon: string;
203
+ rows: {
204
+ agentSource: string;
205
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
206
+ correctN: number;
207
+ wrongN: number;
208
+ partialN: number;
209
+ unresolvedN: number;
210
+ decisiveN: number;
211
+ hitRate: number | null;
212
+ lastResolved: string | null;
213
+ }[];
214
+ }, {
215
+ resolutionHorizon: string;
216
+ rows: {
217
+ agentSource: string;
218
+ taskType: "review-catch" | "bug-localization" | "diagnostic-harness" | "diagnostic-screenshot" | "layout-design" | "code-impl";
219
+ correctN: number;
220
+ wrongN: number;
221
+ partialN: number;
222
+ unresolvedN: number;
223
+ decisiveN: number;
224
+ hitRate: number | null;
225
+ lastResolved: string | null;
226
+ }[];
227
+ }>;
228
+ export type CapabilityLedger = z.infer<typeof CapabilityLedgerSchema>;
229
+ /**
230
+ * Deterministic `claimId` (#697 fold 1): a versioned, canonically-serialized digest of
231
+ * the IDENTITY fields only — `payload`/`assertedAt` are excluded so re-back-mining or a
232
+ * payload edit never re-keys the claim and orphans the join (FM-a). `nativeKey` is the
233
+ * primary discriminator (one source primitive can yield N claims); `claimKind` defends
234
+ * against future-task collisions. Key order is irrelevant (canonical serialization).
235
+ */
236
+ export declare function deriveClaimId(input: {
237
+ agentSource: string;
238
+ taskType: TaskType;
239
+ claimKind: string;
240
+ provenanceRef: string;
241
+ commitSha: string;
242
+ nativeKey: string;
243
+ }): string;
244
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/capability/schema.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;GAIG;AACH,eAAO,MAAM,cAAc,8HAOzB,CAAC;AACH,M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AK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAUT"}
@@ -0,0 +1,141 @@
1
+ // ─── totem-strategy#697 Layer-B cohort-capability ledger — schema ────────────
2
+ //
3
+ // A claim→resolution prediction ledger; per-agent×task-type "capability" is a
4
+ // REGENERABLE CACHE recomputed from an append-only log (Tenet-20 carve-out c, the
5
+ // same shape as #670 + the ADR-110 wind-tunnel). Contract canonical on
6
+ // totem-strategy#697 (schema c.4755374011; folds 1-5 c.4755799517). The hit-rate is
7
+ // NEVER stored mutable — it is recomputed by the regenerator. This module defines the
8
+ // append-only claim/resolution schemas + the derived ledger + the deterministic
9
+ // `claimId`. It is network/LLM-free.
10
+ import { createHash } from 'node:crypto';
11
+ import { z } from 'zod';
12
+ import { canonicalStringify } from '../compile-manifest.js';
13
+ const nonEmpty = (label) => z.string().refine((s) => s.trim().length > 0, { message: `${label} must be a non-empty value` });
14
+ /**
15
+ * Task-types (closed-but-append-extensible, #697 axis 5). Only `review-catch` is
16
+ * mined in the first column; the other five are reserved for follow-on columns and
17
+ * carried in the enum so the ledger shape is stable as columns are added.
18
+ */
19
+ export const TaskTypeSchema = z.enum([
20
+ 'review-catch',
21
+ 'bug-localization',
22
+ 'diagnostic-harness',
23
+ 'diagnostic-screenshot',
24
+ 'layout-design',
25
+ 'code-impl',
26
+ ]);
27
+ /**
28
+ * Resolution outcome (#697). `partial` is its OWN bucket — never half-credited (a
29
+ * `0.5` is an invented score that smuggles quality-synthesis back in, violating FM-b);
30
+ * `unresolved` is the derived absence of an effective resolution by horizon.
31
+ */
32
+ export const OutcomeSchema = z.enum(['correct', 'wrong', 'partial', 'unresolved']);
33
+ /**
34
+ * Closed resolution-source enum (#697 fold 3). There is deliberately NO `llm-judge`
35
+ * member — that makes **FM-b (no LLM-judge in the resolution path) STRUCTURAL**: an
36
+ * LLM-judged resolution is unconstructible at the type/parse boundary, not merely
37
+ * checked. The blind model-diverse head-to-head escape-hatch enters only as a frozen
38
+ * `frozen-label` (a frozen graded result, never a live judge).
39
+ */
40
+ export const ResolutionSourceSchema = z.enum([
41
+ 'deterministic-event',
42
+ 'disposition-thread',
43
+ 'frozen-label',
44
+ 'operator-tiebreak',
45
+ ]);
46
+ /**
47
+ * Layer-B attribution provenance (#697 `{ ref, commitSha }`) — DISTINCT from the spine
48
+ * miner's `ProvenanceRecord` (which keys on a PR number); a capability claim references
49
+ * a thread/primitive `ref` + the commit it was asserted against.
50
+ */
51
+ export const CapabilityProvenanceSchema = z.object({
52
+ ref: nonEmpty('provenance.ref'),
53
+ commitSha: z
54
+ .string()
55
+ .regex(/^[0-9a-f]{40}$/, { message: 'commitSha must be a lowercase 40-hex SHA' }),
56
+ });
57
+ /**
58
+ * An append-only output-time claim. `agentSource` is a STABLE Layer-B actor-id (a
59
+ * cohort seat id or a review-backend catalog id); model/backend identity is NEVER
60
+ * folded into it (kept as separate optional `payload` metadata) so the hit-rate
61
+ * aggregates across model swaps (#697 fold 5; ADR-078 `agent_source` is NOT amended).
62
+ */
63
+ export const CapabilityClaimSchema = z.object({
64
+ claimId: nonEmpty('claimId'),
65
+ agentSource: nonEmpty('agentSource'),
66
+ taskType: TaskTypeSchema,
67
+ claimKind: nonEmpty('claimKind'),
68
+ provenance: CapabilityProvenanceSchema,
69
+ /** The source primitive's stable native id — the `claimId` discriminator that survives re-enumeration. */
70
+ nativeKey: nonEmpty('nativeKey'),
71
+ // RFC-3339 UTC (Z, no offset) — well-formedness lets the regenerator compare timestamps
72
+ // chronologically without a date-only / offset value silently misplacing the window.
73
+ assertedAt: z
74
+ .string()
75
+ .datetime({ message: 'assertedAt must be an RFC-3339 UTC datetime (Z suffix)' }),
76
+ /** Descriptive metadata (incl. model/backend) — NEVER part of `claimId` (identity ≠ content). */
77
+ payload: z.record(z.unknown()).optional(),
78
+ });
79
+ /**
80
+ * An append-only ground-truth-time resolution. The log may carry N resolutions per
81
+ * claim (accept → walked back → operator-adjudicated); the regenerator selects exactly
82
+ * one effective terminal per `resolutionHorizon` (#697 fold 2).
83
+ */
84
+ export const CapabilityResolutionSchema = z.object({
85
+ resolutionId: nonEmpty('resolutionId'),
86
+ claimId: nonEmpty('claimId'),
87
+ outcome: OutcomeSchema,
88
+ resolutionSource: ResolutionSourceSchema,
89
+ evidenceRef: nonEmpty('evidenceRef'),
90
+ resolvedAt: z
91
+ .string()
92
+ .datetime({ message: 'resolvedAt must be an RFC-3339 UTC datetime (Z suffix)' }),
93
+ /**
94
+ * Explicit supersession chain — preferred over `resolvedAt` ordering when present.
95
+ * `nonEmpty` (not bare `z.string()`): a `""` pointer would be neither `undefined` nor a
96
+ * real resolutionId, silently activating chain logic on a ghost target (CR).
97
+ */
98
+ supersedesResolutionId: nonEmpty('supersedesResolutionId').optional(),
99
+ });
100
+ /**
101
+ * One derived row of the regenerable cache. `hitRate = correctN / decisiveN` where
102
+ * `decisiveN = correctN + wrongN`; `partial` and `unresolved` are BOTH excluded from
103
+ * the rate (reported as their own counts). `hitRate` is `null` when `decisiveN === 0`
104
+ * (no decisive evidence yet — never `0/0` NaN). The full distribution is always present.
105
+ */
106
+ export const CapabilityLedgerRowSchema = z.object({
107
+ agentSource: z.string(),
108
+ taskType: TaskTypeSchema,
109
+ correctN: z.number().int().nonnegative(),
110
+ wrongN: z.number().int().nonnegative(),
111
+ partialN: z.number().int().nonnegative(),
112
+ unresolvedN: z.number().int().nonnegative(),
113
+ decisiveN: z.number().int().nonnegative(),
114
+ hitRate: z.number().min(0).max(1).nullable(),
115
+ lastResolved: z.string().nullable(),
116
+ });
117
+ export const CapabilityLedgerSchema = z.object({
118
+ /** The asOf bound for "settled" resolutions — the back-mining analog of the frozen corpus. */
119
+ resolutionHorizon: nonEmpty('resolutionHorizon'),
120
+ rows: z.array(CapabilityLedgerRowSchema),
121
+ });
122
+ const CLAIM_ID_VERSION = 'capclaim:v1';
123
+ /**
124
+ * Deterministic `claimId` (#697 fold 1): a versioned, canonically-serialized digest of
125
+ * the IDENTITY fields only — `payload`/`assertedAt` are excluded so re-back-mining or a
126
+ * payload edit never re-keys the claim and orphans the join (FM-a). `nativeKey` is the
127
+ * primary discriminator (one source primitive can yield N claims); `claimKind` defends
128
+ * against future-task collisions. Key order is irrelevant (canonical serialization).
129
+ */
130
+ export function deriveClaimId(input) {
131
+ const canonical = canonicalStringify({
132
+ agentSource: input.agentSource,
133
+ taskType: input.taskType,
134
+ claimKind: input.claimKind,
135
+ provenanceRef: input.provenanceRef,
136
+ commitSha: input.commitSha,
137
+ nativeKey: input.nativeKey,
138
+ });
139
+ return createHash('sha256').update(`${CLAIM_ID_VERSION}${canonical}`).digest('hex');
140
+ }
141
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/capability/schema.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,kFAAkF;AAClF,uEAAuE;AACvE,oFAAoF;AACpF,sFAAsF;AACtF,gFAAgF;AAChF,qCAAqC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CACjC,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,4BAA4B,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M,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,8FAA8F;IAC9F,iBAAiB,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;CACzC,CAAC,CAAC;AAGH,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAO7B;IACC,MAAM,SAAS,GAAG,kBAAkB,CAAC;QACnC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,gBAAgB,GAAG,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../src/capability/schema.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,93 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { CapabilityClaimSchema, CapabilityResolutionSchema, deriveClaimId, ResolutionSourceSchema, } from './schema.js';
3
+ const sha = (n) => String(n).padStart(40, '0');
4
+ const baseClaimIdInput = {
5
+ agentSource: 'cr',
6
+ taskType: 'review-catch',
7
+ claimKind: 'review-finding',
8
+ provenanceRef: 'mmnto-ai/totem#2205',
9
+ commitSha: sha(1),
10
+ nativeKey: 'gh-review-comment:111',
11
+ };
12
+ describe('deriveClaimId', () => {
13
+ it('is stable + deterministic for identical identity fields', () => {
14
+ expect(deriveClaimId(baseClaimIdInput)).toBe(deriveClaimId({ ...baseClaimIdInput }));
15
+ // 64-char sha256 hex
16
+ expect(deriveClaimId(baseClaimIdInput)).toMatch(/^[0-9a-f]{64}$/);
17
+ });
18
+ it('changes on each identity field (no collisions across nativeKey/claimKind/agentSource)', () => {
19
+ const base = deriveClaimId(baseClaimIdInput);
20
+ expect(deriveClaimId({ ...baseClaimIdInput, nativeKey: 'gh-review-comment:222' })).not.toBe(base);
21
+ expect(deriveClaimId({ ...baseClaimIdInput, claimKind: 'other-kind' })).not.toBe(base);
22
+ expect(deriveClaimId({ ...baseClaimIdInput, agentSource: 'gca' })).not.toBe(base);
23
+ expect(deriveClaimId({ ...baseClaimIdInput, commitSha: sha(2) })).not.toBe(base);
24
+ expect(deriveClaimId({ ...baseClaimIdInput, provenanceRef: 'x#1' })).not.toBe(base);
25
+ });
26
+ });
27
+ describe('ResolutionSourceSchema (FM-b is structural)', () => {
28
+ it('accepts the four authority classes', () => {
29
+ for (const s of [
30
+ 'deterministic-event',
31
+ 'disposition-thread',
32
+ 'frozen-label',
33
+ 'operator-tiebreak',
34
+ ]) {
35
+ expect(ResolutionSourceSchema.parse(s)).toBe(s);
36
+ }
37
+ });
38
+ it('has NO llm-judge member — an LLM-judged resolution is unconstructible', () => {
39
+ expect(ResolutionSourceSchema.safeParse('llm-judge').success).toBe(false);
40
+ expect(ResolutionSourceSchema.options).not.toContain('llm-judge');
41
+ });
42
+ });
43
+ describe('CapabilityClaimSchema', () => {
44
+ const valid = {
45
+ claimId: 'abc',
46
+ agentSource: 'cr',
47
+ taskType: 'review-catch',
48
+ claimKind: 'review-finding',
49
+ provenance: { ref: 'mmnto-ai/totem#2205', commitSha: sha(1) },
50
+ nativeKey: 'gh-review-comment:111',
51
+ assertedAt: '2026-06-20T00:00:00.000Z',
52
+ };
53
+ it('parses a valid claim and rejects a non-SHA commit + empty fields', () => {
54
+ expect(CapabilityClaimSchema.safeParse(valid).success).toBe(true);
55
+ expect(CapabilityClaimSchema.safeParse({
56
+ ...valid,
57
+ provenance: { ref: 'x', commitSha: 'not-a-sha' },
58
+ }).success).toBe(false);
59
+ expect(CapabilityClaimSchema.safeParse({ ...valid, agentSource: ' ' }).success).toBe(false);
60
+ });
61
+ it('rejects a malformed assertedAt — date-only, offset, or empty (greptile P2)', () => {
62
+ expect(CapabilityClaimSchema.safeParse({ ...valid, assertedAt: '2026-06-20' }).success).toBe(false);
63
+ expect(CapabilityClaimSchema.safeParse({ ...valid, assertedAt: '2026-06-20T12:00:00+00:00' })
64
+ .success).toBe(false);
65
+ expect(CapabilityClaimSchema.safeParse({ ...valid, assertedAt: '' }).success).toBe(false);
66
+ });
67
+ });
68
+ describe('CapabilityResolutionSchema', () => {
69
+ const valid = {
70
+ resolutionId: 'rc-res:111',
71
+ claimId: 'abc',
72
+ outcome: 'correct',
73
+ resolutionSource: 'disposition-thread',
74
+ evidenceRef: 'gh-review-comment:111',
75
+ resolvedAt: '2026-06-20T00:00:00.000Z',
76
+ };
77
+ it('parses a valid resolution and rejects a bad outcome', () => {
78
+ expect(CapabilityResolutionSchema.safeParse(valid).success).toBe(true);
79
+ expect(CapabilityResolutionSchema.safeParse({ ...valid, outcome: 'maybe' }).success).toBe(false);
80
+ });
81
+ it('accepts an optional supersedesResolutionId', () => {
82
+ expect(CapabilityResolutionSchema.safeParse({ ...valid, supersedesResolutionId: 'rc-res:110' })
83
+ .success).toBe(true);
84
+ });
85
+ it('rejects a malformed resolvedAt — date-only (greptile P2)', () => {
86
+ expect(CapabilityResolutionSchema.safeParse({ ...valid, resolvedAt: '2026-06-20' }).success).toBe(false);
87
+ });
88
+ it('rejects an empty/whitespace supersedesResolutionId — ghost pointer (CR)', () => {
89
+ expect(CapabilityResolutionSchema.safeParse({ ...valid, supersedesResolutionId: '' }).success).toBe(false);
90
+ expect(CapabilityResolutionSchema.safeParse({ ...valid, supersedesResolutionId: ' ' }).success).toBe(false);
91
+ });
92
+ });
93
+ //# sourceMappingURL=schema.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.test.js","sourceRoot":"","sources":["../../src/capability/schema.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAE/D,MAAM,gBAAgB,GAAG;IACvB,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,cAAuB;IACjC,SAAS,EAAE,gBAAgB;IAC3B,aAAa,EAAE,qBAAqB;IACpC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;IACjB,SAAS,EAAE,uBAAuB;CACnC,CAAC;AAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACrF,qBAAqB;QACrB,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uFAAuF,EAAE,GAAG,EAAE;QAC/F,MAAM,IAAI,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAC7C,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,gBAAgB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CACzF,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EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QACjF,MAAM,CACJ,0BAA0B,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CACvF,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,MAAM,CACJ,0BAA0B,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAC1F,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -141,10 +141,30 @@ export type { RecurrencePattern, RecurrenceSeverityBucket, RecurrenceStats, Recu
141
141
  export { computeSignature, jaccard, normalizeFindingBody, RecurrencePatternSchema, RecurrenceSeverityBucketSchema, RecurrenceStatsSchema, RecurrenceToolSchema, tokenizeForJaccard, toSeverityBucket, } from './recurrence-stats.js';
142
142
  export type { RetrospectClassification, RetrospectFinding, RetrospectReport, RetrospectRound, RetrospectRouteOutReason, } from './retrospect.js';
143
143
  export { buildStopConditions, classifyFinding, computeDedupRate, groupFindingsByRound, RETROSPECT_ROUTE_OUT_REASONS, RetrospectClassificationSchema, RetrospectFindingSchema, RetrospectReportSchema, RetrospectRoundSchema, RetrospectRouteOutReasonSchema, signatureOfBody, toCrossPrBucket, toRoundPosition, } from './retrospect.js';
144
+ export type { CandidateRuleRecord, ClassifierDisposition } from './spine/candidate-rule.js';
145
+ export { CandidateRuleRecordSchema, ClassifierDispositionSchema } from './spine/candidate-rule.js';
146
+ export type { ClassifierResult, ClassifyStageDeps, ClassifyStageResult, DraftClassifier, } from './spine/classify.js';
147
+ export { assembleMinerLedgers, ClassifierResultSchema, dispositionToRouting, runClassifyStage, } from './spine/classify.js';
148
+ export type { DraftExtractor, ExtractStageDeps, ExtractStageResult, FetchResult, ReviewThread, ReviewThreadComment, ReviewThreadContent, ReviewThreadSource, } from './spine/extract.js';
149
+ export { runExtractStage } from './spine/extract.js';
150
+ export type { ApiFetchSlice, ApiUsageLedger, ApiUsageLedgerEntry, ClassifierLedger, ClassifierLedgerEntry, DispositionSource, DropLedger, DropLedgerEntry, DropReasonCode, EmissionLedger, EmissionLedgerEntry, MinerLedgers, Routing, SplitLedger, } from './spine/ledgers.js';
151
+ export { ApiFetchSliceSchema, ApiUsageLedgerEntrySchema, ApiUsageLedgerSchema, ClassifierLedgerEntrySchema, ClassifierLedgerSchema, DispositionSourceSchema, DropLedgerEntrySchema, DropLedgerSchema, DropReasonCodeSchema, EmissionLedgerEntrySchema, EmissionLedgerSchema, MinerLedgersSchema, RoutingSchema, SplitLedgerSchema, } from './spine/ledgers.js';
152
+ export type { FalsificationResult, FmClause, FmViolation } from './spine/miner-harness.js';
153
+ export { checkParsedLedgers, runFalsificationHarness } from './spine/miner-harness.js';
144
154
  export type { CodePathClassifier, PrMeta, PrSetDiff, SelectionRuleConfig, } from './spine/selection-rule.js';
145
155
  export { diffPrSets, isBotIdentity, isCodeTouching, parsePrNumber, parseRevertSha, prSetsEqual, resolveSelectionRule, SelectionRuleParseError, selectionRulePredicate, } from './spine/selection-rule.js';
156
+ export type { SplitArtifact, SplitCoverResult } from './spine/split.js';
157
+ export { mergeCommitMap, resolveSplit, SplitArtifactSchema, SplitCoverError, validateSplitCover, } from './spine/split.js';
146
158
  export type { WindtunnelLock } from './spine/windtunnel-lock.js';
147
159
  export { firingLabelId, WindtunnelLockSchema } from './spine/windtunnel-lock.js';
148
160
  export type { CullLedgerEntry, GroundTruthLabel, RuleFiring, ScorerInput, WindtunnelDiagnostics, WindtunnelVerdict, WindtunnelVerdictKind, } from './spine/windtunnel-scorer.js';
149
161
  export { scoreWindtunnel } from './spine/windtunnel-scorer.js';
162
+ export type { CapabilityFalsificationResult, CapabilityFmClause, CapabilityFmViolation, } from './capability/falsification.js';
163
+ export { runCapabilityFalsification } from './capability/falsification.js';
164
+ export type { RegenerateOptions } from './capability/regenerate.js';
165
+ export { regenerateCapabilityLedger } from './capability/regenerate.js';
166
+ export type { MinedReviewFinding, ReviewCatchMineResult } from './capability/review-catch.js';
167
+ export { mineReviewCatch, resolveActorId } from './capability/review-catch.js';
168
+ export type { CapabilityClaim, CapabilityLedger, CapabilityLedgerRow, CapabilityProvenance, CapabilityResolution, Outcome, ResolutionSource, TaskType, } from './capability/schema.js';
169
+ export { CapabilityClaimSchema, CapabilityLedgerSchema, CapabilityResolutionSchema, deriveClaimId, OutcomeSchema, ResolutionSourceSchema, TaskTypeSchema, } from './capability/schema.js';
150
170
  //# sourceMappingURL=index.d.ts.map