@interf/compiler 0.4.1 → 0.5.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 +70 -66
- package/builtin-workflows/interf/README.md +6 -6
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +7 -7
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +2 -2
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +1 -1
- package/builtin-workflows/interf/{workspace.schema.json → compiled.schema.json} +5 -5
- package/builtin-workflows/interf/improve/SKILL.md +3 -3
- package/builtin-workflows/interf/use/query/SKILL.md +2 -2
- package/builtin-workflows/interf/workflow.json +42 -31
- package/dist/commands/check-draft.d.ts +19 -0
- package/dist/commands/check-draft.js +110 -0
- package/dist/commands/compile-controller.d.ts +4 -4
- package/dist/commands/compile-controller.js +117 -81
- package/dist/commands/compile.d.ts +5 -5
- package/dist/commands/compile.js +61 -62
- package/dist/commands/compiled-flow.d.ts +23 -0
- package/dist/commands/compiled-flow.js +112 -0
- package/dist/commands/create-workflow-wizard.d.ts +3 -3
- package/dist/commands/create-workflow-wizard.js +11 -11
- package/dist/commands/create.d.ts +2 -2
- package/dist/commands/create.js +50 -57
- package/dist/commands/default.js +2 -2
- package/dist/commands/executor-flow.d.ts +20 -1
- package/dist/commands/executor-flow.js +67 -7
- package/dist/commands/init.js +242 -289
- package/dist/commands/list.js +14 -10
- package/dist/commands/reset.js +6 -6
- package/dist/commands/source-config-wizard.d.ts +12 -8
- package/dist/commands/source-config-wizard.js +356 -119
- package/dist/commands/status.js +49 -26
- package/dist/commands/test-flow.d.ts +23 -10
- package/dist/commands/test-flow.js +274 -65
- package/dist/commands/test.d.ts +7 -1
- package/dist/commands/test.js +264 -65
- package/dist/commands/verify.js +23 -14
- package/dist/index.d.ts +7 -7
- package/dist/index.js +4 -4
- package/dist/lib/agent-args.js +2 -1
- package/dist/lib/agent-constants.js +1 -1
- package/dist/lib/agent-render.js +4 -4
- package/dist/lib/agent-shells.d.ts +8 -8
- package/dist/lib/agent-shells.js +231 -142
- package/dist/lib/{workflow-abi.d.ts → builtin-compiled-workflow.d.ts} +37 -46
- package/dist/lib/builtin-compiled-workflow.js +153 -0
- package/dist/lib/compiled-compile.d.ts +52 -0
- package/dist/lib/compiled-compile.js +274 -0
- package/dist/lib/compiled-home.d.ts +5 -0
- package/dist/lib/compiled-home.js +32 -0
- package/dist/lib/compiled-paths.d.ts +39 -0
- package/dist/lib/compiled-paths.js +103 -0
- package/dist/lib/{workspace-raw.d.ts → compiled-raw.d.ts} +9 -8
- package/dist/lib/{workspace-raw.js → compiled-raw.js} +16 -14
- package/dist/lib/compiled-reset.d.ts +1 -0
- package/dist/lib/compiled-reset.js +44 -0
- package/dist/lib/compiled-schema.d.ts +27 -0
- package/dist/lib/compiled-schema.js +110 -0
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +0 -1
- package/dist/lib/discovery.d.ts +1 -1
- package/dist/lib/discovery.js +3 -3
- package/dist/lib/interf-bootstrap.d.ts +1 -1
- package/dist/lib/interf-bootstrap.js +4 -4
- package/dist/lib/interf-detect.d.ts +9 -10
- package/dist/lib/interf-detect.js +70 -59
- package/dist/lib/interf-scaffold.d.ts +2 -2
- package/dist/lib/interf-scaffold.js +90 -57
- package/dist/lib/interf-workflow-package.d.ts +3 -3
- package/dist/lib/interf-workflow-package.js +30 -30
- package/dist/lib/interf.d.ts +5 -5
- package/dist/lib/interf.js +4 -4
- package/dist/lib/local-workflows.d.ts +4 -4
- package/dist/lib/local-workflows.js +35 -70
- package/dist/lib/obsidian.d.ts +1 -1
- package/dist/lib/parse.js +92 -1
- package/dist/lib/project-paths.d.ts +11 -0
- package/dist/lib/project-paths.js +32 -0
- package/dist/lib/runtime-acceptance.d.ts +7 -1
- package/dist/lib/runtime-acceptance.js +194 -59
- package/dist/lib/runtime-contracts.d.ts +2 -4
- package/dist/lib/runtime-contracts.js +17 -161
- package/dist/lib/runtime-inventory.d.ts +7 -0
- package/dist/lib/runtime-inventory.js +29 -0
- package/dist/lib/runtime-paths.js +5 -5
- package/dist/lib/runtime-prompt.js +7 -6
- package/dist/lib/runtime-reconcile.d.ts +2 -3
- package/dist/lib/runtime-reconcile.js +94 -184
- package/dist/lib/runtime-runs.js +25 -119
- package/dist/lib/runtime-types.d.ts +10 -19
- package/dist/lib/runtime.d.ts +2 -2
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/schema.d.ts +169 -153
- package/dist/lib/schema.js +116 -164
- package/dist/lib/source-config.d.ts +24 -20
- package/dist/lib/source-config.js +159 -122
- package/dist/lib/state-artifacts.d.ts +5 -5
- package/dist/lib/state-artifacts.js +8 -8
- package/dist/lib/state-health.d.ts +4 -4
- package/dist/lib/state-health.js +110 -126
- package/dist/lib/state-io.d.ts +8 -8
- package/dist/lib/state-io.js +21 -102
- package/dist/lib/state-paths.js +5 -5
- package/dist/lib/state-view.d.ts +4 -4
- package/dist/lib/state-view.js +52 -55
- package/dist/lib/state.d.ts +5 -5
- package/dist/lib/state.js +4 -4
- package/dist/lib/summarize-plan.d.ts +3 -2
- package/dist/lib/summarize-plan.js +19 -21
- package/dist/lib/test-execution.js +9 -9
- package/dist/lib/test-matrices.d.ts +3 -3
- package/dist/lib/test-matrices.js +6 -6
- package/dist/lib/test-paths.d.ts +4 -4
- package/dist/lib/test-paths.js +26 -11
- package/dist/lib/test-sandbox.d.ts +1 -1
- package/dist/lib/test-sandbox.js +32 -38
- package/dist/lib/test-specs.js +1 -1
- package/dist/lib/test-targets.d.ts +2 -2
- package/dist/lib/test-targets.js +11 -11
- package/dist/lib/test-types.d.ts +1 -1
- package/dist/lib/test.d.ts +1 -1
- package/dist/lib/test.js +1 -1
- package/dist/lib/util.d.ts +2 -0
- package/dist/lib/util.js +14 -1
- package/dist/lib/validate-compiled.d.ts +27 -0
- package/dist/lib/validate-compiled.js +238 -0
- package/dist/lib/validate-helpers.d.ts +0 -8
- package/dist/lib/validate-helpers.js +0 -30
- package/dist/lib/validate.d.ts +6 -4
- package/dist/lib/validate.js +76 -27
- package/dist/lib/workflow-definitions.d.ts +12 -11
- package/dist/lib/workflow-definitions.js +45 -55
- package/dist/lib/workflow-helpers.d.ts +2 -3
- package/dist/lib/workflow-helpers.js +9 -13
- package/dist/lib/workflow-improvement.d.ts +3 -3
- package/dist/lib/workflow-improvement.js +48 -48
- package/dist/lib/workflow-primitives.d.ts +2 -0
- package/dist/lib/workflow-primitives.js +5 -0
- package/dist/lib/workflow-review-paths.d.ts +3 -3
- package/dist/lib/workflow-review-paths.js +11 -11
- package/dist/lib/workflow-stage-runner.d.ts +1 -1
- package/dist/lib/workflow-stage-runner.js +8 -8
- package/dist/lib/workflows.d.ts +9 -9
- package/dist/lib/workflows.js +15 -17
- package/package.json +13 -12
- package/dist/commands/workspace-flow.d.ts +0 -23
- package/dist/commands/workspace-flow.js +0 -109
- package/dist/lib/registry.d.ts +0 -16
- package/dist/lib/registry.js +0 -65
- package/dist/lib/validate-workspace.d.ts +0 -121
- package/dist/lib/validate-workspace.js +0 -407
- package/dist/lib/workflow-abi.js +0 -181
- package/dist/lib/workspace-compile.d.ts +0 -54
- package/dist/lib/workspace-compile.js +0 -476
- package/dist/lib/workspace-home.d.ts +0 -5
- package/dist/lib/workspace-home.js +0 -32
- package/dist/lib/workspace-layout.d.ts +0 -2
- package/dist/lib/workspace-layout.js +0 -60
- package/dist/lib/workspace-paths.d.ts +0 -41
- package/dist/lib/workspace-paths.js +0 -107
- package/dist/lib/workspace-reset.d.ts +0 -1
- package/dist/lib/workspace-reset.js +0 -43
- package/dist/lib/workspace-schema.d.ts +0 -17
- package/dist/lib/workspace-schema.js +0 -74
|
@@ -3,16 +3,9 @@ import { join } from "node:path";
|
|
|
3
3
|
import { isWorkflowId, listLocalWorkflowDefinitions, loadLocalWorkflowDefinition, loadWorkflowDefinitionFromDir, } from "./local-workflows.js";
|
|
4
4
|
import { PACKAGE_ROOT } from "./config.js";
|
|
5
5
|
import { resolveSourceControlPath } from "./interf.js";
|
|
6
|
-
import { validateWorkspaceContractSequence, } from "./workflow-abi.js";
|
|
7
6
|
import { warnInterf } from "./logger.js";
|
|
8
|
-
import {
|
|
7
|
+
import { workflowPackagePathForCompiled } from "./compiled-paths.js";
|
|
9
8
|
let builtinInterfWorkflowCache = null;
|
|
10
|
-
function validateWorkspaceStages(stages) {
|
|
11
|
-
if (stages.length < 3)
|
|
12
|
-
return false;
|
|
13
|
-
const sequence = validateWorkspaceContractSequence(stages.map((stage) => stage.contractType));
|
|
14
|
-
return sequence.ok;
|
|
15
|
-
}
|
|
16
9
|
function toWorkflowStages(stages, fallbackStages) {
|
|
17
10
|
if (!stages || stages.length === 0)
|
|
18
11
|
return [...fallbackStages];
|
|
@@ -42,13 +35,13 @@ function mergeStagePolicyNotes(stages, baseNotes, overrideNotes) {
|
|
|
42
35
|
}
|
|
43
36
|
export function standaloneWorkflowDefinitionFromLocalPackage(local) {
|
|
44
37
|
if (!local.stages || local.stages.length === 0) {
|
|
45
|
-
throw new Error(`Workflow package "${local.id}" is missing explicit stages.
|
|
38
|
+
throw new Error(`Workflow package "${local.id}" is missing explicit stages. Compiled-local and portable workflow packages must be standalone.`);
|
|
46
39
|
}
|
|
47
40
|
const stages = toWorkflowStages(local.stages, []);
|
|
48
41
|
return {
|
|
49
42
|
id: local.id,
|
|
50
43
|
compilerApi: local.compiler_api ?? {
|
|
51
|
-
kind: "
|
|
44
|
+
kind: "compiled",
|
|
52
45
|
version: 1,
|
|
53
46
|
},
|
|
54
47
|
label: local.label,
|
|
@@ -71,9 +64,6 @@ function getBuiltinInterfWorkflow() {
|
|
|
71
64
|
throw new Error("Missing built-in Interf workflow package at builtin-workflows/interf.");
|
|
72
65
|
}
|
|
73
66
|
const resolved = standaloneWorkflowDefinitionFromLocalPackage(local);
|
|
74
|
-
if (!validateWorkspaceStages(resolved.stages)) {
|
|
75
|
-
throw new Error("Built-in Interf workflow package has an invalid stage ordering.");
|
|
76
|
-
}
|
|
77
67
|
builtinInterfWorkflowCache = {
|
|
78
68
|
...resolved,
|
|
79
69
|
id: "interf",
|
|
@@ -82,31 +72,28 @@ function getBuiltinInterfWorkflow() {
|
|
|
82
72
|
};
|
|
83
73
|
return builtinInterfWorkflowCache;
|
|
84
74
|
}
|
|
85
|
-
function
|
|
75
|
+
function listBuiltinCompiledWorkflows() {
|
|
86
76
|
return [getBuiltinInterfWorkflow()];
|
|
87
77
|
}
|
|
88
|
-
function
|
|
78
|
+
function resolveCompiledWorkflowFromLocal(workflowId, sourcePath) {
|
|
89
79
|
const local = loadLocalWorkflowDefinition(sourcePath, workflowId);
|
|
90
80
|
if (!local)
|
|
91
81
|
return null;
|
|
92
82
|
if (local.extends) {
|
|
93
|
-
throw new Error(`Workflow "${workflowId}" uses legacy extends. Rewrite it as a standalone package before creating or compiling a
|
|
83
|
+
throw new Error(`Workflow "${workflowId}" uses legacy extends. Rewrite it as a standalone package before creating or compiling a compiled dataset.`);
|
|
94
84
|
}
|
|
95
85
|
const resolved = standaloneWorkflowDefinitionFromLocalPackage(local);
|
|
96
|
-
if (!validateWorkspaceStages(resolved.stages)) {
|
|
97
|
-
throw new Error(`Workflow "${workflowId}" has an invalid stage ordering. Workspace workflows must have one or more workspace-file-evidence stages followed by one or more workspace-knowledge-structure stages and one or more workspace-query-shape stages.`);
|
|
98
|
-
}
|
|
99
86
|
return resolved;
|
|
100
87
|
}
|
|
101
|
-
export function
|
|
102
|
-
const builtins =
|
|
88
|
+
export function listCompiledWorkflowChoices(sourcePath) {
|
|
89
|
+
const builtins = listBuiltinCompiledWorkflows();
|
|
103
90
|
if (!sourcePath)
|
|
104
91
|
return builtins;
|
|
105
92
|
const locals = listLocalWorkflowDefinitions(sourcePath)
|
|
106
93
|
.filter((definition) => definition.id !== "interf")
|
|
107
94
|
.map((definition) => {
|
|
108
95
|
try {
|
|
109
|
-
return
|
|
96
|
+
return resolveCompiledWorkflowFromLocal(definition.id, sourcePath);
|
|
110
97
|
}
|
|
111
98
|
catch (error) {
|
|
112
99
|
warnInterf(`Warning: skipping local workflow "${definition.id}" because it could not be resolved cleanly: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -116,66 +103,69 @@ export function listWorkspaceWorkflowChoices(sourcePath) {
|
|
|
116
103
|
.filter((definition) => definition !== null);
|
|
117
104
|
return [...builtins, ...locals];
|
|
118
105
|
}
|
|
119
|
-
export function
|
|
120
|
-
const builtin =
|
|
106
|
+
export function getCompiledWorkflow(workflowId, options = {}) {
|
|
107
|
+
const builtin = listBuiltinCompiledWorkflows().find((candidate) => candidate.id === workflowId);
|
|
121
108
|
if (builtin)
|
|
122
109
|
return builtin;
|
|
123
110
|
if (options.sourcePath) {
|
|
124
|
-
const local =
|
|
111
|
+
const local = resolveCompiledWorkflowFromLocal(workflowId, options.sourcePath);
|
|
125
112
|
if (local)
|
|
126
113
|
return local;
|
|
127
114
|
throw new Error(`No local workflow package found for "${workflowId}" under ${join(options.sourcePath, "interf", "workflows", workflowId)}.`);
|
|
128
115
|
}
|
|
129
116
|
throw new Error(`Workflow "${workflowId}" is not built-in. Provide a source path so Interf Compiler can resolve a local workflow package.`);
|
|
130
117
|
}
|
|
131
|
-
export function
|
|
132
|
-
const workflowPath =
|
|
118
|
+
export function getActiveCompiledWorkflow(compiledPath, fallbackWorkflowId) {
|
|
119
|
+
const workflowPath = workflowPackagePathForCompiled(compiledPath);
|
|
133
120
|
if (existsSync(join(workflowPath, "workflow.json"))) {
|
|
134
121
|
const local = loadWorkflowDefinitionFromDir(workflowPath);
|
|
135
122
|
if (!local) {
|
|
136
|
-
throw new Error(`
|
|
123
|
+
throw new Error(`Dataset-local workflow package at ${workflowPath} is missing or invalid. Interf compile runs the local package directly; recreate or reseed this compiled dataset instead of relying on source-root fallback.`);
|
|
137
124
|
}
|
|
138
125
|
if (local.extends) {
|
|
139
|
-
throw new Error(`
|
|
140
|
-
}
|
|
141
|
-
const resolved = standaloneWorkflowDefinitionFromLocalPackage(local);
|
|
142
|
-
if (!validateWorkspaceStages(resolved.stages)) {
|
|
143
|
-
throw new Error(`Workspace-local workflow package at ${workflowPath} has an invalid stage ordering. Interf compile will not silently switch methods for this workspace.`);
|
|
126
|
+
throw new Error(`Dataset-local workflow package at ${workflowPath} still uses legacy extends. Materialize it as a standalone package before compiling this compiled dataset.`);
|
|
144
127
|
}
|
|
145
|
-
return
|
|
128
|
+
return standaloneWorkflowDefinitionFromLocalPackage(local);
|
|
146
129
|
}
|
|
147
|
-
throw new Error(`Missing
|
|
130
|
+
throw new Error(`Missing local workflow package at ${workflowPath}. Interf compile runs the local package directly, so recreate or reseed this compiled dataset instead of relying on source-root workflow "${fallbackWorkflowId}" under ${resolveSourceControlPath(compiledPath)}.`);
|
|
148
131
|
}
|
|
149
|
-
export function
|
|
132
|
+
export function resolveCompiledWorkflowId(value) {
|
|
150
133
|
if (typeof value === "string" && isWorkflowId(value)) {
|
|
151
134
|
return value;
|
|
152
135
|
}
|
|
153
|
-
return
|
|
136
|
+
return null;
|
|
154
137
|
}
|
|
155
|
-
export function
|
|
138
|
+
export function resolveCompiledWorkflowFromConfig(config) {
|
|
156
139
|
if (!config || typeof config !== "object")
|
|
157
|
-
return
|
|
140
|
+
return null;
|
|
158
141
|
const raw = config;
|
|
159
|
-
return
|
|
142
|
+
return resolveCompiledWorkflowId(raw.workflow);
|
|
143
|
+
}
|
|
144
|
+
export function resolveRequiredCompiledWorkflowFromConfig(config, label = "compiled config") {
|
|
145
|
+
const workflowId = resolveCompiledWorkflowFromConfig(config);
|
|
146
|
+
if (!workflowId) {
|
|
147
|
+
throw new Error(`Missing or invalid workflow in ${label}.`);
|
|
148
|
+
}
|
|
149
|
+
return workflowId;
|
|
160
150
|
}
|
|
161
|
-
export function
|
|
162
|
-
return formatWorkflowStageStep(
|
|
151
|
+
export function formatCompiledWorkflowStageStep(workflowId, stage, options = {}) {
|
|
152
|
+
return formatWorkflowStageStep(getCompiledWorkflow(workflowId, options), stage);
|
|
163
153
|
}
|
|
164
154
|
function resolveWorkflowDefinitionForStageMetadata(workflowId, sourcePath) {
|
|
165
155
|
if (sourcePath &&
|
|
166
|
-
existsSync(join(
|
|
167
|
-
return
|
|
156
|
+
existsSync(join(workflowPackagePathForCompiled(sourcePath), "workflow.json"))) {
|
|
157
|
+
return getActiveCompiledWorkflow(sourcePath, workflowId);
|
|
168
158
|
}
|
|
169
|
-
return
|
|
159
|
+
return getCompiledWorkflow(workflowId, { sourcePath });
|
|
170
160
|
}
|
|
171
161
|
function formatWorkflowStageStep(workflow, stage) {
|
|
172
162
|
const stageIndex = workflow.stages.findIndex((candidate) => candidate.id === stage);
|
|
173
163
|
if (stageIndex === -1) {
|
|
174
|
-
throw new Error(`Stage "${stage}" is not part of the
|
|
164
|
+
throw new Error(`Stage "${stage}" is not part of the compiled runtime.`);
|
|
175
165
|
}
|
|
176
166
|
const stageDefinition = workflow.stages[stageIndex];
|
|
177
167
|
if (!stageDefinition) {
|
|
178
|
-
throw new Error(`Stage "${stage}" is not part of the
|
|
168
|
+
throw new Error(`Stage "${stage}" is not part of the compiled runtime.`);
|
|
179
169
|
}
|
|
180
170
|
return `Step ${stageIndex + 1}/${workflow.stages.length} - ${stageDefinition.label}`;
|
|
181
171
|
}
|
|
@@ -197,20 +187,20 @@ export function getWorkflowStagePosition(workflowId, stage, sourcePath) {
|
|
|
197
187
|
export function getWorkflowStages(workflowId, sourcePath) {
|
|
198
188
|
return resolveWorkflowDefinitionForStageMetadata(workflowId, sourcePath).stages.map((definition) => definition.id);
|
|
199
189
|
}
|
|
200
|
-
export function
|
|
201
|
-
return
|
|
190
|
+
export function getActiveCompiledStages(compiledPath, fallbackWorkflowId) {
|
|
191
|
+
return getActiveCompiledWorkflow(compiledPath, fallbackWorkflowId).stages.map((definition) => definition.id);
|
|
202
192
|
}
|
|
203
193
|
export function getWorkflowStagePolicyNotes(workflowId, stage, sourcePath) {
|
|
204
194
|
const workflow = resolveWorkflowDefinitionForStageMetadata(workflowId, sourcePath);
|
|
205
195
|
return [...(workflow.stagePolicyNotes?.[stage] ?? [])];
|
|
206
196
|
}
|
|
207
|
-
export function
|
|
208
|
-
const workflow =
|
|
197
|
+
export function getActiveCompiledStagePolicyNotes(compiledPath, fallbackWorkflowId, stage) {
|
|
198
|
+
const workflow = getActiveCompiledWorkflow(compiledPath, fallbackWorkflowId);
|
|
209
199
|
return [...(workflow.stagePolicyNotes?.[stage] ?? [])];
|
|
210
200
|
}
|
|
211
|
-
export function
|
|
212
|
-
return
|
|
201
|
+
export function resolveActiveCompiledStageAcceptance(compiledPath, fallbackWorkflowId, stage) {
|
|
202
|
+
return getActiveCompiledWorkflow(compiledPath, fallbackWorkflowId).stages.find((candidate) => candidate.id === stage)?.acceptance;
|
|
213
203
|
}
|
|
214
|
-
export function
|
|
215
|
-
return formatWorkflowStageStep(
|
|
204
|
+
export function formatActiveCompiledWorkflowStageStep(compiledPath, fallbackWorkflowId, stage) {
|
|
205
|
+
return formatWorkflowStageStep(getActiveCompiledWorkflow(compiledPath, fallbackWorkflowId), stage);
|
|
216
206
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LocalInstructionMode, type
|
|
1
|
+
import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "./schema.js";
|
|
2
2
|
import { type WorkflowStageDefinition } from "./workflow-definitions.js";
|
|
3
3
|
export interface WorkflowReporter {
|
|
4
4
|
line?: (message: string) => void;
|
|
@@ -24,11 +24,10 @@ export declare function emptyLocalSkillContractExtension(): LocalSkillContractEx
|
|
|
24
24
|
export declare function buildLocalSkillContractExtension(rootPath: string, directories: string[], purpose: string): LocalSkillContractExtension;
|
|
25
25
|
export declare function buildLocalSkillContractExtensionRelativeTo(rootPath: string, relativeToPath: string, directories: string[], purpose: string): LocalSkillContractExtension;
|
|
26
26
|
export declare function mergeLocalSkillContractExtensions(extensions: LocalSkillContractExtension[]): LocalSkillContractExtension;
|
|
27
|
-
export declare function buildStageInstructions(
|
|
27
|
+
export declare function buildStageInstructions(stageSkillDir: string, localSkills: LocalSkillContractExtension): RuntimeStageInstructions;
|
|
28
28
|
export declare function reportLine(reporter: WorkflowReporter | undefined, message: string): void;
|
|
29
29
|
export declare function reportBlankLine(reporter: WorkflowReporter | undefined): void;
|
|
30
30
|
export declare function reportValidationFailure(reporter: WorkflowReporter | undefined, summary: string, errors?: string[]): void;
|
|
31
|
-
export declare function bundledSkillForContractType(contractType: RuntimeContractType): string;
|
|
32
31
|
export declare function resolveStageAcceptance(workflowId: string, stageId: string, sourcePath?: string): WorkflowStageDefinition["acceptance"] | undefined;
|
|
33
32
|
export declare function validateStageOutcome(_dirPath: string, validation: {
|
|
34
33
|
ok: boolean;
|
|
@@ -2,10 +2,9 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import { join, relative, sep } from "node:path";
|
|
3
3
|
import { listFilesRecursive } from "./filesystem.js";
|
|
4
4
|
import { isMarkdownFile } from "./util.js";
|
|
5
|
-
import {
|
|
6
|
-
import { getWorkspaceWorkflow, } from "./workflow-definitions.js";
|
|
5
|
+
import { getCompiledWorkflow, } from "./workflow-definitions.js";
|
|
7
6
|
import { parseJsonFrontmatter } from "./parse.js";
|
|
8
|
-
import {
|
|
7
|
+
import { workflowPackagePathForCompiled } from "./compiled-paths.js";
|
|
9
8
|
const LOCAL_SKILL_READ_LIMIT = 50;
|
|
10
9
|
export function workflowQueryDirectory() {
|
|
11
10
|
return "workflow/use/query";
|
|
@@ -41,7 +40,7 @@ function collectLocalSkillDocs(rootPath, directories) {
|
|
|
41
40
|
}
|
|
42
41
|
function collectLocalSkillDocsRelativeTo(rootPath, relativeToPath, directories) {
|
|
43
42
|
const docs = new Map();
|
|
44
|
-
const workflowRoot =
|
|
43
|
+
const workflowRoot = workflowPackagePathForCompiled(rootPath);
|
|
45
44
|
const rootReadme = join(workflowRoot, "README.md");
|
|
46
45
|
if (existsSync(rootReadme)) {
|
|
47
46
|
const read = projectWorkflowReadPath(rootPath, relativeToPath, rootReadme);
|
|
@@ -68,16 +67,16 @@ function collectLocalSkillDocsRelativeTo(rootPath, relativeToPath, directories)
|
|
|
68
67
|
}
|
|
69
68
|
function resolveAuthoringDirectory(rootPath, directory) {
|
|
70
69
|
if (directory === "workflow") {
|
|
71
|
-
return
|
|
70
|
+
return workflowPackagePathForCompiled(rootPath);
|
|
72
71
|
}
|
|
73
72
|
if (directory.startsWith(`workflow${sep}`) || directory.startsWith("workflow/")) {
|
|
74
73
|
const relativeWorkflowPath = directory.replace(/^workflow[\\/]/, "");
|
|
75
|
-
return join(
|
|
74
|
+
return join(workflowPackagePathForCompiled(rootPath), relativeWorkflowPath);
|
|
76
75
|
}
|
|
77
76
|
return join(rootPath, directory);
|
|
78
77
|
}
|
|
79
78
|
function projectWorkflowReadPath(rootPath, relativeToPath, absolutePath) {
|
|
80
|
-
const workflowRoot =
|
|
79
|
+
const workflowRoot = workflowPackagePathForCompiled(rootPath);
|
|
81
80
|
const normalizedWorkflowRoot = `${workflowRoot}${sep}`;
|
|
82
81
|
if (absolutePath === workflowRoot || absolutePath.startsWith(normalizedWorkflowRoot)) {
|
|
83
82
|
const relativeWorkflowPath = relative(workflowRoot, absolutePath);
|
|
@@ -139,9 +138,9 @@ export function mergeLocalSkillContractExtensions(extensions) {
|
|
|
139
138
|
modeSources,
|
|
140
139
|
};
|
|
141
140
|
}
|
|
142
|
-
export function buildStageInstructions(
|
|
141
|
+
export function buildStageInstructions(stageSkillDir, localSkills) {
|
|
143
142
|
return {
|
|
144
|
-
|
|
143
|
+
stage_skill_dir: stageSkillDir,
|
|
145
144
|
effective_mode: localSkills.effectiveMode,
|
|
146
145
|
local_mode: localSkills.localMode,
|
|
147
146
|
local_docs: localSkills.reads,
|
|
@@ -160,11 +159,8 @@ export function reportValidationFailure(reporter, summary, errors = []) {
|
|
|
160
159
|
reportLine(reporter, `- ${error}`);
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
|
-
export function bundledSkillForContractType(contractType) {
|
|
164
|
-
return workspaceBundledSkillForContractType(contractType);
|
|
165
|
-
}
|
|
166
162
|
export function resolveStageAcceptance(workflowId, stageId, sourcePath) {
|
|
167
|
-
return
|
|
163
|
+
return getCompiledWorkflow(workflowId, { sourcePath }).stages.find((stage) => stage.id === stageId)?.acceptance;
|
|
168
164
|
}
|
|
169
165
|
export function validateStageOutcome(_dirPath, validation) {
|
|
170
166
|
return validation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WorkflowExecutor } from "./executors.js";
|
|
2
2
|
import { type WorkflowValidationResult } from "./local-workflows.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { SourceDatasetConfig, WorkflowImprovementLoopSummary } from "./schema.js";
|
|
4
4
|
export interface WorkflowImprovementRunResult {
|
|
5
5
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
6
6
|
changed: boolean;
|
|
@@ -11,9 +11,9 @@ export interface WorkflowImprovementRunResult {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function runWorkflowImprovementLoop(options: {
|
|
13
13
|
executor: WorkflowExecutor;
|
|
14
|
-
|
|
14
|
+
compiledPath: string;
|
|
15
15
|
workflowId: string;
|
|
16
|
-
|
|
16
|
+
compiledConfig: Pick<SourceDatasetConfig, "checks">;
|
|
17
17
|
runId: string;
|
|
18
18
|
loopIndex: number;
|
|
19
19
|
maxLoops: number;
|
|
@@ -4,10 +4,10 @@ import { createWorkflowImprovementShell, freezeWorkflowImprovementShell, } from
|
|
|
4
4
|
import { readInterfConfig } from "./interf.js";
|
|
5
5
|
import { validateWorkflowPackage } from "./local-workflows.js";
|
|
6
6
|
import { readJsonFileWithSchema } from "./parse.js";
|
|
7
|
-
import {
|
|
7
|
+
import { saveCompiledInterfConfig } from "./source-config.js";
|
|
8
8
|
import { WorkflowImprovementRunLedgerSchema, } from "./schema.js";
|
|
9
9
|
import { resolveWorkflowImprovementReviewPaths } from "./workflow-review-paths.js";
|
|
10
|
-
import {
|
|
10
|
+
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, workflowImprovementRunRoot, workflowPackagePathForCompiled, } from "./compiled-paths.js";
|
|
11
11
|
function copyDirectory(sourcePath, targetPath) {
|
|
12
12
|
rmSync(targetPath, { recursive: true, force: true });
|
|
13
13
|
mkdirSync(targetPath, { recursive: true });
|
|
@@ -55,31 +55,31 @@ function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
|
|
|
55
55
|
const relativePath = relative(sourceRoot, absolutePath);
|
|
56
56
|
return join(shellRoot, relativePath);
|
|
57
57
|
}
|
|
58
|
-
function mapLoopSummaryForShell(summary,
|
|
58
|
+
function mapLoopSummaryForShell(summary, compiledPath) {
|
|
59
59
|
const shellTestRunsRoot = "artifacts/test-runs";
|
|
60
60
|
const shellTestSandboxesRoot = "artifacts/test-sandboxes";
|
|
61
61
|
return {
|
|
62
62
|
...summary,
|
|
63
|
-
test_run_path: toShellArtifactPath(summary.test_run_path,
|
|
64
|
-
test_sandbox_path: toShellArtifactPath(summary.test_sandbox_path,
|
|
63
|
+
test_run_path: toShellArtifactPath(summary.test_run_path, targetTestRunsRootForCompiled(compiledPath), shellTestRunsRoot) ?? summary.test_run_path ?? null,
|
|
64
|
+
test_sandbox_path: toShellArtifactPath(summary.test_sandbox_path, targetTestSandboxesRootForCompiled(compiledPath), shellTestSandboxesRoot) ?? summary.test_sandbox_path ?? null,
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
function buildLoopContext(options) {
|
|
68
|
-
const previousVariations = options.previousVariations.map((summary) => mapLoopSummaryForShell(summary, options.
|
|
68
|
+
const previousVariations = options.previousVariations.map((summary) => mapLoopSummaryForShell(summary, options.compiledPath));
|
|
69
69
|
const latestFailure = previousVariations.at(-1) ?? null;
|
|
70
70
|
return {
|
|
71
71
|
kind: "interf-workflow-improvement-loop",
|
|
72
72
|
version: 1,
|
|
73
73
|
generated_at: new Date().toISOString(),
|
|
74
|
-
target_name: readInterfConfig(options.
|
|
74
|
+
target_name: readInterfConfig(options.compiledPath)?.name ?? "compiled",
|
|
75
75
|
workflow_id: options.workflowId,
|
|
76
76
|
loop_index: options.loopIndex,
|
|
77
77
|
max_loops: options.maxLoops,
|
|
78
78
|
max_attempts: options.maxAttempts,
|
|
79
|
-
review_paths: resolveWorkflowImprovementReviewPaths(options.
|
|
79
|
+
review_paths: resolveWorkflowImprovementReviewPaths(options.compiledPath),
|
|
80
80
|
truth_checks: {
|
|
81
|
-
count: options.
|
|
82
|
-
questions: options.
|
|
81
|
+
count: options.compiledConfig.checks.length,
|
|
82
|
+
questions: options.compiledConfig.checks.map((check, index) => ({
|
|
83
83
|
id: check.id ?? `check-${index + 1}`,
|
|
84
84
|
question: check.question,
|
|
85
85
|
})),
|
|
@@ -93,21 +93,21 @@ function buildWorkflowImprovementPrompt() {
|
|
|
93
93
|
"This is an automated Interf Compiler workflow-improvement run, not an open-ended chat session.",
|
|
94
94
|
"The user already invoked this through `interf compile` with self-improving loops enabled. Execute it now.",
|
|
95
95
|
"Read `runtime/loop-context.json` first.",
|
|
96
|
-
"Then read `workflow/README.md`, `workflow/workflow.json`, `workflow/
|
|
96
|
+
"Then read `workflow/README.md`, `workflow/workflow.json`, `workflow/compiled.schema.json`, and `workflow/improve/SKILL.md` if it exists.",
|
|
97
97
|
"Review preserved evidence from earlier failures under `artifacts/` before you edit the workflow.",
|
|
98
98
|
"Treat `workflow/improve/SKILL.md` as guidance for how to improve the workflow, not as the default file to edit.",
|
|
99
99
|
"Prefer editing the stage docs, workflow contract, or schema ownership that actually change compiled outputs.",
|
|
100
100
|
"Edit only files under `workflow/`.",
|
|
101
|
-
"Do not edit truth checks, test specs, raw dataset files, or generated
|
|
102
|
-
"Keep the workflow valid for the current compiler API and
|
|
101
|
+
"Do not edit truth checks, test specs, raw dataset files, or generated compiled outputs.",
|
|
102
|
+
"Keep the workflow valid for the current compiler API and compiled schema.",
|
|
103
103
|
"Prefer small, defensible changes to workflow docs, stage docs, stage policies, or schema ownership over random churn.",
|
|
104
104
|
"Do not narrate plans or ask follow-up questions.",
|
|
105
105
|
"Only emit user-visible updates that begin with STATUS:, DONE:, BLOCKED:, or ERROR:.",
|
|
106
106
|
"As soon as the workflow edits are complete, stop.",
|
|
107
107
|
].join("\n");
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const current = readInterfConfig(options.
|
|
109
|
+
function updateCompiledWorkflowOrigin(options) {
|
|
110
|
+
const current = readInterfConfig(options.compiledPath);
|
|
111
111
|
if (!current)
|
|
112
112
|
return;
|
|
113
113
|
const nextConfig = {
|
|
@@ -118,27 +118,27 @@ function updateWorkspaceWorkflowOrigin(options) {
|
|
|
118
118
|
...(options.localDraft ? { local_draft: true } : {}),
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
saveCompiledInterfConfig(options.compiledPath, nextConfig);
|
|
122
122
|
}
|
|
123
|
-
function workflowImprovementRunLedgerPath(
|
|
124
|
-
return join(workflowImprovementRunRoot(
|
|
123
|
+
function workflowImprovementRunLedgerPath(compiledPath, runId) {
|
|
124
|
+
return join(workflowImprovementRunRoot(compiledPath, runId), "run.json");
|
|
125
125
|
}
|
|
126
|
-
function workflowImprovementLoopHistoryPath(
|
|
127
|
-
return join(workflowImprovementRunRoot(
|
|
126
|
+
function workflowImprovementLoopHistoryPath(compiledPath, runId) {
|
|
127
|
+
return join(workflowImprovementRunRoot(compiledPath, runId), "loop-history.jsonl");
|
|
128
128
|
}
|
|
129
129
|
function workflowImprovementLoopRecordPath(loopRootPath) {
|
|
130
130
|
return join(loopRootPath, "loop.json");
|
|
131
131
|
}
|
|
132
|
-
function readWorkflowImprovementRunLedger(
|
|
133
|
-
const ledgerPath = workflowImprovementRunLedgerPath(
|
|
132
|
+
function readWorkflowImprovementRunLedger(compiledPath, runId) {
|
|
133
|
+
const ledgerPath = workflowImprovementRunLedgerPath(compiledPath, runId);
|
|
134
134
|
if (!existsSync(ledgerPath))
|
|
135
135
|
return null;
|
|
136
136
|
return readJsonFileWithSchema(ledgerPath, "workflow improvement run ledger", WorkflowImprovementRunLedgerSchema);
|
|
137
137
|
}
|
|
138
|
-
function writeWorkflowImprovementRunLedger(
|
|
139
|
-
const runRoot = workflowImprovementRunRoot(
|
|
138
|
+
function writeWorkflowImprovementRunLedger(compiledPath, runId, record, options) {
|
|
139
|
+
const runRoot = workflowImprovementRunRoot(compiledPath, runId);
|
|
140
140
|
mkdirSync(runRoot, { recursive: true });
|
|
141
|
-
const existing = readWorkflowImprovementRunLedger(
|
|
141
|
+
const existing = readWorkflowImprovementRunLedger(compiledPath, runId);
|
|
142
142
|
const generatedAt = existing?.generated_at ?? new Date().toISOString();
|
|
143
143
|
const ledger = {
|
|
144
144
|
kind: "interf-workflow-improvement-run",
|
|
@@ -152,9 +152,9 @@ function writeWorkflowImprovementRunLedger(workspacePath, runId, record, options
|
|
|
152
152
|
max_attempts: options.maxAttempts,
|
|
153
153
|
loops: [...(existing?.loops ?? []), record],
|
|
154
154
|
};
|
|
155
|
-
writeFileSync(workflowImprovementRunLedgerPath(
|
|
155
|
+
writeFileSync(workflowImprovementRunLedgerPath(compiledPath, runId), `${JSON.stringify(ledger, null, 2)}\n`);
|
|
156
156
|
writeFileSync(workflowImprovementLoopRecordPath(record.loop_root_path), `${JSON.stringify(record, null, 2)}\n`);
|
|
157
|
-
appendFileSync(workflowImprovementLoopHistoryPath(
|
|
157
|
+
appendFileSync(workflowImprovementLoopHistoryPath(compiledPath, runId), `${JSON.stringify(record)}\n`);
|
|
158
158
|
}
|
|
159
159
|
function buildWorkflowImprovementLoopRecord(options) {
|
|
160
160
|
return {
|
|
@@ -182,17 +182,17 @@ function buildWorkflowImprovementLoopRecord(options) {
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
export async function runWorkflowImprovementLoop(options) {
|
|
185
|
-
const
|
|
185
|
+
const compiledName = readInterfConfig(options.compiledPath)?.name ?? "compiled";
|
|
186
186
|
const context = buildLoopContext(options);
|
|
187
187
|
const shell = createWorkflowImprovementShell({
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
compiledPath: options.compiledPath,
|
|
189
|
+
compiledName,
|
|
190
190
|
workflowId: options.workflowId,
|
|
191
191
|
runId: options.runId,
|
|
192
192
|
loopIndex: options.loopIndex,
|
|
193
193
|
context,
|
|
194
194
|
});
|
|
195
|
-
const workflowRoot =
|
|
195
|
+
const workflowRoot = workflowPackagePathForCompiled(options.compiledPath);
|
|
196
196
|
copyDirectory(workflowRoot, shell.workflowBeforePath);
|
|
197
197
|
const prompt = buildWorkflowImprovementPrompt();
|
|
198
198
|
writeFileSync(shell.promptLogPath, `${prompt}\n`);
|
|
@@ -213,8 +213,8 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
213
213
|
if (executeError) {
|
|
214
214
|
copyDirectory(shell.workflowBeforePath, workflowRoot);
|
|
215
215
|
const summary = `Workflow improver failed before completing: ${executeError}`;
|
|
216
|
-
writeWorkflowImprovementRunLedger(options.
|
|
217
|
-
targetName:
|
|
216
|
+
writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
|
|
217
|
+
targetName: compiledName,
|
|
218
218
|
workflowId: options.workflowId,
|
|
219
219
|
runId: options.runId,
|
|
220
220
|
loopIndex: options.loopIndex,
|
|
@@ -231,7 +231,7 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
231
231
|
result: "executor-failed",
|
|
232
232
|
summary,
|
|
233
233
|
}), {
|
|
234
|
-
targetName:
|
|
234
|
+
targetName: compiledName,
|
|
235
235
|
workflowId: options.workflowId,
|
|
236
236
|
maxLoops: options.maxLoops,
|
|
237
237
|
maxAttempts: options.maxAttempts,
|
|
@@ -248,8 +248,8 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
248
248
|
if (code !== 0) {
|
|
249
249
|
copyDirectory(shell.workflowBeforePath, workflowRoot);
|
|
250
250
|
const summary = `Workflow improver exited with code ${code}.`;
|
|
251
|
-
writeWorkflowImprovementRunLedger(options.
|
|
252
|
-
targetName:
|
|
251
|
+
writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
|
|
252
|
+
targetName: compiledName,
|
|
253
253
|
workflowId: options.workflowId,
|
|
254
254
|
runId: options.runId,
|
|
255
255
|
loopIndex: options.loopIndex,
|
|
@@ -266,7 +266,7 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
266
266
|
result: "executor-failed",
|
|
267
267
|
summary,
|
|
268
268
|
}), {
|
|
269
|
-
targetName:
|
|
269
|
+
targetName: compiledName,
|
|
270
270
|
workflowId: options.workflowId,
|
|
271
271
|
maxLoops: options.maxLoops,
|
|
272
272
|
maxAttempts: options.maxAttempts,
|
|
@@ -289,8 +289,8 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
289
289
|
const summary = validation.ok
|
|
290
290
|
? "Workflow improver made no workflow edits."
|
|
291
291
|
: `Workflow variation is invalid without any workflow edits: ${validation.summary}`;
|
|
292
|
-
writeWorkflowImprovementRunLedger(options.
|
|
293
|
-
targetName:
|
|
292
|
+
writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
|
|
293
|
+
targetName: compiledName,
|
|
294
294
|
workflowId: options.workflowId,
|
|
295
295
|
runId: options.runId,
|
|
296
296
|
loopIndex: options.loopIndex,
|
|
@@ -307,7 +307,7 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
307
307
|
result,
|
|
308
308
|
summary,
|
|
309
309
|
}), {
|
|
310
|
-
targetName:
|
|
310
|
+
targetName: compiledName,
|
|
311
311
|
workflowId: options.workflowId,
|
|
312
312
|
maxLoops: options.maxLoops,
|
|
313
313
|
maxAttempts: options.maxAttempts,
|
|
@@ -325,8 +325,8 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
325
325
|
if (!validation.ok) {
|
|
326
326
|
copyDirectory(shell.workflowBeforePath, workflowRoot);
|
|
327
327
|
const summary = `Workflow variation failed validation: ${validation.summary}`;
|
|
328
|
-
writeWorkflowImprovementRunLedger(options.
|
|
329
|
-
targetName:
|
|
328
|
+
writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
|
|
329
|
+
targetName: compiledName,
|
|
330
330
|
workflowId: options.workflowId,
|
|
331
331
|
runId: options.runId,
|
|
332
332
|
loopIndex: options.loopIndex,
|
|
@@ -343,7 +343,7 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
343
343
|
result: "invalid",
|
|
344
344
|
summary,
|
|
345
345
|
}), {
|
|
346
|
-
targetName:
|
|
346
|
+
targetName: compiledName,
|
|
347
347
|
workflowId: options.workflowId,
|
|
348
348
|
maxLoops: options.maxLoops,
|
|
349
349
|
maxAttempts: options.maxAttempts,
|
|
@@ -357,8 +357,8 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
357
357
|
loopRootPath: shell.loopRootPath,
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
writeWorkflowImprovementRunLedger(options.
|
|
361
|
-
targetName:
|
|
360
|
+
writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
|
|
361
|
+
targetName: compiledName,
|
|
362
362
|
workflowId: options.workflowId,
|
|
363
363
|
runId: options.runId,
|
|
364
364
|
loopIndex: options.loopIndex,
|
|
@@ -375,13 +375,13 @@ export async function runWorkflowImprovementLoop(options) {
|
|
|
375
375
|
result: "updated",
|
|
376
376
|
summary: "Workflow variation updated and validated.",
|
|
377
377
|
}), {
|
|
378
|
-
targetName:
|
|
378
|
+
targetName: compiledName,
|
|
379
379
|
workflowId: options.workflowId,
|
|
380
380
|
maxLoops: options.maxLoops,
|
|
381
381
|
maxAttempts: options.maxAttempts,
|
|
382
382
|
});
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
updateCompiledWorkflowOrigin({
|
|
384
|
+
compiledPath: options.compiledPath,
|
|
385
385
|
selectedWorkflowId: options.workflowId,
|
|
386
386
|
localDraft: true,
|
|
387
387
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { WorkflowImprovementContext } from "./schema.js";
|
|
2
2
|
export interface WorkflowImprovementReviewSourcePaths {
|
|
3
|
-
|
|
3
|
+
compiledRuntime: string | null;
|
|
4
4
|
testComparisons: string | null;
|
|
5
5
|
executionShells: string | null;
|
|
6
6
|
targetTestRuns: string | null;
|
|
7
7
|
targetTestSandboxes: string | null;
|
|
8
8
|
}
|
|
9
|
-
export declare function resolveWorkflowImprovementReviewSourcePaths(
|
|
10
|
-
export declare function resolveWorkflowImprovementReviewPaths(
|
|
9
|
+
export declare function resolveWorkflowImprovementReviewSourcePaths(compiledPath: string): WorkflowImprovementReviewSourcePaths;
|
|
10
|
+
export declare function resolveWorkflowImprovementReviewPaths(compiledPath: string): WorkflowImprovementContext["review_paths"];
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import {
|
|
3
|
-
export function resolveWorkflowImprovementReviewSourcePaths(
|
|
4
|
-
const
|
|
5
|
-
const testComparisons =
|
|
6
|
-
const executionShells = stageExecutionShellsRoot(
|
|
7
|
-
const targetTestRuns =
|
|
8
|
-
const targetTestSandboxes =
|
|
2
|
+
import { testRootForCompiled, targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, stageExecutionShellsRoot, compiledRuntimeRoot, } from "./compiled-paths.js";
|
|
3
|
+
export function resolveWorkflowImprovementReviewSourcePaths(compiledPath) {
|
|
4
|
+
const compiledRuntime = compiledRuntimeRoot(compiledPath);
|
|
5
|
+
const testComparisons = testRootForCompiled(compiledPath);
|
|
6
|
+
const executionShells = stageExecutionShellsRoot(compiledPath);
|
|
7
|
+
const targetTestRuns = targetTestRunsRootForCompiled(compiledPath);
|
|
8
|
+
const targetTestSandboxes = targetTestSandboxesRootForCompiled(compiledPath);
|
|
9
9
|
return {
|
|
10
|
-
|
|
10
|
+
compiledRuntime: existsSync(compiledRuntime) ? compiledRuntime : null,
|
|
11
11
|
testComparisons: existsSync(testComparisons) ? testComparisons : null,
|
|
12
12
|
executionShells: existsSync(executionShells) ? executionShells : null,
|
|
13
13
|
targetTestRuns: existsSync(targetTestRuns) ? targetTestRuns : null,
|
|
14
14
|
targetTestSandboxes: existsSync(targetTestSandboxes) ? targetTestSandboxes : null,
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export function resolveWorkflowImprovementReviewPaths(
|
|
18
|
-
const sources = resolveWorkflowImprovementReviewSourcePaths(
|
|
17
|
+
export function resolveWorkflowImprovementReviewPaths(compiledPath) {
|
|
18
|
+
const sources = resolveWorkflowImprovementReviewSourcePaths(compiledPath);
|
|
19
19
|
return {
|
|
20
20
|
workflow_root: "workflow",
|
|
21
|
-
|
|
21
|
+
compiled_runtime: sources.compiledRuntime ? "artifacts/compiled-runtime" : null,
|
|
22
22
|
test_comparisons: sources.testComparisons ? "artifacts/test-comparisons" : null,
|
|
23
23
|
execution_shells: sources.executionShells ? "artifacts/execution-shells" : null,
|
|
24
24
|
test_runs: sources.targetTestRuns ? "artifacts/test-runs" : null,
|