@proposit/proposit-core 2.2.0 → 2.3.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 (74) hide show
  1. package/dist/extensions/basics/schemata.d.ts +4 -0
  2. package/dist/extensions/basics/schemata.d.ts.map +1 -1
  3. package/dist/extensions/basics/schemata.js +14 -0
  4. package/dist/extensions/basics/schemata.js.map +1 -1
  5. package/dist/extensions/chat-completions/structured-output.d.ts.map +1 -1
  6. package/dist/extensions/chat-completions/structured-output.js +13 -3
  7. package/dist/extensions/chat-completions/structured-output.js.map +1 -1
  8. package/dist/extensions/openai/openai-retrieval.d.ts.map +1 -1
  9. package/dist/extensions/openai/openai-retrieval.js +2 -9
  10. package/dist/extensions/openai/openai-retrieval.js.map +1 -1
  11. package/dist/extensions/openai/provider.d.ts.map +1 -1
  12. package/dist/extensions/openai/provider.js +5 -9
  13. package/dist/extensions/openai/provider.js.map +1 -1
  14. package/dist/extensions/openai/structured-output.d.ts.map +1 -1
  15. package/dist/extensions/openai/structured-output.js +12 -3
  16. package/dist/extensions/openai/structured-output.js.map +1 -1
  17. package/dist/extensions/openai/types.d.ts +19 -0
  18. package/dist/extensions/openai/types.d.ts.map +1 -1
  19. package/dist/extensions/openai/types.js +22 -0
  20. package/dist/extensions/openai/types.js.map +1 -1
  21. package/dist/extensions/pipelines/base/finalize-response-v2.d.ts.map +1 -1
  22. package/dist/extensions/pipelines/base/finalize-response-v2.js +88 -22
  23. package/dist/extensions/pipelines/base/finalize-response-v2.js.map +1 -1
  24. package/dist/extensions/pipelines/base/stages/claim-canonicalization.d.ts +1 -1
  25. package/dist/extensions/pipelines/base/stages/claim-canonicalization.d.ts.map +1 -1
  26. package/dist/extensions/pipelines/base/stages/claim-canonicalization.js +1 -1
  27. package/dist/extensions/pipelines/base/stages/conclusion-selection.d.ts +3 -3
  28. package/dist/extensions/pipelines/base/stages/conclusion-selection.d.ts.map +1 -1
  29. package/dist/extensions/pipelines/base/stages/conclusion-selection.js +5 -5
  30. package/dist/extensions/pipelines/base/stages/conclusion-selection.js.map +1 -1
  31. package/dist/extensions/pipelines/base/stages/formula-compilation.d.ts +69 -14
  32. package/dist/extensions/pipelines/base/stages/formula-compilation.d.ts.map +1 -1
  33. package/dist/extensions/pipelines/base/stages/formula-compilation.js +204 -76
  34. package/dist/extensions/pipelines/base/stages/formula-compilation.js.map +1 -1
  35. package/dist/extensions/pipelines/base/stages/relation-extraction.d.ts +1 -1
  36. package/dist/extensions/pipelines/base/stages/relation-extraction.d.ts.map +1 -1
  37. package/dist/extensions/pipelines/base/stages/relation-extraction.js +20 -19
  38. package/dist/extensions/pipelines/base/stages/relation-extraction.js.map +1 -1
  39. package/dist/extensions/pipelines/base/stages/schemas.d.ts +10 -8
  40. package/dist/extensions/pipelines/base/stages/schemas.d.ts.map +1 -1
  41. package/dist/extensions/pipelines/base/stages/schemas.js +14 -11
  42. package/dist/extensions/pipelines/base/stages/schemas.js.map +1 -1
  43. package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts +1 -1
  44. package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts.map +1 -1
  45. package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js +2 -1
  46. package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js.map +1 -1
  47. package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts +3 -3
  48. package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts +1 -1
  49. package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts.map +1 -1
  50. package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js +2 -2
  51. package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js.map +1 -1
  52. package/dist/extensions/structured-output/length-hint.d.ts +29 -0
  53. package/dist/extensions/structured-output/length-hint.d.ts.map +1 -0
  54. package/dist/extensions/structured-output/length-hint.js +120 -0
  55. package/dist/extensions/structured-output/length-hint.js.map +1 -0
  56. package/dist/lib/parsing/argument-parser.d.ts.map +1 -1
  57. package/dist/lib/parsing/argument-parser.js +18 -68
  58. package/dist/lib/parsing/argument-parser.js.map +1 -1
  59. package/dist/lib/parsing/schemata.d.ts +13 -0
  60. package/dist/lib/parsing/schemata.d.ts.map +1 -1
  61. package/dist/lib/parsing/schemata.js +10 -0
  62. package/dist/lib/parsing/schemata.js.map +1 -1
  63. package/dist/lib/pipelines/debug-log.d.ts +14 -0
  64. package/dist/lib/pipelines/debug-log.d.ts.map +1 -1
  65. package/dist/lib/pipelines/debug-log.js +13 -0
  66. package/dist/lib/pipelines/debug-log.js.map +1 -1
  67. package/dist/lib/pipelines/index.d.ts +1 -1
  68. package/dist/lib/pipelines/index.d.ts.map +1 -1
  69. package/dist/lib/pipelines/index.js +1 -1
  70. package/dist/lib/pipelines/index.js.map +1 -1
  71. package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
  72. package/dist/lib/pipelines/stage-helpers.js +16 -4
  73. package/dist/lib/pipelines/stage-helpers.js.map +1 -1
  74. package/package.json +1 -1
@@ -1,34 +1,167 @@
1
- // `formula-compilation` — deterministic stage that compiles each
2
- // `relation-extraction` output into a `parseFormula`-consumable
3
- // formula string, and mints one dedicated "conclusion premise" whose
4
- // formula is just the conclusion claim's variable symbol.
1
+ // `formula-compilation` — deterministic stage that turns each `inference`
2
+ // relation into a `parseFormula`-consumable formula string for a freeform
3
+ // premise, sorts citation/axiomatic antecedents out into derivation
4
+ // backing, and mints one dedicated "conclusion premise" whose formula is
5
+ // just the conclusion claim's variable symbol.
5
6
  //
6
- // Compilation rules (spec §7.3):
7
- // support s t s_symbol IMPLIES t_symbol
8
- // joint-support s1..sn → t ⇒ (s1 AND s2 AND ...) IMPLIES t_symbol
9
- // derivation-support s → t ⇒ s_symbol IMPLIES t_symbol
7
+ // Inference relations compile to:
8
+ // antecedents a1..an consequent c (a1 AND ... AND an) IMPLIES c
9
+ // (a single antecedent drops the parentheses: a1 IMPLIES c)
10
10
  //
11
- // The conclusion-premise mapping rule:
12
- // - When `conclusion-selection.conclusionMiniId` is non-null:
13
- // exactly one premise is minted with `roleHint: "conclusion"` and
14
- // `formula: <conclusion claim's variable symbol>`.
15
- // - When `conclusion-selection.conclusionMiniId` is null OR the
16
- // conclusion claim has no resolvable variable symbol:
17
- // `conclusionPremiseMiniId` is null and the conclusion premise is
18
- // not emitted. The relation premises are still emitted.
11
+ // Citation/axiomatic claims may not sit in a freeform premise (grammar
12
+ // rules D-4 / D-5) they ground a derivation premise instead.
13
+ // `sortInferenceRelations` extracts any citation/axiomatic antecedent into
14
+ // `derivationBacking` (consumed by the parser to build derivation premises)
15
+ // and keeps only the normal antecedents in the freeform implication. A
16
+ // relation left with no normal antecedents is fully captured by the backing
17
+ // and emits no freeform premise. A relation whose consequent is itself
18
+ // citation/axiomatic, or whose antecedent can't be resolved to a known
19
+ // claim type, is dropped with a recorded warning — a bad relation degrades
20
+ // to "premise omitted", never to a failed import.
19
21
  //
20
- // We emit a `ProcessingFailure` (severity `error`) when a relation's
21
- // `sources` or `target` cannot be resolved to a variable symbol. The
22
- // failing relation's premise is dropped from the output (we can't
23
- // compile it without symbols).
22
+ // The conclusion-premise mapping rule:
23
+ // - When `conclusion-selection.conclusionMiniId` is non-null AND the
24
+ // claim resolves to a variable symbol: one premise is minted with
25
+ // `roleHint: "conclusion"` and `formula: <the claim's symbol>`.
26
+ // - Otherwise `conclusionPremiseMiniId` is null.
24
27
  import { STAGE_IDS, FormulaCompilationOutputSchema, } from "./schemas.js";
25
28
  import { deterministicStage } from "../../../../lib/pipelines/stage-helpers.js";
26
29
  export const FORMULA_COMPILATION_FAILURE_CODES = {
27
- unresolvedSource: "FORMULA_COMPILATION_SOURCE_UNRESOLVED",
28
- unresolvedTarget: "FORMULA_COMPILATION_TARGET_UNRESOLVED",
30
+ unresolvedAntecedent: "FORMULA_COMPILATION_ANTECEDENT_UNRESOLVED",
31
+ unresolvedConsequent: "FORMULA_COMPILATION_CONSEQUENT_UNRESOLVED",
29
32
  unresolvedConclusion: "FORMULA_COMPILATION_CONCLUSION_UNRESOLVED",
30
- emptySources: "FORMULA_COMPILATION_SOURCES_EMPTY",
33
+ emptyAntecedents: "FORMULA_COMPILATION_ANTECEDENTS_EMPTY",
31
34
  };
35
+ // Claim types that may only ground a derivation premise — never sit in a
36
+ // freeform premise. An inference antecedent of one of these types is
37
+ // extracted into derivation backing instead of the freeform formula.
38
+ const DERIVATION_ONLY_CLAIM_TYPES = new Set(["citation", "axiomatic"]);
39
+ export const RELATION_PLACEMENT_FAILURE_CODES = {
40
+ droppedTypedConsequent: "RELATION_PLACEMENT_DROPPED_TYPED_CONSEQUENT",
41
+ droppedUnresolvedClaim: "RELATION_PLACEMENT_DROPPED_UNRESOLVED_CLAIM",
42
+ droppedEmptyAntecedents: "RELATION_PLACEMENT_DROPPED_EMPTY_ANTECEDENTS",
43
+ };
44
+ /**
45
+ * Resolve each claim's effective type into a `miniId → type` map,
46
+ * preferring the `claim-type-classification` entry and falling back to the
47
+ * canonicalizer's drafted `type`. This is the SAME resolution
48
+ * `finalizeResponseV2` uses, so the sort and finalize never disagree on
49
+ * whether a claim is citation/axiomatic — a disagreement is exactly what
50
+ * would let a citation slip into a freeform premise.
51
+ */
52
+ export function resolveClaimTypes(input) {
53
+ const byMiniId = new Map();
54
+ for (const claim of input.canonicalClaims) {
55
+ byMiniId.set(claim.miniId, claim.type);
56
+ }
57
+ for (const entry of input.classifications) {
58
+ byMiniId.set(entry.miniId, entry.type);
59
+ }
60
+ return byMiniId;
61
+ }
62
+ /**
63
+ * Deterministically sort inference relations into freeform premises and
64
+ * derivation backing. For each relation:
65
+ * - drop (warn) if the consequent is citation/axiomatic — a typed claim
66
+ * cannot be the consequent of an implication;
67
+ * - dedupe antecedents and drop a self-referential antecedent;
68
+ * - drop (warn) the whole relation if any antecedent's type can't be
69
+ * resolved — never silently treat an unresolved id as `normal`;
70
+ * - route citation/axiomatic antecedents into `derivationBacking`;
71
+ * - keep the normal antecedents as the freeform implication; if none
72
+ * remain, the relation is fully captured by the backing and yields no
73
+ * freeform premise.
74
+ */
75
+ export function sortInferenceRelations(input) {
76
+ const emit = input.addFailure ?? (() => undefined);
77
+ const freeformRelations = [];
78
+ const derivationBacking = new Map();
79
+ const addBacking = (consequent, supporter) => {
80
+ const list = derivationBacking.get(consequent) ?? [];
81
+ if (!list.includes(supporter))
82
+ list.push(supporter);
83
+ derivationBacking.set(consequent, list);
84
+ };
85
+ for (const relation of input.relations) {
86
+ const consequentType = input.typeByClaimMiniId.get(relation.consequent);
87
+ if (consequentType === undefined) {
88
+ emit({
89
+ code: RELATION_PLACEMENT_FAILURE_CODES.droppedUnresolvedClaim,
90
+ message: `Relation "${relation.relationId}" consequent "${relation.consequent}" has no resolvable claim type; dropping.`,
91
+ severity: "warning",
92
+ context: {
93
+ relationId: relation.relationId,
94
+ claimMiniId: relation.consequent,
95
+ },
96
+ });
97
+ continue;
98
+ }
99
+ if (DERIVATION_ONLY_CLAIM_TYPES.has(consequentType)) {
100
+ emit({
101
+ code: RELATION_PLACEMENT_FAILURE_CODES.droppedTypedConsequent,
102
+ message: `Relation "${relation.relationId}" has a ${consequentType} consequent; citation/axiomatic claims cannot be an implication's consequent. Dropping.`,
103
+ severity: "warning",
104
+ context: {
105
+ relationId: relation.relationId,
106
+ consequent: relation.consequent,
107
+ consequentType,
108
+ },
109
+ });
110
+ continue;
111
+ }
112
+ // Dedupe antecedents and drop any self-reference to the consequent.
113
+ const antecedents = [...new Set(relation.antecedents)].filter((a) => a !== relation.consequent);
114
+ if (antecedents.length === 0) {
115
+ emit({
116
+ code: RELATION_PLACEMENT_FAILURE_CODES.droppedEmptyAntecedents,
117
+ message: `Relation "${relation.relationId}" has no usable antecedents; dropping.`,
118
+ severity: "warning",
119
+ context: { relationId: relation.relationId },
120
+ });
121
+ continue;
122
+ }
123
+ const normalAntecedents = [];
124
+ const typedAntecedents = [];
125
+ let unresolved = false;
126
+ for (const antecedent of antecedents) {
127
+ const type = input.typeByClaimMiniId.get(antecedent);
128
+ if (type === undefined) {
129
+ emit({
130
+ code: RELATION_PLACEMENT_FAILURE_CODES.droppedUnresolvedClaim,
131
+ message: `Relation "${relation.relationId}" antecedent "${antecedent}" has no resolvable claim type; dropping the relation rather than treating it as normal.`,
132
+ severity: "warning",
133
+ context: {
134
+ relationId: relation.relationId,
135
+ claimMiniId: antecedent,
136
+ },
137
+ });
138
+ unresolved = true;
139
+ break;
140
+ }
141
+ if (DERIVATION_ONLY_CLAIM_TYPES.has(type)) {
142
+ typedAntecedents.push(antecedent);
143
+ }
144
+ else {
145
+ normalAntecedents.push(antecedent);
146
+ }
147
+ }
148
+ if (unresolved)
149
+ continue;
150
+ for (const supporter of typedAntecedents) {
151
+ addBacking(relation.consequent, supporter);
152
+ }
153
+ if (normalAntecedents.length === 0) {
154
+ // Fully captured by derivation backing; no freeform premise.
155
+ continue;
156
+ }
157
+ freeformRelations.push({
158
+ relationId: relation.relationId,
159
+ antecedents: normalAntecedents,
160
+ consequent: relation.consequent,
161
+ });
162
+ }
163
+ return { freeformRelations, derivationBacking };
164
+ }
32
165
  function buildClaimToSymbol(variables) {
33
166
  const m = new Map();
34
167
  for (const v of variables) {
@@ -36,94 +169,71 @@ function buildClaimToSymbol(variables) {
36
169
  }
37
170
  return m;
38
171
  }
39
- function relationToRoleHint(type) {
40
- switch (type) {
41
- case "support":
42
- return "support";
43
- case "joint-support":
44
- return "joint-support";
45
- case "derivation-support":
46
- return "derivation";
47
- }
48
- }
49
172
  /**
50
- * Pure helper exposed for direct testing.
173
+ * Compile freeform relations into premise formulas, and mint the
174
+ * conclusion premise. Pure helper exposed for direct testing. The stage's
175
+ * `derivationBacking` is added by the stage wrapper, not here.
51
176
  */
52
177
  export function compileFormulas(input) {
53
178
  const claimToSymbol = buildClaimToSymbol(input.variables);
54
- const noopEmit = () => {
55
- // intentionally empty — tests can supply addFailure to capture emits
56
- };
57
- const emit = input.addFailure ?? noopEmit;
179
+ const emit = input.addFailure ?? (() => undefined);
58
180
  const premises = [];
59
- // Compile each relation into a premise.
60
- for (const relation of input.relations) {
61
- if (relation.sources.length === 0) {
181
+ for (const relation of input.freeformRelations) {
182
+ if (relation.antecedents.length === 0) {
62
183
  emit({
63
- code: FORMULA_COMPILATION_FAILURE_CODES.emptySources,
64
- message: `Relation "${relation.relationId}" has no sources; cannot compile.`,
184
+ code: FORMULA_COMPILATION_FAILURE_CODES.emptyAntecedents,
185
+ message: `Relation "${relation.relationId}" has no antecedents; cannot compile.`,
65
186
  severity: "warning",
66
187
  context: { relationId: relation.relationId },
67
188
  });
68
189
  continue;
69
190
  }
70
- const targetSymbol = claimToSymbol.get(relation.target);
71
- if (!targetSymbol) {
191
+ const consequentSymbol = claimToSymbol.get(relation.consequent);
192
+ if (!consequentSymbol) {
72
193
  emit({
73
- code: FORMULA_COMPILATION_FAILURE_CODES.unresolvedTarget,
74
- message: `Relation "${relation.relationId}" target claim "${relation.target}" has no variable assignment; dropping.`,
194
+ code: FORMULA_COMPILATION_FAILURE_CODES.unresolvedConsequent,
195
+ message: `Relation "${relation.relationId}" consequent claim "${relation.consequent}" has no variable assignment; dropping.`,
75
196
  severity: "error",
76
197
  context: {
77
198
  relationId: relation.relationId,
78
- targetClaimMiniId: relation.target,
199
+ consequentClaimMiniId: relation.consequent,
79
200
  },
80
201
  });
81
202
  continue;
82
203
  }
83
- const sourceSymbols = [];
84
- let sourcesOk = true;
85
- for (const src of relation.sources) {
86
- const sym = claimToSymbol.get(src);
204
+ const antecedentSymbols = [];
205
+ let antecedentsOk = true;
206
+ for (const antecedent of relation.antecedents) {
207
+ const sym = claimToSymbol.get(antecedent);
87
208
  if (!sym) {
88
209
  emit({
89
- code: FORMULA_COMPILATION_FAILURE_CODES.unresolvedSource,
90
- message: `Relation "${relation.relationId}" source claim "${src}" has no variable assignment; dropping.`,
210
+ code: FORMULA_COMPILATION_FAILURE_CODES.unresolvedAntecedent,
211
+ message: `Relation "${relation.relationId}" antecedent claim "${antecedent}" has no variable assignment; dropping.`,
91
212
  severity: "error",
92
213
  context: {
93
214
  relationId: relation.relationId,
94
- sourceClaimMiniId: src,
215
+ antecedentClaimMiniId: antecedent,
95
216
  },
96
217
  });
97
- sourcesOk = false;
218
+ antecedentsOk = false;
98
219
  break;
99
220
  }
100
- sourceSymbols.push(sym);
221
+ antecedentSymbols.push(sym);
101
222
  }
102
- if (!sourcesOk)
223
+ if (!antecedentsOk)
103
224
  continue;
104
- let formula;
105
- if (relation.type === "joint-support" && sourceSymbols.length > 1) {
106
- formula = `(${sourceSymbols.join(" and ")}) implies ${targetSymbol}`;
107
- }
108
- else if (sourceSymbols.length === 1) {
109
- formula = `${sourceSymbols[0]} implies ${targetSymbol}`;
110
- }
111
- else {
112
- // joint-support with exactly one source — degenerate; still
113
- // compile as a plain support implication (the parens would
114
- // be redundant). joint-support with zero sources is caught
115
- // by the emptySources guard above.
116
- formula = `${sourceSymbols.join(" and ")} implies ${targetSymbol}`;
117
- }
225
+ const formula = antecedentSymbols.length > 1
226
+ ? `(${antecedentSymbols.join(" and ")}) implies ${consequentSymbol}`
227
+ : `${antecedentSymbols[0]} implies ${consequentSymbol}`;
118
228
  premises.push({
119
229
  premiseMiniId: input.generateId(),
120
230
  formula,
121
- roleHint: relationToRoleHint(relation.type),
231
+ roleHint: "freeform",
122
232
  sourceRelationId: relation.relationId,
123
233
  });
124
234
  }
125
- // Mint the conclusion premise iff conclusion-selection chose a
126
- // claim AND the claim resolves to a known variable symbol.
235
+ // Mint the conclusion premise iff conclusion-selection chose a claim
236
+ // AND the claim resolves to a known variable symbol.
127
237
  let conclusionPremiseMiniId = null;
128
238
  const conclusionClaimMiniId = input.conclusion?.conclusionMiniId ?? null;
129
239
  if (conclusionClaimMiniId !== null) {
@@ -156,6 +266,7 @@ export const formulaCompilationStage = deterministicStage({
156
266
  STAGE_IDS.conclusionSelection,
157
267
  STAGE_IDS.variableAssignment,
158
268
  STAGE_IDS.claimTypeClassification,
269
+ STAGE_IDS.claimCanonicalization,
159
270
  ],
160
271
  outputSchema: FormulaCompilationOutputSchema,
161
272
  fn: (ctx) => {
@@ -163,13 +274,30 @@ export const formulaCompilationStage = deterministicStage({
163
274
  const relations = relationEnvelope?.relations ?? [];
164
275
  const conclusion = ctx.get(STAGE_IDS.conclusionSelection);
165
276
  const variables = ctx.get(STAGE_IDS.variableAssignment) ?? [];
166
- return compileFormulas({
277
+ const typeEnvelope = ctx.get(STAGE_IDS.claimTypeClassification);
278
+ const canon = ctx.get(STAGE_IDS.claimCanonicalization);
279
+ const { freeformRelations, derivationBacking } = sortInferenceRelations({
167
280
  relations,
281
+ typeByClaimMiniId: resolveClaimTypes({
282
+ classifications: typeEnvelope?.classifications ?? [],
283
+ canonicalClaims: canon?.canonicalClaims ?? [],
284
+ }),
285
+ addFailure: ctx.addFailure,
286
+ });
287
+ const compiled = compileFormulas({
288
+ freeformRelations,
168
289
  conclusion,
169
290
  variables,
170
291
  generateId: ctx.generateId,
171
292
  addFailure: ctx.addFailure,
172
293
  });
294
+ return {
295
+ ...compiled,
296
+ derivationBacking: [...derivationBacking.entries()].map(([derivedClaimMiniId, supportingClaimMiniIds]) => ({
297
+ derivedClaimMiniId,
298
+ supportingClaimMiniIds,
299
+ })),
300
+ };
173
301
  },
174
302
  });
175
303
  //# sourceMappingURL=formula-compilation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formula-compilation.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/formula-compilation.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,gEAAgE;AAChE,qEAAqE;AACrE,0DAA0D;AAC1D,EAAE;AACF,iCAAiC;AACjC,mEAAmE;AACnE,8EAA8E;AAC9E,mEAAmE;AACnE,EAAE;AACF,uCAAuC;AACvC,gEAAgE;AAChE,sEAAsE;AACtE,uDAAuD;AACvD,kEAAkE;AAClE,0DAA0D;AAC1D,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,kEAAkE;AAClE,+BAA+B;AAE/B,OAA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G,GAAG,CAAC,GAAG,CACjB,SAAS,CAAC,qBAAqB,CAClC,CAAA;QACD,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAC1C,sBAAsB,CAAC;YACnB,SAAS;YACT,iBAAiB,EAAE,iBAAiB,CAAC;gBACjC,eAAe,EAAE,YAAY,EAAE,eAAe,IAAI,EAAE;gBACpD,eAAe,EAAE,KAAK,EAAE,eAAe,IAAI,EAAE;aAChD,CAAC;YACF,UAAU,EAAE,GAAG,CAAC,UAAU;SAC7B,CAAC,CAAA;QACN,MAAM,QAAQ,GAAG,eAAe,CAAC;YAC7B,iBAAiB;YACjB,UAAU;YACV,SAAS;YACT,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,UAAU,EAAE,GAAG,CAAC,UAAU;SAC7B,CAAC,CAAA;QACF,OAAO;YACH,GAAG,QAAQ;YACX,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CACnD,CAAC,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC/C,kBAAkB;gBAClB,sBAAsB;aACzB,CAAC,CACL;SACJ,CAAA;IACL,CAAC;CACJ,CAAC,CAAA"}
@@ -3,7 +3,7 @@ import type { TStage } from "../../../../lib/pipelines/types.js";
3
3
  import type { TLlmStageOptionsOverride } from "../types.js";
4
4
  export declare const RELATION_EXTRACTION_MODEL = "gpt-5.5";
5
5
  export declare const RELATION_EXTRACTION_REASONING: "minimal" | "low" | "medium" | "high";
6
- export declare const RELATION_EXTRACTION_SYSTEM_PROMPT = "You identify support relationships between canonical claims in an argument.\n\nGiven the canonical claim set, the per-claim type map, and the original segments, emit one entry per supporting relationship. Return an object with a single key `relations` whose value is the array. There are three relation kinds:\n\n- `\"support\"` \u2014 a single claim S supports another claim T. Use this for ordinary \"P, therefore Q\" support edges where the supporting evidence is a single normal-typed proposition.\n- `\"joint-support\"` \u2014 multiple claims S1, S2, ... jointly support T. Use this when the author commits to a syllogistic step that requires ALL of the sources to hold (e.g. major premise + minor premise \u2192 conclusion).\n- `\"derivation-support\"` \u2014 a citation-typed or axiomatic-typed claim S supports a normal-typed claim T. Use this exclusively for relations whose source is \"citation\" or \"axiomatic\". The shape is otherwise identical to `\"support\"`.\n\nFor each relation emit:\n- a fresh `relationId` (r1, r2, ...)\n- the `type`\n- `sources` \u2014 an array of supporting claim miniIds (length 1 for support and derivation-support; length \u2265 2 for joint-support)\n- `target` \u2014 the supported claim's miniId\n- `evidence.segmentIds` \u2014 the segments that ground the relation (often a single segment containing a \"therefore\", \"so\", \"because\")\n- `evidence.quote` \u2014 a short verbatim quote from the input that justifies the relation\n\n## Conservatism rules\n\n- Do not invent relations. If the author doesn't actually argue from S to T, don't emit a relation between them.\n- Do not double-count. If two claims share an axiomatic backing, that's one derivation-support relation per claim, not a joint-support pair.\n- The conclusion of the argument is identified in a separate stage; do NOT emit a special \"conclusion\" relation here. Just emit the support edges you see; the conclusion stage selects from your output.\n- Avoid attack/rebuttal relations entirely in this MVP \u2014 the pipeline does not yet handle them.\n\nIf there are no relations to emit, return `{ \"relations\": [] }`.";
6
+ export declare const RELATION_EXTRACTION_SYSTEM_PROMPT = "You identify inference relationships between canonical claims in an argument.\n\nGiven the canonical claim set, the per-claim type map, and the original segments, emit one entry per inference. Return an object with a single key `relations` whose value is the array.\n\nAn `inference` relation says: the claims in `antecedents`, taken together, imply the claim in `consequent`. Use a SINGLE antecedent for an ordinary \"P, therefore Q\" step; use MULTIPLE antecedents when the author commits to a step that requires ALL of them to hold together (e.g. major premise + minor premise \u2192 conclusion).\n\nFor each relation emit:\n- a fresh `relationId` (r1, r2, ...)\n- `type` \u2014 always `\"inference\"`\n- `antecedents` \u2014 an array of the supporting claim miniIds (one or more) whose conjunction implies the consequent\n- `consequent` \u2014 the implied claim's miniId\n- `evidence.segmentIds` \u2014 the segments that ground the relation (often a single segment containing a \"therefore\", \"so\", \"because\")\n- `evidence.quote` \u2014 a short verbatim quote from the input that justifies the relation\n\n`antecedents` and `consequent` are CLAIM miniIds \u2014 NOT source citations. A citation-typed or axiomatic-typed claim may appear in `antecedents` (the pipeline routes it to where it belongs); do not special-case it. A citation/axiomatic claim is never a `consequent`.\n\n## Conservatism rules\n\n- Do not invent relations. If the author doesn't actually argue from the antecedents to the consequent, don't emit a relation.\n- Do not double-count. If several claims share the same backing, emit one relation per consequent, not a redundant pairing.\n- The conclusion of the argument is identified in a separate stage; do NOT emit a special \"conclusion\" relation here. Just emit the inference edges you see; the conclusion stage selects from your output.\n- Avoid attack/rebuttal relations entirely for now \u2014 the pipeline does not yet handle them.\n\nIf there are no relations to emit, return `{ \"relations\": [] }`.";
7
7
  /** Internal default knobs for the relation-extraction stage. */
8
8
  export declare const RELATION_EXTRACTION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
9
9
  /** Build the relation-extraction stage with optional caller overrides. */
@@ -1 +1 @@
1
- {"version":3,"file":"relation-extraction.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/relation-extraction.ts"],"names":[],"mappings":"AASA,OAAO,EAMH,KAAK,yBAAyB,EAEjC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE3D,eAAO,MAAM,yBAAyB,YAAY,CAAA;AAClD,eAAO,MAAM,6BAA6B,EACpC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAe,CAAA;AAErB,eAAO,MAAM,iCAAiC,6lEAuBqB,CAAA;AAuCnE,gEAAgE;AAChE,eAAO,MAAM,kCAAkC,EAAE,wBAGhD,CAAA;AAED,0EAA0E;AAC1E,wBAAgB,6BAA6B,CACzC,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,yBAAyB,CAAC,CAgBnC;AAED,iDAAiD;AACjD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CACnC,CAAA"}
1
+ {"version":3,"file":"relation-extraction.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/relation-extraction.ts"],"names":[],"mappings":"AAUA,OAAO,EAMH,KAAK,yBAAyB,EAEjC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE3D,eAAO,MAAM,yBAAyB,YAAY,CAAA;AAClD,eAAO,MAAM,6BAA6B,EACpC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAe,CAAA;AAErB,eAAO,MAAM,iCAAiC,2/DAuBqB,CAAA;AAuCnE,gEAAgE;AAChE,eAAO,MAAM,kCAAkC,EAAE,wBAGhD,CAAA;AAED,0EAA0E;AAC1E,wBAAgB,6BAA6B,CACzC,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,yBAAyB,CAAC,CAgBnC;AAED,iDAAiD;AACjD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CACnC,CAAA"}
@@ -1,37 +1,38 @@
1
1
  // `relation-extraction` — strong-reasoning stage that identifies the
2
- // supporting relationships between canonical claims. MVP relation
3
- // types: support, joint-support, derivation-support.
2
+ // inference relationships between canonical claims. Each relation is an
3
+ // `inference`: its `antecedents` claims, taken together, imply its
4
+ // `consequent` claim.
4
5
  //
5
- // Per spec §6.4 this stage uses gpt-5.5 with reasoning_effort=high —
6
- // it's the most subtle judgement call in the pipeline. The output is
7
- // a graph; the conclusion + the support graph drive the
8
- // formula-compilation stage that comes next.
6
+ // This stage uses gpt-5.5 with reasoning_effort=high — it's the most
7
+ // subtle judgement call in the pipeline. The output is a graph; the
8
+ // conclusion + the inference graph drive the formula-compilation stage
9
+ // that comes next.
9
10
  import { STAGE_IDS, RelationExtractionOutputSchema, } from "./schemas.js";
10
11
  import { llmStage } from "../../../../lib/pipelines/stage-helpers.js";
11
12
  export const RELATION_EXTRACTION_MODEL = "gpt-5.5";
12
13
  export const RELATION_EXTRACTION_REASONING = "high";
13
- export const RELATION_EXTRACTION_SYSTEM_PROMPT = `You identify support relationships between canonical claims in an argument.
14
+ export const RELATION_EXTRACTION_SYSTEM_PROMPT = `You identify inference relationships between canonical claims in an argument.
14
15
 
15
- Given the canonical claim set, the per-claim type map, and the original segments, emit one entry per supporting relationship. Return an object with a single key \`relations\` whose value is the array. There are three relation kinds:
16
+ Given the canonical claim set, the per-claim type map, and the original segments, emit one entry per inference. Return an object with a single key \`relations\` whose value is the array.
16
17
 
17
- - \`"support"\` a single claim S supports another claim T. Use this for ordinary "P, therefore Q" support edges where the supporting evidence is a single normal-typed proposition.
18
- - \`"joint-support"\` — multiple claims S1, S2, ... jointly support T. Use this when the author commits to a syllogistic step that requires ALL of the sources to hold (e.g. major premise + minor premise → conclusion).
19
- - \`"derivation-support"\` — a citation-typed or axiomatic-typed claim S supports a normal-typed claim T. Use this exclusively for relations whose source is "citation" or "axiomatic". The shape is otherwise identical to \`"support"\`.
18
+ An \`inference\` relation says: the claims in \`antecedents\`, taken together, imply the claim in \`consequent\`. Use a SINGLE antecedent for an ordinary "P, therefore Q" step; use MULTIPLE antecedents when the author commits to a step that requires ALL of them to hold together (e.g. major premise + minor premise → conclusion).
20
19
 
21
20
  For each relation emit:
22
21
  - a fresh \`relationId\` (r1, r2, ...)
23
- - the \`type\`
24
- - \`sources\` — an array of supporting claim miniIds (length 1 for support and derivation-support; length ≥ 2 for joint-support)
25
- - \`target\` — the supported claim's miniId
22
+ - \`type\` — always \`"inference"\`
23
+ - \`antecedents\` — an array of the supporting claim miniIds (one or more) whose conjunction implies the consequent
24
+ - \`consequent\` — the implied claim's miniId
26
25
  - \`evidence.segmentIds\` — the segments that ground the relation (often a single segment containing a "therefore", "so", "because")
27
26
  - \`evidence.quote\` — a short verbatim quote from the input that justifies the relation
28
27
 
28
+ \`antecedents\` and \`consequent\` are CLAIM miniIds — NOT source citations. A citation-typed or axiomatic-typed claim may appear in \`antecedents\` (the pipeline routes it to where it belongs); do not special-case it. A citation/axiomatic claim is never a \`consequent\`.
29
+
29
30
  ## Conservatism rules
30
31
 
31
- - Do not invent relations. If the author doesn't actually argue from S to T, don't emit a relation between them.
32
- - Do not double-count. If two claims share an axiomatic backing, that's one derivation-support relation per claim, not a joint-support pair.
33
- - The conclusion of the argument is identified in a separate stage; do NOT emit a special "conclusion" relation here. Just emit the support edges you see; the conclusion stage selects from your output.
34
- - Avoid attack/rebuttal relations entirely in this MVP — the pipeline does not yet handle them.
32
+ - Do not invent relations. If the author doesn't actually argue from the antecedents to the consequent, don't emit a relation.
33
+ - Do not double-count. If several claims share the same backing, emit one relation per consequent, not a redundant pairing.
34
+ - The conclusion of the argument is identified in a separate stage; do NOT emit a special "conclusion" relation here. Just emit the inference edges you see; the conclusion stage selects from your output.
35
+ - Avoid attack/rebuttal relations entirely for now — the pipeline does not yet handle them.
35
36
 
36
37
  If there are no relations to emit, return \`{ "relations": [] }\`.`;
37
38
  function buildPrompt(ctx) {
@@ -59,7 +60,7 @@ function buildPrompt(ctx) {
59
60
  .map((s) => ` [${s.segmentId}] ${JSON.stringify(s.text)}`)
60
61
  .join("\n");
61
62
  const markedSystem = `<!-- stage-id: ${STAGE_IDS.relationExtraction} -->\n${RELATION_EXTRACTION_SYSTEM_PROMPT}`;
62
- const user = `Canonical claims (with refined types):\n${claimLines}\n\nSegments:\n${segmentLines}\n\nEmit every support relationship as a relations array.`;
63
+ const user = `Canonical claims (with refined types):\n${claimLines}\n\nSegments:\n${segmentLines}\n\nEmit every inference relationship as a relations array.`;
63
64
  return { system: markedSystem, user };
64
65
  }
65
66
  /** Internal default knobs for the relation-extraction stage. */
@@ -1 +1 @@
1
- {"version":3,"file":"relation-extraction.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/relation-extraction.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,kEAAkE;AAClE,qDAAq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AAM,uBAAuB,GAChC,6BAA6B,EAAE,CAAA"}
1
+ {"version":3,"file":"relation-extraction.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/relation-extraction.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,wEAAwE;AACxE,mEAAmE;AACnE,sBAAsB;AACtB,EAAE;AACF,qEAAqE;AACrE,oEAAoE;AACpE,uEAAuE;AACvE,mBAAmB;AAEnB,OAAO,EACH,SAAS,EACT,8BAA8B,GAMjC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AAIrE,MAAM,CAAC,MAAM,yBAAyB,GAAG,SAAS,CAAA;AAClD,MAAM,CAAC,MAAM,6BAA6B,GAI3B,MAAM,CAAA;AAErB,MAAM,CAAC,MAAM,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;;;;;;mEAuBkB,CAAA;AAEnE,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CACjB,SAAS,CAAC,qBAAqB,CAClC,CAAA;IACD,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CACxB,SAAS,CAAC,uBAAuB,CACpC,CAAA;IACD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAyC,CAAA;IACrE,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,eAAe,IAAI,EAAE,EAAE,CAAC;QACtD,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;IACD,MAAM,eAAe,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IAC5E,MAAM,QAAQ,GAAG,eAAe,EAAE,QAAQ,IAAI,EAAE,CAAA;IAEhD,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,eAAe,IAAI,EAAE,CAAC;SAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACP,MAAM,WAAW,GAA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ClD,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,eAAe,EACX,OAAO,EAAE,eAAe,IAAI,6BAA6B;QAC7D,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,WAAW;KACd,CAAC,CAAA;AACN,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAChC,6BAA6B,EAAE,CAAA"}
@@ -104,14 +104,12 @@ export declare const VariableAssignmentOutputSchema: Type.TArray<Type.TObject<{
104
104
  }>>;
105
105
  export type TVariableAssignmentOutput = Static<typeof VariableAssignmentOutputSchema>;
106
106
  export type TAssignedVariable = TVariableAssignmentOutput[number];
107
- export declare const RelationKindSchema: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation-support">]>;
108
- export type TRelationKind = Static<typeof RelationKindSchema>;
109
107
  export declare const RelationExtractionOutputSchema: Type.TObject<{
110
108
  relations: Type.TArray<Type.TObject<{
111
109
  relationId: Type.TString;
112
- type: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation-support">]>;
113
- sources: Type.TArray<Type.TString>;
114
- target: Type.TString;
110
+ type: Type.TLiteral<"inference">;
111
+ antecedents: Type.TArray<Type.TString>;
112
+ consequent: Type.TString;
115
113
  evidence: Type.TObject<{
116
114
  segmentIds: Type.TArray<Type.TString>;
117
115
  quote: Type.TString;
@@ -119,7 +117,7 @@ export declare const RelationExtractionOutputSchema: Type.TObject<{
119
117
  }>>;
120
118
  }>;
121
119
  export type TRelationExtractionOutput = Static<typeof RelationExtractionOutputSchema>;
122
- export type TRelation = TRelationExtractionOutput["relations"][number];
120
+ export type TInferenceRelation = TRelationExtractionOutput["relations"][number];
123
121
  export declare const ConclusionSelectionLlmOutputSchema: Type.TObject<{
124
122
  conclusionCandidates: Type.TArray<Type.TString>;
125
123
  rationale: Type.TString;
@@ -131,16 +129,20 @@ export declare const ConclusionSelectionOutputSchema: Type.TObject<{
131
129
  rationale: Type.TString;
132
130
  }>;
133
131
  export type TConclusionSelectionOutput = Static<typeof ConclusionSelectionOutputSchema>;
134
- export declare const FormulaPremiseRoleHintSchema: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation">, Type.TLiteral<"conclusion">]>;
132
+ export declare const FormulaPremiseRoleHintSchema: Type.TUnion<[Type.TLiteral<"freeform">, Type.TLiteral<"conclusion">]>;
135
133
  export type TFormulaPremiseRoleHint = Static<typeof FormulaPremiseRoleHintSchema>;
136
134
  export declare const FormulaCompilationOutputSchema: Type.TObject<{
137
135
  premises: Type.TArray<Type.TObject<{
138
136
  premiseMiniId: Type.TString;
139
137
  formula: Type.TString;
140
- roleHint: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation">, Type.TLiteral<"conclusion">]>;
138
+ roleHint: Type.TUnion<[Type.TLiteral<"freeform">, Type.TLiteral<"conclusion">]>;
141
139
  sourceRelationId: Type.TUnion<[Type.TString, Type.TNull]>;
142
140
  }>>;
143
141
  conclusionPremiseMiniId: Type.TUnion<[Type.TString, Type.TNull]>;
142
+ derivationBacking: Type.TArray<Type.TObject<{
143
+ derivedClaimMiniId: Type.TString;
144
+ supportingClaimMiniIds: Type.TArray<Type.TString>;
145
+ }>>;
144
146
  }>;
145
147
  export type TFormulaCompilationOutput = Static<typeof FormulaCompilationOutputSchema>;
146
148
  export type TCompiledPremise = TFormulaCompilationOutput["premises"][number];
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/schemas.ts"],"names":[],"mappings":"AAOA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAiB3C,eAAO,MAAM,UAAU;;;EASrB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAA;AAiB7C,eAAO,MAAM,wBAAwB;;;;;;;;;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AAOD,eAAO,MAAM,+BAA+B;;;;EAI1C,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC3C,OAAO,+BAA+B,CACzC,CAAA;AAID,eAAO,MAAM,4BAA4B,uEAGvC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CACxC,OAAO,4BAA4B,CACtC,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;EAuBzC,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC1C,OAAO,8BAA8B,CACxC,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AAO5E,eAAO,MAAM,2BAA2B;;;;GAMvC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAI/E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAqBZ,CAAA"}
@@ -150,17 +150,14 @@ export const VariableAssignmentOutputSchema = Type.Array(Type.Object({
150
150
  claimMiniId: Type.String(),
151
151
  }));
152
152
  // -- Stage 9: relation-extraction --
153
- export const RelationKindSchema = Type.Union([
154
- Type.Literal("support"),
155
- Type.Literal("joint-support"),
156
- Type.Literal("derivation-support"),
157
- ]);
158
153
  export const RelationExtractionOutputSchema = Type.Object({
159
154
  relations: Type.Array(Type.Object({
160
155
  relationId: Type.String(),
161
- type: RelationKindSchema,
162
- sources: Type.Array(Type.String()),
163
- target: Type.String(),
156
+ // `type` stays a discriminator so further relation kinds can
157
+ // be added as union members without reshaping the object.
158
+ type: Type.Literal("inference"),
159
+ antecedents: Type.Array(Type.String()),
160
+ consequent: Type.String(),
164
161
  evidence: Type.Object({
165
162
  segmentIds: Type.Array(Type.String()),
166
163
  quote: Type.String(),
@@ -188,9 +185,7 @@ export const ConclusionSelectionOutputSchema = Type.Object({
188
185
  });
189
186
  // -- Stage 11: formula-compilation --
190
187
  export const FormulaPremiseRoleHintSchema = Type.Union([
191
- Type.Literal("support"),
192
- Type.Literal("joint-support"),
193
- Type.Literal("derivation"),
188
+ Type.Literal("freeform"),
194
189
  Type.Literal("conclusion"),
195
190
  ]);
196
191
  export const FormulaCompilationOutputSchema = Type.Object({
@@ -204,6 +199,14 @@ export const FormulaCompilationOutputSchema = Type.Object({
204
199
  sourceRelationId: Type.Union([Type.String(), Type.Null()]),
205
200
  })),
206
201
  conclusionPremiseMiniId: Type.Union([Type.String(), Type.Null()]),
202
+ // Citation/axiomatic backing extracted from inference antecedents:
203
+ // each entry records that claim `derivedClaimMiniId` is grounded by
204
+ // the listed citation/axiomatic supporting claims. The parser
205
+ // materializes these into derivation premises.
206
+ derivationBacking: Type.Array(Type.Object({
207
+ derivedClaimMiniId: Type.String(),
208
+ supportingClaimMiniIds: Type.Array(Type.String()),
209
+ })),
207
210
  });
208
211
  // -- Stage 7 + 12 are validation stages whose `run` return value is
209
212
  // the same shape: an array of structured processing-failure-context