@proposit/proposit-core 3.3.0 → 3.4.1
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/README.md +99 -2
- package/dist/cli/commands/expressions.d.ts.map +1 -1
- package/dist/cli/commands/expressions.js +44 -0
- package/dist/cli/commands/expressions.js.map +1 -1
- package/dist/cli/commands/origins.d.ts +3 -0
- package/dist/cli/commands/origins.d.ts.map +1 -0
- package/dist/cli/commands/origins.js +264 -0
- package/dist/cli/commands/origins.js.map +1 -0
- package/dist/cli/commands/premises.d.ts.map +1 -1
- package/dist/cli/commands/premises.js +18 -2
- package/dist/cli/commands/premises.js.map +1 -1
- package/dist/cli/engine.d.ts.map +1 -1
- package/dist/cli/engine.js +5 -2
- package/dist/cli/engine.js.map +1 -1
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +1 -0
- package/dist/cli/router.js.map +1 -1
- package/dist/cli/schemata.d.ts +2 -0
- package/dist/cli/schemata.d.ts.map +1 -1
- package/dist/cli/schemata.js +14 -1
- package/dist/cli/schemata.js.map +1 -1
- package/dist/cli/storage/libraries.d.ts +4 -0
- package/dist/cli/storage/libraries.d.ts.map +1 -1
- package/dist/cli/storage/libraries.js +19 -0
- package/dist/cli/storage/libraries.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/extensions/basics/schemata.d.ts +2 -0
- package/dist/extensions/basics/schemata.d.ts.map +1 -1
- package/dist/extensions/citations/ieee/index.d.ts +1 -0
- package/dist/extensions/citations/ieee/index.d.ts.map +1 -1
- package/dist/extensions/citations/ieee/index.js +1 -0
- package/dist/extensions/citations/ieee/index.js.map +1 -1
- package/dist/extensions/citations/ieee/origin-document.d.ts +452 -0
- package/dist/extensions/citations/ieee/origin-document.d.ts.map +1 -0
- package/dist/extensions/citations/ieee/origin-document.js +25 -0
- package/dist/extensions/citations/ieee/origin-document.js.map +1 -0
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts +24 -0
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/finalize-response-v2.js +249 -8
- package/dist/extensions/pipelines/base/finalize-response-v2.js.map +1 -1
- package/dist/extensions/pipelines/base/index.d.ts +3 -1
- package/dist/extensions/pipelines/base/index.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/index.js +2 -1
- package/dist/extensions/pipelines/base/index.js.map +1 -1
- package/dist/extensions/pipelines/base/source-anchors.d.ts +58 -0
- package/dist/extensions/pipelines/base/source-anchors.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/source-anchors.js +209 -0
- package/dist/extensions/pipelines/base/source-anchors.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/canonical-stages.js +1 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scholar/scholar.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scholar/scholar.js +11 -1
- package/dist/extensions/pipelines/ingestion/scholar/scholar.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts +27 -11
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js +56 -22
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts +25 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js +25 -3
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/scribe.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js +25 -4
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js.map +1 -1
- 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 +1 -1
- package/dist/lib/consts.d.ts.map +1 -1
- package/dist/lib/consts.js +27 -0
- package/dist/lib/consts.js.map +1 -1
- package/dist/lib/core/argument-engine.d.ts +5 -3
- package/dist/lib/core/argument-engine.d.ts.map +1 -1
- package/dist/lib/core/argument-engine.js +7 -4
- package/dist/lib/core/argument-engine.js.map +1 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +2 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/core/interfaces/index.d.ts +1 -1
- package/dist/lib/core/interfaces/index.d.ts.map +1 -1
- package/dist/lib/core/interfaces/library.interfaces.d.ts +72 -1
- package/dist/lib/core/interfaces/library.interfaces.d.ts.map +1 -1
- package/dist/lib/core/origin-library.d.ts +127 -0
- package/dist/lib/core/origin-library.d.ts.map +1 -0
- package/dist/lib/core/origin-library.js +520 -0
- package/dist/lib/core/origin-library.js.map +1 -0
- package/dist/lib/core/premise-engine.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.js +20 -3
- package/dist/lib/core/premise-engine.js.map +1 -1
- package/dist/lib/core/proposit-core.d.ts +15 -8
- package/dist/lib/core/proposit-core.d.ts.map +1 -1
- package/dist/lib/core/proposit-core.js +28 -3
- package/dist/lib/core/proposit-core.js.map +1 -1
- package/dist/lib/grammar/types.d.ts +2 -2
- package/dist/lib/grammar/types.d.ts.map +1 -1
- package/dist/lib/grammar/types.js +2 -1
- package/dist/lib/grammar/types.js.map +1 -1
- package/dist/lib/grammar/validators/presentable.d.ts +19 -0
- package/dist/lib/grammar/validators/presentable.d.ts.map +1 -1
- package/dist/lib/grammar/validators/presentable.js +57 -0
- package/dist/lib/grammar/validators/presentable.js.map +1 -1
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/parsing/argument-parser.d.ts.map +1 -1
- package/dist/lib/parsing/argument-parser.js +4 -3
- package/dist/lib/parsing/argument-parser.js.map +1 -1
- package/dist/lib/schemata/index.d.ts +1 -0
- package/dist/lib/schemata/index.d.ts.map +1 -1
- package/dist/lib/schemata/index.js +1 -0
- package/dist/lib/schemata/index.js.map +1 -1
- package/dist/lib/schemata/origin.d.ts +48 -0
- package/dist/lib/schemata/origin.d.ts.map +1 -0
- package/dist/lib/schemata/origin.js +102 -0
- package/dist/lib/schemata/origin.js.map +1 -0
- package/dist/lib/schemata/propositional.d.ts +6 -0
- package/dist/lib/schemata/propositional.d.ts.map +1 -1
- package/dist/lib/schemata/propositional.js +13 -0
- package/dist/lib/schemata/propositional.js.map +1 -1
- package/dist/lib/types/checksum.d.ts +3 -0
- package/dist/lib/types/checksum.d.ts.map +1 -1
- package/dist/lib/types/validation.d.ts +19 -1
- package/dist/lib/types/validation.d.ts.map +1 -1
- package/dist/lib/types/validation.js +19 -0
- package/dist/lib/types/validation.js.map +1 -1
- package/dist/lib/utils/collections.d.ts +15 -0
- package/dist/lib/utils/collections.d.ts.map +1 -1
- package/dist/lib/utils/collections.js +17 -0
- package/dist/lib/utils/collections.js.map +1 -1
- package/dist/lib/utils/origin-text.d.ts +62 -0
- package/dist/lib/utils/origin-text.d.ts.map +1 -0
- package/dist/lib/utils/origin-text.js +204 -0
- package/dist/lib/utils/origin-text.js.map +1 -0
- package/dist/lib/utils/sha256.d.ts +6 -0
- package/dist/lib/utils/sha256.d.ts.map +1 -0
- package/dist/lib/utils/sha256.js +98 -0
- package/dist/lib/utils/sha256.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-anchors.js","sourceRoot":"","sources":["../../../../src/extensions/pipelines/base/source-anchors.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,wEAAwE;AACxE,yDA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M,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC5B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAE1C,IAAI,UAAU,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC1C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAA;QAC/C,IAAI,OAAO,KAAK,SAAS;YAAE,UAAU,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACrE,CAAC;IACD,gEAAgE;IAChE,kDAAkD;IAClD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAC5B,CAAC,KAAK,EAAE,EAAE,CACN,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;QACxC,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAC7C,CAAA;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC7C,OAAO,KAAK,KAAK,SAAS;QACtB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC;YACI,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;YAClD,WAAW,EAAE,MAAM,CAAC,MAAM;SAC7B,CAAA;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-stages.d.ts","sourceRoot":"","sources":["../../../../src/extensions/pipelines/ingestion/canonical-stages.ts"],"names":[],"mappings":"AASA,2DAA2D;AAC3D,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAaxD,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"canonical-stages.d.ts","sourceRoot":"","sources":["../../../../src/extensions/pipelines/ingestion/canonical-stages.ts"],"names":[],"mappings":"AASA,2DAA2D;AAC3D,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAaxD,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAYvD,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC/B,SAAS,MAAM,EAAE,CAMnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-stages.js","sourceRoot":"","sources":["../../../../src/extensions/pipelines/ingestion/canonical-stages.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,+EAA+E;AAC/E,2DAA2D;AAC3D,sCAAsC;AAEtC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,2BAA2B,GAAsB;IAC1D,cAAc;IACd,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B,wBAAwB;IACxB,2BAA2B;IAC3B,4BAA4B;IAC5B,qBAAqB;IACrB,qBAAqB;IACrB,sBAAsB;IACtB,qBAAqB;IACrB,oBAAoB;CACvB,CAAA;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IACzD,SAAS;IACT,wBAAwB;IACxB,2BAA2B;IAC3B,4BAA4B;IAC5B,qBAAqB;IACrB,kBAAkB;IAClB,qBAAqB;IACrB,sBAAsB;IACtB,qBAAqB;IACrB,oBAAoB;CACvB,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAChC,UAA8B;IAE9B,IAAI,UAAU,KAAK,4BAA4B;QAC3C,OAAO,2BAA2B,CAAA;IACtC,IAAI,UAAU,KAAK,2BAA2B;QAC1C,OAAO,0BAA0B,CAAA;IACrC,OAAO,EAAE,CAAA;AACb,CAAC"}
|
|
1
|
+
{"version":3,"file":"canonical-stages.js","sourceRoot":"","sources":["../../../../src/extensions/pipelines/ingestion/canonical-stages.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,+EAA+E;AAC/E,2DAA2D;AAC3D,sCAAsC;AAEtC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,2BAA2B,GAAsB;IAC1D,cAAc;IACd,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B,wBAAwB;IACxB,2BAA2B;IAC3B,4BAA4B;IAC5B,qBAAqB;IACrB,qBAAqB;IACrB,sBAAsB;IACtB,qBAAqB;IACrB,oBAAoB;CACvB,CAAA;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IACzD,SAAS;IACT,wBAAwB;IACxB,2BAA2B;IAC3B,0BAA0B;IAC1B,4BAA4B;IAC5B,qBAAqB;IACrB,kBAAkB;IAClB,qBAAqB;IACrB,sBAAsB;IACtB,qBAAqB;IACrB,oBAAoB;CACvB,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAChC,UAA8B;IAE9B,IAAI,UAAU,KAAK,4BAA4B;QAC3C,OAAO,2BAA2B,CAAA;IACtC,IAAI,UAAU,KAAK,2BAA2B;QAC1C,OAAO,0BAA0B,CAAA;IACrC,OAAO,EAAE,CAAA;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scholar.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scholar/scholar.ts"],"names":[],"mappings":"AAgCA,OAAO,IAAI,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"scholar.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scholar/scholar.ts"],"names":[],"mappings":"AAgCA,OAAO,IAAI,MAAM,SAAS,CAAA;AA2B1B,OAAO,KAAK,EAAE,SAAS,EAAU,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAG/E,OAAO,KAAK,EACR,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACvB,MAAM,qBAAqB,CAAA;AAK5B;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;EAEjC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,6BAA6B,GAAG;IACxC,GAAG,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,mBAAmB,EAC9B,OAAO,CAAC,EAAE,6BAA6B,GACxC,SAAS,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAiHrD"}
|
|
@@ -99,8 +99,18 @@ export function createScholarPipeline(extension, options) {
|
|
|
99
99
|
optional(STAGE_IDS.conclusionSelection),
|
|
100
100
|
optional(STAGE_IDS.formulaValidation),
|
|
101
101
|
optional(STAGE_IDS.claimReferenceValidation),
|
|
102
|
+
// Read only for the source anchors finalize attaches to
|
|
103
|
+
// claims; a missing segmentation or mention output costs
|
|
104
|
+
// the anchors, never the argument.
|
|
105
|
+
optional(STAGE_IDS.segmentation),
|
|
106
|
+
optional(STAGE_IDS.claimMentionExtraction),
|
|
102
107
|
],
|
|
103
|
-
run: (ctx) => finalizeResponseV2({
|
|
108
|
+
run: (ctx) => finalizeResponseV2({
|
|
109
|
+
ctx,
|
|
110
|
+
extension,
|
|
111
|
+
segmentation: ctx.get(STAGE_IDS.segmentation),
|
|
112
|
+
mentions: ctx.get(STAGE_IDS.claimMentionExtraction),
|
|
113
|
+
}),
|
|
104
114
|
},
|
|
105
115
|
};
|
|
106
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scholar.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scholar/scholar.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,kEAAkE;AAClE,sEAAsE;AACtE,mEAAmE;AACnE,iDAAiD;AACjD,EAAE;AACF,OAAO;AACP,EAAE;AACF,iBAAiB;AACjB,gEAAgE;AAChE,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,qEAAqE;AACrE,8DAA8D;AAC9D,sEAAsE;AACtE,8DAA8D;AAC9D,qEAAqE;AACrE,8DAA8D;AAC9D,oEAAoE;AACpE,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,2DAA2D;AAE3D,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EACH,SAAS,EACT,6BAA6B,EAC7B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,uCAAuC,EACvC,wCAAwC,EACxC,wCAAwC,EACxC,qCAAqC,EACrC,wCAAwC,EACxC,kCAAkC,EAClC,mCAAmC,
|
|
1
|
+
{"version":3,"file":"scholar.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scholar/scholar.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,kEAAkE;AAClE,sEAAsE;AACtE,mEAAmE;AACnE,iDAAiD;AACjD,EAAE;AACF,OAAO;AACP,EAAE;AACF,iBAAiB;AACjB,gEAAgE;AAChE,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,qEAAqE;AACrE,8DAA8D;AAC9D,sEAAsE;AACtE,8DAA8D;AAC9D,q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AC,kBAAkB;gBAC5B,SAAS,CAAC,kBAAkB;gBAC5B,QAAQ,CAAC,SAAS,CAAC,uBAAuB,CAAC;gBAC3C,QAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC;gBACtC,QAAQ,CAAC,SAAS,CAAC,mBAAmB,CAAC;gBACvC,QAAQ,CAAC,SAAS,CAAC,iBAAiB,CAAC;gBACrC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC;gBAC5C,wDAAwD;gBACxD,yDAAyD;gBACzD,mCAAmC;gBACnC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC;gBAChC,QAAQ,CAAC,SAAS,CAAC,sBAAsB,CAAC;aAC7C;YACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CACT,kBAAkB,CAAC;gBACf,GAAG;gBACH,SAAS;gBACT,YAAY,EAAE,GAAG,CAAC,GAAG,CACjB,SAAS,CAAC,YAAY,CACzB;gBACD,QAAQ,EAAE,GAAG,CAAC,GAAG,CACb,SAAS,CAAC,sBAAsB,CACnC;aACJ,CAAC;SACT;KACJ,CAAA;AACL,CAAC"}
|
|
@@ -1,27 +1,43 @@
|
|
|
1
1
|
import type { TStage } from "../../../../lib/pipelines/types.js";
|
|
2
|
-
import { type TClaimCanonicalizationOutput, type TClaimTypeClassificationOutput } from "../../base/stages/index.js";
|
|
2
|
+
import { type TClaimCanonicalizationOutput, type TClaimMentionExtractionOutput, type TClaimTypeClassificationOutput } from "../../base/stages/index.js";
|
|
3
3
|
import type { TIngestionExtension, TLlmStageOptionsOverride } from "../../base/types.js";
|
|
4
|
+
import { type TScribeExtractOutput } from "./schemas.js";
|
|
4
5
|
export declare const EXTRACT_MODEL = "gpt-5.4-mini";
|
|
5
6
|
/** Internal default knobs for scribe's `extract` stage. */
|
|
6
7
|
export declare const EXTRACT_STAGE_DEFAULTS: TLlmStageOptionsOverride;
|
|
7
|
-
export declare const EXTRACT_SYSTEM_PROMPT = "You read a raw argument and emit its canonical claim set in one pass.\n\nFor each distinct proposition the author makes, emit one canonical claim. Two phrasings of the same proposition merge into a single claim.\n\
|
|
8
|
+
export declare const EXTRACT_SYSTEM_PROMPT = "You read a raw argument and emit its canonical claim set in one pass.\n\nFor each distinct proposition the author makes, emit one canonical claim. Two phrasings of the same proposition merge into a single claim.\n\nAlso emit `mentions` \u2014 where in the input each claim is stated. One entry per place a claim is made:\n- `mentionId` \u2014 \"<claim miniId>-m\" for the first mention of a claim, then \"-m2\", \"-m3\", ... for further ones (e.g. \"c1-m\", \"c1-m2\").\n- `text` \u2014 the span of the input that states the claim, COPIED CHARACTER FOR CHARACTER from the input. Never reword, summarize, translate, correct, or join separated passages with an ellipsis, and do not change capitalization or punctuation \u2014 copy the first character exactly as the input has it, upper- or lower-case. Prefer the shortest span that states the claim on its own \u2014 usually one sentence or clause. A span that is not present in the input verbatim is discarded, and the claim loses its link back to the source.\n- `span` \u2014 approximate `{ start, end }` character offsets of that text in the input. A rough estimate is fine; the text is what is trusted.\n- `segmentId` \u2014 the empty string.\n\nEach canonical claim carries:\n- `miniId` \u2014 assign in order: c1, c2, c3, ...\n- `mentionIds` \u2014 the `mentionId`s of every mention that states this claim.\n- `type` \u2014 \"normal\" (a primary proposition), \"citation\" (content is \"the cited source asserts X\"; populate `url` + `title`, and set `citationTypeGuess`), or \"axiomatic\" (invoked as self-evident; populate `axiom`).\n- `citationTypeGuess` (citation claims only) \u2014 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\", \u2026). Use \"unknown\" when no IEEE type fits or you cannot tell.\n- `suggestedSymbol` \u2014 a short PascalCase-or-snake_case identifier (letters/digits/underscores, starts with a letter or underscore, under 32 chars). Avoid single letters and generic names.\n- the extension fields your output schema requires (title, body, url, axiom \u2014 whichever apply to the claim's type).\n- `mentionToClaim` \u2014 one `{ \"mentionId\": \"...\", \"claimMiniId\": \"...\" }` entry per mention id you used.\n\nStyle:\n- Third-person, present-tense, active voice.\n- State the proposition itself \u2014 never \"The author claims that ...\". For a citation claim, the title summarizes what the source asserts.\n\nOutput ONLY the schema-shaped object. No prose.";
|
|
8
9
|
/**
|
|
9
10
|
* Build scribe's `extract` LLM stage. Its `outputSchema` is the
|
|
10
|
-
* per-extension canonicalization schema
|
|
11
|
-
* for the same extension-shaped claim
|
|
12
|
-
* scholar's canonicalizer produces —
|
|
13
|
-
* assemble empty claims
|
|
11
|
+
* per-extension canonicalization schema widened with the mention slot,
|
|
12
|
+
* so the cheap model is asked for the same extension-shaped claim
|
|
13
|
+
* records (title/body/url/axiom) scholar's canonicalizer produces —
|
|
14
|
+
* without which finalize would assemble empty claims — plus the quoted
|
|
15
|
+
* spans those claims came from.
|
|
14
16
|
*/
|
|
15
|
-
export declare function createExtractStage(extension: TIngestionExtension, options?: TLlmStageOptionsOverride): TStage<
|
|
17
|
+
export declare function createExtractStage(extension: TIngestionExtension, options?: TLlmStageOptionsOverride): TStage<TScribeExtractOutput>;
|
|
16
18
|
/**
|
|
17
19
|
* Adapter — republish `extract`'s canonical claims under the
|
|
18
20
|
* canonicalization slot scholar's deterministic stages + finalize read.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
*
|
|
22
|
+
* It picks the two keys rather than passing the whole output through:
|
|
23
|
+
* the canonicalization envelope is `additionalProperties: false`, so
|
|
24
|
+
* `extract`'s `mentions` would fail validation here. They reach finalize
|
|
25
|
+
* through the mention adapter below instead.
|
|
26
|
+
*
|
|
27
|
+
* Built per-extension because the canonicalization slot's schema carries
|
|
28
|
+
* the extension's claim fields.
|
|
23
29
|
*/
|
|
24
30
|
export declare function createExtractCanonicalizationAdapterStage(extension: TIngestionExtension): TStage<TClaimCanonicalizationOutput>;
|
|
31
|
+
/**
|
|
32
|
+
* Adapter — republish `extract`'s mentions under the mention slot
|
|
33
|
+
* finalize resolves into each claim's source anchors.
|
|
34
|
+
*
|
|
35
|
+
* Scribe has no segmentation stage, and needs none: a mention's `span`
|
|
36
|
+
* is only ever a tie-break hint between repeated occurrences, and with
|
|
37
|
+
* no segment to offset from, `buildAnchorByMentionId` falls back to the
|
|
38
|
+
* mention's own reported start. The quoted text is what is located.
|
|
39
|
+
*/
|
|
40
|
+
export declare const extractMentionAdapterStage: TStage<TClaimMentionExtractionOutput>;
|
|
25
41
|
/**
|
|
26
42
|
* Adapter — derive the classification slot from `extract`'s claim
|
|
27
43
|
* records: each canonical claim already carries its `type`, so the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-stage.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/extract-stage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extract-stage.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/extract-stage.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAKH,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACtC,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EACR,mBAAmB,EAEnB,wBAAwB,EAC3B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEH,KAAK,oBAAoB,EAC5B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,aAAa,iBAAiB,CAAA;AAE3C,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,EAAE,wBAEpC,CAAA;AAED,eAAO,MAAM,qBAAqB,2iFAuBc,CAAA;AAYhD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,mBAAmB,EAC9B,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,oBAAoB,CAAC,CAW9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yCAAyC,CACrD,SAAS,EAAE,mBAAmB,GAC/B,MAAM,CAAC,4BAA4B,CAAC,CAatC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,6BAA6B,CAUvE,CAAA;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,8BAA8B,CAmB/E,CAAA"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// scribe stage 1 — `extract`: one cheap LLM call that produces the
|
|
2
2
|
// canonical claim set (the same per-extension canonicalization shape
|
|
3
|
-
// scholar's `claim-canonicalization` stage emits)
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// scholar's `claim-canonicalization` stage emits) plus the mentions that
|
|
4
|
+
// locate each claim in the input, collapsing scholar's segmentation,
|
|
5
|
+
// claim-mention, citation-source, axiom-indicator, canonicalization, and
|
|
6
|
+
// type-classification stages.
|
|
6
7
|
//
|
|
7
8
|
// Because a stage writes exactly one output slot, `extract` is paired
|
|
8
|
-
// with
|
|
9
|
-
// the canonicalization and
|
|
10
|
-
// backend + `finalizeResponseV2` read.
|
|
9
|
+
// with three deterministic adapter stages that republish its parts under
|
|
10
|
+
// the canonicalization, classification, and mention slots scholar's
|
|
11
|
+
// deterministic backend + `finalizeResponseV2` read.
|
|
11
12
|
import { llmStage } from "../../../../lib/pipelines/stage-helpers.js";
|
|
12
13
|
import { deterministicStage } from "../../../../lib/pipelines/stage-helpers.js";
|
|
13
|
-
import { STAGE_IDS, buildResponseSchema, ClaimTypeClassificationOutputSchema, } from "../../base/stages/index.js";
|
|
14
|
+
import { STAGE_IDS, buildResponseSchema, ClaimMentionExtractionOutputSchema, ClaimTypeClassificationOutputSchema, } from "../../base/stages/index.js";
|
|
15
|
+
import { buildExtractOutputSchema, } from "./schemas.js";
|
|
14
16
|
export const EXTRACT_MODEL = "gpt-5.4-mini";
|
|
15
17
|
/** Internal default knobs for scribe's `extract` stage. */
|
|
16
18
|
export const EXTRACT_STAGE_DEFAULTS = {
|
|
@@ -20,14 +22,20 @@ export const EXTRACT_SYSTEM_PROMPT = `You read a raw argument and emit its canon
|
|
|
20
22
|
|
|
21
23
|
For each distinct proposition the author makes, emit one canonical claim. Two phrasings of the same proposition merge into a single claim.
|
|
22
24
|
|
|
25
|
+
Also emit \`mentions\` — where in the input each claim is stated. One entry per place a claim is made:
|
|
26
|
+
- \`mentionId\` — "<claim miniId>-m" for the first mention of a claim, then "-m2", "-m3", ... for further ones (e.g. "c1-m", "c1-m2").
|
|
27
|
+
- \`text\` — the span of the input that states the claim, COPIED CHARACTER FOR CHARACTER from the input. Never reword, summarize, translate, correct, or join separated passages with an ellipsis, and do not change capitalization or punctuation — copy the first character exactly as the input has it, upper- or lower-case. Prefer the shortest span that states the claim on its own — usually one sentence or clause. A span that is not present in the input verbatim is discarded, and the claim loses its link back to the source.
|
|
28
|
+
- \`span\` — approximate \`{ start, end }\` character offsets of that text in the input. A rough estimate is fine; the text is what is trusted.
|
|
29
|
+
- \`segmentId\` — the empty string.
|
|
30
|
+
|
|
23
31
|
Each canonical claim carries:
|
|
24
32
|
- \`miniId\` — assign in order: c1, c2, c3, ...
|
|
25
|
-
- \`mentionIds\` —
|
|
33
|
+
- \`mentionIds\` — the \`mentionId\`s of every mention that states this claim.
|
|
26
34
|
- \`type\` — "normal" (a primary proposition), "citation" (content is "the cited source asserts X"; populate \`url\` + \`title\`, and set \`citationTypeGuess\`), or "axiomatic" (invoked as self-evident; populate \`axiom\`).
|
|
27
35
|
- \`citationTypeGuess\` (citation claims only) — 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", …). Use "unknown" when no IEEE type fits or you cannot tell.
|
|
28
36
|
- \`suggestedSymbol\` — a short PascalCase-or-snake_case identifier (letters/digits/underscores, starts with a letter or underscore, under 32 chars). Avoid single letters and generic names.
|
|
29
37
|
- the extension fields your output schema requires (title, body, url, axiom — whichever apply to the claim's type).
|
|
30
|
-
- \`mentionToClaim\` — one \`{ "mentionId": "...", "claimMiniId": "..." }\` entry per
|
|
38
|
+
- \`mentionToClaim\` — one \`{ "mentionId": "...", "claimMiniId": "..." }\` entry per mention id you used.
|
|
31
39
|
|
|
32
40
|
Style:
|
|
33
41
|
- Third-person, present-tense, active voice.
|
|
@@ -37,21 +45,22 @@ Output ONLY the schema-shaped object. No prose.`;
|
|
|
37
45
|
function buildExtractPrompt(ctx) {
|
|
38
46
|
const input = ctx.input;
|
|
39
47
|
const system = `<!-- stage-id: ${STAGE_IDS.extract} -->\n${EXTRACT_SYSTEM_PROMPT}`;
|
|
40
|
-
const user = `Input text:\n\n${input.text}\n\nProduce the canonicalClaims + mentionToClaim object.`;
|
|
48
|
+
const user = `Input text:\n\n${input.text}\n\nProduce the canonicalClaims + mentions + mentionToClaim object.`;
|
|
41
49
|
return { system, user };
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* Build scribe's `extract` LLM stage. Its `outputSchema` is the
|
|
45
|
-
* per-extension canonicalization schema
|
|
46
|
-
* for the same extension-shaped claim
|
|
47
|
-
* scholar's canonicalizer produces —
|
|
48
|
-
* assemble empty claims
|
|
53
|
+
* per-extension canonicalization schema widened with the mention slot,
|
|
54
|
+
* so the cheap model is asked for the same extension-shaped claim
|
|
55
|
+
* records (title/body/url/axiom) scholar's canonicalizer produces —
|
|
56
|
+
* without which finalize would assemble empty claims — plus the quoted
|
|
57
|
+
* spans those claims came from.
|
|
49
58
|
*/
|
|
50
59
|
export function createExtractStage(extension, options) {
|
|
51
60
|
return llmStage({
|
|
52
61
|
id: STAGE_IDS.extract,
|
|
53
62
|
dependsOn: [],
|
|
54
|
-
outputSchema:
|
|
63
|
+
outputSchema: buildExtractOutputSchema(extension),
|
|
55
64
|
model: options?.model ?? EXTRACT_MODEL,
|
|
56
65
|
maxOutputTokens: options?.maxOutputTokens,
|
|
57
66
|
reasoningEffort: options?.reasoningEffort,
|
|
@@ -62,22 +71,47 @@ export function createExtractStage(extension, options) {
|
|
|
62
71
|
/**
|
|
63
72
|
* Adapter — republish `extract`'s canonical claims under the
|
|
64
73
|
* canonicalization slot scholar's deterministic stages + finalize read.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
74
|
+
*
|
|
75
|
+
* It picks the two keys rather than passing the whole output through:
|
|
76
|
+
* the canonicalization envelope is `additionalProperties: false`, so
|
|
77
|
+
* `extract`'s `mentions` would fail validation here. They reach finalize
|
|
78
|
+
* through the mention adapter below instead.
|
|
79
|
+
*
|
|
80
|
+
* Built per-extension because the canonicalization slot's schema carries
|
|
81
|
+
* the extension's claim fields.
|
|
69
82
|
*/
|
|
70
83
|
export function createExtractCanonicalizationAdapterStage(extension) {
|
|
71
84
|
return deterministicStage({
|
|
72
85
|
id: STAGE_IDS.claimCanonicalization,
|
|
73
86
|
dependsOn: [STAGE_IDS.extract],
|
|
74
87
|
outputSchema: buildResponseSchema(extension),
|
|
75
|
-
fn: (ctx) =>
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
fn: (ctx) => {
|
|
89
|
+
const extract = ctx.get(STAGE_IDS.extract);
|
|
90
|
+
return {
|
|
91
|
+
canonicalClaims: extract?.canonicalClaims ?? [],
|
|
92
|
+
mentionToClaim: extract?.mentionToClaim ?? [],
|
|
93
|
+
};
|
|
78
94
|
},
|
|
79
95
|
});
|
|
80
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Adapter — republish `extract`'s mentions under the mention slot
|
|
99
|
+
* finalize resolves into each claim's source anchors.
|
|
100
|
+
*
|
|
101
|
+
* Scribe has no segmentation stage, and needs none: a mention's `span`
|
|
102
|
+
* is only ever a tie-break hint between repeated occurrences, and with
|
|
103
|
+
* no segment to offset from, `buildAnchorByMentionId` falls back to the
|
|
104
|
+
* mention's own reported start. The quoted text is what is located.
|
|
105
|
+
*/
|
|
106
|
+
export const extractMentionAdapterStage = deterministicStage({
|
|
107
|
+
id: STAGE_IDS.claimMentionExtraction,
|
|
108
|
+
dependsOn: [STAGE_IDS.extract],
|
|
109
|
+
outputSchema: ClaimMentionExtractionOutputSchema,
|
|
110
|
+
fn: (ctx) => ({
|
|
111
|
+
mentions: ctx.get(STAGE_IDS.extract)?.mentions ??
|
|
112
|
+
[],
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
81
115
|
/**
|
|
82
116
|
* Adapter — derive the classification slot from `extract`'s claim
|
|
83
117
|
* records: each canonical claim already carries its `type`, so the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-stage.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/extract-stage.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"extract-stage.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/extract-stage.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AACrE,yEAAyE;AACzE,qEAAqE;AACrE,yEAAyE;AACzE,8BAA8B;AAC9B,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,oEAAoE;AACpE,qDAAqD;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAE/E,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,kCAAkC,EAClC,mCAAmC,GAItC,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EACH,wBAAwB,GAE3B,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAA;AAE3C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAA6B;IAC5D,KAAK,EAAE,aAAa;CACvB,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;gDAuBW,CAAA;AAEhD,SAAS,kBAAkB,CAAC,GAAkB;IAI1C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAwB,CAAA;IAC1C,MAAM,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AAS,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IAC9B,YAAY,EAAE,kCAAkC;IAChD,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACV,QAAQ,EACJ,GAAG,CAAC,GAAG,CAAuB,SAAS,CAAC,OAAO,CAAC,EAAE,QAAQ;YAC1D,EAAE;KACT,CAAC;CACL,CAAC,CAAA;AAEN;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC1C,kBAAkB,CAAiC;IAC/C,EAAE,EAAE,SAAS,CAAC,uBAAuB;IACrC,SAAS,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IAC9B,YAAY,EAAE,mCAAmC;IACjD,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;QACR,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CACjB,SAAS,CAAC,OAAO,CACpB,CAAA;QACD,MAAM,MAAM,GAAG,KAAK,EAAE,eAAe,IAAI,EAAE,CAAA;QAC3C,OAAO;YACH,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC9B,MAAM,GAAG,GAAI,CAA6B,CAAC,GAAG,CAAA;gBAC9C,MAAM,YAAY,GACd,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;gBAC1D,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,CAAA;YAC3D,CAAC,CAAC;SACL,CAAA;IACL,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
import Type, { type Static } from "typebox";
|
|
1
|
+
import Type, { type Static, type TSchema } from "typebox";
|
|
2
|
+
import type { TClaimCanonicalizationOutput, TClaimMentionExtractionOutput } from "../../base/stages/index.js";
|
|
3
|
+
import type { TIngestionExtension } from "../../base/types.js";
|
|
4
|
+
/**
|
|
5
|
+
* What `extract` returns: the canonicalization slot's payload and the
|
|
6
|
+
* mention slot's, in one object. Structural rather than a `Static<>`,
|
|
7
|
+
* because the schema is built per-extension.
|
|
8
|
+
*/
|
|
9
|
+
export type TScribeExtractOutput = TClaimCanonicalizationOutput & TClaimMentionExtractionOutput;
|
|
10
|
+
/**
|
|
11
|
+
* `extract`'s output: the per-extension canonicalization shape, plus the
|
|
12
|
+
* mentions whose quoted text becomes each claim's source anchor.
|
|
13
|
+
*
|
|
14
|
+
* The mentions ride along on the one stage that is given the input text,
|
|
15
|
+
* rather than coming from a stage of their own — scribe's whole point is
|
|
16
|
+
* that there are two LLM calls, and locating a claim in the text is not
|
|
17
|
+
* worth a third. Their item shape is scholar's, so the same finalize
|
|
18
|
+
* resolution reads them without a translation layer.
|
|
19
|
+
*
|
|
20
|
+
* The canonicalization envelope is `additionalProperties: false`, so the
|
|
21
|
+
* widened shape is a distinct schema rather than an extra key on the
|
|
22
|
+
* shared one — and the adapter that republishes the canonicalization slot
|
|
23
|
+
* has to narrow back to it. See `createExtractCanonicalizationAdapterStage`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildExtractOutputSchema(extension: TIngestionExtension): TSchema;
|
|
2
26
|
export declare const ScribeStructureOutputSchema: Type.TObject<{
|
|
3
27
|
relations: Type.TArray<Type.TObject<{
|
|
4
28
|
relationId: Type.TString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/schemas.ts"],"names":[],"mappings":"AAeA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/schemas.ts"],"names":[],"mappings":"AAeA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAA;AAMzD,OAAO,KAAK,EACR,4BAA4B,EAC5B,6BAA6B,EAChC,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,4BAA4B,GAC3D,6BAA6B,CAAA;AAEjC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,mBAAmB,GAC/B,OAAO,CAWT;AAMD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;EAOvC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -10,10 +10,32 @@
|
|
|
10
10
|
// relation-extraction + conclusion-selection slots.
|
|
11
11
|
//
|
|
12
12
|
// `extract`'s output schema is the per-extension canonicalization
|
|
13
|
-
// schema
|
|
14
|
-
// needs a bespoke schema
|
|
13
|
+
// schema widened with the mention slot (`buildExtractOutputSchema`);
|
|
14
|
+
// `structure` needs a bespoke schema. Both are defined here.
|
|
15
15
|
import Type, {} from "typebox";
|
|
16
|
-
import { RelationExtractionOutputSchema } from "../../base/stages/index.js";
|
|
16
|
+
import { ClaimMentionExtractionOutputSchema, RelationExtractionOutputSchema, buildResponseSchema, } from "../../base/stages/index.js";
|
|
17
|
+
/**
|
|
18
|
+
* `extract`'s output: the per-extension canonicalization shape, plus the
|
|
19
|
+
* mentions whose quoted text becomes each claim's source anchor.
|
|
20
|
+
*
|
|
21
|
+
* The mentions ride along on the one stage that is given the input text,
|
|
22
|
+
* rather than coming from a stage of their own — scribe's whole point is
|
|
23
|
+
* that there are two LLM calls, and locating a claim in the text is not
|
|
24
|
+
* worth a third. Their item shape is scholar's, so the same finalize
|
|
25
|
+
* resolution reads them without a translation layer.
|
|
26
|
+
*
|
|
27
|
+
* The canonicalization envelope is `additionalProperties: false`, so the
|
|
28
|
+
* widened shape is a distinct schema rather than an extra key on the
|
|
29
|
+
* shared one — and the adapter that republishes the canonicalization slot
|
|
30
|
+
* has to narrow back to it. See `createExtractCanonicalizationAdapterStage`.
|
|
31
|
+
*/
|
|
32
|
+
export function buildExtractOutputSchema(extension) {
|
|
33
|
+
const canonicalization = buildResponseSchema(extension);
|
|
34
|
+
return Type.Object({
|
|
35
|
+
...canonicalization.properties,
|
|
36
|
+
mentions: ClaimMentionExtractionOutputSchema.properties.mentions,
|
|
37
|
+
}, { additionalProperties: false });
|
|
38
|
+
}
|
|
17
39
|
// `structure` emits the relation graph (same per-relation shape as
|
|
18
40
|
// scholar's `relation-extraction`) plus the conclusion candidates +
|
|
19
41
|
// rationale (same fields scholar's conclusion-selection LLM emits,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/schemas.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,uEAAuE;AACvE,mEAAmE;AACnE,kEAAkE;AAClE,mEAAmE;AACnE,qCAAqC;AACrC,qEAAqE;AACrE,+DAA+D;AAC/D,wDAAwD;AACxD,EAAE;AACF,kEAAkE;AAClE,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/schemas.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,uEAAuE;AACvE,mEAAmE;AACnE,kEAAkE;AAClE,mEAAmE;AACnE,qCAAqC;AACrC,qEAAqE;AACrE,+DAA+D;AAC/D,wDAAwD;AACxD,EAAE;AACF,kEAAkE;AAClE,qEAAqE;AACrE,6DAA6D;AAE7D,OAAO,IAAI,EAAE,EAA6B,MAAM,SAAS,CAAA;AACzD,OAAO,EACH,kCAAkC,EAClC,8BAA8B,EAC9B,mBAAmB,GACtB,MAAM,4BAA4B,CAAA;AAenC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,wBAAwB,CACpC,SAA8B;IAE9B,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,CAErD,CAAA;IACD,OAAO,IAAI,CAAC,MAAM,CACd;QACI,GAAG,gBAAgB,CAAC,UAAU;QAC9B,QAAQ,EAAE,kCAAkC,CAAC,UAAU,CAAC,QAAQ;KACnE,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAClC,CAAA;AACL,CAAC;AAED,mEAAmE;AACnE,oEAAoE;AACpE,mEAAmE;AACnE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAClD;IACI,SAAS,EAAE,8BAA8B,CAAC,UAAU,CAAC,SAAS;IAC9D,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC/C,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;CAC3B,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/scribe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scribe.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/scribe.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,SAAS,EAAU,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAW/E,OAAO,KAAK,EACR,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACvB,MAAM,qBAAqB,CAAA;AAmB5B;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACvC,GAAG,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,mBAAmB,EAC9B,OAAO,CAAC,EAAE,4BAA4B,GACvC,SAAS,CAAC,eAAe,EAAE,uBAAuB,CAAC,CA2ErD"}
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
// DAG:
|
|
12
12
|
//
|
|
13
13
|
// extract ──┬─ (adapter) claim-canonicalization ─┬─ claim-reference-validation
|
|
14
|
-
//
|
|
15
|
-
//
|
|
14
|
+
// ├─ (adapter) claim-type-classification ┤
|
|
15
|
+
// │ └─ variable-assignment
|
|
16
|
+
// └─ (adapter) claim-mention-extraction
|
|
16
17
|
// structure ─┬─ (adapter) relation-extraction
|
|
17
18
|
// └─ (adapter) conclusion-selection
|
|
18
19
|
// formula-compilation
|
|
@@ -26,7 +27,7 @@ import { STAGE_IDS, claimReferenceValidationStage, variableAssignmentStage, form
|
|
|
26
27
|
import { finalizeResponseV2 } from "../../base/finalize-response-v2.js";
|
|
27
28
|
import { resolveLlmStageOptions } from "../../base/resolve-llm-stage-options.js";
|
|
28
29
|
import { INGESTION_INPUT_SCHEMA } from "../scholar/scholar.js";
|
|
29
|
-
import { createExtractStage, createExtractCanonicalizationAdapterStage, extractClassificationAdapterStage, EXTRACT_STAGE_DEFAULTS, } from "./extract-stage.js";
|
|
30
|
+
import { createExtractStage, createExtractCanonicalizationAdapterStage, extractClassificationAdapterStage, extractMentionAdapterStage, EXTRACT_STAGE_DEFAULTS, } from "./extract-stage.js";
|
|
30
31
|
import { createStructureStage, structureRelationAdapterStage, structureConclusionAdapterStage, STRUCTURE_STAGE_DEFAULTS, } from "./structure-stage.js";
|
|
31
32
|
const PIPELINE_ID = "argument-ingestion-scribe";
|
|
32
33
|
const PIPELINE_VERSION = "1.0.0";
|
|
@@ -46,6 +47,7 @@ export function createScribePipeline(extension, options) {
|
|
|
46
47
|
extractStage,
|
|
47
48
|
extractCanonicalizationAdapterStage,
|
|
48
49
|
extractClassificationAdapterStage,
|
|
50
|
+
extractMentionAdapterStage,
|
|
49
51
|
claimReferenceValidationStage,
|
|
50
52
|
variableAssignmentStage,
|
|
51
53
|
structureStage,
|
|
@@ -73,8 +75,27 @@ export function createScribePipeline(extension, options) {
|
|
|
73
75
|
optional(STAGE_IDS.conclusionSelection),
|
|
74
76
|
optional(STAGE_IDS.formulaValidation),
|
|
75
77
|
optional(STAGE_IDS.claimReferenceValidation),
|
|
78
|
+
// Read only for the source anchors finalize attaches to
|
|
79
|
+
// claims; a missing mention output costs the anchors,
|
|
80
|
+
// never the argument.
|
|
81
|
+
optional(STAGE_IDS.claimMentionExtraction),
|
|
76
82
|
],
|
|
77
|
-
|
|
83
|
+
// No segmentation is passed — this pipeline has no such stage,
|
|
84
|
+
// and needs none: a mention's span is only a tie-break hint
|
|
85
|
+
// between repeated occurrences, and finalize locates the quoted
|
|
86
|
+
// text itself.
|
|
87
|
+
//
|
|
88
|
+
// Premises carry no source anchors here. Their quote would have
|
|
89
|
+
// to come from `structure`, which is built from the canonical
|
|
90
|
+
// claim set and never sees the input text, so anything it
|
|
91
|
+
// returned would be a paraphrase that could only fail to
|
|
92
|
+
// resolve. `structure` is asked for no quote at all rather than
|
|
93
|
+
// for one it cannot have.
|
|
94
|
+
run: (ctx) => finalizeResponseV2({
|
|
95
|
+
ctx,
|
|
96
|
+
extension,
|
|
97
|
+
mentions: ctx.get(STAGE_IDS.claimMentionExtraction),
|
|
98
|
+
}),
|
|
78
99
|
},
|
|
79
100
|
};
|
|
80
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/scribe.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,+DAA+D;AAC/D,sEAAsE;AACtE,8DAA8D;AAC9D,sEAAsE;AACtE,iEAAiE;AACjE,oEAAoE;AACpE,qEAAqE;AACrE,EAAE;AACF,OAAO;AACP,EAAE;AACF,iFAAiF;AACjF,uDAAuD;AACvD,4EAA4E;AAC5E,gDAAgD;AAChD,iDAAiD;AACjD,+DAA+D;AAC/D,8DAA8D;AAC9D,oDAAoD;AACpD,EAAE;AACF,sEAAsE;AACtE,4CAA4C;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAG7D,OAAO,EACH,SAAS,EACT,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"scribe.js","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/scribe.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,+DAA+D;AAC/D,sEAAsE;AACtE,8DAA8D;AAC9D,sEAAsE;AACtE,iEAAiE;AACjE,oEAAoE;AACpE,qEAAqE;AACrE,EAAE;AACF,OAAO;AACP,EAAE;AACF,iFAAiF;AACjF,uDAAuD;AACvD,4EAA4E;AAC5E,oDAAoD;AACpD,gDAAgD;AAChD,iDAAiD;AACjD,+DAA+D;AAC/D,8DAA8D;AAC9D,oDAAoD;AACpD,EAAE;AACF,sEAAsE;AACtE,4CAA4C;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAG7D,OAAO,EACH,SAAS,EACT,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,GAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAMhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EACH,kBAAkB,EAClB,yCAAyC,EACzC,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACH,oBAAoB,EACpB,6BAA6B,EAC7B,+BAA+B,EAC/B,wBAAwB,GAC3B,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,GAAG,2BAA2B,CAAA;A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B;gBACtB,QAAQ,CAAC,SAAS,CAAC,sBAAsB,CAAC;aAC7C;YACD,+DAA+D;YAC/D,4DAA4D;YAC5D,gEAAgE;YAChE,eAAe;YACf,EAAE;YACF,gEAAgE;YAChE,8DAA8D;YAC9D,0DAA0D;YAC1D,yDAAyD;YACzD,gEAAgE;YAChE,0BAA0B;YAC1B,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CACT,kBAAkB,CAAC;gBACf,GAAG;gBACH,SAAS;gBACT,QAAQ,EAAE,GAAG,CAAC,GAAG,CACb,SAAS,CAAC,sBAAsB,CACnC;aACJ,CAAC;SACT;KACJ,CAAA;AACL,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { type TScribeStructureOutput } from "./schemas.js";
|
|
|
5
5
|
export declare const STRUCTURE_MODEL = "gpt-5.4-mini";
|
|
6
6
|
/** Internal default knobs for scribe's `structure` stage. */
|
|
7
7
|
export declare const STRUCTURE_STAGE_DEFAULTS: TLlmStageOptionsOverride;
|
|
8
|
-
export declare const STRUCTURE_SYSTEM_PROMPT = "You read a canonical claim set \u2014 each claim's id, type, and content fields (title/body) \u2014 and emit the argument's structure.\n\nEmit:\n- `relations` \u2014 the inference edges between claims. Each relation: a stable `relationId` (r1, r2, ...), a `type` of \"inference\", an `antecedents` array of the claim miniIds whose conjunction implies the consequent (one or more; citation- or axiomatic-typed claims may appear here, but never as the consequent), a single `consequent` claim miniId, and an `evidence` object
|
|
8
|
+
export declare const STRUCTURE_SYSTEM_PROMPT = "You read a canonical claim set \u2014 each claim's id, type, and content fields (title/body) \u2014 and emit the argument's structure.\n\nEmit:\n- `relations` \u2014 the inference edges between claims. Each relation: a stable `relationId` (r1, r2, ...), a `type` of \"inference\", an `antecedents` array of the claim miniIds whose conjunction implies the consequent (one or more; citation- or axiomatic-typed claims may appear here, but never as the consequent), a single `consequent` claim miniId, and an `evidence` object, which is always exactly { segmentIds: [], quote: \"\" } \u2014 you are shown the claims, not the text they came from, so you have nothing to quote.\n- `conclusionCandidates` \u2014 the claim miniIds that could be the argument's conclusion, ordered by DECREASING confidence (best first). The conclusion is the claim other claims support but that supports nothing further. Never list a citation- or axiomatic-typed claim. Return an empty array only when there is no argument structure.\n- `rationale` \u2014 one sentence explaining your best pick (or why none qualifies).\n\nOutput ONLY the schema-shaped object. No prose.";
|
|
9
9
|
/**
|
|
10
10
|
* Build scribe's `structure` LLM stage. Depends on the canonicalization
|
|
11
11
|
* + classification slots (populated by `extract`'s adapters) so the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure-stage.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/structure-stage.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAQH,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EACjC,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,eAAe,iBAAiB,CAAA;AAE7C,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,EAAE,wBAEtC,CAAA;AAED,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"structure-stage.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/pipelines/ingestion/scribe/structure-stage.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAQH,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EACjC,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,eAAe,iBAAiB,CAAA;AAE7C,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,EAAE,wBAEtC,CAAA;AAED,eAAO,MAAM,uBAAuB,8nCAOY,CAAA;AAwChD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,CAAC,EAAE,wBAAwB,GACnC,MAAM,CAAC,sBAAsB,CAAC,CAchC;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,yBAAyB,CAUtE,CAAA;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,0BAA0B,CAwDzE,CAAA"}
|
|
@@ -23,7 +23,7 @@ export const STRUCTURE_STAGE_DEFAULTS = {
|
|
|
23
23
|
export const STRUCTURE_SYSTEM_PROMPT = `You read a canonical claim set — each claim's id, type, and content fields (title/body) — and emit the argument's structure.
|
|
24
24
|
|
|
25
25
|
Emit:
|
|
26
|
-
- \`relations\` — the inference edges between claims. Each relation: a stable \`relationId\` (r1, r2, ...), a \`type\` of "inference", an \`antecedents\` array of the claim miniIds whose conjunction implies the consequent (one or more; citation- or axiomatic-typed claims may appear here, but never as the consequent), a single \`consequent\` claim miniId, and an \`evidence\` object
|
|
26
|
+
- \`relations\` — the inference edges between claims. Each relation: a stable \`relationId\` (r1, r2, ...), a \`type\` of "inference", an \`antecedents\` array of the claim miniIds whose conjunction implies the consequent (one or more; citation- or axiomatic-typed claims may appear here, but never as the consequent), a single \`consequent\` claim miniId, and an \`evidence\` object, which is always exactly { segmentIds: [], quote: "" } — you are shown the claims, not the text they came from, so you have nothing to quote.
|
|
27
27
|
- \`conclusionCandidates\` — the claim miniIds that could be the argument's conclusion, ordered by DECREASING confidence (best first). The conclusion is the claim other claims support but that supports nothing further. Never list a citation- or axiomatic-typed claim. Return an empty array only when there is no argument structure.
|
|
28
28
|
- \`rationale\` — one sentence explaining your best pick (or why none qualifies).
|
|
29
29
|
|
package/dist/lib/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/lib/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/lib/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAgB9D,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,mBAAmB,CAkEjE,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACxC,mBAAmB,GAAG,SAAS,CAcjC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAStC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,mBAAmB,GAChC,mBAAmB,CAQrB"}
|
package/dist/lib/consts.js
CHANGED
|
@@ -7,6 +7,9 @@ const CHECKSUM_CONFIG_KEYS = [
|
|
|
7
7
|
"claimFields",
|
|
8
8
|
"claimCitationFields",
|
|
9
9
|
"claimAxiomFields",
|
|
10
|
+
"originDocumentFields",
|
|
11
|
+
"originLinkFields",
|
|
12
|
+
"originAnchorFields",
|
|
10
13
|
];
|
|
11
14
|
export const DEFAULT_CHECKSUM_CONFIG = {
|
|
12
15
|
expressionFields: new Set([
|
|
@@ -18,6 +21,7 @@ export const DEFAULT_CHECKSUM_CONFIG = {
|
|
|
18
21
|
"premiseId",
|
|
19
22
|
"variableId",
|
|
20
23
|
"operator",
|
|
24
|
+
"enthymeme",
|
|
21
25
|
]),
|
|
22
26
|
variableFields: new Set([
|
|
23
27
|
"symbol",
|
|
@@ -34,6 +38,7 @@ export const DEFAULT_CHECKSUM_CONFIG = {
|
|
|
34
38
|
"argumentVersion",
|
|
35
39
|
"type",
|
|
36
40
|
"derivedClaimId",
|
|
41
|
+
"enthymeme",
|
|
37
42
|
]),
|
|
38
43
|
argumentFields: new Set(["version"]),
|
|
39
44
|
roleFields: new Set(["conclusionPremiseId"]),
|
|
@@ -50,6 +55,28 @@ export const DEFAULT_CHECKSUM_CONFIG = {
|
|
|
50
55
|
"supportingClaimId",
|
|
51
56
|
"supportingClaimVersion",
|
|
52
57
|
]),
|
|
58
|
+
// The digest stands in for the text: it already identifies the content,
|
|
59
|
+
// and hashing it costs a pass over 64 characters rather than over the
|
|
60
|
+
// whole document body.
|
|
61
|
+
originDocumentFields: new Set(["digest"]),
|
|
62
|
+
originLinkFields: new Set([
|
|
63
|
+
"argumentId",
|
|
64
|
+
"argumentVersion",
|
|
65
|
+
"documentId",
|
|
66
|
+
"stance",
|
|
67
|
+
]),
|
|
68
|
+
originAnchorFields: new Set([
|
|
69
|
+
"argumentId",
|
|
70
|
+
"argumentVersion",
|
|
71
|
+
"documentId",
|
|
72
|
+
"targetType",
|
|
73
|
+
"targetId",
|
|
74
|
+
"exact",
|
|
75
|
+
"prefix",
|
|
76
|
+
"suffix",
|
|
77
|
+
"startCodePoint",
|
|
78
|
+
"endCodePoint",
|
|
79
|
+
]),
|
|
53
80
|
};
|
|
54
81
|
/**
|
|
55
82
|
* Ensures all fields of a `TCoreChecksumConfig` are `Set<string>` instances.
|
package/dist/lib/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/lib/consts.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG;IACzB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/lib/consts.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG;IACzB,kBAAkB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AA;IACtC,KAAK,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,uBAAuB,CAAC,GAAG,CAAE,CAAA;QAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAA;QAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -245,9 +245,11 @@ export declare class ArgumentEngine<TArg extends TCoreArgument = TCoreArgument,
|
|
|
245
245
|
* This is the public API for consumers that need to attach app-level
|
|
246
246
|
* metadata (e.g. `creatorId`, `createdOn`) to expressions synthesized
|
|
247
247
|
* by the engine's auto-normalization. It resolves the owning premise
|
|
248
|
-
* internally, applies the patch in place
|
|
249
|
-
*
|
|
250
|
-
*
|
|
248
|
+
* internally, applies the patch in place, and marks the expression
|
|
249
|
+
* dirty — callers cannot patch without marking (stale checksum) or mark
|
|
250
|
+
* without patching (no-op). A field whose value is `undefined` is
|
|
251
|
+
* **deleted** rather than assigned, so clearing one restores the shape and
|
|
252
|
+
* the checksum the entity had before it was set.
|
|
251
253
|
*
|
|
252
254
|
* @param expressionId - The ID of the expression to patch.
|
|
253
255
|
* @param fields - Fields to merge into the expression.
|