@proposit/proposit-core 2.5.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/pipelines/ingestion/canonical-stages.d.ts +12 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.js +50 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/index.d.ts +1 -0
- package/dist/extensions/pipelines/ingestion/index.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/index.js +1 -0
- package/dist/extensions/pipelines/ingestion/index.js.map +1 -1
- package/dist/lib/core/argument-engine.d.ts +82 -1
- package/dist/lib/core/argument-engine.d.ts.map +1 -1
- package/dist/lib/core/argument-engine.js +175 -1
- package/dist/lib/core/argument-engine.js.map +1 -1
- package/dist/lib/core/evaluation/argument-evaluation.d.ts +14 -1
- package/dist/lib/core/evaluation/argument-evaluation.d.ts.map +1 -1
- package/dist/lib/core/evaluation/argument-evaluation.js +43 -0
- package/dist/lib/core/evaluation/argument-evaluation.js.map +1 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +64 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +9 -18
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/pipelines/scheduling.d.ts +42 -0
- package/dist/lib/pipelines/scheduling.d.ts.map +1 -0
- package/dist/lib/pipelines/scheduling.js +79 -0
- package/dist/lib/pipelines/scheduling.js.map +1 -0
- package/package.json +6 -1
package/dist/lib/index.js
CHANGED
|
@@ -42,28 +42,19 @@ export { validateArgument, validateArgumentAfterPremiseMutation, validateArgumen
|
|
|
42
42
|
export { InvariantViolationError } from "./core/invariant-violation-error.js";
|
|
43
43
|
export { executePipeline, executeStage, executeFinalize, launchStage, completeStage, optional, deterministicStage, llmStage, subPipelineStage, isLlmStage, DEFAULT_RETRY_POLICY, PipelineConfigurationError, LlmStageRetryExhaustedError, StageAbortedError, SubPipelineFailedError, LLM_QUOTA_EXHAUSTED, LLM_RATE_LIMITED, LLM_TRANSIENT_ERROR, LLM_NON_RETRYABLE_ERROR, LLM_UNKNOWN_ERROR, OUTPUT_SCHEMA_INVALID, ProcessingFailureSchema, } from "./pipelines/index.js";
|
|
44
44
|
export { LlmTokenUsageSchema } from "./llm/index.js";
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
// from this root barrel. They ship as their own subpaths —
|
|
55
|
-
// `@proposit/proposit-core/pipelines/base` (the shared contract +
|
|
56
|
-
// helpers) and `@proposit/proposit-core/pipelines/ingestion` (the
|
|
57
|
-
// `createScholarPipeline` / `createScribePipeline` factories). The root
|
|
58
|
-
// barrel carries only the engine, the pipeline framework, and the
|
|
59
|
-
// provider extensions.
|
|
45
|
+
// Opinionated extensions are NOT re-exported from this root barrel; each
|
|
46
|
+
// ships as its own subpath so the root stays the pure engine + pipeline
|
|
47
|
+
// framework. The concrete OpenAI Responses-API provider (and its error
|
|
48
|
+
// classes) lives at `@proposit/proposit-core/extensions/openai`; the
|
|
49
|
+
// ingestion pipelines + their task contract at
|
|
50
|
+
// `@proposit/proposit-core/pipelines/base` (shared contract + helpers) and
|
|
51
|
+
// `@proposit/proposit-core/pipelines/ingestion` (the `createScholarPipeline`
|
|
52
|
+
// / `createScribePipeline` factories); the Argument Builder turn factories at
|
|
53
|
+
// `@proposit/proposit-core/builder`.
|
|
60
54
|
export { InvalidArgumentStructureError, UnknownExpressionError, NotOperatorNotDecidableError, } from "./core/review-errors.js";
|
|
61
55
|
export { collectArgumentReferencedClaims } from "./core/review-helpers.js";
|
|
62
56
|
export { canonicalizeOperatorAssignments } from "./core/review-helpers.js";
|
|
63
57
|
// Conversation primitive — multi-turn LLM exchange support.
|
|
64
58
|
// Subpath: @proposit/proposit-core/conversation
|
|
65
59
|
export { executeTurn, createConversation, ConversationClosedError, } from "./conversation/index.js";
|
|
66
|
-
// Builder extension — Argument Builder turn factories.
|
|
67
|
-
// Subpath: @proposit/proposit-core/builder
|
|
68
|
-
export { createReviewTurn, createSimulateTurn, createDistillTurn, } from "../extensions/builder/index.js";
|
|
69
60
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAK7E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAK9D,OAAO,EACH,gBAAgB,EAChB,qBAA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nD,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,OAAO,EACH,gBAAgB,EAChB,oCAAoC,EACpC,4BAA4B,EAC5B,kCAAkC,GACrC,MAAM,+BAA+B,CAAA;AAKtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAC7E,OAAO,EACH,eAAe,EACf,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,sBAAsB,CAAA;AAqB7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAYpD,yEAAyE;AACzE,wEAAwE;AACxE,uEAAuE;AACvE,qEAAqE;AACrE,+CAA+C;AAC/C,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,qCAAqC;AACrC,OAAO,EACH,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,GAC/B,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAE1E,4DAA4D;AAC5D,gDAAgD;AAChD,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,uBAAuB,GAC1B,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TDepSpec } from "./types.js";
|
|
2
|
+
import type { TStageOutcomeRecord } from "./single-stage.js";
|
|
3
|
+
export { optional, depId, isOptionalDep } from "./types.js";
|
|
4
|
+
export type { TDepSpec, TOptionalDep } from "./types.js";
|
|
5
|
+
/** A serializable stage descriptor — all an eligibility check needs. */
|
|
6
|
+
export type TStageDescriptor = {
|
|
7
|
+
id: string;
|
|
8
|
+
dependsOn: readonly TDepSpec[];
|
|
9
|
+
};
|
|
10
|
+
type TRecordMap = Readonly<Record<string, TStageOutcomeRecord>>;
|
|
11
|
+
/**
|
|
12
|
+
* A stage is eligible to run once every required dep is `completed` and every
|
|
13
|
+
* optional dep has reached some terminal outcome.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isStageEligible(stage: TStageDescriptor, records: TRecordMap): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* A stage is skip-eligible when a REQUIRED dep reached a non-`completed`
|
|
18
|
+
* terminal outcome (skipped / failed) — the dependent then skips rather than
|
|
19
|
+
* failing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function hasRequiredFailureUpstream(stage: TStageDescriptor, records: TRecordMap): boolean;
|
|
22
|
+
/** A scheduling step: stages to launch now + stages to mark skipped now. */
|
|
23
|
+
export type TDagProgress<TStage extends TStageDescriptor> = {
|
|
24
|
+
/** Stages eligible to run now (deps satisfied, not yet terminal). */
|
|
25
|
+
runnable: TStage[];
|
|
26
|
+
/**
|
|
27
|
+
* Stages whose required dep failed (skip-eligible, not yet terminal).
|
|
28
|
+
* Marking each `skipped` lets its optional-dependent downstream stages
|
|
29
|
+
* then reach eligibility (eager skip propagation).
|
|
30
|
+
*/
|
|
31
|
+
skippable: TStage[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* From the full descriptor list + the committed terminal-outcome map, partition
|
|
35
|
+
* the not-yet-terminal stages into the ones to launch now (`runnable`) and the
|
|
36
|
+
* ones to mark skipped now (`skippable`). An already-terminal stage appears in
|
|
37
|
+
* neither. Skip-eligibility takes precedence over runnability (the two sets are
|
|
38
|
+
* disjoint). Generic over the descriptor subtype so a caller carrying extra
|
|
39
|
+
* serializable fields gets them back on the partitioned stages.
|
|
40
|
+
*/
|
|
41
|
+
export declare function computeDagProgress<TStage extends TStageDescriptor>(stages: readonly TStage[], records: TRecordMap): TDagProgress<TStage>;
|
|
42
|
+
//# sourceMappingURL=scheduling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../../src/lib/pipelines/scheduling.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC3D,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAExD,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAA;CACjC,CAAA;AAED,KAAK,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAA;AAE/D;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,UAAU,GACpB,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,UAAU,GACpB,OAAO,CAOT;AAED,4EAA4E;AAC5E,MAAM,MAAM,YAAY,CAAC,MAAM,SAAS,gBAAgB,IAAI;IACxD,qEAAqE;IACrE,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB;;;;OAIG;IACH,SAAS,EAAE,MAAM,EAAE,CAAA;CACtB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,gBAAgB,EAC9D,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,OAAO,EAAE,UAAU,GACpB,YAAY,CAAC,MAAM,CAAC,CAYtB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Descriptor-based DAG scheduling helpers.
|
|
2
|
+
//
|
|
3
|
+
// These compute stage eligibility from a serializable stage descriptor
|
|
4
|
+
// (`{ id, dependsOn }`) plus a plain record map of terminal outcomes — no
|
|
5
|
+
// `TStage` with its `run`/`outputSchema`, no live `Map`, no I/O. They exist so
|
|
6
|
+
// a consumer that drives the pipeline DAG out of process (e.g. persisting each
|
|
7
|
+
// stage outcome and advancing across separate invocations) can decide what to
|
|
8
|
+
// launch and what to skip without re-implementing the scheduler-loop
|
|
9
|
+
// eligibility rules. They mirror the in-process scheduler's semantics exactly:
|
|
10
|
+
//
|
|
11
|
+
// - a REQUIRED dep is satisfied only when its outcome is `completed`;
|
|
12
|
+
// - an OPTIONAL dep is satisfied once it reaches ANY terminal outcome
|
|
13
|
+
// (`completed` / `skipped` / `failed`);
|
|
14
|
+
// - a stage with a REQUIRED dep that reached a non-`completed` terminal
|
|
15
|
+
// outcome is skip-eligible — the dependent skips rather than failing, and
|
|
16
|
+
// marking it `skipped` lets its OPTIONAL-dependent downstream stages then
|
|
17
|
+
// reach eligibility (eager skip propagation).
|
|
18
|
+
import { depId, isOptionalDep } from "./types.js";
|
|
19
|
+
export { optional, depId, isOptionalDep } from "./types.js";
|
|
20
|
+
/**
|
|
21
|
+
* A stage is eligible to run once every required dep is `completed` and every
|
|
22
|
+
* optional dep has reached some terminal outcome.
|
|
23
|
+
*/
|
|
24
|
+
export function isStageEligible(stage, records) {
|
|
25
|
+
for (const dep of stage.dependsOn) {
|
|
26
|
+
const id = depId(dep);
|
|
27
|
+
const record = records[id];
|
|
28
|
+
if (isOptionalDep(dep)) {
|
|
29
|
+
// Optional: eligible once the upstream has ANY final outcome.
|
|
30
|
+
if (!record)
|
|
31
|
+
return false;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (!record)
|
|
35
|
+
return false;
|
|
36
|
+
if (record.outcome !== "completed")
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A stage is skip-eligible when a REQUIRED dep reached a non-`completed`
|
|
43
|
+
* terminal outcome (skipped / failed) — the dependent then skips rather than
|
|
44
|
+
* failing.
|
|
45
|
+
*/
|
|
46
|
+
export function hasRequiredFailureUpstream(stage, records) {
|
|
47
|
+
for (const dep of stage.dependsOn) {
|
|
48
|
+
if (isOptionalDep(dep))
|
|
49
|
+
continue;
|
|
50
|
+
const record = records[depId(dep)];
|
|
51
|
+
if (record && record.outcome !== "completed")
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* From the full descriptor list + the committed terminal-outcome map, partition
|
|
58
|
+
* the not-yet-terminal stages into the ones to launch now (`runnable`) and the
|
|
59
|
+
* ones to mark skipped now (`skippable`). An already-terminal stage appears in
|
|
60
|
+
* neither. Skip-eligibility takes precedence over runnability (the two sets are
|
|
61
|
+
* disjoint). Generic over the descriptor subtype so a caller carrying extra
|
|
62
|
+
* serializable fields gets them back on the partitioned stages.
|
|
63
|
+
*/
|
|
64
|
+
export function computeDagProgress(stages, records) {
|
|
65
|
+
const runnable = [];
|
|
66
|
+
const skippable = [];
|
|
67
|
+
for (const stage of stages) {
|
|
68
|
+
if (records[stage.id])
|
|
69
|
+
continue; // already terminal — never revisit
|
|
70
|
+
if (hasRequiredFailureUpstream(stage, records)) {
|
|
71
|
+
skippable.push(stage);
|
|
72
|
+
}
|
|
73
|
+
else if (isStageEligible(stage, records)) {
|
|
74
|
+
runnable.push(stage);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { runnable, skippable };
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=scheduling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduling.js","sourceRoot":"","sources":["../../../src/lib/pipelines/scheduling.ts"],"names":[],"mappings":"AAAA,2CA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AAA;IAC7D,CAAC;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAcD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAyB,EACzB,OAAmB;IAEnB,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,MAAM,SAAS,GAAa,EAAE,CAAA;IAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAAE,SAAQ,CAAC,mCAAmC;QACnE,IAAI,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;YAC7C,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC;aAAM,IAAI,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proposit/proposit-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Core engine for building and manipulating propositional logic arguments.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -58,6 +58,11 @@
|
|
|
58
58
|
"import": "./dist/extensions/pipelines/ingestion/index.js",
|
|
59
59
|
"default": "./dist/extensions/pipelines/ingestion/index.js"
|
|
60
60
|
},
|
|
61
|
+
"./pipelines/scheduling": {
|
|
62
|
+
"types": "./dist/lib/pipelines/scheduling.d.ts",
|
|
63
|
+
"import": "./dist/lib/pipelines/scheduling.js",
|
|
64
|
+
"default": "./dist/lib/pipelines/scheduling.js"
|
|
65
|
+
},
|
|
61
66
|
"./conversation": {
|
|
62
67
|
"types": "./dist/lib/conversation/index.d.ts",
|
|
63
68
|
"import": "./dist/lib/conversation/index.js",
|