@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.
- package/dist/extensions/basics/schemata.d.ts +4 -0
- package/dist/extensions/basics/schemata.d.ts.map +1 -1
- package/dist/extensions/basics/schemata.js +14 -0
- package/dist/extensions/basics/schemata.js.map +1 -1
- package/dist/extensions/chat-completions/structured-output.d.ts.map +1 -1
- package/dist/extensions/chat-completions/structured-output.js +13 -3
- package/dist/extensions/chat-completions/structured-output.js.map +1 -1
- package/dist/extensions/openai/openai-retrieval.d.ts.map +1 -1
- package/dist/extensions/openai/openai-retrieval.js +2 -9
- package/dist/extensions/openai/openai-retrieval.js.map +1 -1
- package/dist/extensions/openai/provider.d.ts.map +1 -1
- package/dist/extensions/openai/provider.js +5 -9
- package/dist/extensions/openai/provider.js.map +1 -1
- package/dist/extensions/openai/structured-output.d.ts.map +1 -1
- package/dist/extensions/openai/structured-output.js +12 -3
- package/dist/extensions/openai/structured-output.js.map +1 -1
- package/dist/extensions/openai/types.d.ts +19 -0
- package/dist/extensions/openai/types.d.ts.map +1 -1
- package/dist/extensions/openai/types.js +22 -0
- package/dist/extensions/openai/types.js.map +1 -1
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/finalize-response-v2.js +88 -22
- package/dist/extensions/pipelines/base/finalize-response-v2.js.map +1 -1
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.js +1 -1
- package/dist/extensions/pipelines/base/stages/conclusion-selection.d.ts +3 -3
- package/dist/extensions/pipelines/base/stages/conclusion-selection.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/stages/conclusion-selection.js +5 -5
- package/dist/extensions/pipelines/base/stages/conclusion-selection.js.map +1 -1
- package/dist/extensions/pipelines/base/stages/formula-compilation.d.ts +69 -14
- package/dist/extensions/pipelines/base/stages/formula-compilation.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/stages/formula-compilation.js +204 -76
- package/dist/extensions/pipelines/base/stages/formula-compilation.js.map +1 -1
- package/dist/extensions/pipelines/base/stages/relation-extraction.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/relation-extraction.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/stages/relation-extraction.js +20 -19
- package/dist/extensions/pipelines/base/stages/relation-extraction.js.map +1 -1
- package/dist/extensions/pipelines/base/stages/schemas.d.ts +10 -8
- package/dist/extensions/pipelines/base/stages/schemas.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/stages/schemas.js +14 -11
- package/dist/extensions/pipelines/base/stages/schemas.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js +2 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts +3 -3
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js +2 -2
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js.map +1 -1
- package/dist/extensions/structured-output/length-hint.d.ts +29 -0
- package/dist/extensions/structured-output/length-hint.d.ts.map +1 -0
- package/dist/extensions/structured-output/length-hint.js +120 -0
- package/dist/extensions/structured-output/length-hint.js.map +1 -0
- package/dist/lib/parsing/argument-parser.d.ts.map +1 -1
- package/dist/lib/parsing/argument-parser.js +18 -68
- package/dist/lib/parsing/argument-parser.js.map +1 -1
- package/dist/lib/parsing/schemata.d.ts +13 -0
- package/dist/lib/parsing/schemata.d.ts.map +1 -1
- package/dist/lib/parsing/schemata.js +10 -0
- package/dist/lib/parsing/schemata.js.map +1 -1
- package/dist/lib/pipelines/debug-log.d.ts +14 -0
- package/dist/lib/pipelines/debug-log.d.ts.map +1 -1
- package/dist/lib/pipelines/debug-log.js +13 -0
- package/dist/lib/pipelines/debug-log.js.map +1 -1
- package/dist/lib/pipelines/index.d.ts +1 -1
- package/dist/lib/pipelines/index.d.ts.map +1 -1
- package/dist/lib/pipelines/index.js +1 -1
- package/dist/lib/pipelines/index.js.map +1 -1
- package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
- package/dist/lib/pipelines/stage-helpers.js +16 -4
- package/dist/lib/pipelines/stage-helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finalize-response-v2.js","sourceRoot":"","sources":["../../../../src/extensions/pipelines/base/finalize-response-v2.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,iEAAiE;AACjE,qBAAqB;AACrB,EAAE;AACF,iEAAiE;AACjE,wBAAwB;AACxB,EAAE;AACF,8DAA8D;AAC9D,oEAAoE;AACpE,iDAAiD;AACjD,2DAA2D;AAC3D,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,yDAAyD;AACzD,sEAAsE;AACtE,EAAE;AACF,sEAAsE;AACtE,gEAAgE;AAChE,yEAAyE;AACzE,4EAA4E;AAC5E,kEAAkE;AAClE,yBAAyB;AACzB,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,yEAAyE;AACzE,uEAAuE;AACvE,sEAAsE;AACtE,uEAAuE;AACvE,uDAAuD;AAIvD,OAAO,EACH,SAAS,GAUZ,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"finalize-response-v2.js","sourceRoot":"","sources":["../../../../src/extensions/pipelines/base/finalize-response-v2.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,iEAAiE;AACjE,qBAAqB;AACrB,EAAE;AACF,iEAAiE;AACjE,wB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,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAClD;QACD,mBAAmB,EAAE,IAAI,GAAG,CACxB,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAClD;QACD,YAAY,EAAE,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;KACjE,CAAA;IAED,MAAM,aAAa,GAAwB,WAAW,CAAC,QAAQ,CAAC,GAAG,CAC/D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACJ,MAAM,EAAE,CAAC,CAAC,aAAa;QACvB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,CAAC;KACjD,CAAC,CACL,CAAA;IAED,MAAM,QAAQ,GAAuB;QACjC,MAAM;QACN,SAAS,EAAE,cAAc;QACzB,QAAQ,EAAE,aAAa;QACvB,uBAAuB,EAAE,WAAW,CAAC,uBAAuB;QAC5D,+DAA+D;QAC/D,iEAAiE;QACjE,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;QAChD,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,eAAe,EAAE,gBAAgB,CAAC;KACrE,CAAA;IAED,OAAO;QACH,QAAQ,EAAE,QAA0D;QACpE,WAAW,EAAE,IAAI;QACjB,GAAG,YAAY;QAEf,kBAAkB;KACM,CAAA;AAChC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { TStage } from "../../../../lib/pipelines/types.js";
|
|
|
4
4
|
import type { TIngestionExtension, TLlmStageOptionsOverride } from "../types.js";
|
|
5
5
|
export declare const CLAIM_CANONICALIZATION_MODEL = "gpt-5.5";
|
|
6
6
|
export declare const CLAIM_CANONICALIZATION_REASONING: "minimal" | "low" | "medium" | "high";
|
|
7
|
-
export declare const CLAIM_CANONICALIZATION_SYSTEM_PROMPT = "You merge raw claim mentions into a single canonical set of claims for an argument-ingestion pipeline.\n\nYou are given:\n- the raw input text (for full context)\n- the segmented breakdown of the text\n- the list of every claim mention extracted from those segments\n- optionally, the detected citation sources + axiom indicators\n\nYour output has two parts:\n\n1. `canonicalClaims` \u2014 an array of canonical claims, one entry per distinct proposition the author makes. Two mentions that assert the same proposition (even when phrased differently across the text) merge into a single canonical claim. Each canonical claim carries:\n - `miniId` \u2014 assign in canonicalization order: c1, c2, c3, ...\n - `mentionIds` \u2014 list of the mention ids that resolved to this claim\n - `type` \u2014 one of \"normal\", \"citation\", or \"axiomatic\" (see below)\n - `suggestedSymbol` \u2014 a short PascalCase-or-snake_case identifier summarizing the claim (e.g. \"Rain_Wets_Ground\", \"NASA_Temp_Rise\", \"Socrates_Mortal\"). Use letters, digits, and underscores only; start with a letter or underscore; keep under 32 characters; aim for under 20. AVOID single letters and generic names like \"Claim1\".\n - the extension fields described in your output schema (title, body, url, axiom \u2014 whichever apply to the claim's `type`)\n\n2. `mentionToClaim` \u2014 an array of `{ \"mentionId\": \"...\", \"claimMiniId\": \"...\" }` entries, one per input mention. Every input mentionId must appear in exactly one entry; the mapping is total. (We surface this as a list rather than a map because the response schema does not allow arbitrary string keys.)\n\n## Claim types\n\n- `\"normal\"` \u2014 a primary proposition the argument argues for or from.\n- `\"citation\"` \u2014 a claim whose content is \"the cited source asserts X\". Use this type when one of the citation sources covers the same span(s) as the mention. Populate `url` (the URL if present)
|
|
7
|
+
export declare const CLAIM_CANONICALIZATION_SYSTEM_PROMPT = "You merge raw claim mentions into a single canonical set of claims for an argument-ingestion pipeline.\n\nYou are given:\n- the raw input text (for full context)\n- the segmented breakdown of the text\n- the list of every claim mention extracted from those segments\n- optionally, the detected citation sources + axiom indicators\n\nYour output has two parts:\n\n1. `canonicalClaims` \u2014 an array of canonical claims, one entry per distinct proposition the author makes. Two mentions that assert the same proposition (even when phrased differently across the text) merge into a single canonical claim. Each canonical claim carries:\n - `miniId` \u2014 assign in canonicalization order: c1, c2, c3, ...\n - `mentionIds` \u2014 list of the mention ids that resolved to this claim\n - `type` \u2014 one of \"normal\", \"citation\", or \"axiomatic\" (see below)\n - `suggestedSymbol` \u2014 a short PascalCase-or-snake_case identifier summarizing the claim (e.g. \"Rain_Wets_Ground\", \"NASA_Temp_Rise\", \"Socrates_Mortal\"). Use letters, digits, and underscores only; start with a letter or underscore; keep under 32 characters; aim for under 20. AVOID single letters and generic names like \"Claim1\".\n - the extension fields described in your output schema (title, body, url, axiom \u2014 whichever apply to the claim's `type`)\n\n2. `mentionToClaim` \u2014 an array of `{ \"mentionId\": \"...\", \"claimMiniId\": \"...\" }` entries, one per input mention. Every input mentionId must appear in exactly one entry; the mapping is total. (We surface this as a list rather than a map because the response schema does not allow arbitrary string keys.)\n\n## Claim types\n\n- `\"normal\"` \u2014 a primary proposition the argument argues for or from.\n- `\"citation\"` \u2014 a claim whose content is \"the cited source asserts X\". Use this type when one of the citation sources covers the same span(s) as the mention. Populate `url` (the URL if present), `title` (a short human-readable label), and `citationTypeGuess` (your best guess at the source's IEEE reference type, chosen from the allowed values in your output schema \u2014 e.g. \"JournalArticle\", \"NewspaperArticle\", \"Book\", \"Website\", \"GovernmentPublication\", \u2026 \u2014 or \"unknown\" when no IEEE type fits or you cannot tell).\n- `\"axiomatic\"` \u2014 a claim invoked as self-evident truth. Use this type when an axiom indicator (e.g. \"by definition\") covers or precedes the mention. Populate `axiom` with the gist of the self-evident proposition.\n\nWhen a mention is the antecedent of \"according to X, P\", split it into two claims: a citation-typed claim for the source itself + a normal-typed claim for the proposition. The two are connected via a relation in a later stage, not here.\n\n## Style\n\n- Claim titles + bodies are written in third-person, present-tense, active voice.\n- State the proposition itself \u2014 never prepend an author-attributive reporting frame such as \"The author claims that\u2026\", \"The author argues\u2026\", \"The writer believes\u2026\", or \"According to the author\u2026\". Write *what is asserted*, not *that someone asserts it*: emit \"Rain wets the ground,\" not \"The author claims that rain wets the ground.\" This applies to the `title`, `body`, and `axiom` prose for the argument's own (normal / axiomatic) claims.\n- Titles are short (\u2264 50 characters); bodies fill in the detail.\n- For citation claims, the title summarizes what the source asserts (e.g. \"NASA reports temperature rise\"); the URL goes in `url`. This source attribution is intentional and is NOT removed by the rule above \u2014 that rule targets only author-attribution of the argument's own claims, never the cited-source framing of a citation claim.\n- For axiomatic claims, the `axiom` field captures the self-evident proposition as a bare declarative statement (e.g. \"A bachelor is an unmarried man by definition.\").\n\nOutput ONLY the schema-shaped object. No prose.";
|
|
8
8
|
/**
|
|
9
9
|
* Build the per-extension canonicalization output schema: an object of
|
|
10
10
|
* `canonicalClaims` (each carrying the canonicalizer fields merged with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim-canonicalization.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/claim-canonicalization.ts"],"names":[],"mappings":"AAgBA,OAAa,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAMH,KAAK,4BAA4B,EACpC,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,KAAK,EACR,mBAAmB,EAEnB,wBAAwB,EAC3B,MAAM,aAAa,CAAA;AAEpB,eAAO,MAAM,4BAA4B,YAAY,CAAA;AACrD,eAAO,MAAM,gCAAgC,EACvC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAiB,CAAA;AAEvB,eAAO,MAAM,oCAAoC,
|
|
1
|
+
{"version":3,"file":"claim-canonicalization.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/claim-canonicalization.ts"],"names":[],"mappings":"AAgBA,OAAa,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAMH,KAAK,4BAA4B,EACpC,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,KAAK,EACR,mBAAmB,EAEnB,wBAAwB,EAC3B,MAAM,aAAa,CAAA;AAEpB,eAAO,MAAM,4BAA4B,YAAY,CAAA;AACrD,eAAO,MAAM,gCAAgC,EACvC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAiB,CAAA;AAEvB,eAAO,MAAM,oCAAoC,y5HAmCD,CAAA;AAEhD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAc3E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CA6CpE;AA+CD,mEAAmE;AACnE,eAAO,MAAM,qCAAqC,EAAE,wBAGnD,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC5C,SAAS,EAAE,mBAAmB,EAC9B,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,4BAA4B,CAAC,CAgBtC"}
|
|
@@ -41,7 +41,7 @@ Your output has two parts:
|
|
|
41
41
|
## Claim types
|
|
42
42
|
|
|
43
43
|
- \`"normal"\` — a primary proposition the argument argues for or from.
|
|
44
|
-
- \`"citation"\` — a claim whose content is "the cited source asserts X". Use this type when one of the citation sources covers the same span(s) as the mention. Populate \`url\` (the URL if present)
|
|
44
|
+
- \`"citation"\` — a claim whose content is "the cited source asserts X". Use this type when one of the citation sources covers the same span(s) as the mention. Populate \`url\` (the URL if present), \`title\` (a short human-readable label), and \`citationTypeGuess\` (your best guess at the source's IEEE reference type, chosen from the allowed values in your output schema — e.g. "JournalArticle", "NewspaperArticle", "Book", "Website", "GovernmentPublication", … — or "unknown" when no IEEE type fits or you cannot tell).
|
|
45
45
|
- \`"axiomatic"\` — a claim invoked as self-evident truth. Use this type when an axiom indicator (e.g. "by definition") covers or precedes the mention. Populate \`axiom\` with the gist of the self-evident proposition.
|
|
46
46
|
|
|
47
47
|
When a mention is the antecedent of "according to X, P", split it into two claims: a citation-typed claim for the source itself + a normal-typed claim for the proposition. The two are connected via a relation in a later stage, not here.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type TClaimTypeClassificationEntry, type TConclusionSelectionOutput, type
|
|
1
|
+
import { type TClaimTypeClassificationEntry, type TConclusionSelectionOutput, type TInferenceRelation } from "./schemas.js";
|
|
2
2
|
import type { TStage } from "../../../../lib/pipelines/types.js";
|
|
3
3
|
import type { TLlmStageOptionsOverride } from "../types.js";
|
|
4
4
|
export declare const CONCLUSION_SELECTION_MODEL = "gpt-5.5";
|
|
5
5
|
export declare const CONCLUSION_SELECTION_REASONING: "minimal" | "low" | "medium" | "high";
|
|
6
6
|
export declare const CONCLUSION_SELECTION_NO_CONCLUSION_FAILURE_CODE = "NO_SINGLE_CONCLUSION";
|
|
7
|
-
export declare const CONCLUSION_SELECTION_SYSTEM_PROMPT = "You select the conclusion claim of an argument from the canonical claim set and the relation graph.\n\nYou receive:\n- the per-claim type map (normal / citation / axiomatic)\n- the
|
|
7
|
+
export declare const CONCLUSION_SELECTION_SYSTEM_PROMPT = "You select the conclusion claim of an argument from the canonical claim set and the relation graph.\n\nYou receive:\n- the per-claim type map (normal / citation / axiomatic)\n- the inference relation graph from `relation-extraction` (each relation's antecedents jointly imply its consequent)\n\nEmit:\n- `conclusionCandidates` \u2014 an array of canonical claim miniIds ordered by DECREASING confidence: the first element is your single best pick for the conclusion. Return exactly one when the conclusion is clear; return several (best first) only when multiple claims are genuinely plausible conclusions. Return an empty array ONLY when the input has no argument structure at all.\n- `rationale` \u2014 a one-sentence explanation of your ordering and best pick (or, for an empty array, why no claim is a conclusion)\n\n## Selection rules\n\n1. The conclusion is the claim that no other claim is meant to support but is itself the terminus of one or more support edges. In a clean argument it's the \"therefore X\" claim \u2014 list it first.\n2. When several distinct claims are each terminal and plausibly the point, include them all, ordered best first. Do not abstain just because more than one is plausible.\n3. Citation-typed and axiomatic-typed claims are never conclusions \u2014 never include them as candidates; they are always sources of support.\n4. If no claim is supported by any relation (a single-statement input), return an empty array; there is no argument to select a conclusion from.\n\nAlways name your best candidate first rather than abstaining. Only an input with no argument structure yields an empty array.";
|
|
8
8
|
/** Internal default knobs for the conclusion-selection stage. */
|
|
9
9
|
export declare const CONCLUSION_SELECTION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
|
|
10
10
|
/**
|
|
@@ -24,7 +24,7 @@ export declare const CONCLUSION_SELECTION_STAGE_DEFAULTS: TLlmStageOptionsOverri
|
|
|
24
24
|
* slot — keeping the resolved `conclusionMiniId` contract uniform
|
|
25
25
|
* across pipelines.
|
|
26
26
|
*/
|
|
27
|
-
export declare function selectFallbackConclusion(classifications: readonly TClaimTypeClassificationEntry[], relations: readonly
|
|
27
|
+
export declare function selectFallbackConclusion(classifications: readonly TClaimTypeClassificationEntry[], relations: readonly TInferenceRelation[]): string | null;
|
|
28
28
|
/**
|
|
29
29
|
* Build the conclusion-selection stage with optional caller overrides.
|
|
30
30
|
* The inner `llmStage` asks the model for a confidence-ranked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conclusion-selection.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/conclusion-selection.ts"],"names":[],"mappings":"AAgBA,OAAO,EAIH,KAAK,6BAA6B,EAGlC,KAAK,0BAA0B,EAC/B,KAAK,
|
|
1
|
+
{"version":3,"file":"conclusion-selection.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/conclusion-selection.ts"],"names":[],"mappings":"AAgBA,OAAO,EAIH,KAAK,6BAA6B,EAGlC,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EAE1B,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,0BAA0B,YAAY,CAAA;AACnD,eAAO,MAAM,8BAA8B,EACrC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAiB,CAAA;AAEvB,eAAO,MAAM,+CAA+C,yBAClC,CAAA;AAE1B,eAAO,MAAM,kCAAkC,smDAiB+E,CAAA;AA8B9H,iEAAiE;AACjE,eAAO,MAAM,mCAAmC,EAAE,wBAGjD,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACpC,eAAe,EAAE,SAAS,6BAA6B,EAAE,EACzD,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACzC,MAAM,GAAG,IAAI,CA4Cf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAC1C,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,0BAA0B,CAAC,CAqEpC;AAED,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CACpC,CAAA"}
|
|
@@ -22,7 +22,7 @@ export const CONCLUSION_SELECTION_SYSTEM_PROMPT = `You select the conclusion cla
|
|
|
22
22
|
|
|
23
23
|
You receive:
|
|
24
24
|
- the per-claim type map (normal / citation / axiomatic)
|
|
25
|
-
- the
|
|
25
|
+
- the inference relation graph from \`relation-extraction\` (each relation's antecedents jointly imply its consequent)
|
|
26
26
|
|
|
27
27
|
Emit:
|
|
28
28
|
- \`conclusionCandidates\` — an array of canonical claim miniIds ordered by DECREASING confidence: the first element is your single best pick for the conclusion. Return exactly one when the conclusion is clear; return several (best first) only when multiple claims are genuinely plausible conclusions. Return an empty array ONLY when the input has no argument structure at all.
|
|
@@ -46,7 +46,7 @@ function buildPrompt(ctx) {
|
|
|
46
46
|
.join("\n");
|
|
47
47
|
const relationLines = relations.length > 0
|
|
48
48
|
? relations
|
|
49
|
-
.map((r) => ` [${r.relationId}]
|
|
49
|
+
.map((r) => ` [${r.relationId}] antecedents=[${r.antecedents.join(",")}] consequent=${r.consequent}`)
|
|
50
50
|
.join("\n")
|
|
51
51
|
: " (no relations)";
|
|
52
52
|
const markedSystem = `<!-- stage-id: ${STAGE_IDS.conclusionSelection} -->\n${CONCLUSION_SELECTION_SYSTEM_PROMPT}`;
|
|
@@ -90,9 +90,9 @@ export function selectFallbackConclusion(classifications, relations) {
|
|
|
90
90
|
const sourceMiniIds = new Set();
|
|
91
91
|
const inDegree = new Map();
|
|
92
92
|
for (const relation of relations) {
|
|
93
|
-
for (const
|
|
94
|
-
sourceMiniIds.add(
|
|
95
|
-
inDegree.set(relation.
|
|
93
|
+
for (const antecedent of relation.antecedents)
|
|
94
|
+
sourceMiniIds.add(antecedent);
|
|
95
|
+
inDegree.set(relation.consequent, (inDegree.get(relation.consequent) ?? 0) + 1);
|
|
96
96
|
}
|
|
97
97
|
const supportedNormals = [...inDegree.keys()].filter((miniId) => normalMiniIds.has(miniId));
|
|
98
98
|
const pureSinks = supportedNormals.filter((miniId) => !sourceMiniIds.has(miniId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conclusion-selection.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/conclusion-selection.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE,iEAAiE;AACjE,qEAAqE;AACrE,yEAAyE;AACzE,sEAAsE;AACtE,uDAAuD;AACvD,wEAAwE;AACxE,gEAAgE;AAChE,wEAAwE;AACxE,2CAA2C;AAC3C,EAAE;AACF,0EAA0E;AAE1E,OAAO,EACH,SAAS,EACT,kCAAkC,EAClC,+BAA+B,GAOlC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AAIrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAA;AACnD,MAAM,CAAC,MAAM,8BAA8B,GAI5B,QAAQ,CAAA;AAEvB,MAAM,CAAC,MAAM,+CAA+C,GACxD,sBAAsB,CAAA;AAE1B,MAAM,CAAC,MAAM,kCAAkC,GAAG;;;;;;;;;;;;;;;;;8HAiB4E,CAAA;AAE9H,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CACxB,SAAS,CAAC,uBAAuB,CACpC,CAAA;IACD,MAAM,eAAe,GAAG,YAAY,EAAE,eAAe,IAAI,EAAE,CAAA;IAC3D,MAAM,gBAAgB,GAAG,GAAG,CAAC,GAAG,CAC5B,SAAS,CAAC,kBAAkB,CAC/B,CAAA;IACD,MAAM,SAAS,GAAG,gBAAgB,EAAE,SAAS,IAAI,EAAE,CAAA;IAEnD,MAAM,SAAS,GAAG,eAAe;SAC5B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,MAAM,UAAU,KAAK,CAAC,IAAI,EAAE,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,aAAa,GACf,SAAS,CAAC,MAAM,GAAG,CAAC;QAChB,CAAC,CAAC,SAAS;aACJ,GAAG,CACA,CAAC,CAAC,EAAE,EAAE,CACF,MAAM,CAAC,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"conclusion-selection.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/conclusion-selection.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE,iEAAiE;AACjE,qEAAqE;AACrE,yEAAyE;AACzE,sEAAsE;AACtE,uDAAuD;AACvD,wEAAwE;AACxE,gEAAgE;AAChE,wEAAwE;AACxE,2CAA2C;AAC3C,EAAE;AACF,0EAA0E;AAE1E,OAAO,EACH,SAAS,EACT,kCAAkC,EAClC,+BAA+B,GAOlC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AAIrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAA;AACnD,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;YACxD,MAAM,iBAAiB,GACnB,SAAS,KAAK,IAAI,IAAI,gBAAgB,KAAK,IAAI,CAAA;YAEnD,IAAI,gBAAgB,KAAK,IAAI,EAAE,CAAC;gBAC5B,GAAG,CAAC,UAAU,CAAC;oBACX,IAAI,EAAE,+CAA+C;oBACrD,OAAO,EACH,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;wBAC1B,CAAC,CAAC,SAAS,CAAC,SAAS;wBACrB,CAAC,CAAC,yCAAyC;oBACnD,QAAQ,EAAE,SAAS;oBACnB,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE;iBAC9C,CAAC,CAAA;YACN,CAAC;YAED,OAAO;gBACH,gBAAgB;gBAChB,oBAAoB,EAAE,SAAS,CAAC,oBAAoB;gBACpD,SAAS,EAAE,iBAAiB;oBACxB,CAAC,CAAC,iBAAiB,gBAAgB,iEAAiE;oBACpG,CAAC,CAAC,SAAS,CAAC,SAAS;aAC5B,CAAA;QACL,CAAC;KACJ,CAAA;AACL,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,wBAAwB,GACjC,8BAA8B,EAAE,CAAA"}
|
|
@@ -1,27 +1,82 @@
|
|
|
1
|
-
import { type TConclusionSelectionOutput, type TFormulaCompilationOutput, type
|
|
1
|
+
import { type TClaimTypeClassificationEntry, type TConclusionSelectionOutput, type TFormulaCompilationOutput, type TInferenceRelation, type TVariableAssignmentOutput } from "./schemas.js";
|
|
2
2
|
import type { TStage } from "../../../../lib/pipelines/types.js";
|
|
3
3
|
export declare const FORMULA_COMPILATION_FAILURE_CODES: {
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
4
|
+
readonly unresolvedAntecedent: "FORMULA_COMPILATION_ANTECEDENT_UNRESOLVED";
|
|
5
|
+
readonly unresolvedConsequent: "FORMULA_COMPILATION_CONSEQUENT_UNRESOLVED";
|
|
6
6
|
readonly unresolvedConclusion: "FORMULA_COMPILATION_CONCLUSION_UNRESOLVED";
|
|
7
|
-
readonly
|
|
7
|
+
readonly emptyAntecedents: "FORMULA_COMPILATION_ANTECEDENTS_EMPTY";
|
|
8
8
|
};
|
|
9
|
+
export declare const RELATION_PLACEMENT_FAILURE_CODES: {
|
|
10
|
+
readonly droppedTypedConsequent: "RELATION_PLACEMENT_DROPPED_TYPED_CONSEQUENT";
|
|
11
|
+
readonly droppedUnresolvedClaim: "RELATION_PLACEMENT_DROPPED_UNRESOLVED_CLAIM";
|
|
12
|
+
readonly droppedEmptyAntecedents: "RELATION_PLACEMENT_DROPPED_EMPTY_ANTECEDENTS";
|
|
13
|
+
};
|
|
14
|
+
type TAddFailure = (failure: {
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
severity: "warning" | "error";
|
|
18
|
+
context?: Record<string, unknown>;
|
|
19
|
+
}) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve each claim's effective type into a `miniId → type` map,
|
|
22
|
+
* preferring the `claim-type-classification` entry and falling back to the
|
|
23
|
+
* canonicalizer's drafted `type`. This is the SAME resolution
|
|
24
|
+
* `finalizeResponseV2` uses, so the sort and finalize never disagree on
|
|
25
|
+
* whether a claim is citation/axiomatic — a disagreement is exactly what
|
|
26
|
+
* would let a citation slip into a freeform premise.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveClaimTypes(input: {
|
|
29
|
+
classifications: TClaimTypeClassificationEntry[];
|
|
30
|
+
canonicalClaims: {
|
|
31
|
+
miniId: string;
|
|
32
|
+
type: TClaimTypeClassificationEntry["type"];
|
|
33
|
+
}[];
|
|
34
|
+
}): Map<string, TClaimTypeClassificationEntry["type"]>;
|
|
35
|
+
/**
|
|
36
|
+
* A freeform relation after the citation/axiomatic sort: only normal
|
|
37
|
+
* antecedents remain.
|
|
38
|
+
*/
|
|
39
|
+
export type TFreeformRelation = {
|
|
40
|
+
relationId: string;
|
|
41
|
+
antecedents: string[];
|
|
42
|
+
consequent: string;
|
|
43
|
+
};
|
|
44
|
+
export type TSortInferenceRelationsResult = {
|
|
45
|
+
freeformRelations: TFreeformRelation[];
|
|
46
|
+
/** consequent claim miniId → its citation/axiomatic supporting claim miniIds. */
|
|
47
|
+
derivationBacking: Map<string, string[]>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Deterministically sort inference relations into freeform premises and
|
|
51
|
+
* derivation backing. For each relation:
|
|
52
|
+
* - drop (warn) if the consequent is citation/axiomatic — a typed claim
|
|
53
|
+
* cannot be the consequent of an implication;
|
|
54
|
+
* - dedupe antecedents and drop a self-referential antecedent;
|
|
55
|
+
* - drop (warn) the whole relation if any antecedent's type can't be
|
|
56
|
+
* resolved — never silently treat an unresolved id as `normal`;
|
|
57
|
+
* - route citation/axiomatic antecedents into `derivationBacking`;
|
|
58
|
+
* - keep the normal antecedents as the freeform implication; if none
|
|
59
|
+
* remain, the relation is fully captured by the backing and yields no
|
|
60
|
+
* freeform premise.
|
|
61
|
+
*/
|
|
62
|
+
export declare function sortInferenceRelations(input: {
|
|
63
|
+
relations: TInferenceRelation[];
|
|
64
|
+
typeByClaimMiniId: Map<string, TClaimTypeClassificationEntry["type"]>;
|
|
65
|
+
addFailure?: TAddFailure;
|
|
66
|
+
}): TSortInferenceRelationsResult;
|
|
9
67
|
export type TCompileFormulasInput = {
|
|
10
|
-
|
|
11
|
-
relations: TRelationExtractionOutput["relations"];
|
|
68
|
+
freeformRelations: TFreeformRelation[];
|
|
12
69
|
conclusion: TConclusionSelectionOutput | undefined;
|
|
13
70
|
variables: TVariableAssignmentOutput;
|
|
14
71
|
generateId: () => string;
|
|
15
|
-
addFailure?:
|
|
16
|
-
code: string;
|
|
17
|
-
message: string;
|
|
18
|
-
severity: "warning" | "error";
|
|
19
|
-
context?: Record<string, unknown>;
|
|
20
|
-
}) => void;
|
|
72
|
+
addFailure?: TAddFailure;
|
|
21
73
|
};
|
|
22
74
|
/**
|
|
23
|
-
*
|
|
75
|
+
* Compile freeform relations into premise formulas, and mint the
|
|
76
|
+
* conclusion premise. Pure helper exposed for direct testing. The stage's
|
|
77
|
+
* `derivationBacking` is added by the stage wrapper, not here.
|
|
24
78
|
*/
|
|
25
|
-
export declare function compileFormulas(input: TCompileFormulasInput): TFormulaCompilationOutput
|
|
79
|
+
export declare function compileFormulas(input: TCompileFormulasInput): Omit<TFormulaCompilationOutput, "derivationBacking">;
|
|
26
80
|
export declare const formulaCompilationStage: TStage<TFormulaCompilationOutput>;
|
|
81
|
+
export {};
|
|
27
82
|
//# sourceMappingURL=formula-compilation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formula-compilation.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/formula-compilation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formula-compilation.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/base/stages/formula-compilation.ts"],"names":[],"mappings":"AA2BA,OAAO,EAIH,KAAK,6BAA6B,EAElC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EAEvB,KAAK,yBAAyB,EACjC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAE/E,eAAO,MAAM,iCAAiC;;;;;CAKpC,CAAA;AASV,eAAO,MAAM,gCAAgC;;;;CAInC,CAAA;AAEV,KAAK,WAAW,GAAG,CAAC,OAAO,EAAE;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC,KAAK,IAAI,CAAA;AAEV;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACrC,eAAe,EAAE,6BAA6B,EAAE,CAAA;IAChD,eAAe,EAAE;QACb,MAAM,EAAE,MAAM,CAAA;QACd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