@juicesharp/rpiv-workflow 2.13.8 → 2.13.9
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/api.ts +4 -4
- package/audit-ctx.ts +4 -4
- package/audit-rows.ts +6 -6
- package/audit.ts +17 -17
- package/built-ins.ts +2 -2
- package/chain-state.ts +7 -7
- package/command-run.ts +12 -12
- package/command.ts +3 -3
- package/death-scene.ts +4 -4
- package/docs/embedding.md +1 -1
- package/events.ts +6 -6
- package/execution-host.ts +3 -3
- package/extension.ts +3 -3
- package/failure-memos.ts +3 -3
- package/index.ts +2 -2
- package/internal.ts +10 -10
- package/judge.ts +4 -4
- package/load/alias.ts +4 -4
- package/load/cache.ts +4 -4
- package/load/index.ts +19 -19
- package/load/issues.ts +2 -2
- package/load/legacy.ts +2 -2
- package/load/merge.ts +7 -7
- package/load/normalize.ts +2 -2
- package/load/resolve-default.ts +2 -2
- package/load/shape-guards.ts +1 -1
- package/load/skill-contract-phase.ts +4 -4
- package/loop-constructors.ts +6 -6
- package/loop-def.ts +3 -3
- package/loop-kinds.ts +10 -10
- package/loop-parallel.ts +9 -9
- package/loop-waves.ts +3 -3
- package/loop.ts +11 -11
- package/loops/constructors.ts +5 -5
- package/loops/derivations.ts +5 -5
- package/loops/introspection.ts +3 -3
- package/loops/panel.ts +4 -4
- package/loops/verify.ts +3 -3
- package/messages.ts +2 -2
- package/outcomes/collectors/directory-path.ts +4 -4
- package/outcomes/collectors/index.ts +7 -7
- package/outcomes/collectors/text-scan.ts +6 -6
- package/outcomes/collectors/tool-call.ts +5 -5
- package/outcomes/collectors/transcript-path.ts +5 -5
- package/outcomes/collectors/union.ts +4 -4
- package/outcomes/collectors/url.ts +5 -5
- package/outcomes/collectors/workspace-diff.ts +4 -4
- package/outcomes/git-commit.ts +4 -4
- package/outcomes/index.ts +4 -4
- package/outcomes/parsers/index.ts +1 -1
- package/outcomes/parsers/json-body.ts +3 -3
- package/outcomes/side-effect.ts +1 -1
- package/output-spec.ts +3 -3
- package/output.ts +1 -1
- package/package.json +2 -2
- package/preview.ts +5 -5
- package/registration.ts +24 -24
- package/routing-dsl.ts +3 -3
- package/routing.ts +2 -2
- package/runner/by-name.ts +4 -4
- package/runner/by-run-id.ts +6 -6
- package/runner/chain-advance.ts +10 -10
- package/runner/errors.ts +1 -1
- package/runner/failure.ts +5 -5
- package/runner/index.ts +6 -6
- package/runner/input-validation.ts +8 -8
- package/runner/preflight.ts +7 -7
- package/runner/resolve-stage.ts +4 -4
- package/runner/resume-entry.ts +9 -9
- package/runner/resume-loop.ts +9 -9
- package/runner/resume.ts +15 -15
- package/runner/run-context.ts +8 -8
- package/runner/run-stage.ts +26 -26
- package/runner/runner.ts +18 -18
- package/runner/script-stage.ts +12 -12
- package/schema-compat.ts +2 -2
- package/semaphore.ts +1 -1
- package/sessions/bash-strikes.ts +1 -1
- package/sessions/extraction.ts +16 -16
- package/sessions/halt-routing.ts +10 -10
- package/sessions/index.ts +3 -3
- package/sessions/locate.ts +3 -3
- package/sessions/reattach.ts +8 -8
- package/sessions/sessions.ts +9 -9
- package/sessions/spawn.ts +2 -2
- package/sessions/success-persist.ts +7 -7
- package/skill-contract.ts +3 -3
- package/skill-contracts/composition.ts +5 -5
- package/skill-contracts/extension-points.ts +3 -3
- package/skill-contracts/harvest.ts +6 -6
- package/skill-contracts/index.ts +6 -6
- package/skill-contracts/registry.ts +2 -2
- package/stage-def.ts +5 -5
- package/stage-errors.ts +1 -1
- package/stage-identity.ts +3 -3
- package/startup.ts +5 -5
- package/state/index.ts +2 -2
- package/state/names.ts +3 -3
- package/state/raw.ts +1 -1
- package/state/reads.ts +5 -5
- package/state/resolve.ts +3 -3
- package/state/state.ts +8 -8
- package/state/writes.ts +3 -3
- package/transcript.ts +1 -1
- package/typebox-adapter.ts +2 -2
- package/types.ts +11 -11
- package/validate/contract-compat.ts +8 -8
- package/validate/graph.ts +2 -2
- package/validate/stage-rules.ts +7 -7
- package/validate-output.ts +3 -3
- package/validate-workflow.ts +7 -7
package/registration.ts
CHANGED
|
@@ -61,12 +61,12 @@ export {
|
|
|
61
61
|
type UnitSelector,
|
|
62
62
|
type VerifySpec,
|
|
63
63
|
type Workflow,
|
|
64
|
-
} from "./api.
|
|
65
|
-
export { registerBuiltIns, registerBuiltInsProvider } from "./built-ins.
|
|
64
|
+
} from "./api.ts";
|
|
65
|
+
export { registerBuiltIns, registerBuiltInsProvider } from "./built-ins.ts";
|
|
66
66
|
// The shared dispatch predicate (and SkillStage type guard) — public so
|
|
67
67
|
// extension points that key on a stage's skill identity (outcome derivers,
|
|
68
68
|
// contract tooling) apply the same gate the loader/validator/harvest use.
|
|
69
|
-
export { isDispatchingStage } from "./chain-state.
|
|
69
|
+
export { isDispatchingStage } from "./chain-state.ts";
|
|
70
70
|
export {
|
|
71
71
|
type LifecycleContext,
|
|
72
72
|
type LifecycleListeners,
|
|
@@ -75,7 +75,7 @@ export {
|
|
|
75
75
|
registerLifecycle,
|
|
76
76
|
type StageRef,
|
|
77
77
|
type UnitEvent,
|
|
78
|
-
} from "./events.
|
|
78
|
+
} from "./events.ts";
|
|
79
79
|
export {
|
|
80
80
|
type Artifact,
|
|
81
81
|
type ArtifactHandle,
|
|
@@ -84,20 +84,20 @@ export {
|
|
|
84
84
|
inline,
|
|
85
85
|
opaque,
|
|
86
86
|
url,
|
|
87
|
-
} from "./handle.
|
|
87
|
+
} from "./handle.ts";
|
|
88
88
|
export type {
|
|
89
89
|
ModelSelection,
|
|
90
90
|
WorkflowHost,
|
|
91
91
|
WorkflowHostContext,
|
|
92
92
|
WorkflowSessionContext,
|
|
93
|
-
} from "./host.
|
|
93
|
+
} from "./host.ts";
|
|
94
94
|
// Only the contract data types are public — they're referenced by kept public
|
|
95
95
|
// signatures (`JsonSchemaCapable` ← `typeboxSchema`, `JsonSchemaObject` ←
|
|
96
96
|
// `ConsumesSpec`/`ProducesSpec.data`, `SchemaCompatResult` ← `canCompose`). The
|
|
97
97
|
// low-level json-schema and schema-compat FUNCTIONS stay package-private (no
|
|
98
98
|
// consumer needs them); internal callers import them from their source modules
|
|
99
99
|
// directly.
|
|
100
|
-
export type { JsonSchemaCapable, JsonSchemaObject } from "./json-schema.
|
|
100
|
+
export type { JsonSchemaCapable, JsonSchemaObject } from "./json-schema.ts";
|
|
101
101
|
export {
|
|
102
102
|
type AnyJudge,
|
|
103
103
|
type FoldFn,
|
|
@@ -112,9 +112,9 @@ export {
|
|
|
112
112
|
type PromptJudge,
|
|
113
113
|
panelMembers,
|
|
114
114
|
type SkillJudge,
|
|
115
|
-
} from "./judge.
|
|
116
|
-
export type { ConfigLayer, Issue, LoadedWorkflows, LoadIssue, OverlayPaths } from "./load/index.
|
|
117
|
-
export { aliasSkills, loadWorkflows, projectOverlayPaths, userOverlayPaths } from "./load/index.
|
|
115
|
+
} from "./judge.ts";
|
|
116
|
+
export type { ConfigLayer, Issue, LoadedWorkflows, LoadIssue, OverlayPaths } from "./load/index.ts";
|
|
117
|
+
export { aliasSkills, loadWorkflows, projectOverlayPaths, userOverlayPaths } from "./load/index.ts";
|
|
118
118
|
export {
|
|
119
119
|
type AnyJudgeSpec,
|
|
120
120
|
all,
|
|
@@ -141,7 +141,7 @@ export {
|
|
|
141
141
|
type StageShape,
|
|
142
142
|
verify,
|
|
143
143
|
verifyShapeIssues,
|
|
144
|
-
} from "./loop-constructors.
|
|
144
|
+
} from "./loop-constructors.ts";
|
|
145
145
|
export {
|
|
146
146
|
type DirectoryPathCollectorOpts,
|
|
147
147
|
directoryPathCollector,
|
|
@@ -165,8 +165,8 @@ export {
|
|
|
165
165
|
type WorkspaceDiffCollectorOpts,
|
|
166
166
|
type WorkspaceDiffSnapshot,
|
|
167
167
|
workspaceDiffCollector,
|
|
168
|
-
} from "./outcomes/index.
|
|
169
|
-
export type { Output, OutputMeta, RunView, Verdict } from "./output.
|
|
168
|
+
} from "./outcomes/index.ts";
|
|
169
|
+
export type { Output, OutputMeta, RunView, Verdict } from "./output.ts";
|
|
170
170
|
// Producer-side surface — `output-spec.ts` is the ONE canonical import path
|
|
171
171
|
// for collector/parser/outcome authoring types (`output.ts` keeps only the
|
|
172
172
|
// envelope). `OutputSpec` is the deprecated pre-rename alias of `Outcome`.
|
|
@@ -182,8 +182,8 @@ export {
|
|
|
182
182
|
type ParseContext,
|
|
183
183
|
type ParseResult,
|
|
184
184
|
type SnapshotContext,
|
|
185
|
-
} from "./output-spec.
|
|
186
|
-
export { eq, gt, gte, lt, lte, type NumericPredicate, type Predicate } from "./predicates.
|
|
185
|
+
} from "./output-spec.ts";
|
|
186
|
+
export { eq, gt, gte, lt, lte, type NumericPredicate, type Predicate } from "./predicates.ts";
|
|
187
187
|
export type {
|
|
188
188
|
ConsumesReadSpec,
|
|
189
189
|
ConsumesSpec,
|
|
@@ -192,7 +192,7 @@ export type {
|
|
|
192
192
|
SchemaCompatResult,
|
|
193
193
|
SkillContract,
|
|
194
194
|
SkillContractMap,
|
|
195
|
-
} from "./skill-contract.
|
|
195
|
+
} from "./skill-contract.ts";
|
|
196
196
|
export {
|
|
197
197
|
canCompose,
|
|
198
198
|
getBucketKindMappings,
|
|
@@ -203,7 +203,7 @@ export {
|
|
|
203
203
|
registerOutcomeDeriver,
|
|
204
204
|
registerSkillContracts,
|
|
205
205
|
registerSkillContractsProvider,
|
|
206
|
-
} from "./skill-contracts/index.
|
|
206
|
+
} from "./skill-contracts/index.ts";
|
|
207
207
|
export {
|
|
208
208
|
type LoopCapRow,
|
|
209
209
|
listArtifacts,
|
|
@@ -223,21 +223,21 @@ export {
|
|
|
223
223
|
summarizeRun,
|
|
224
224
|
type WorkflowHeader,
|
|
225
225
|
type WorkflowStage,
|
|
226
|
-
} from "./state/index.
|
|
226
|
+
} from "./state/index.ts";
|
|
227
227
|
// The persisted-session branch shape the host-injected `readSessionBranch`
|
|
228
228
|
// reader returns (`WorkflowExecutionProvider.readSessionBranch` /
|
|
229
229
|
// `RunContext.readSessionBranch`). Re-exported so the rpiv-pi host can name the
|
|
230
230
|
// return type when it narrows `SessionManager.open(file).getBranch()`.
|
|
231
|
-
export type { BranchEntry } from "./transcript.
|
|
232
|
-
export { DEFAULT_TRIGGER, type RunTrigger } from "./triggers.
|
|
233
|
-
export { typeboxSchema } from "./typebox-adapter.
|
|
231
|
+
export type { BranchEntry } from "./transcript.ts";
|
|
232
|
+
export { DEFAULT_TRIGGER, type RunTrigger } from "./triggers.ts";
|
|
233
|
+
export { typeboxSchema } from "./typebox-adapter.ts";
|
|
234
234
|
// `RunState` is deliberately NOT here — it is runner-private; user contexts
|
|
235
235
|
// use the deep-readonly `RunView`. Test fixtures that must construct one
|
|
236
236
|
// import it from `@juicesharp/rpiv-workflow/internal`.
|
|
237
|
-
export type { RunTermination } from "./types.
|
|
238
|
-
export { type SchemaValidationFailure, validateOutputData } from "./validate-output.
|
|
237
|
+
export type { RunTermination } from "./types.ts";
|
|
238
|
+
export { type SchemaValidationFailure, validateOutputData } from "./validate-output.ts";
|
|
239
239
|
export {
|
|
240
240
|
type ValidationIssueCode,
|
|
241
241
|
validateWorkflow,
|
|
242
242
|
type WorkflowValidationIssue,
|
|
243
|
-
} from "./validate-workflow.
|
|
243
|
+
} from "./validate-workflow.ts";
|
package/routing-dsl.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* EXECUTION lives in routing.ts — this module is authoring-surface only.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { markSymbol, readSymbol, requireNonEmptyString, throwInvalid } from "./internal-utils.
|
|
10
|
-
import type { Output, RunView } from "./output.
|
|
11
|
-
import type { NumericPredicate } from "./predicates.
|
|
9
|
+
import { markSymbol, readSymbol, requireNonEmptyString, throwInvalid } from "./internal-utils.ts";
|
|
10
|
+
import type { Output, RunView } from "./output.ts";
|
|
11
|
+
import type { NumericPredicate } from "./predicates.ts";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Runtime context handed to an `EdgeFn`. The sole context shape for both
|
package/routing.ts
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* any other halt site.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { type EdgeContext, type EdgeFn, STOP, type Workflow } from "./api.
|
|
23
|
-
import { formatError } from "./internal-utils.
|
|
22
|
+
import { type EdgeContext, type EdgeFn, STOP, type Workflow } from "./api.ts";
|
|
23
|
+
import { formatError } from "./internal-utils.ts";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Three-way return from `nextStage`. Matches the convention established by
|
package/runner/by-name.ts
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
* loader's "never throws" guarantee. Callers branch on `result.success`.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { WorkflowHostContext } from "../host.
|
|
23
|
-
import { findWorkflow, loadWorkflows } from "../load/index.
|
|
24
|
-
import type { RunWorkflowOptions, RunWorkflowResult } from "../types.
|
|
25
|
-
import { runWorkflow } from "./runner.
|
|
22
|
+
import type { WorkflowHostContext } from "../host.ts";
|
|
23
|
+
import { findWorkflow, loadWorkflows } from "../load/index.ts";
|
|
24
|
+
import type { RunWorkflowOptions, RunWorkflowResult } from "../types.ts";
|
|
25
|
+
import { runWorkflow } from "./runner.ts";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Options for `runWorkflowByName` — the full `RunWorkflowOptions` surface
|
package/runner/by-run-id.ts
CHANGED
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
* no-JSONL refusals once while leaving in-run failures to the stage machinery).
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
import type { WorkflowHostContext } from "../host.
|
|
36
|
-
import { findWorkflow, loadWorkflows } from "../load/index.
|
|
37
|
-
import { MSG_LOAD_ABORTED, MSG_RESUME_WORKFLOW_GONE, MSG_RUN_NOT_FOUND } from "../messages.
|
|
38
|
-
import { resolveRun } from "../state/index.
|
|
39
|
-
import type { RunWorkflowResult } from "../types.
|
|
40
|
-
import { type ResumeWorkflowOptions, resumeWorkflow } from "./runner.
|
|
35
|
+
import type { WorkflowHostContext } from "../host.ts";
|
|
36
|
+
import { findWorkflow, loadWorkflows } from "../load/index.ts";
|
|
37
|
+
import { MSG_LOAD_ABORTED, MSG_RESUME_WORKFLOW_GONE, MSG_RUN_NOT_FOUND } from "../messages.ts";
|
|
38
|
+
import { resolveRun } from "../state/index.ts";
|
|
39
|
+
import type { RunWorkflowResult } from "../types.ts";
|
|
40
|
+
import { type ResumeWorkflowOptions, resumeWorkflow } from "./runner.ts";
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Options for `resumeWorkflowByRunId` — the full `ResumeWorkflowOptions` surface
|
package/runner/chain-advance.ts
CHANGED
|
@@ -11,22 +11,22 @@
|
|
|
11
11
|
* spelled as a module cycle.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { type EdgeTarget, PROGRESS_VALUES, type ProgressValue, type StageDef, takeRouteNote } from "../api.
|
|
15
|
-
import { auditCtxFor, failedArgs, recordFatalFailure } from "../audit.
|
|
16
|
-
import { resolveSkill } from "../chain-state.
|
|
17
|
-
import { lifecycleCtxFor, skillStageRef } from "../events.
|
|
18
|
-
import { nowIso } from "../internal-utils.
|
|
14
|
+
import { type EdgeTarget, PROGRESS_VALUES, type ProgressValue, type StageDef, takeRouteNote } from "../api.ts";
|
|
15
|
+
import { auditCtxFor, failedArgs, recordFatalFailure } from "../audit.ts";
|
|
16
|
+
import { resolveSkill } from "../chain-state.ts";
|
|
17
|
+
import { lifecycleCtxFor, skillStageRef } from "../events.ts";
|
|
18
|
+
import { nowIso } from "../internal-utils.ts";
|
|
19
19
|
import {
|
|
20
20
|
FAIL_BACKWARD_JUMP_EXHAUSTED,
|
|
21
21
|
FAIL_GATE_STOP,
|
|
22
22
|
type FailureText,
|
|
23
23
|
MSG_CHAIN_ADVANCE_FAILED,
|
|
24
24
|
MSG_ROUTING_AUDIT_DROPPED,
|
|
25
|
-
} from "../messages.
|
|
26
|
-
import { edgeIsDecision, nextStage } from "../routing.
|
|
27
|
-
import { appendRoutingDecision } from "../state/index.
|
|
28
|
-
import type { RunContext, RunState, WorkflowHostContext } from "../types.
|
|
29
|
-
import { type ChainOutcome, finalizeWorkflow, haltChain } from "./failure.
|
|
25
|
+
} from "../messages.ts";
|
|
26
|
+
import { edgeIsDecision, nextStage } from "../routing.ts";
|
|
27
|
+
import { appendRoutingDecision } from "../state/index.ts";
|
|
28
|
+
import type { RunContext, RunState, WorkflowHostContext } from "../types.ts";
|
|
29
|
+
import { type ChainOutcome, finalizeWorkflow, haltChain } from "./failure.ts";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* The walk continuation injected by the composition site
|
package/runner/errors.ts
CHANGED
package/runner/failure.ts
CHANGED
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
notifyPartialArtifacts,
|
|
13
13
|
recordFatalFailure,
|
|
14
14
|
terminate,
|
|
15
|
-
} from "../audit.
|
|
16
|
-
import { formatError, isAbortError } from "../internal-utils.
|
|
17
|
-
import { FAIL_WORKFLOW_ABORTED, MSG_STAGE_THREW, MSG_WORKFLOW_COMPLETE } from "../messages.
|
|
18
|
-
import type { RunContext, UnitRef, WorkflowHostContext } from "../types.
|
|
19
|
-
import { StagePreflightError } from "./errors.
|
|
15
|
+
} from "../audit.ts";
|
|
16
|
+
import { formatError, isAbortError } from "../internal-utils.ts";
|
|
17
|
+
import { FAIL_WORKFLOW_ABORTED, MSG_STAGE_THREW, MSG_WORKFLOW_COMPLETE } from "../messages.ts";
|
|
18
|
+
import type { RunContext, UnitRef, WorkflowHostContext } from "../types.ts";
|
|
19
|
+
import { StagePreflightError } from "./errors.ts";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Explicit result of one chain-walk step, threaded up through
|
package/runner/index.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* the symbols the package itself needs to publish.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export type { RunWorkflowOptions, RunWorkflowResult } from "../types.
|
|
8
|
-
export { type RunWorkflowByNameOptions, runWorkflowByName } from "./by-name.
|
|
9
|
-
export { type ResumeWorkflowByRunIdOptions, resumeWorkflowByRunId } from "./by-run-id.
|
|
10
|
-
export { StagePreflightError } from "./errors.
|
|
7
|
+
export type { RunWorkflowOptions, RunWorkflowResult } from "../types.ts";
|
|
8
|
+
export { type RunWorkflowByNameOptions, runWorkflowByName } from "./by-name.ts";
|
|
9
|
+
export { type ResumeWorkflowByRunIdOptions, resumeWorkflowByRunId } from "./by-run-id.ts";
|
|
10
|
+
export { StagePreflightError } from "./errors.ts";
|
|
11
11
|
export {
|
|
12
12
|
MAX_BACKWARD_JUMPS,
|
|
13
13
|
MAX_ITERATIONS,
|
|
14
14
|
MAX_LAPS,
|
|
15
15
|
type RunBudgetOptions,
|
|
16
16
|
validateRunBudgets,
|
|
17
|
-
} from "./run-context.
|
|
18
|
-
export { type ResumeWorkflowOptions, resumeWorkflow, runWorkflow } from "./runner.
|
|
17
|
+
} from "./run-context.ts";
|
|
18
|
+
export { type ResumeWorkflowOptions, resumeWorkflow, runWorkflow } from "./runner.ts";
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
* halting only on timeouts.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { formatError, withTimeout } from "../internal-utils.
|
|
20
|
-
import { isJsonSchemaObject, jsonSchemaToStandard } from "../json-schema.
|
|
21
|
-
import { ERR_SCHEMA_TIMEOUT, FAIL_INPUT_VALIDATION } from "../messages.
|
|
22
|
-
import type { RunContext } from "../types.
|
|
19
|
+
import { formatError, withTimeout } from "../internal-utils.ts";
|
|
20
|
+
import { isJsonSchemaObject, jsonSchemaToStandard } from "../json-schema.ts";
|
|
21
|
+
import { ERR_SCHEMA_TIMEOUT, FAIL_INPUT_VALIDATION } from "../messages.ts";
|
|
22
|
+
import type { RunContext } from "../types.ts";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_VALIDATION_RETRY_TIMEOUT_MS,
|
|
25
25
|
describeFailure,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
SchemaTimeoutError,
|
|
29
29
|
type ValidationResult,
|
|
30
30
|
validateOutputData,
|
|
31
|
-
} from "../validate-output.
|
|
32
|
-
import { clampRange } from "../validation-bounds.
|
|
33
|
-
import { haltPreflight } from "./errors.
|
|
34
|
-
import type { ResolvedStage } from "./resolve-stage.
|
|
31
|
+
} from "../validate-output.ts";
|
|
32
|
+
import { clampRange } from "../validation-bounds.ts";
|
|
33
|
+
import { haltPreflight } from "./errors.ts";
|
|
34
|
+
import type { ResolvedStage } from "./resolve-stage.ts";
|
|
35
35
|
|
|
36
36
|
// ---------------------------------------------------------------------------
|
|
37
37
|
// Shared helper
|
package/runner/preflight.ts
CHANGED
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
* of re-probing `def.prompt` — the slot-priority rule lives in one place.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { currentPrimaryArtifact } from "../chain-state.
|
|
13
|
-
import { type AnyJudge, panelMembers } from "../judge.
|
|
12
|
+
import { currentPrimaryArtifact } from "../chain-state.ts";
|
|
13
|
+
import { type AnyJudge, panelMembers } from "../judge.ts";
|
|
14
14
|
import {
|
|
15
15
|
FAIL_MISSING_ARTIFACT,
|
|
16
16
|
FAIL_MISSING_NAMED_READ,
|
|
17
17
|
FAIL_SKILL_NOT_REGISTERED,
|
|
18
18
|
MSG_STAGE_THREW,
|
|
19
|
-
} from "../messages.
|
|
20
|
-
import { readName } from "../stage-def.
|
|
21
|
-
import type { RunContext } from "../types.
|
|
22
|
-
import { haltPreflight, invariantPreflight } from "./errors.
|
|
23
|
-
import type { ResolvedStage } from "./resolve-stage.
|
|
19
|
+
} from "../messages.ts";
|
|
20
|
+
import { readName } from "../stage-def.ts";
|
|
21
|
+
import type { RunContext } from "../types.ts";
|
|
22
|
+
import { haltPreflight, invariantPreflight } from "./errors.ts";
|
|
23
|
+
import type { ResolvedStage } from "./resolve-stage.ts";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* The skill-path preflight sequence, in its load-bearing order:
|
package/runner/resolve-stage.ts
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* comment; the ordering now lives in exactly one place (`stageModeOf`).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { LoopDef, StageDef } from "../api.
|
|
10
|
-
import { resolveSkill } from "../chain-state.
|
|
11
|
-
import { effectiveLoopOf } from "../loop-constructors.
|
|
12
|
-
import type { RunContext } from "../types.
|
|
9
|
+
import type { LoopDef, StageDef } from "../api.ts";
|
|
10
|
+
import { resolveSkill } from "../chain-state.ts";
|
|
11
|
+
import { effectiveLoopOf } from "../loop-constructors.ts";
|
|
12
|
+
import type { RunContext } from "../types.ts";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* How a stage's BODY is dispatched:
|
package/runner/resume-entry.ts
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
* `resume-loop.ts` (which owns the loop-trailer arm's dispatch).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { Workflow } from "../api.
|
|
8
|
+
import type { Workflow } from "../api.ts";
|
|
9
9
|
import {
|
|
10
10
|
ERR_RESUME_MALFORMED_ROW,
|
|
11
11
|
ERR_RESUME_NO_ROWS,
|
|
12
12
|
ERR_RESUME_STAGE_GONE,
|
|
13
13
|
ERR_RESUME_VERSION_MISMATCH,
|
|
14
|
-
} from "../messages.
|
|
15
|
-
import { STOP } from "../routing-dsl.
|
|
16
|
-
import { STATE_SCHEMA_VERSION } from "../state/index.
|
|
17
|
-
import type { RunContext, WorkflowHostContext } from "../types.
|
|
18
|
-
import { recordEntryThrow } from "./failure.
|
|
19
|
-
import type { ReconstructResult } from "./resume.
|
|
20
|
-
import { recordLoopDriftFailure, resumeLoopStage } from "./resume-loop.
|
|
21
|
-
import { advance, buildLoopDeps, dispatchStageOrRecordFailure, resumeStageWithSession } from "./run-stage.
|
|
14
|
+
} from "../messages.ts";
|
|
15
|
+
import { STOP } from "../routing-dsl.ts";
|
|
16
|
+
import { STATE_SCHEMA_VERSION } from "../state/index.ts";
|
|
17
|
+
import type { RunContext, WorkflowHostContext } from "../types.ts";
|
|
18
|
+
import { recordEntryThrow } from "./failure.ts";
|
|
19
|
+
import type { ReconstructResult } from "./resume.ts";
|
|
20
|
+
import { recordLoopDriftFailure, resumeLoopStage } from "./resume-loop.ts";
|
|
21
|
+
import { advance, buildLoopDeps, dispatchStageOrRecordFailure, resumeStageWithSession } from "./run-stage.ts";
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Pick the chain re-entry thunk from the trail trailer. Dispatch keys on the
|
package/runner/resume-loop.ts
CHANGED
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
* probe pull is the documented harmless deterministic double-pull.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { auditCtxFor, failedArgs, recordFatalFailure } from "../audit.
|
|
21
|
-
import { resolveSkill } from "../chain-state.
|
|
22
|
-
import { announceLoopStart, pendingFanoutIndices, runFanoutResume, runLoop } from "../loop.
|
|
23
|
-
import { effectiveLoopOf, freezesEntryArgsOf } from "../loop-constructors.
|
|
24
|
-
import { buildLoopEntry, type LoopDeps, sequentialStrategyOf } from "../loop-kinds.
|
|
25
|
-
import { ensureUnitDeps } from "../loop-waves.
|
|
26
|
-
import { FAIL_MISSING_ARTIFACT, type FailureText, MSG_RESUME_LOOP_MISMATCH } from "../messages.
|
|
27
|
-
import type { RunContext, WorkflowHostContext } from "../types.
|
|
28
|
-
import type { LoopResumePoint } from "./resume.
|
|
20
|
+
import { auditCtxFor, failedArgs, recordFatalFailure } from "../audit.ts";
|
|
21
|
+
import { resolveSkill } from "../chain-state.ts";
|
|
22
|
+
import { announceLoopStart, pendingFanoutIndices, runFanoutResume, runLoop } from "../loop.ts";
|
|
23
|
+
import { effectiveLoopOf, freezesEntryArgsOf } from "../loop-constructors.ts";
|
|
24
|
+
import { buildLoopEntry, type LoopDeps, sequentialStrategyOf } from "../loop-kinds.ts";
|
|
25
|
+
import { ensureUnitDeps } from "../loop-waves.ts";
|
|
26
|
+
import { FAIL_MISSING_ARTIFACT, type FailureText, MSG_RESUME_LOOP_MISMATCH } from "../messages.ts";
|
|
27
|
+
import type { RunContext, WorkflowHostContext } from "../types.ts";
|
|
28
|
+
import type { LoopResumePoint } from "./resume.ts";
|
|
29
29
|
|
|
30
30
|
export async function resumeLoopStage(
|
|
31
31
|
ctx: WorkflowHostContext,
|
package/runner/resume.ts
CHANGED
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
* re-entry hands it straight back to `runLoop`.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
import type { LoopDef, StageDef, Unit, Workflow } from "../api.
|
|
28
|
-
import { applyStageSuccess, rollLastSession } from "../audit-rows.
|
|
29
|
-
import { stageEntryArgs } from "../chain-state.
|
|
30
|
-
import { pushFailureMemo } from "../failure-memos.
|
|
31
|
-
import type { Artifact } from "../handle.
|
|
32
|
-
import { formatError } from "../internal-utils.
|
|
33
|
-
import { panelMembers } from "../judge.
|
|
34
|
-
import { projectResult, publishPanelVerdict } from "../loop.
|
|
35
|
-
import { effectiveLoopOf, freezesEntryArgsOf } from "../loop-constructors.
|
|
27
|
+
import type { LoopDef, StageDef, Unit, Workflow } from "../api.ts";
|
|
28
|
+
import { applyStageSuccess, rollLastSession } from "../audit-rows.ts";
|
|
29
|
+
import { stageEntryArgs } from "../chain-state.ts";
|
|
30
|
+
import { pushFailureMemo } from "../failure-memos.ts";
|
|
31
|
+
import type { Artifact } from "../handle.ts";
|
|
32
|
+
import { formatError } from "../internal-utils.ts";
|
|
33
|
+
import { panelMembers } from "../judge.ts";
|
|
34
|
+
import { projectResult, publishPanelVerdict } from "../loop.ts";
|
|
35
|
+
import { effectiveLoopOf, freezesEntryArgsOf } from "../loop-constructors.ts";
|
|
36
36
|
import {
|
|
37
37
|
advanceCursor,
|
|
38
38
|
foldFanoutCompletion,
|
|
@@ -41,18 +41,18 @@ import {
|
|
|
41
41
|
type LoopCursor,
|
|
42
42
|
sequentialStrategyOf,
|
|
43
43
|
unitTagOf,
|
|
44
|
-
} from "../loop-kinds.
|
|
45
|
-
import { ERR_RESUME_LOOP_MISMATCH } from "../messages.
|
|
46
|
-
import { failedOutput, type Output, outputMeta } from "../output.
|
|
44
|
+
} from "../loop-kinds.ts";
|
|
45
|
+
import { ERR_RESUME_LOOP_MISMATCH } from "../messages.ts";
|
|
46
|
+
import { failedOutput, type Output, outputMeta } from "../output.ts";
|
|
47
47
|
import {
|
|
48
48
|
type RoutingDecision,
|
|
49
49
|
readAllStagesForResume,
|
|
50
50
|
STATE_SCHEMA_VERSION,
|
|
51
51
|
type WorkflowHeader,
|
|
52
52
|
type WorkflowStage,
|
|
53
|
-
} from "../state/index.
|
|
54
|
-
import type { RunState } from "../types.
|
|
55
|
-
import { freshRunState } from "./run-context.
|
|
53
|
+
} from "../state/index.ts";
|
|
54
|
+
import type { RunState } from "../types.ts";
|
|
55
|
+
import { freshRunState } from "./run-context.ts";
|
|
56
56
|
|
|
57
57
|
/** Trailing open generation — everything `resume-loop.ts` needs to re-enter `runLoop`. */
|
|
58
58
|
export interface LoopResumePoint {
|
package/runner/run-context.ts
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* construction site without importing each other.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { Workflow } from "../api.
|
|
10
|
-
import { LifecycleDispatcher, type LifecycleListeners } from "../events.
|
|
11
|
-
import type { ModelSelection, WorkflowHost } from "../host.
|
|
12
|
-
import { MSG_BUDGET_INVALID } from "../messages.
|
|
13
|
-
import { getSkillContracts } from "../skill-contracts/index.
|
|
14
|
-
import type { BranchEntry } from "../transcript.
|
|
15
|
-
import type { RunTrigger } from "../triggers.
|
|
16
|
-
import type { RunContext, RunState } from "../types.
|
|
9
|
+
import type { Workflow } from "../api.ts";
|
|
10
|
+
import { LifecycleDispatcher, type LifecycleListeners } from "../events.ts";
|
|
11
|
+
import type { ModelSelection, WorkflowHost } from "../host.ts";
|
|
12
|
+
import { MSG_BUDGET_INVALID } from "../messages.ts";
|
|
13
|
+
import { getSkillContracts } from "../skill-contracts/index.ts";
|
|
14
|
+
import type { BranchEntry } from "../transcript.ts";
|
|
15
|
+
import type { RunTrigger } from "../triggers.ts";
|
|
16
|
+
import type { RunContext, RunState } from "../types.ts";
|
|
17
17
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// Policy constants
|
package/runner/run-stage.ts
CHANGED
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* JSONL failure row via failure.ts.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import type { StageDef, Unit } from "../api.
|
|
24
|
-
import { auditCtxFor, failedArgs, notifyPartialArtifacts, recordFatalFailure, runIdentityOf } from "../audit.
|
|
25
|
-
import { currentPrimaryArtifact, resolveStagePrompt, stageEntryArgs } from "../chain-state.
|
|
26
|
-
import { lifecycleCtxFor, skillStageRef } from "../events.
|
|
27
|
-
import { failureMemoSuffix } from "../failure-memos.
|
|
28
|
-
import { formatError } from "../internal-utils.
|
|
29
|
-
import { announceLoopStart, runLoop } from "../loop.
|
|
30
|
-
import { freezesEntryArgsOf } from "../loop-constructors.
|
|
31
|
-
import { buildLoopEntry, freshCursor, type LoopDeps, type LoopEntry } from "../loop-kinds.
|
|
32
|
-
import { ensureUnitDeps } from "../loop-waves.
|
|
23
|
+
import type { StageDef, Unit } from "../api.ts";
|
|
24
|
+
import { auditCtxFor, failedArgs, notifyPartialArtifacts, recordFatalFailure, runIdentityOf } from "../audit.ts";
|
|
25
|
+
import { currentPrimaryArtifact, resolveStagePrompt, stageEntryArgs } from "../chain-state.ts";
|
|
26
|
+
import { lifecycleCtxFor, skillStageRef } from "../events.ts";
|
|
27
|
+
import { failureMemoSuffix } from "../failure-memos.ts";
|
|
28
|
+
import { formatError } from "../internal-utils.ts";
|
|
29
|
+
import { announceLoopStart, runLoop } from "../loop.ts";
|
|
30
|
+
import { freezesEntryArgsOf } from "../loop-constructors.ts";
|
|
31
|
+
import { buildLoopEntry, freshCursor, type LoopDeps, type LoopEntry } from "../loop-kinds.ts";
|
|
32
|
+
import { ensureUnitDeps } from "../loop-waves.ts";
|
|
33
33
|
import {
|
|
34
34
|
FAIL_FANOUT_ALL_FAILED,
|
|
35
35
|
FAIL_LOOP_CAP_HALT,
|
|
@@ -38,31 +38,31 @@ import {
|
|
|
38
38
|
MSG_CONTINUE_FALLBACK,
|
|
39
39
|
MSG_RESUME_SESSION_FALLBACK,
|
|
40
40
|
MSG_SNAPSHOT_FAILED,
|
|
41
|
-
} from "../messages.
|
|
41
|
+
} from "../messages.ts";
|
|
42
42
|
import {
|
|
43
43
|
continueStageSession,
|
|
44
44
|
executeStageSession,
|
|
45
45
|
locateSessionFile,
|
|
46
46
|
reattachStageSession,
|
|
47
|
-
} from "../sessions/index.
|
|
48
|
-
import { forkChildSession, reattachChildSession } from "../sessions/spawn.
|
|
49
|
-
import type { SkillContractMap } from "../skill-contract.
|
|
50
|
-
import { effectiveOutputSchemaOf } from "../stage-identity.
|
|
51
|
-
import type { WorkflowStage } from "../state/index.
|
|
52
|
-
import type { RunContext, RunState, StageSessionContext, WorkflowHostContext } from "../types.
|
|
53
|
-
import { resolveDigest } from "../worktree-digest.
|
|
54
|
-
import { advanceChain, type ChainDeps } from "./chain-advance.
|
|
55
|
-
import { type ChainOutcome, haltChain, recordAbortedAtSeam, recordEntryThrow, withStageEntryGuard } from "./failure.
|
|
56
|
-
import { ensureContractInputValid, ensureInputValid } from "./input-validation.
|
|
57
|
-
import { ensureLoopNotContinue, runLoopPreflights, runSingleStagePreflights } from "./preflight.
|
|
58
|
-
import { type ResolvedStage, resolveStage } from "./resolve-stage.
|
|
59
|
-
import { runScript } from "./script-stage.
|
|
47
|
+
} from "../sessions/index.ts";
|
|
48
|
+
import { forkChildSession, reattachChildSession } from "../sessions/spawn.ts";
|
|
49
|
+
import type { SkillContractMap } from "../skill-contract.ts";
|
|
50
|
+
import { effectiveOutputSchemaOf } from "../stage-identity.ts";
|
|
51
|
+
import type { WorkflowStage } from "../state/index.ts";
|
|
52
|
+
import type { RunContext, RunState, StageSessionContext, WorkflowHostContext } from "../types.ts";
|
|
53
|
+
import { resolveDigest } from "../worktree-digest.ts";
|
|
54
|
+
import { advanceChain, type ChainDeps } from "./chain-advance.ts";
|
|
55
|
+
import { type ChainOutcome, haltChain, recordAbortedAtSeam, recordEntryThrow, withStageEntryGuard } from "./failure.ts";
|
|
56
|
+
import { ensureContractInputValid, ensureInputValid } from "./input-validation.ts";
|
|
57
|
+
import { ensureLoopNotContinue, runLoopPreflights, runSingleStagePreflights } from "./preflight.ts";
|
|
58
|
+
import { type ResolvedStage, resolveStage } from "./resolve-stage.ts";
|
|
59
|
+
import { runScript } from "./script-stage.ts";
|
|
60
60
|
|
|
61
61
|
// Re-exported for the package barrel + existing consumers; the class itself
|
|
62
62
|
// lives in the leaf errors.ts so preflight/input-validation can throw it
|
|
63
63
|
// without importing this module back.
|
|
64
|
-
export { StagePreflightError } from "./errors.
|
|
65
|
-
export type { ResolvedStage } from "./resolve-stage.
|
|
64
|
+
export { StagePreflightError } from "./errors.ts";
|
|
65
|
+
export type { ResolvedStage } from "./resolve-stage.ts";
|
|
66
66
|
|
|
67
67
|
// ---------------------------------------------------------------------------
|
|
68
68
|
// Walk composition — the ONE place the mutual recursion is wired
|
package/runner/runner.ts
CHANGED
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
* `## Phase N:` subdivision inside an implement plan artifact.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import type { Workflow } from "../api.
|
|
22
|
-
import { currentPrimaryArtifact } from "../chain-state.
|
|
23
|
-
import { type LifecycleListeners, lifecycleCtxFor } from "../events.
|
|
24
|
-
import { getWorkflowExecutionProvider } from "../execution-host.
|
|
25
|
-
import { handleToString } from "../handle.
|
|
26
|
-
import type { ModelSelection, WorkflowHost, WorkflowHostContext } from "../host.
|
|
27
|
-
import { nowIso } from "../internal-utils.
|
|
21
|
+
import type { Workflow } from "../api.ts";
|
|
22
|
+
import { currentPrimaryArtifact } from "../chain-state.ts";
|
|
23
|
+
import { type LifecycleListeners, lifecycleCtxFor } from "../events.ts";
|
|
24
|
+
import { getWorkflowExecutionProvider } from "../execution-host.ts";
|
|
25
|
+
import { handleToString } from "../handle.ts";
|
|
26
|
+
import type { ModelSelection, WorkflowHost, WorkflowHostContext } from "../host.ts";
|
|
27
|
+
import { nowIso } from "../internal-utils.ts";
|
|
28
28
|
import {
|
|
29
29
|
MSG_HEADER_WRITE_FAILED,
|
|
30
30
|
MSG_NAME_COLLISION,
|
|
31
31
|
MSG_NAME_INDEX_WRITE_FAILED,
|
|
32
32
|
MSG_NAME_INVALID,
|
|
33
|
-
} from "../messages.
|
|
34
|
-
import { pruneOrphanedChildSessions } from "../sessions/index.
|
|
33
|
+
} from "../messages.ts";
|
|
34
|
+
import { pruneOrphanedChildSessions } from "../sessions/index.ts";
|
|
35
35
|
import {
|
|
36
36
|
appendHeader,
|
|
37
37
|
type ClaimResult,
|
|
@@ -41,15 +41,15 @@ import {
|
|
|
41
41
|
releaseName,
|
|
42
42
|
STATE_SCHEMA_VERSION,
|
|
43
43
|
type WorkflowHeader,
|
|
44
|
-
} from "../state/index.
|
|
45
|
-
import { childSessionsDir } from "../state/paths.
|
|
46
|
-
import type { BranchEntry } from "../transcript.
|
|
47
|
-
import { DEFAULT_TRIGGER } from "../triggers.
|
|
48
|
-
import type { RunContext, RunWorkflowOptions, RunWorkflowResult } from "../types.
|
|
49
|
-
import { reconstructState } from "./resume.
|
|
50
|
-
import { resumeRefusalError, selectResumeEntry } from "./resume-entry.
|
|
51
|
-
import { buildRunContext, freshRunState, validateRunBudgets } from "./run-context.
|
|
52
|
-
import { dispatchStageOrRecordFailure } from "./run-stage.
|
|
44
|
+
} from "../state/index.ts";
|
|
45
|
+
import { childSessionsDir } from "../state/paths.ts";
|
|
46
|
+
import type { BranchEntry } from "../transcript.ts";
|
|
47
|
+
import { DEFAULT_TRIGGER } from "../triggers.ts";
|
|
48
|
+
import type { RunContext, RunWorkflowOptions, RunWorkflowResult } from "../types.ts";
|
|
49
|
+
import { reconstructState } from "./resume.ts";
|
|
50
|
+
import { resumeRefusalError, selectResumeEntry } from "./resume-entry.ts";
|
|
51
|
+
import { buildRunContext, freshRunState, validateRunBudgets } from "./run-context.ts";
|
|
52
|
+
import { dispatchStageOrRecordFailure } from "./run-stage.ts";
|
|
53
53
|
|
|
54
54
|
// ---------------------------------------------------------------------------
|
|
55
55
|
// Shared tail — executeRun
|