@proposit/proposit-core 1.3.0 → 1.4.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 (92) hide show
  1. package/README.md +9 -0
  2. package/dist/extensions/argument-ingestion/index.d.ts +4 -2
  3. package/dist/extensions/argument-ingestion/index.d.ts.map +1 -1
  4. package/dist/extensions/argument-ingestion/index.js +2 -1
  5. package/dist/extensions/argument-ingestion/index.js.map +1 -1
  6. package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.d.ts +19 -0
  7. package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.d.ts.map +1 -0
  8. package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.js +44 -0
  9. package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.js.map +1 -0
  10. package/dist/extensions/argument-ingestion/shared/types.d.ts +39 -0
  11. package/dist/extensions/argument-ingestion/shared/types.d.ts.map +1 -1
  12. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.d.ts +6 -0
  13. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.d.ts.map +1 -1
  14. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.js +16 -7
  15. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.js.map +1 -1
  16. package/dist/extensions/argument-ingestion/stages/citation-source-detection.d.ts +6 -0
  17. package/dist/extensions/argument-ingestion/stages/citation-source-detection.d.ts.map +1 -1
  18. package/dist/extensions/argument-ingestion/stages/citation-source-detection.js +16 -7
  19. package/dist/extensions/argument-ingestion/stages/citation-source-detection.js.map +1 -1
  20. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.d.ts +8 -2
  21. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.d.ts.map +1 -1
  22. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.js +11 -2
  23. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.js.map +1 -1
  24. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.d.ts +6 -0
  25. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.d.ts.map +1 -1
  26. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.js +16 -7
  27. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.js.map +1 -1
  28. package/dist/extensions/argument-ingestion/stages/claim-type-classification.d.ts +6 -0
  29. package/dist/extensions/argument-ingestion/stages/claim-type-classification.d.ts.map +1 -1
  30. package/dist/extensions/argument-ingestion/stages/claim-type-classification.js +20 -11
  31. package/dist/extensions/argument-ingestion/stages/claim-type-classification.js.map +1 -1
  32. package/dist/extensions/argument-ingestion/stages/conclusion-selection.d.ts +14 -7
  33. package/dist/extensions/argument-ingestion/stages/conclusion-selection.d.ts.map +1 -1
  34. package/dist/extensions/argument-ingestion/stages/conclusion-selection.js +47 -37
  35. package/dist/extensions/argument-ingestion/stages/conclusion-selection.js.map +1 -1
  36. package/dist/extensions/argument-ingestion/stages/index.d.ts +8 -8
  37. package/dist/extensions/argument-ingestion/stages/index.d.ts.map +1 -1
  38. package/dist/extensions/argument-ingestion/stages/index.js +8 -8
  39. package/dist/extensions/argument-ingestion/stages/index.js.map +1 -1
  40. package/dist/extensions/argument-ingestion/stages/relation-extraction.d.ts +6 -0
  41. package/dist/extensions/argument-ingestion/stages/relation-extraction.d.ts.map +1 -1
  42. package/dist/extensions/argument-ingestion/stages/relation-extraction.js +21 -11
  43. package/dist/extensions/argument-ingestion/stages/relation-extraction.js.map +1 -1
  44. package/dist/extensions/argument-ingestion/stages/segmentation.d.ts +20 -0
  45. package/dist/extensions/argument-ingestion/stages/segmentation.d.ts.map +1 -1
  46. package/dist/extensions/argument-ingestion/stages/segmentation.js +51 -7
  47. package/dist/extensions/argument-ingestion/stages/segmentation.js.map +1 -1
  48. package/dist/extensions/argument-ingestion/v1-single-shot.d.ts +9 -1
  49. package/dist/extensions/argument-ingestion/v1-single-shot.d.ts.map +1 -1
  50. package/dist/extensions/argument-ingestion/v1-single-shot.js +13 -6
  51. package/dist/extensions/argument-ingestion/v1-single-shot.js.map +1 -1
  52. package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts +25 -2
  53. package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts.map +1 -1
  54. package/dist/extensions/argument-ingestion/v2-multi-stage.js +12 -3
  55. package/dist/extensions/argument-ingestion/v2-multi-stage.js.map +1 -1
  56. package/dist/extensions/openai/errors.d.ts +17 -0
  57. package/dist/extensions/openai/errors.d.ts.map +1 -1
  58. package/dist/extensions/openai/errors.js +30 -3
  59. package/dist/extensions/openai/errors.js.map +1 -1
  60. package/dist/extensions/openai/index.d.ts +1 -1
  61. package/dist/extensions/openai/index.d.ts.map +1 -1
  62. package/dist/extensions/openai/index.js +1 -1
  63. package/dist/extensions/openai/index.js.map +1 -1
  64. package/dist/extensions/openai/provider.d.ts.map +1 -1
  65. package/dist/extensions/openai/provider.js +162 -5
  66. package/dist/extensions/openai/provider.js.map +1 -1
  67. package/dist/extensions/openai/types.d.ts +19 -0
  68. package/dist/extensions/openai/types.d.ts.map +1 -1
  69. package/dist/lib/index.d.ts +4 -4
  70. package/dist/lib/index.d.ts.map +1 -1
  71. package/dist/lib/index.js +3 -3
  72. package/dist/lib/index.js.map +1 -1
  73. package/dist/lib/pipelines/debug-log.d.ts +96 -0
  74. package/dist/lib/pipelines/debug-log.d.ts.map +1 -0
  75. package/dist/lib/pipelines/debug-log.js +144 -0
  76. package/dist/lib/pipelines/debug-log.js.map +1 -0
  77. package/dist/lib/pipelines/execute.d.ts.map +1 -1
  78. package/dist/lib/pipelines/execute.js +84 -54
  79. package/dist/lib/pipelines/execute.js.map +1 -1
  80. package/dist/lib/pipelines/failure-codes.d.ts +19 -0
  81. package/dist/lib/pipelines/failure-codes.d.ts.map +1 -0
  82. package/dist/lib/pipelines/failure-codes.js +33 -0
  83. package/dist/lib/pipelines/failure-codes.js.map +1 -0
  84. package/dist/lib/pipelines/index.d.ts +2 -0
  85. package/dist/lib/pipelines/index.d.ts.map +1 -1
  86. package/dist/lib/pipelines/index.js +2 -0
  87. package/dist/lib/pipelines/index.js.map +1 -1
  88. package/dist/lib/pipelines/stage-helpers.d.ts +1 -1
  89. package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
  90. package/dist/lib/pipelines/stage-helpers.js +16 -7
  91. package/dist/lib/pipelines/stage-helpers.js.map +1 -1
  92. package/package.json +2 -3
package/README.md CHANGED
@@ -1196,4 +1196,13 @@ A CLI smoke test exercises every command against an isolated temp directory:
1196
1196
  pnpm run build && bash scripts/smoke-test.sh
1197
1197
  ```
1198
1198
 
1199
+ ### Git hooks
1200
+
1201
+ `pnpm install` runs a `prepare` script that points `core.hooksPath` at the
1202
+ tracked `.githooks/` directory, so the **pre-push** hook activates
1203
+ automatically. Before each push it runs Prettier (`--check`) on the files your
1204
+ branch changed relative to its remote counterpart, falling back to the whole
1205
+ repo when that comparison can't be made. Fix any reported files with
1206
+ `pnpm prettify`, or bypass the check once with `git push --no-verify`.
1207
+
1199
1208
  See [CLI_EXAMPLES.md](CLI_EXAMPLES.md) for a full walkthrough.
@@ -1,8 +1,10 @@
1
- export { createIngestionV1Pipeline } from "./v1-single-shot.js";
1
+ export { createIngestionV1Pipeline, V1_PARSE_STAGE_ID, } from "./v1-single-shot.js";
2
2
  export type { TCreateIngestionV1PipelineOptions } from "./v1-single-shot.js";
3
3
  export { createIngestionV2Pipeline } from "./v2-multi-stage.js";
4
+ export type { TCreateIngestionV2PipelineOptions } from "./v2-multi-stage.js";
5
+ export { resolveLlmStageOptions } from "./shared/resolve-llm-stage-options.js";
4
6
  export { basicsExtension } from "./shared/basics-extension.js";
5
- export type { TIngestionExtension, TIngestionInput } from "./shared/types.js";
7
+ export type { TIngestionExtension, TIngestionInput, TIngestionLlmOptions, TLlmStageOptionsOverride, } from "./shared/types.js";
6
8
  export { finalizeResponse } from "./shared/finalize-response.js";
7
9
  export type { TFinalizeResponseInput } from "./shared/finalize-response.js";
8
10
  export { finalizeResponseV2, FINALIZE_V2_FAILURE_TEXTS, } from "./shared/finalize-response-v2.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/argument-ingestion/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,YAAY,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EACH,kBAAkB,EAClB,yBAAyB,GAC5B,MAAM,kCAAkC,CAAA;AACzC,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAGhF,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/argument-ingestion/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,yBAAyB,EACzB,iBAAiB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,YAAY,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,YAAY,EACR,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EACH,kBAAkB,EAClB,yBAAyB,GAC5B,MAAM,kCAAkC,CAAA;AACzC,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAGhF,cAAc,mBAAmB,CAAA"}
@@ -4,8 +4,9 @@
4
4
  // pipeline factory + the default `basicsExtension`. The shared
5
5
  // `TIngestionExtension` descriptor is forward-compatible across both
6
6
  // pipelines.
7
- export { createIngestionV1Pipeline } from "./v1-single-shot.js";
7
+ export { createIngestionV1Pipeline, V1_PARSE_STAGE_ID, } from "./v1-single-shot.js";
8
8
  export { createIngestionV2Pipeline } from "./v2-multi-stage.js";
9
+ export { resolveLlmStageOptions } from "./shared/resolve-llm-stage-options.js";
9
10
  export { basicsExtension } from "./shared/basics-extension.js";
10
11
  export { finalizeResponse } from "./shared/finalize-response.js";
11
12
  export { finalizeResponseV2, FINALIZE_V2_FAILURE_TEXTS, } from "./shared/finalize-response-v2.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/argument-ingestion/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,mEAAmE;AACnE,+DAA+D;AAC/D,qEAAqE;AACrE,aAAa;AAEb,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,OAAO,EACH,kBAAkB,EAClB,yBAAyB,GAC5B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,iEAAiE;AACjE,kEAAkE;AAClE,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/argument-ingestion/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,mEAAmE;AACnE,+DAA+D;AAC/D,qEAAqE;AACrE,aAAa;AAEb,OAAO,EACH,yBAAyB,EACzB,iBAAiB,GACpB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAO9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,OAAO,EACH,kBAAkB,EAClB,yBAAyB,GAC5B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,iEAAiE;AACjE,kEAAkE;AAClE,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { TIngestionLlmOptions, TLlmStageOptionsOverride } from "./types.js";
2
+ /**
3
+ * Resolve the final per-stage LLM knobs.
4
+ *
5
+ * @param stageId — the stage's id (e.g. `"segmentation"`). Used to
6
+ * pick the right entry from `options.overrides`.
7
+ * @param internalDefault — the stage's built-in defaults; takes
8
+ * effect for any knob not set by `options.defaults`
9
+ * or `options.overrides[stageId]`.
10
+ * @param options — the caller's pipeline-level options surface.
11
+ * May be `undefined`, in which case the resolver
12
+ * returns `internalDefault` verbatim.
13
+ *
14
+ * The merge is shallow per-field. A missing field at higher
15
+ * precedence does not blank out a lower-precedence value — it
16
+ * simply doesn't override.
17
+ */
18
+ export declare function resolveLlmStageOptions(stageId: string, internalDefault: TLlmStageOptionsOverride, options?: TIngestionLlmOptions): TLlmStageOptionsOverride;
19
+ //# sourceMappingURL=resolve-llm-stage-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-llm-stage-options.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/shared/resolve-llm-stage-options.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAEhF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,wBAAwB,EACzC,OAAO,CAAC,EAAE,oBAAoB,GAC/B,wBAAwB,CAiB1B"}
@@ -0,0 +1,44 @@
1
+ // Shared resolver for per-stage LLM-knob options.
2
+ //
3
+ // The ingestion pipelines (`createIngestionV1Pipeline`,
4
+ // `createIngestionV2Pipeline`) expose a `TIngestionLlmOptions`
5
+ // surface with pipeline-level `defaults` + per-stage `overrides`.
6
+ // Each LLM stage in turn carries its own *internal default* — the
7
+ // model + effort + token cap the stage author picked for typical
8
+ // inputs. The two surfaces compose via this resolver: stage-level
9
+ // override > pipeline-default > internal stage default.
10
+ /**
11
+ * Resolve the final per-stage LLM knobs.
12
+ *
13
+ * @param stageId — the stage's id (e.g. `"segmentation"`). Used to
14
+ * pick the right entry from `options.overrides`.
15
+ * @param internalDefault — the stage's built-in defaults; takes
16
+ * effect for any knob not set by `options.defaults`
17
+ * or `options.overrides[stageId]`.
18
+ * @param options — the caller's pipeline-level options surface.
19
+ * May be `undefined`, in which case the resolver
20
+ * returns `internalDefault` verbatim.
21
+ *
22
+ * The merge is shallow per-field. A missing field at higher
23
+ * precedence does not blank out a lower-precedence value — it
24
+ * simply doesn't override.
25
+ */
26
+ export function resolveLlmStageOptions(stageId, internalDefault, options) {
27
+ const pipelineDefault = options?.defaults ?? {};
28
+ const perStage = options?.overrides?.[stageId] ?? {};
29
+ const resolved = { ...internalDefault };
30
+ if (pipelineDefault.maxOutputTokens !== undefined) {
31
+ resolved.maxOutputTokens = pipelineDefault.maxOutputTokens;
32
+ }
33
+ if (pipelineDefault.reasoningEffort !== undefined) {
34
+ resolved.reasoningEffort = pipelineDefault.reasoningEffort;
35
+ }
36
+ if (perStage.maxOutputTokens !== undefined) {
37
+ resolved.maxOutputTokens = perStage.maxOutputTokens;
38
+ }
39
+ if (perStage.reasoningEffort !== undefined) {
40
+ resolved.reasoningEffort = perStage.reasoningEffort;
41
+ }
42
+ return resolved;
43
+ }
44
+ //# sourceMappingURL=resolve-llm-stage-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-llm-stage-options.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/shared/resolve-llm-stage-options.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,wDAAwD;AACxD,+DAA+D;AAC/D,kEAAkE;AAClE,kEAAkE;AAClE,iEAAiE;AACjE,kEAAkE;AAClE,wDAAwD;AAIxD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB,CAClC,OAAe,EACf,eAAyC,EACzC,OAA8B;IAE9B,MAAM,eAAe,GAAG,OAAO,EAAE,QAAQ,IAAI,EAAE,CAAA;IAC/C,MAAM,QAAQ,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACpD,MAAM,QAAQ,GAA6B,EAAE,GAAG,eAAe,EAAE,CAAA;IACjE,IAAI,eAAe,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAChD,QAAQ,CAAC,eAAe,GAAG,eAAe,CAAC,eAAe,CAAA;IAC9D,CAAC;IACD,IAAI,eAAe,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAChD,QAAQ,CAAC,eAAe,GAAG,eAAe,CAAC,eAAe,CAAA;IAC9D,CAAC;IACD,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACzC,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAA;IACvD,CAAC;IACD,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACzC,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAA;IACvD,CAAC;IACD,OAAO,QAAQ,CAAA;AACnB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { TSchema } from "typebox";
2
+ import type { TReasoningEffort } from "../../../lib/llm/types.js";
2
3
  /**
3
4
  * Bundle of TypeBox schemas a caller hands to an ingestion pipeline
4
5
  * factory. Only `responseSchema` is consumed by v1; the per-entity
@@ -31,4 +32,42 @@ export type TIngestionExtension = {
31
32
  export type TIngestionInput = {
32
33
  text: string;
33
34
  };
35
+ /**
36
+ * Per-stage LLM knob overrides for an ingestion pipeline factory.
37
+ *
38
+ * Every field is optional and merges over the stage's internal
39
+ * default (which is in turn merged over the pipeline-level default).
40
+ * The merge order is: stage-override > pipeline-default > internal
41
+ * stage default. A missing field at every layer means the stage
42
+ * keeps its built-in behavior.
43
+ *
44
+ * Currently exposes the two knobs that have proven load-bearing for
45
+ * the v2 pipeline: `maxOutputTokens` (the output-budget cap; not
46
+ * setting one means the model's default applies, which is what
47
+ * caused the v1.3.0 segmentation truncation against the Singer
48
+ * fixture) and `reasoningEffort` (effort budget for reasoning
49
+ * models). The struct is forward-compatible — new knobs (e.g.
50
+ * `model` overrides) can land additively without breaking callers.
51
+ */
52
+ export type TLlmStageOptionsOverride = {
53
+ maxOutputTokens?: number;
54
+ reasoningEffort?: TReasoningEffort;
55
+ };
56
+ /**
57
+ * Pipeline-level LLM-options surface threaded through every LLM
58
+ * stage by the ingestion-pipeline factories.
59
+ *
60
+ * `defaults` applies to all LLM stages in the pipeline that don't
61
+ * have a per-stage entry under `overrides`. A stage's internal
62
+ * default still takes effect for any knob neither `defaults` nor
63
+ * `overrides` sets.
64
+ *
65
+ * `overrides` is keyed by stage id (`STAGE_IDS.segmentation`,
66
+ * `STAGE_IDS.claimMentionExtraction`, etc.). v1 has only one LLM
67
+ * stage and uses the id `"parse-argument"`.
68
+ */
69
+ export type TIngestionLlmOptions = {
70
+ defaults?: TLlmStageOptionsOverride;
71
+ overrides?: Record<string, TLlmStageOptionsOverride>;
72
+ };
34
73
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/shared/types.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,8EAA8E;IAC9E,cAAc,EAAE,OAAO,CAAA;IACvB,uGAAuG;IACvG,WAAW,EAAE,OAAO,CAAA;IACpB,gDAAgD;IAChD,cAAc,EAAE,OAAO,CAAA;IACvB,+CAA+C;IAC/C,aAAa,EAAE,OAAO,CAAA;IACtB,yDAAyD;IACzD,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;CACf,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/shared/types.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,8EAA8E;IAC9E,cAAc,EAAE,OAAO,CAAA;IACvB,uGAAuG;IACvG,WAAW,EAAE,OAAO,CAAA;IACpB,gDAAgD;IAChD,cAAc,EAAE,OAAO,CAAA;IACvB,+CAA+C;IAC/C,aAAa,EAAE,OAAO,CAAA;IACtB,yDAAyD;IACzD,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,CAAC,EAAE,gBAAgB,CAAA;CACrC,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,CAAC,EAAE,wBAAwB,CAAA;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAA;CACvD,CAAA"}
@@ -1,6 +1,12 @@
1
1
  import { type TAxiomIndicatorDetectionOutput } from "./schemas.js";
2
2
  import type { TStage } from "../../../lib/pipelines/types.js";
3
+ import type { TLlmStageOptionsOverride } from "../shared/types.js";
3
4
  export declare const AXIOM_INDICATOR_DETECTION_MODEL = "gpt-5.4-mini";
4
5
  export declare const AXIOM_INDICATOR_DETECTION_SYSTEM_PROMPT = "You scan the segments of an argument for axiom indicators \u2014 explicit signals that the author is invoking a self-evident truth as bottom-level support.\n\nRecognized indicator patterns include (non-exhaustive):\n- \"by definition\"\n- \"tautologically\", \"necessarily true\"\n- \"by convention\"\n- \"is true a priori\"\n- \"as a matter of (logic | mathematics | definition)\"\n- \"trivially\"\n\nReturn an object with a single key `axioms` whose value is the array of detected indicators. For each detected indicator emit:\n- a fresh \"axiomId\" (ax1, ax2, ...)\n- the list of \"segmentIds\" the indicator occurs in (usually one; sometimes two when the indicator straddles a clause)\n- the \"indicator\" \u2014 the verbatim trigger phrase\n- the character \"spans\" \u2014 one span object (\"start\" inclusive, \"end\" exclusive) per occurrence, relative to the SEGMENT'S TEXT\n\nHedging phrases (\"clearly\", \"obviously\", \"of course\") are NOT axiom indicators on their own \u2014 they are stylistic emphasis. Return `{ \"axioms\": [] }` when no indicators are present.";
6
+ /** Internal default knobs for the axiom-indicator-detection stage. */
7
+ export declare const AXIOM_INDICATOR_DETECTION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
8
+ /** Build the axiom-indicator-detection stage with optional caller overrides. */
9
+ export declare function createAxiomIndicatorDetectionStage(options?: TLlmStageOptionsOverride): TStage<TAxiomIndicatorDetectionOutput>;
10
+ /** Backward-compatible default-options stage. */
5
11
  export declare const axiomIndicatorDetectionStage: TStage<TAxiomIndicatorDetectionOutput>;
6
12
  //# sourceMappingURL=axiom-indicator-detection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"axiom-indicator-detection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/axiom-indicator-detection.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,KAAK,8BAA8B,EAEtC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAE5E,eAAO,MAAM,+BAA+B,iBAAiB,CAAA;AAE7D,eAAO,MAAM,uCAAuC,4jCAgBmI,CAAA;AAavL,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,8BAA8B,CAO1E,CAAA"}
1
+ {"version":3,"file":"axiom-indicator-detection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/axiom-indicator-detection.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,KAAK,8BAA8B,EAEtC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAElE,eAAO,MAAM,+BAA+B,iBAAiB,CAAA;AAE7D,eAAO,MAAM,uCAAuC,4jCAgBmI,CAAA;AAavL,sEAAsE;AACtE,eAAO,MAAM,wCAAwC,EAAE,wBACjD,CAAA;AAEN,gFAAgF;AAChF,wBAAgB,kCAAkC,CAC9C,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,8BAA8B,CAAC,CAUxC;AAED,iDAAiD;AACjD,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,8BAA8B,CACxC,CAAA"}
@@ -32,11 +32,20 @@ function buildPrompt(ctx) {
32
32
  const user = `Segments:\n\n${renderedSegments}\n\nDetect every axiom indicator.`;
33
33
  return { system: markedSystem, user };
34
34
  }
35
- export const axiomIndicatorDetectionStage = llmStage({
36
- id: STAGE_IDS.axiomIndicatorDetection,
37
- dependsOn: [STAGE_IDS.segmentation],
38
- outputSchema: AxiomIndicatorDetectionOutputSchema,
39
- model: AXIOM_INDICATOR_DETECTION_MODEL,
40
- buildPrompt,
41
- });
35
+ /** Internal default knobs for the axiom-indicator-detection stage. */
36
+ export const AXIOM_INDICATOR_DETECTION_STAGE_DEFAULTS = {};
37
+ /** Build the axiom-indicator-detection stage with optional caller overrides. */
38
+ export function createAxiomIndicatorDetectionStage(options) {
39
+ return llmStage({
40
+ id: STAGE_IDS.axiomIndicatorDetection,
41
+ dependsOn: [STAGE_IDS.segmentation],
42
+ outputSchema: AxiomIndicatorDetectionOutputSchema,
43
+ model: AXIOM_INDICATOR_DETECTION_MODEL,
44
+ maxOutputTokens: options?.maxOutputTokens,
45
+ reasoningEffort: options?.reasoningEffort,
46
+ buildPrompt,
47
+ });
48
+ }
49
+ /** Backward-compatible default-options stage. */
50
+ export const axiomIndicatorDetectionStage = createAxiomIndicatorDetectionStage();
42
51
  //# sourceMappingURL=axiom-indicator-detection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"axiom-indicator-detection.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/axiom-indicator-detection.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,sEAAsE;AACtE,6DAA6D;AAC7D,gEAAgE;AAEhE,OAAO,EACH,SAAS,EACT,mCAAmC,GAGtC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAGlE,MAAM,CAAC,MAAM,+BAA+B,GAAG,cAAc,CAAA;AAE7D,MAAM,CAAC,MAAM,uCAAuC,GAAG;;;;;;;;;;;;;;;;uLAgBgI,CAAA;AAEvL,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,YAAY,EAAE,QAAQ,IAAI,EAAE,CAAA;IAC7C,MAAM,gBAAgB,GAAG,QAAQ;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,uBAAuB,SAAS,uCAAuC,EAAE,CAAA;IAC1H,MAAM,IAAI,GAAG,gBAAgB,gBAAgB,mCAAmC,CAAA;IAChF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GACrC,QAAQ,CAAiC;IACrC,EAAE,EAAE,SAAS,CAAC,uBAAuB;IACrC,SAAS,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;IACnC,YAAY,EAAE,mCAAmC;IACjD,KAAK,EAAE,+BAA+B;IACtC,WAAW;CACd,CAAC,CAAA"}
1
+ {"version":3,"file":"axiom-indicator-detection.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/axiom-indicator-detection.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,sEAAsE;AACtE,6DAA6D;AAC7D,gEAAgE;AAEhE,OAAO,EACH,SAAS,EACT,mCAAmC,GAGtC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CA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etectionOutput } from "./schemas.js";
2
2
  import type { TStage } from "../../../lib/pipelines/types.js";
3
+ import type { TLlmStageOptionsOverride } from "../shared/types.js";
3
4
  export declare const CITATION_SOURCE_DETECTION_MODEL = "gpt-5.4-mini";
4
5
  export declare const CITATION_SOURCE_DETECTION_SYSTEM_PROMPT = "You scan the segments of an argument for explicit references to external sources of evidence.\n\nA source reference is any of:\n- a Markdown link: `[label](url)`\n- a named source: \"according to X\", \"as reported in Y\", \"the X report\"\n- a bracketed citation marker: `[1]`, `[Smith 2024]`\n- a fully-qualified URL\n\nReturn an object with a single key `sources` whose value is the array of detected source references. For each detected source emit:\n- a fresh \"sourceId\" (src1, src2, ...)\n- the list of \"segmentIds\" the source occurs in (almost always one; multi-segment when one citation spans a clause boundary)\n- a short \"sourceString\" \u2014 the human-readable label (e.g. \"NASA climate report\", \"Smith 2024\")\n- the \"url\" field \u2014 the URL when one is present, otherwise null\n- the character \"spans\" \u2014 one span object (\"start\" inclusive, \"end\" exclusive) per occurrence, relative to the SEGMENT'S TEXT\n\nDo not detect mere mentions of people, organizations, or studies that are not invoked as supporting evidence. Quote attribution alone (\"Bob said X\") is not a citation unless Bob's saying is being used to support a claim. Return `{ \"sources\": [] }` when no sources are present.";
6
+ /** Internal default knobs for the citation-source-detection stage. */
7
+ export declare const CITATION_SOURCE_DETECTION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
8
+ /** Build the citation-source-detection stage with optional caller overrides. */
9
+ export declare function createCitationSourceDetectionStage(options?: TLlmStageOptionsOverride): TStage<TCitationSourceDetectionOutput>;
10
+ /** Backward-compatible default-options stage. */
5
11
  export declare const citationSourceDetectionStage: TStage<TCitationSourceDetectionOutput>;
6
12
  //# sourceMappingURL=citation-source-detection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"citation-source-detection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/citation-source-detection.ts"],"names":[],"mappings":"AAMA,OAAO,EAGH,KAAK,8BAA8B,EAEtC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAE5E,eAAO,MAAM,+BAA+B,iBAAiB,CAAA;AAE7D,eAAO,MAAM,uCAAuC,6sCAemO,CAAA;AAavR,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,8BAA8B,CAO1E,CAAA"}
1
+ {"version":3,"file":"citation-source-detection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/citation-source-detection.ts"],"names":[],"mappings":"AAMA,OAAO,EAGH,KAAK,8BAA8B,EAEtC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAElE,eAAO,MAAM,+BAA+B,iBAAiB,CAAA;AAE7D,eAAO,MAAM,uCAAuC,6sCAemO,CAAA;AAavR,sEAAsE;AACtE,eAAO,MAAM,wCAAwC,EAAE,wBACjD,CAAA;AAEN,gFAAgF;AAChF,wBAAgB,kCAAkC,CAC9C,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,8BAA8B,CAAC,CAUxC;AAED,iDAAiD;AACjD,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,8BAA8B,CACxC,CAAA"}
@@ -32,11 +32,20 @@ function buildPrompt(ctx) {
32
32
  const user = `Segments:\n\n${renderedSegments}\n\nDetect every citation/source reference.`;
33
33
  return { system: markedSystem, user };
34
34
  }
35
- export const citationSourceDetectionStage = llmStage({
36
- id: STAGE_IDS.citationSourceDetection,
37
- dependsOn: [STAGE_IDS.segmentation],
38
- outputSchema: CitationSourceDetectionOutputSchema,
39
- model: CITATION_SOURCE_DETECTION_MODEL,
40
- buildPrompt,
41
- });
35
+ /** Internal default knobs for the citation-source-detection stage. */
36
+ export const CITATION_SOURCE_DETECTION_STAGE_DEFAULTS = {};
37
+ /** Build the citation-source-detection stage with optional caller overrides. */
38
+ export function createCitationSourceDetectionStage(options) {
39
+ return llmStage({
40
+ id: STAGE_IDS.citationSourceDetection,
41
+ dependsOn: [STAGE_IDS.segmentation],
42
+ outputSchema: CitationSourceDetectionOutputSchema,
43
+ model: CITATION_SOURCE_DETECTION_MODEL,
44
+ maxOutputTokens: options?.maxOutputTokens,
45
+ reasoningEffort: options?.reasoningEffort,
46
+ buildPrompt,
47
+ });
48
+ }
49
+ /** Backward-compatible default-options stage. */
50
+ export const citationSourceDetectionStage = createCitationSourceDetectionStage();
42
51
  //# sourceMappingURL=citation-source-detection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"citation-source-detection.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/citation-source-detection.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+DAA+D;AAC/D,kEAAkE;AAClE,qEAAqE;AACrE,kEAAkE;AAElE,OAAO,EACH,SAAS,EACT,mCAAmC,GAGtC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAGlE,MAAM,CAAC,MAAM,+BAA+B,GAAG,cAAc,CAAA;AAE7D,MAAM,CAAC,MAAM,uCAAuC,GAAG;;;;;;;;;;;;;;;uRAegO,CAAA;AAEvR,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,YAAY,EAAE,QAAQ,IAAI,EAAE,CAAA;IAC7C,MAAM,gBAAgB,GAAG,QAAQ;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,uBAAuB,SAAS,uCAAuC,EAAE,CAAA;IAC1H,MAAM,IAAI,GAAG,gBAAgB,gBAAgB,6CAA6C,CAAA;IAC1F,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GACrC,QAAQ,CAAiC;IACrC,EAAE,EAAE,SAAS,CAAC,uBAAuB;IACrC,SAAS,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;IACnC,YAAY,EAAE,mCAAmC;IACjD,KAAK,EAAE,+BAA+B;IACtC,WAAW;CACd,CAAC,CAAA"}
1
+ {"version":3,"file":"citation-source-detection.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/citation-source-detection.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+DAA+D;AAC/D,kEAAkE;AAClE,qEAAqE;AACrE,kEAAkE;AAElE,OAAO,EACH,SAAS,EACT,mCAAmC,GAGtC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAIlE,MAAM,CAAC,MAAM,+BAA+B,GAAG,cAAc,CAAA;AAE7D,MAAM,CAAC,MAAM,uCAAuC,GAAG;;;;;;;;;;;;;;;uRAegO,CAAA;AAEvR,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,YAAY,EAAE,QAAQ,IAAI,EAAE,CAAA;IAC7C,MAAM,gBAAgB,GAAG,QAAQ;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,uBAAuB,SAAS,uCAAuC,EAAE,CAAA;IAC1H,MAAM,IAAI,GAAG,gBAAgB,gBAAgB,6CAA6C,CAAA;IAC1F,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,wCAAwC,GACjD,EAAE,CAAA;AAEN,gFAAgF;AAChF,MAAM,UAAU,kCAAkC,CAC9C,OAAkC;IAElC,OAAO,QAAQ,CAAiC;QAC5C,EAAE,EAAE,SAAS,CAAC,uBAAuB;QACrC,SAAS,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;QACnC,YAAY,EAAE,mCAAmC;QACjD,KAAK,EAAE,+BAA+B;QACtC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,WAAW;KACd,CAAC,CAAA;AACN,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,4BAA4B,GACrC,kCAAkC,EAAE,CAAA"}
@@ -1,15 +1,21 @@
1
1
  import { type TClaimCanonicalizationOutput } from "./schemas.js";
2
2
  import type { TStage } from "../../../lib/pipelines/types.js";
3
- import type { TIngestionExtension } from "../shared/types.js";
3
+ import type { TIngestionExtension, TLlmStageOptionsOverride } from "../shared/types.js";
4
4
  export declare const CLAIM_CANONICALIZATION_MODEL = "gpt-5.5";
5
5
  export declare const CLAIM_CANONICALIZATION_REASONING: "minimal" | "low" | "medium" | "high";
6
6
  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) and `title` (a short human-readable label).\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- 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`.\n- For axiomatic claims, the `axiom` field captures the self-evident proposition (e.g. \"A bachelor is an unmarried man by definition.\").\n\nOutput ONLY the schema-shaped object. No prose.";
7
+ /** Internal default knobs for the claim-canonicalization stage. */
8
+ export declare const CLAIM_CANONICALIZATION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
7
9
  /**
8
10
  * Builds the `claim-canonicalization` stage for the supplied
9
11
  * extension. The stage's `outputSchema` carries the extension's
10
12
  * per-claim fields, so the LLM's structured-output schema matches the
11
13
  * extension's claim shape (e.g. for `basics`: a discriminated union
12
14
  * over `type`).
15
+ *
16
+ * `options` overrides the stage's internal defaults
17
+ * (`CLAIM_CANONICALIZATION_STAGE_DEFAULTS`). Threaded through by
18
+ * `createIngestionV2Pipeline` per its `TIngestionLlmOptions` surface.
13
19
  */
14
- export declare function createClaimCanonicalizationStage(extension: TIngestionExtension): TStage<TClaimCanonicalizationOutput>;
20
+ export declare function createClaimCanonicalizationStage(extension: TIngestionExtension, options?: TLlmStageOptionsOverride): TStage<TClaimCanonicalizationOutput>;
15
21
  //# sourceMappingURL=claim-canonicalization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim-canonicalization.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-canonicalization.ts"],"names":[],"mappings":"AAiBA,OAAO,EAMH,KAAK,4BAA4B,EACpC,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,oBAAoB,CAAA;AAE9E,eAAO,MAAM,4BAA4B,YAAY,CAAA;AACrD,eAAO,MAAM,gCAAgC,EACvC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAiB,CAAA;AAEvB,eAAO,MAAM,oCAAoC,05FAkCD,CAAA;AA8GhD;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC5C,SAAS,EAAE,mBAAmB,GAC/B,MAAM,CAAC,4BAA4B,CAAC,CAatC"}
1
+ {"version":3,"file":"claim-canonicalization.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-canonicalization.ts"],"names":[],"mappings":"AAiBA,OAAO,EAMH,KAAK,4BAA4B,EACpC,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EACR,mBAAmB,EAEnB,wBAAwB,EAC3B,MAAM,oBAAoB,CAAA;AAE3B,eAAO,MAAM,4BAA4B,YAAY,CAAA;AACrD,eAAO,MAAM,gCAAgC,EACvC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAiB,CAAA;AAEvB,eAAO,MAAM,oCAAoC,05FAkCD,CAAA;AA8GhD,mEAAmE;AACnE,eAAO,MAAM,qCAAqC,EAAE,wBAEnD,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC5C,SAAS,EAAE,mBAAmB,EAC9B,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,4BAA4B,CAAC,CAetC"}
@@ -124,14 +124,22 @@ function buildPrompt(ctx) {
124
124
  const user = `Input text:\n\n${input.text}\n\nClaim mentions:\n${mentionLines}\n\nDetected citation sources:\n${citationLines}\n\nDetected axiom indicators:\n${axiomLines}\n\nProduce the canonicalClaims + mentionToClaim object.`;
125
125
  return { system: markedSystem, user };
126
126
  }
127
+ /** Internal default knobs for the claim-canonicalization stage. */
128
+ export const CLAIM_CANONICALIZATION_STAGE_DEFAULTS = {
129
+ reasoningEffort: CLAIM_CANONICALIZATION_REASONING,
130
+ };
127
131
  /**
128
132
  * Builds the `claim-canonicalization` stage for the supplied
129
133
  * extension. The stage's `outputSchema` carries the extension's
130
134
  * per-claim fields, so the LLM's structured-output schema matches the
131
135
  * extension's claim shape (e.g. for `basics`: a discriminated union
132
136
  * over `type`).
137
+ *
138
+ * `options` overrides the stage's internal defaults
139
+ * (`CLAIM_CANONICALIZATION_STAGE_DEFAULTS`). Threaded through by
140
+ * `createIngestionV2Pipeline` per its `TIngestionLlmOptions` surface.
133
141
  */
134
- export function createClaimCanonicalizationStage(extension) {
142
+ export function createClaimCanonicalizationStage(extension, options) {
135
143
  return llmStage({
136
144
  id: STAGE_IDS.claimCanonicalization,
137
145
  dependsOn: [
@@ -141,7 +149,8 @@ export function createClaimCanonicalizationStage(extension) {
141
149
  ],
142
150
  outputSchema: buildResponseSchema(extension),
143
151
  model: CLAIM_CANONICALIZATION_MODEL,
144
- reasoningEffort: CLAIM_CANONICALIZATION_REASONING,
152
+ maxOutputTokens: options?.maxOutputTokens,
153
+ reasoningEffort: options?.reasoningEffort ?? CLAIM_CANONICALIZATION_REASONING,
145
154
  buildPrompt,
146
155
  });
147
156
  }
@@ -1 +1 @@
1
- {"version":3,"file":"claim-canonicalization.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-canonicalization.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qDAAqD;AACrD,oDAAoD;AACpD,iCAAiC;AACjC,kEAAkE;AAClE,6DAA6D;AAC7D,6DAA6D;AAC7D,iEAAiE;AACjE,EAAE;AACF,8DAA8D;AAC9D,+DAA+D;AAC/D,0DAA0D;AAC1D,EAAE;AACF,iEAAiE;AACjE,+BAA+B;AAE/B,OAAO,IAAI,EAAE,EAAgB,MAAM,SAAS,CAAA;AAC5C,OAAO,EACH,yBAAyB,EACzB,SAAS,GAKZ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAI1D,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAA;AACrD,MAAM,CAAC,MAAM,gCAAgC,GAI9B,QAAQ,CAAA;AAEvB,MAAM,CAAC,MAAM,oCAAoC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAkCJ,CAAA;AAEhD,SAAS,mBAAmB,CAAC,SAA8B;IACvD,OAAO,IAAI,CAAC,MAAM,CACd;QACI,eAAe,EAAE,IAAI,CAAC,KAAK,CACvB,sBAAsB,CAAC,SAAS,CAAC,WAAW,CAAC,CAChD;QACD,qDAAqD;QACrD,4DAA4D;QAC5D,4DAA4D;QAC5D,oBAAoB;QACpB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,yBAAy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CAAC;QACjB,CAAC,CAAC,UAAU,CAAA;IACpB,MAAM,UAAU,GACZ,MAAM,CAAC,MAAM,GAAG,CAAC;QACb,CAAC,CAAC,MAAM;aACD,GAAG,CACA,CAAC,CAAC,EAAE,EAAE,CACF,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CACpF;aACA,IAAI,CAAC,IAAI,CAAC;QACjB,CAAC,CAAC,UAAU,CAAA;IAEpB,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,qBAAqB,SAAS,oCAAoC,EAAE,CAAA;IACrH,MAAM,IAAI,GAAG,kBAAkB,KAAK,CAAC,IAAI,wBAAwB,YAAY,mCAAmC,aAAa,mCAAmC,UAAU,0DAA0D,CAAA;IACpO,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC5C,SAA8B;IAE9B,OAAO,QAAQ,CAA+B;QAC1C,EAAE,EAAE,SAAS,CAAC,qBAAqB;QACnC,SAAS,EAAE;YACP,SAAS,CAAC,sBAAsB;YAChC,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;YAC3C,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;SAC9C;QACD,YAAY,EAAE,mBAAmB,CAAC,SAAS,CAAC;QAC5C,KAAK,EAAE,4BAA4B;QACnC,eAAe,EAAE,gCAAgC;QACjD,WAAW;KACd,CAAC,CAAA;AACN,CAAC"}
1
+ {"version":3,"file":"claim-canonicalization.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-canonicalization.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qDAAqD;AACrD,oDAAoD;AACpD,iCAAiC;AACjC,kEAAkE;AAClE,6DAA6D;AAC7D,6DAA6D;A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A;IACrH,MAAM,IAAI,GAAG,kBAAkB,KAAK,CAAC,IAAI,wBAAwB,YAAY,mCAAmC,aAAa,mCAAmC,UAAU,0DAA0D,CAAA;IACpO,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,MAAM,qCAAqC,GAA6B;IAC3E,eAAe,EAAE,gCAAgC;CACpD,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gCAAgC,CAC5C,SAA8B,EAC9B,OAAkC;IAElC,OAAO,QAAQ,CAA+B;QAC1C,EAAE,EAAE,SAAS,CAAC,qBAAqB;QACnC,SAAS,EAAE;YACP,SAAS,CAAC,sBAAsB;YAChC,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;YAC3C,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;SAC9C;QACD,YAAY,EAAE,mBAAmB,CAAC,SAAS,CAAC;QAC5C,KAAK,EAAE,4BAA4B;QACnC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,eAAe,EACX,OAAO,EAAE,eAAe,IAAI,gCAAgC;QAChE,WAAW;KACd,CAAC,CAAA;AACN,CAAC"}
@@ -1,6 +1,12 @@
1
1
  import { type TClaimMentionExtractionOutput } from "./schemas.js";
2
2
  import type { TStage } from "../../../lib/pipelines/types.js";
3
+ import type { TLlmStageOptionsOverride } from "../shared/types.js";
3
4
  export declare const CLAIM_MENTION_EXTRACTION_MODEL = "gpt-5.4";
4
5
  export declare const CLAIM_MENTION_EXTRACTION_SYSTEM_PROMPT = "You extract textual \"claim mentions\" from segments of an argument. A mention is any contiguous span of text that asserts a proposition the author is making \u2014 a sentence-or-clause-sized chunk that a reader would read as a single assertion.\n\nReturn an object with a single key `mentions` whose value is the array of extracted mentions. For each mention emit:\n- a fresh \"mentionId\" (m1, m2, ...; unique across all segments)\n- the \"segmentId\" the mention belongs to\n- the verbatim \"text\" of the mention (copy from the input \u2014 do not rewrite)\n- the character \"span\" (an object with \"start\" inclusive, \"end\" exclusive) relative to the SEGMENT'S TEXT (not the original input)\n\nA single segment can produce multiple mentions when it asserts multiple things. Most segments produce one mention. Do NOT deduplicate \u2014 if the same proposition is reasserted in a later segment, emit it as a separate mention there too. Do NOT classify the mention. Do NOT include connectives, hedges, or discourse markers in the span when they are not part of the asserted proposition.\n\nIf a segment is purely a discourse marker (e.g., \"Therefore,\" or \"Moreover,\"), emit no mention for it. If there are no mentions at all, return `{ \"mentions\": [] }`.";
6
+ /** Internal default knobs for the claim-mention-extraction stage. */
7
+ export declare const CLAIM_MENTION_EXTRACTION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
8
+ /** Build the claim-mention-extraction stage with optional caller overrides. */
9
+ export declare function createClaimMentionExtractionStage(options?: TLlmStageOptionsOverride): TStage<TClaimMentionExtractionOutput>;
10
+ /** Backward-compatible default-options stage. */
5
11
  export declare const claimMentionExtractionStage: TStage<TClaimMentionExtractionOutput>;
6
12
  //# sourceMappingURL=claim-mention-extraction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim-mention-extraction.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-mention-extraction.ts"],"names":[],"mappings":"AAOA,OAAO,EAGH,KAAK,6BAA6B,EAErC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAE5E,eAAO,MAAM,8BAA8B,YAAY,CAAA;AAEvD,eAAO,MAAM,sCAAsC,svCAUoH,CAAA;AAavK,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAOxE,CAAA"}
1
+ {"version":3,"file":"claim-mention-extraction.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-mention-extraction.ts"],"names":[],"mappings":"AAOA,OAAO,EAGH,KAAK,6BAA6B,EAErC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAElE,eAAO,MAAM,8BAA8B,YAAY,CAAA;AAEvD,eAAO,MAAM,sCAAsC,svCAUoH,CAAA;AAavK,qEAAqE;AACrE,eAAO,MAAM,uCAAuC,EAAE,wBAChD,CAAA;AAEN,+EAA+E;AAC/E,wBAAgB,iCAAiC,CAC7C,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,6BAA6B,CAAC,CAUvC;AAED,iDAAiD;AACjD,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CACvC,CAAA"}
@@ -28,11 +28,20 @@ function buildPrompt(ctx) {
28
28
  const user = `Segments:\n\n${renderedSegments}\n\nExtract every claim mention.`;
29
29
  return { system: markedSystem, user };
30
30
  }
31
- export const claimMentionExtractionStage = llmStage({
32
- id: STAGE_IDS.claimMentionExtraction,
33
- dependsOn: [STAGE_IDS.segmentation],
34
- outputSchema: ClaimMentionExtractionOutputSchema,
35
- model: CLAIM_MENTION_EXTRACTION_MODEL,
36
- buildPrompt,
37
- });
31
+ /** Internal default knobs for the claim-mention-extraction stage. */
32
+ export const CLAIM_MENTION_EXTRACTION_STAGE_DEFAULTS = {};
33
+ /** Build the claim-mention-extraction stage with optional caller overrides. */
34
+ export function createClaimMentionExtractionStage(options) {
35
+ return llmStage({
36
+ id: STAGE_IDS.claimMentionExtraction,
37
+ dependsOn: [STAGE_IDS.segmentation],
38
+ outputSchema: ClaimMentionExtractionOutputSchema,
39
+ model: CLAIM_MENTION_EXTRACTION_MODEL,
40
+ maxOutputTokens: options?.maxOutputTokens,
41
+ reasoningEffort: options?.reasoningEffort,
42
+ buildPrompt,
43
+ });
44
+ }
45
+ /** Backward-compatible default-options stage. */
46
+ export const claimMentionExtractionStage = createClaimMentionExtractionStage();
38
47
  //# sourceMappingURL=claim-mention-extraction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim-mention-extraction.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-mention-extraction.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,mEAAmE;AACnE,+DAA+D;AAC/D,2BAA2B;AAE3B,OAAO,EACH,SAAS,EACT,kCAAkC,GAGrC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAGlE,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAA;AAEvD,MAAM,CAAC,MAAM,sCAAsC,GAAG;;;;;;;;;;uKAUiH,CAAA;AAEvK,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,YAAY,EAAE,QAAQ,IAAI,EAAE,CAAA;IAC7C,MAAM,gBAAgB,GAAG,QAAQ;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,sBAAsB,SAAS,sCAAsC,EAAE,CAAA;IACxH,MAAM,IAAI,GAAG,gBAAgB,gBAAgB,kCAAkC,CAAA;IAC/E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GACpC,QAAQ,CAAgC;IACpC,EAAE,EAAE,SAAS,CAAC,sBAAsB;IACpC,SAAS,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;IACnC,YAAY,EAAE,kCAAkC;IAChD,KAAK,EAAE,8BAA8B;IACrC,WAAW;CACd,CAAC,CAAA"}
1
+ {"version":3,"file":"claim-mention-extraction.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-mention-extraction.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,mEAAmE;AACnE,+DAA+D;AAC/D,2BAA2B;AAE3B,OAAO,EACH,SAAS,EACT,kCAAkC,GAGrC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAIlE,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAA;AAEvD,MAAM,CAAC,MAAM,sCAAsC,GAAG;;;;;;;;;;uKAUiH,CAAA;AAEvK,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,YAAY,EAAE,QAAQ,IAAI,EAAE,CAAA;IAC7C,MAAM,gBAAgB,GAAG,QAAQ;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,sBAAsB,SAAS,sCAAsC,EAAE,CAAA;IACxH,MAAM,IAAI,GAAG,gBAAgB,gBAAgB,kCAAkC,CAAA;IAC/E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,uCAAuC,GAChD,EAAE,CAAA;AAEN,+EAA+E;AAC/E,MAAM,UAAU,iCAAiC,CAC7C,OAAkC;IAElC,OAAO,QAAQ,CAAgC;QAC3C,EAAE,EAAE,SAAS,CAAC,sBAAsB;QACpC,SAAS,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;QACnC,YAAY,EAAE,kCAAkC;QAChD,KAAK,EAAE,8BAA8B;QACrC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,WAAW;KACd,CAAC,CAAA;AACN,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,2BAA2B,GACpC,iCAAiC,EAAE,CAAA"}
@@ -1,6 +1,12 @@
1
1
  import { type TClaimTypeClassificationOutput } from "./schemas.js";
2
2
  import type { TStage } from "../../../lib/pipelines/types.js";
3
+ import type { TLlmStageOptionsOverride } from "../shared/types.js";
3
4
  export declare const CLAIM_TYPE_CLASSIFICATION_MODEL = "gpt-5.4";
4
5
  export declare const CLAIM_TYPE_CLASSIFICATION_SYSTEM_PROMPT = "You confirm or revise the type of each canonical claim in an argument-ingestion pipeline.\n\nReturn an object with a single key `classifications` whose value is an array of per-claim entries. For each canonical claim you receive (id, the canonicalizer's draft `type`, and the claim's body/title/url/axiom fields), emit one entry with:\n- `miniId` \u2014 the canonical claim's miniId (copy verbatim)\n- `type` \u2014 one of \"normal\", \"citation\", \"axiomatic\"\n- `sourceString` \u2014 populate when type is \"citation\" with the source label (or url) the claim is built on; null otherwise\n\nUse the supplied detected citation sources + axiom indicators as evidence. Override the canonicalizer's draft only when the evidence clearly contradicts it. The default is to confirm the draft. Be conservative \u2014 a wrong override here cascades into wrong support edges downstream.\n\nEvery input claim must appear in `classifications` exactly once.\n\n## Type rules\n\n- `\"normal\"` \u2014 primary reasoning content; the default.\n- `\"citation\"` \u2014 content is \"the cited source says/shows X\" AND a citation source covers the claim. The claim's title/body summarizes what the source asserts; the URL (when present) names the source.\n- `\"axiomatic\"` \u2014 content is invoked as self-evidently true AND an axiom indicator (e.g. \"by definition\") covers or precedes the claim.";
6
+ /** Internal default knobs for the claim-type-classification stage. */
7
+ export declare const CLAIM_TYPE_CLASSIFICATION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
8
+ /** Build the claim-type-classification stage with optional caller overrides. */
9
+ export declare function createClaimTypeClassificationStage(options?: TLlmStageOptionsOverride): TStage<TClaimTypeClassificationOutput>;
10
+ /** Backward-compatible default-options stage. */
5
11
  export declare const claimTypeClassificationStage: TStage<TClaimTypeClassificationOutput>;
6
12
  //# sourceMappingURL=claim-type-classification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim-type-classification.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-type-classification.ts"],"names":[],"mappings":"AAOA,OAAO,EAMH,KAAK,8BAA8B,EACtC,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAE5E,eAAO,MAAM,+BAA+B,YAAY,CAAA;AAExD,eAAO,MAAM,uCAAuC,82CAesF,CAAA;AAqD1I,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,8BAA8B,CAW1E,CAAA"}
1
+ {"version":3,"file":"claim-type-classification.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-type-classification.ts"],"names":[],"mappings":"AAOA,OAAO,EAMH,KAAK,8BAA8B,EACtC,MAAM,cAAc,CAAA;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAElE,eAAO,MAAM,+BAA+B,YAAY,CAAA;AAExD,eAAO,MAAM,uCAAuC,82CAesF,CAAA;AAqD1I,sEAAsE;AACtE,eAAO,MAAM,wCAAwC,EAAE,wBACjD,CAAA;AAEN,gFAAgF;AAChF,wBAAgB,kCAAkC,CAC9C,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,8BAA8B,CAAC,CAcxC;AAED,iDAAiD;AACjD,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,8BAA8B,CACxC,CAAA"}
@@ -53,15 +53,24 @@ function buildPrompt(ctx) {
53
53
  const user = `Canonical claims (with the canonicalizer's draft type):\n${claimLines}\n\nDetected citation sources:\n${citationLines}\n\nDetected axiom indicators:\n${axiomLines}\n\nEmit the per-claim type map.`;
54
54
  return { system: markedSystem, user };
55
55
  }
56
- export const claimTypeClassificationStage = llmStage({
57
- id: STAGE_IDS.claimTypeClassification,
58
- dependsOn: [
59
- STAGE_IDS.claimCanonicalization,
60
- optional(STAGE_IDS.citationSourceDetection),
61
- optional(STAGE_IDS.axiomIndicatorDetection),
62
- ],
63
- outputSchema: ClaimTypeClassificationOutputSchema,
64
- model: CLAIM_TYPE_CLASSIFICATION_MODEL,
65
- buildPrompt,
66
- });
56
+ /** Internal default knobs for the claim-type-classification stage. */
57
+ export const CLAIM_TYPE_CLASSIFICATION_STAGE_DEFAULTS = {};
58
+ /** Build the claim-type-classification stage with optional caller overrides. */
59
+ export function createClaimTypeClassificationStage(options) {
60
+ return llmStage({
61
+ id: STAGE_IDS.claimTypeClassification,
62
+ dependsOn: [
63
+ STAGE_IDS.claimCanonicalization,
64
+ optional(STAGE_IDS.citationSourceDetection),
65
+ optional(STAGE_IDS.axiomIndicatorDetection),
66
+ ],
67
+ outputSchema: ClaimTypeClassificationOutputSchema,
68
+ model: CLAIM_TYPE_CLASSIFICATION_MODEL,
69
+ maxOutputTokens: options?.maxOutputTokens,
70
+ reasoningEffort: options?.reasoningEffort,
71
+ buildPrompt,
72
+ });
73
+ }
74
+ /** Backward-compatible default-options stage. */
75
+ export const claimTypeClassificationStage = createClaimTypeClassificationStage();
67
76
  //# sourceMappingURL=claim-type-classification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim-type-classification.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-type-classification.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,qEAAqE;AACrE,uEAAuE;AAEvE,OAAO,EACH,SAAS,EACT,mCAAmC,GAKtC,MAAM,cAAc,CAAA;AACrB,OAAO,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AAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1H;aACA,IAAI,CAAC,IAAI,CAAC;QACjB,CAAC,CAAC,UAAU,CAAA;IACpB,MAAM,UAAU,GACZ,MAAM,CAAC,MAAM,GAAG,CAAC;QACb,CAAC,CAAC,MAAM;aACD,GAAG,CACA,CAAC,CAAC,EAAE,EAAE,CACF,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CACpF;aACA,IAAI,CAAC,IAAI,CAAC;QACjB,CAAC,CAAC,UAAU,CAAA;IAEpB,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,uBAAuB,SAAS,uCAAuC,EAAE,CAAA;IAC1H,MAAM,IAAI,GAAG,4DAA4D,UAAU,mCAAmC,aAAa,mCAAmC,UAAU,kCAAkC,CAAA;IAClN,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GACrC,QAAQ,CAAiC;IACrC,EAAE,EAAE,SAAS,CAAC,uBAAuB;IACrC,SAAS,EAAE;QACP,SAAS,CAAC,qBAAqB;QAC/B,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;QAC3C,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;KAC9C;IACD,YAAY,EAAE,mCAAmC;IACjD,KAAK,EAAE,+BAA+B;IACtC,WAAW;CACd,CAAC,CAAA"}
1
+ {"version":3,"file":"claim-type-classification.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/claim-type-classification.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,q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tC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,eAAe,EAAE,OAAO,EAAE,eAAe;QACzC,WAAW;KACd,CAAC,CAAA;AACN,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,4BAA4B,GACrC,kCAAkC,EAAE,CAAA"}
@@ -1,20 +1,27 @@
1
1
  import { type TConclusionSelectionOutput } from "./schemas.js";
2
2
  import type { TStage } from "../../../lib/pipelines/types.js";
3
+ import type { TLlmStageOptionsOverride } from "../shared/types.js";
3
4
  export declare const CONCLUSION_SELECTION_MODEL = "gpt-5.5";
4
5
  export declare const CONCLUSION_SELECTION_REASONING: "minimal" | "low" | "medium" | "high";
5
6
  export declare const CONCLUSION_SELECTION_NO_CONCLUSION_FAILURE_CODE = "NO_SINGLE_CONCLUSION";
6
7
  export declare const CONCLUSION_SELECTION_SYSTEM_PROMPT = "You select the single 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 support relation graph from `relation-extraction`\n\nEmit:\n- `conclusionMiniId` \u2014 the canonical claim miniId of the conclusion, OR `null` when no single claim is clearly the conclusion\n- `rationale` \u2014 a one-sentence explanation of your pick (or your inability to pick one)\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.\n2. If multiple distinct claims are each terminal AND each could plausibly be THE point of the argument (genuinely ambiguous), return null with a rationale naming the contenders.\n3. Citation-typed and axiomatic-typed claims are never conclusions \u2014 they are always sources of support.\n4. If no claim is supported by any relation (a single-statement input), return null; there is no argument to select a conclusion from.\n\nThe default disposition is \"select\"; only return null when ambiguity is genuine. Forcing a wrong choice is worse than admitting \"no single conclusion could be selected\" \u2014 downstream stages handle the null cleanly.";
8
+ /** Internal default knobs for the conclusion-selection stage. */
9
+ export declare const CONCLUSION_SELECTION_STAGE_DEFAULTS: TLlmStageOptionsOverride;
7
10
  /**
8
- * `conclusionSelectionStage` wraps the inner `llmStage` so that when
9
- * the LLM returns `conclusionMiniId: null`, the stage emits a
11
+ * Build the conclusion-selection stage with optional caller
12
+ * overrides. The stage wraps an inner `llmStage` so that when the LLM
13
+ * returns `conclusionMiniId: null`, it also emits a
10
14
  * `ProcessingFailure` with code `NO_SINGLE_CONCLUSION` via
11
15
  * `ctx.addFailure` (spec §7.2 row 10). The stage still completes
12
16
  * successfully — the null output flows through `formula-compilation`
13
- * (which emits `conclusionPremiseMiniId: null`) into `finalize-response-v2`
14
- * (which assembles `{ argument: null, failureText: "No single
15
- * conclusion could be selected." }`). The added failure is a
16
- * UI-rendering hint, not a task-outcome signal; severity is `warning`
17
- * to match the informational-only role of finalize's failureText path.
17
+ * (which emits `conclusionPremiseMiniId: null`) into
18
+ * `finalize-response-v2` (which assembles `{ argument: null,
19
+ * failureText: "No single conclusion could be selected." }`). The
20
+ * added failure is a UI-rendering hint, not a task-outcome signal;
21
+ * severity is `warning` to match the informational-only role of
22
+ * finalize's failureText path.
18
23
  */
24
+ export declare function createConclusionSelectionStage(options?: TLlmStageOptionsOverride): TStage<TConclusionSelectionOutput>;
25
+ /** Backward-compatible default-options stage. */
19
26
  export declare const conclusionSelectionStage: TStage<TConclusionSelectionOutput>;
20
27
  //# sourceMappingURL=conclusion-selection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conclusion-selection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/conclusion-selection.ts"],"names":[],"mappings":"AAWA,OAAO,EAIH,KAAK,0BAA0B,EAElC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAE5E,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,szCAiBuK,CAAA;AA2CtN;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAmBvE,CAAA"}
1
+ {"version":3,"file":"conclusion-selection.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/conclusion-selection.ts"],"names":[],"mappings":"AAWA,OAAO,EAIH,KAAK,0BAA0B,EAElC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAElE,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,szCAiBuK,CAAA;AA8BtN,iEAAiE;AACjE,eAAO,MAAM,mCAAmC,EAAE,wBAEjD,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAC1C,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,0BAA0B,CAAC,CAkCpC;AAED,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CACpC,CAAA"}