@interf/compiler 0.5.0 → 0.6.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.
Files changed (113) hide show
  1. package/README.md +126 -188
  2. package/builtin-workflows/interf/README.md +22 -10
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +6 -3
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
  6. package/builtin-workflows/interf/improve/SKILL.md +2 -2
  7. package/builtin-workflows/interf/workflow.json +18 -4
  8. package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +9 -2
  9. package/dist/commands/check-draft.js +3 -3
  10. package/dist/commands/compile-controller.js +9 -16
  11. package/dist/commands/compile.d.ts +19 -1
  12. package/dist/commands/compile.js +98 -28
  13. package/dist/commands/create-workflow-wizard.d.ts +20 -2
  14. package/dist/commands/create-workflow-wizard.js +163 -27
  15. package/dist/commands/create.d.ts +1 -1
  16. package/dist/commands/create.js +67 -60
  17. package/dist/commands/dataset-selection.d.ts +6 -0
  18. package/dist/commands/dataset-selection.js +11 -0
  19. package/dist/commands/default.js +3 -3
  20. package/dist/commands/doctor.js +8 -8
  21. package/dist/commands/executor-flow.d.ts +1 -1
  22. package/dist/commands/executor-flow.js +5 -2
  23. package/dist/commands/init.d.ts +5 -0
  24. package/dist/commands/init.js +56 -48
  25. package/dist/commands/list.js +6 -3
  26. package/dist/commands/reset.js +1 -1
  27. package/dist/commands/source-config-wizard.d.ts +2 -2
  28. package/dist/commands/source-config-wizard.js +50 -17
  29. package/dist/commands/test-flow.js +5 -16
  30. package/dist/commands/test.d.ts +0 -6
  31. package/dist/commands/test.js +9 -17
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/lib/agent-args.d.ts +1 -0
  35. package/dist/lib/agent-args.js +10 -0
  36. package/dist/lib/agent-execution.js +2 -1
  37. package/dist/lib/agent-preflight.js +2 -1
  38. package/dist/lib/agent-shells.d.ts +26 -1
  39. package/dist/lib/agent-shells.js +214 -40
  40. package/dist/lib/agents.d.ts +1 -1
  41. package/dist/lib/agents.js +1 -1
  42. package/dist/lib/builtin-compiled-workflow.d.ts +38 -0
  43. package/dist/lib/builtin-compiled-workflow.js +94 -0
  44. package/dist/lib/compiled-compile.d.ts +0 -4
  45. package/dist/lib/compiled-compile.js +11 -30
  46. package/dist/lib/compiled-paths.d.ts +1 -2
  47. package/dist/lib/compiled-paths.js +8 -13
  48. package/dist/lib/compiled-raw.d.ts +2 -2
  49. package/dist/lib/compiled-reset.d.ts +1 -0
  50. package/dist/lib/compiled-reset.js +42 -14
  51. package/dist/lib/compiled-schema.d.ts +11 -7
  52. package/dist/lib/compiled-schema.js +47 -16
  53. package/dist/lib/discovery.d.ts +1 -1
  54. package/dist/lib/discovery.js +2 -2
  55. package/dist/lib/executors.d.ts +1 -1
  56. package/dist/lib/executors.js +2 -2
  57. package/dist/lib/interf-detect.d.ts +0 -1
  58. package/dist/lib/interf-detect.js +7 -18
  59. package/dist/lib/interf-scaffold.js +4 -11
  60. package/dist/lib/interf-workflow-package.d.ts +8 -3
  61. package/dist/lib/interf-workflow-package.js +128 -62
  62. package/dist/lib/interf.d.ts +1 -1
  63. package/dist/lib/interf.js +1 -1
  64. package/dist/lib/local-workflows.d.ts +4 -3
  65. package/dist/lib/local-workflows.js +127 -104
  66. package/dist/lib/project-paths.d.ts +2 -4
  67. package/dist/lib/project-paths.js +13 -10
  68. package/dist/lib/runtime-acceptance.js +15 -3
  69. package/dist/lib/runtime-contracts.js +3 -2
  70. package/dist/lib/runtime-paths.d.ts +1 -0
  71. package/dist/lib/runtime-paths.js +4 -1
  72. package/dist/lib/runtime-prompt.js +4 -4
  73. package/dist/lib/runtime-reconcile.js +90 -64
  74. package/dist/lib/runtime-runs.js +29 -102
  75. package/dist/lib/runtime.d.ts +1 -1
  76. package/dist/lib/runtime.js +1 -1
  77. package/dist/lib/schema.d.ts +104 -54
  78. package/dist/lib/schema.js +32 -116
  79. package/dist/lib/source-config.js +21 -22
  80. package/dist/lib/state-health.js +4 -2
  81. package/dist/lib/state-io.js +2 -110
  82. package/dist/lib/state-view.js +8 -8
  83. package/dist/lib/state.d.ts +1 -0
  84. package/dist/lib/state.js +7 -0
  85. package/dist/lib/test-execution.js +2 -2
  86. package/dist/lib/test-paths.js +12 -3
  87. package/dist/lib/test-sandbox.js +4 -17
  88. package/dist/lib/test-specs.js +1 -1
  89. package/dist/lib/validate-compiled.js +13 -8
  90. package/dist/lib/validate.d.ts +5 -1
  91. package/dist/lib/validate.js +30 -22
  92. package/dist/lib/workflow-authoring.d.ts +26 -0
  93. package/dist/lib/workflow-authoring.js +119 -0
  94. package/dist/lib/workflow-definitions.d.ts +14 -3
  95. package/dist/lib/workflow-definitions.js +21 -17
  96. package/dist/lib/workflow-edit-session.d.ts +16 -0
  97. package/dist/lib/workflow-edit-session.js +57 -0
  98. package/dist/lib/workflow-edit-utils.d.ts +10 -0
  99. package/dist/lib/workflow-edit-utils.js +39 -0
  100. package/dist/lib/workflow-improvement.js +30 -217
  101. package/dist/lib/workflow-primitives.d.ts +2 -0
  102. package/dist/lib/workflow-primitives.js +5 -0
  103. package/dist/lib/workflow-stage-policy.d.ts +5 -0
  104. package/dist/lib/workflow-stage-policy.js +31 -0
  105. package/package.json +7 -8
  106. package/dist/lib/compiled-layout.d.ts +0 -2
  107. package/dist/lib/compiled-layout.js +0 -60
  108. package/dist/lib/obsidian.d.ts +0 -1
  109. package/dist/lib/obsidian.js +0 -15
  110. package/dist/lib/summarize-plan.d.ts +0 -17
  111. package/dist/lib/summarize-plan.js +0 -124
  112. package/dist/lib/workflow-abi.d.ts +0 -129
  113. package/dist/lib/workflow-abi.js +0 -156
@@ -3,25 +3,12 @@ import { dirname, join } from "node:path";
3
3
  import { copyWorkflowPackageDirectory, isPortableWorkflowPackage, patchWorkflowPackageMetadata, resolveWorkflowPackageSourcePath, workflowDefinitionPath, } from "./local-workflows.js";
4
4
  import { getCompiledWorkflow, } from "./workflow-definitions.js";
5
5
  import { renderCompiledQuerySkill } from "./agent-shells.js";
6
- import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
7
- import { writeCompiledSchemaFile } from "./compiled-schema.js";
6
+ import { WORKFLOW_SCHEMA_FILE, writeWorkflowSchemaDocument, writeWorkflowSchemaFile, } from "./compiled-schema.js";
8
7
  import { workflowPackagePathForCompiled } from "./compiled-paths.js";
8
+ import { mergeStagePolicyNotesForStages } from "./workflow-stage-policy.js";
9
9
  function workflowPackagePath(dirPath) {
10
10
  return workflowPackagePathForCompiled(dirPath);
11
11
  }
12
- function mergeWorkflowStagePolicyNotes(stages, baseNotes, nextNotes) {
13
- const merged = {};
14
- for (const stage of stages) {
15
- const combined = Array.from(new Set([
16
- ...(baseNotes?.[stage.id] ?? []),
17
- ...(nextNotes?.[stage.id] ?? []),
18
- ].map((note) => note.trim()).filter((note) => note.length > 0)));
19
- if (combined.length > 0) {
20
- merged[stage.id] = combined;
21
- }
22
- }
23
- return Object.keys(merged).length > 0 ? merged : undefined;
24
- }
25
12
  function writeWorkflowStarterDocs(dirPath, docs, options) {
26
13
  for (const doc of docs ?? []) {
27
14
  const targetPath = join(dirPath, doc.relativePath);
@@ -42,6 +29,14 @@ function writeWorkflowPackageJson(rootPath, workflow, options) {
42
29
  kind: "compiled",
43
30
  version: 1,
44
31
  },
32
+ ...(workflow.purpose
33
+ ? {
34
+ purpose: {
35
+ label: workflow.purpose.label,
36
+ task_hint: workflow.purpose.taskHint,
37
+ },
38
+ }
39
+ : {}),
45
40
  label: workflow.label,
46
41
  hint: workflow.hint,
47
42
  stages: workflow.stages.map((stage) => ({
@@ -61,24 +56,46 @@ function renderWorkflowReadme(workflow) {
61
56
  const stageLines = workflow.stages
62
57
  .map((stage) => `- \`${stage.id}\` — ${stage.description} (${stage.contractType}; reads: ${stage.reads.join(", ")}; writes: ${stage.writes.join(", ")})`)
63
58
  .join("\n");
59
+ const zoneLines = workflow.schema?.zones
60
+ ? workflow.schema.zones
61
+ .map((zone) => `- \`${zone.id}\` — ${zone.role} ${zone.kind} at \`${zone.path}\``)
62
+ .join("\n")
63
+ : null;
64
64
  return [
65
65
  `# ${workflow.label}`,
66
66
  "",
67
67
  workflow.hint,
68
+ ...(workflow.purpose
69
+ ? [
70
+ "",
71
+ "## Purpose",
72
+ "",
73
+ `- ${workflow.purpose.label}`,
74
+ `- ${workflow.purpose.taskHint}`,
75
+ ]
76
+ : []),
68
77
  "",
69
78
  "## Package",
70
79
  "",
71
80
  "- `workflow.json` = stage graph, compiler API target, and compile contract mapping",
72
- "- `compiled.schema.json` = deterministic compiled-dataset output shape",
81
+ "- `workflow.schema.json` = deterministic zone contract for the workflow package",
73
82
  "- `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs",
74
83
  "- Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder",
75
- "- Interf Compiler projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops",
84
+ "- Interf projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops",
85
+ ...(zoneLines
86
+ ? [
87
+ "",
88
+ "## Zones",
89
+ "",
90
+ zoneLines,
91
+ ]
92
+ : []),
76
93
  "",
77
94
  "## Stages",
78
95
  "",
79
96
  stageLines,
80
97
  "",
81
- "Interf Compiler runs the local copy of this package directly from `.interf/workflow/` inside each compiled dataset.",
98
+ "Interf runs the local copy of this package directly from `.interf/workflow/` inside each compiled dataset.",
82
99
  "",
83
100
  ].join("\n");
84
101
  }
@@ -90,13 +107,25 @@ function renderDerivedWorkflowReadme(options) {
90
107
  "",
91
108
  `This workflow package was copied from \`${options.baseWorkflowId}\` and materialized as a standalone package for this dataset job.`,
92
109
  "",
93
- "Interf Compiler runs the local copy of this package directly. Keep changes in this folder self-contained instead of relying on runtime inheritance or fallback.",
110
+ "Interf runs the local copy of this package directly. Keep changes in this folder self-contained instead of relying on runtime inheritance or fallback.",
94
111
  "",
95
112
  "## Emphasis",
96
113
  "",
97
- `- summarize: ${options.summarizeBias}`,
98
- `- structure: ${options.structureBias}`,
99
- `- shape: ${options.shapeBias}`,
114
+ ...(options.emphasis.length > 0
115
+ ? options.emphasis.map((entry) => `- ${entry.stageId} (${entry.label}): ${entry.notes.join("; ")}`)
116
+ : ["- No stage-specific emphasis was added yet."]),
117
+ "",
118
+ ].join("\n");
119
+ }
120
+ function renderSeedWorkflowReadme(options) {
121
+ return [
122
+ `# ${options.label}`,
123
+ "",
124
+ options.hint,
125
+ "",
126
+ `This workflow package was seeded from \`${options.baseWorkflowId}\` as a standalone local draft.`,
127
+ "",
128
+ "Interf runs the local copy of this package directly. Refine the workflow docs, stage instructions, and zone contract in this folder instead of relying on inheritance or runtime fallback.",
100
129
  "",
101
130
  ].join("\n");
102
131
  }
@@ -106,14 +135,14 @@ function renderImproveSkill(workflow) {
106
135
  "",
107
136
  `Workflow: ${workflow.id}`,
108
137
  "",
109
- "This file is the editable authoring source for Interf Compiler's generated native workflow-improver shell.",
138
+ "This file is the editable authoring source for Interf's generated native workflow-improver shell.",
110
139
  "The improver edits this local package directly.",
111
140
  "",
112
141
  "Default loop:",
113
142
  "1. Read the loop context first.",
114
143
  "2. Review preserved stage shells, runtime logs, and saved test runs from failed attempts.",
115
144
  "3. Edit only the local workflow package for this compiled dataset to create a better workflow variation for this dataset.",
116
- "4. Keep `workflow.json`, `compiled.schema.json`, and any changed stage docs aligned.",
145
+ `4. Keep \`workflow.json\`, \`${WORKFLOW_SCHEMA_FILE}\`, and any changed stage docs aligned.`,
117
146
  "",
118
147
  "Guardrails:",
119
148
  "- do not edit truth checks, test specs, or raw dataset files",
@@ -125,37 +154,41 @@ function renderImproveSkill(workflow) {
125
154
  }
126
155
  function renderStageSkill(workflow, stage) {
127
156
  const notes = workflow.stagePolicyNotes?.[stage.id] ?? [];
128
- const stageSpecificNotes = stage.contractType === "compiled-file-evidence"
157
+ const acceptanceKeys = stage.acceptance ? Object.keys(stage.acceptance) : [];
158
+ const abstractRules = stage.contractType === "compiled-file-evidence"
129
159
  ? [
130
- "Each summary must use JSON frontmatter and include `source`, `source_kind`, `evidence_tier`, `truth_mode`, `state`, and a non-empty `abstract`.",
131
- "Include a clear abstract block in the body so a human can skim the summary quickly.",
132
- "Do not skip the abstract just because the overview section is present.",
160
+ "- Valid abstract forms for deterministic validation are:",
161
+ ' - frontmatter key `"abstract"` with a real sentence, or',
162
+ " - a markdown heading `## Abstract` followed by at least one sentence",
163
+ "- A bare `Abstract` label without markdown heading syntax does not count.",
133
164
  ]
134
- : stage.contractType === "compiled-knowledge-structure"
135
- ? [
136
- "Treat the knowledge layer as retrieval structure, not final truth.",
137
- "Prefer durable entity, claim, and index notes over one giant catch-all file.",
138
- ]
139
- : stage.contractType === "compiled-query-shape"
140
- ? [
141
- "Use the compiled focus plus saved truth-check question text to shape `home.md` and retrieval routes.",
142
- "Rewrite `home.md` into a real entrypoint note. Do not leave the scaffold `Not yet compiled.` placeholder in place.",
143
- ...CHART_APPROXIMATION_NOTES,
144
- "Do not copy expected answers into the compiled dataset.",
145
- ]
146
- : [];
165
+ : [];
147
166
  return [
148
167
  `# ${stage.label}`,
149
168
  "",
150
169
  stage.description,
151
170
  "",
152
- `Contract type: \`${stage.contractType}\``,
171
+ "## Stage Contract",
153
172
  "",
154
- ...(stageSpecificNotes.length > 0
173
+ `- Contract type: \`${stage.contractType}\``,
174
+ `- Reads zones: ${stage.reads.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
175
+ `- Writes zones: ${stage.writes.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
176
+ "",
177
+ "## Requirements",
178
+ "",
179
+ "- Treat `workflow.json` and `workflow.schema.json` as the authoritative package contract for this stage.",
180
+ "- Read only from the declared input zones unless this package explicitly documents a broader method.",
181
+ "- Write only inside the declared output zones for this stage. Do not invent undeclared zones or implicit outputs.",
182
+ "- Keep stage instructions, zone ownership, and workflow-level acceptance aligned when you change this stage.",
183
+ "- Treat runtime files as proof and execution state, not as the source of truth for workflow behavior.",
184
+ "- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
185
+ ...abstractRules,
186
+ "",
187
+ ...(acceptanceKeys.length > 0
155
188
  ? [
156
- "## Requirements",
189
+ "## Declarative Acceptance",
157
190
  "",
158
- ...stageSpecificNotes.map((note) => `- ${note}`),
191
+ ...acceptanceKeys.map((key) => `- \`${key}\``),
159
192
  "",
160
193
  ]
161
194
  : []),
@@ -181,8 +214,16 @@ export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
181
214
  mkdirSync(join(workflowDir, "compile", "stages", stage.skillDir), { recursive: true });
182
215
  }
183
216
  writeWorkflowPackageJson(workflowDir, workflow, { overwrite });
184
- if (overwrite || !existsSync(join(workflowDir, "compiled.schema.json"))) {
185
- writeCompiledSchemaFile(workflowDir, workflow.stages, `${workflow.label} compiled schema`);
217
+ if (overwrite || !existsSync(join(workflowDir, WORKFLOW_SCHEMA_FILE))) {
218
+ if (workflow.schema) {
219
+ writeWorkflowSchemaDocument(workflowDir, {
220
+ ...workflow.schema,
221
+ label: workflow.schema.label || `${workflow.label} workflow schema`,
222
+ });
223
+ }
224
+ else {
225
+ writeWorkflowSchemaFile(workflowDir, workflow.stages, `${workflow.label} workflow schema`);
226
+ }
186
227
  }
187
228
  if (overwrite || !existsSync(join(workflowDir, "README.md"))) {
188
229
  writeFileSync(join(workflowDir, "README.md"), renderWorkflowReadme(workflow));
@@ -210,6 +251,12 @@ export function seedCompiledWorkflowPackage(options) {
210
251
  // Portable seed packages can be copied directly because compile runs the
211
252
  // local package folder without any source-root fallback.
212
253
  copyWorkflowPackageDirectory(sourceWorkflowPath, workflowPackagePath(options.compiledPath));
254
+ patchWorkflowPackageMetadata(workflowPackagePath(options.compiledPath), {
255
+ id: resolvedWorkflow.id,
256
+ label: resolvedWorkflow.label,
257
+ hint: resolvedWorkflow.hint,
258
+ stagePolicyNotes: resolvedWorkflow.stagePolicyNotes,
259
+ });
213
260
  return;
214
261
  }
215
262
  // Legacy or partially-defined seed packages are resolved once and
@@ -217,13 +264,40 @@ export function seedCompiledWorkflowPackage(options) {
217
264
  writeCompiledWorkflowPackage(options.compiledPath, resolvedWorkflow);
218
265
  }
219
266
  export function createLocalWorkflowPackageFromTemplate(options) {
267
+ const targetPath = seedLocalWorkflowPackageFromBase({
268
+ sourcePath: options.sourcePath,
269
+ baseWorkflowId: options.baseWorkflowId,
270
+ workflowId: options.workflowId,
271
+ label: options.label,
272
+ hint: options.hint,
273
+ });
274
+ const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
275
+ sourcePath: options.sourcePath,
276
+ });
277
+ const stagePolicyNotes = mergeStagePolicyNotesForStages(baseWorkflow.stages, baseWorkflow.stagePolicyNotes, options.stagePolicyNotes);
278
+ patchWorkflowPackageMetadata(targetPath, {
279
+ id: options.workflowId,
280
+ label: options.label,
281
+ hint: options.hint,
282
+ stagePolicyNotes,
283
+ });
284
+ writeFileSync(join(targetPath, "README.md"), renderDerivedWorkflowReadme({
285
+ label: options.label,
286
+ hint: options.hint,
287
+ baseWorkflowId: options.baseWorkflowId,
288
+ emphasis: baseWorkflow.stages
289
+ .map((stage) => ({
290
+ stageId: stage.id,
291
+ label: stage.label,
292
+ notes: stagePolicyNotes?.[stage.id] ?? [],
293
+ }))
294
+ .filter((entry) => entry.notes.length > 0),
295
+ }));
296
+ return targetPath;
297
+ }
298
+ export function seedLocalWorkflowPackageFromBase(options) {
220
299
  const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, options.baseWorkflowId);
221
300
  const targetPath = workflowDefinitionPath(options.sourcePath, options.workflowId);
222
- const stagePolicyNotes = {
223
- summarize: [options.summarizeBias],
224
- structure: [options.structureBias],
225
- shape: [options.shapeBias],
226
- };
227
301
  if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
228
302
  // Copy directly when the base package is already portable and standalone.
229
303
  copyWorkflowPackageDirectory(sourceWorkflowPath, targetPath);
@@ -231,15 +305,11 @@ export function createLocalWorkflowPackageFromTemplate(options) {
231
305
  id: options.workflowId,
232
306
  label: options.label,
233
307
  hint: options.hint,
234
- stagePolicyNotes,
235
308
  });
236
- writeFileSync(join(targetPath, "README.md"), renderDerivedWorkflowReadme({
309
+ writeFileSync(join(targetPath, "README.md"), renderSeedWorkflowReadme({
237
310
  label: options.label,
238
311
  hint: options.hint,
239
312
  baseWorkflowId: options.baseWorkflowId,
240
- summarizeBias: options.summarizeBias,
241
- structureBias: options.structureBias,
242
- shapeBias: options.shapeBias,
243
313
  }));
244
314
  return targetPath;
245
315
  }
@@ -255,17 +325,13 @@ export function createLocalWorkflowPackageFromTemplate(options) {
255
325
  hint: options.hint,
256
326
  recommended: false,
257
327
  scope: "local",
258
- stagePolicyNotes: mergeWorkflowStagePolicyNotes(baseWorkflow.stages, baseWorkflow.stagePolicyNotes, stagePolicyNotes),
259
328
  starterDocs: [
260
329
  {
261
330
  relativePath: "README.md",
262
- content: renderDerivedWorkflowReadme({
331
+ content: renderSeedWorkflowReadme({
263
332
  label: options.label,
264
333
  hint: options.hint,
265
334
  baseWorkflowId: options.baseWorkflowId,
266
- summarizeBias: options.summarizeBias,
267
- structureBias: options.structureBias,
268
- shapeBias: options.shapeBias,
269
335
  }),
270
336
  },
271
337
  ...(baseWorkflow.starterDocs ?? []).filter((doc) => doc.relativePath !== "README.md"),
@@ -1,4 +1,4 @@
1
- export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, prepareCompiledLayout, readInterfConfig, detectInterf, resolveCompiled, resolveSourceFolderPath, resolveSourceControlPath, resolveSourceInputPath, listCompiledDatasetsForSourceFolder, hasSourceFolderInput, assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
1
+ export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, readInterfConfig, detectInterf, resolveCompiled, resolveSourceFolderPath, resolveSourceControlPath, resolveSourceInputPath, listCompiledDatasetsForSourceFolder, hasSourceFolderInput, assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
2
2
  export type { InterfConfig, ResolvedCompiled } from "./interf-detect.js";
3
3
  export { ensureCompiledRawBinding, resolveCompiledRawPath, syncCompiledRawSnapshot, } from "./compiled-raw.js";
4
4
  export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
@@ -1,4 +1,4 @@
1
- export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, prepareCompiledLayout, readInterfConfig, detectInterf, resolveCompiled, resolveSourceFolderPath, resolveSourceControlPath, resolveSourceInputPath, listCompiledDatasetsForSourceFolder, hasSourceFolderInput, assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
1
+ export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, readInterfConfig, detectInterf, resolveCompiled, resolveSourceFolderPath, resolveSourceControlPath, resolveSourceInputPath, listCompiledDatasetsForSourceFolder, hasSourceFolderInput, assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
2
2
  export { ensureCompiledRawBinding, resolveCompiledRawPath, syncCompiledRawSnapshot, } from "./compiled-raw.js";
3
3
  export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
4
4
  export { createCompiled, defaultCompiledNameForSource, } from "./interf-scaffold.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { WorkflowCompilerApiSchema, RuntimeContractTypeSchema, RuntimeStageAcceptanceSchema, WorkflowStageZoneAccessSchema, type WorkflowCompiledSchema } from "./schema.js";
2
+ import { WorkflowCompilerApiSchema, RuntimeContractTypeSchema, RuntimeStageAcceptanceSchema, WorkflowPurposeSchema, WorkflowStageZoneAccessSchema, type WorkflowCompiledSchema } from "./schema.js";
3
3
  export interface LocalWorkflowStarterDoc {
4
4
  relativePath: string;
5
5
  content: string;
@@ -18,16 +18,17 @@ export interface LocalWorkflowDefinition {
18
18
  id: string;
19
19
  type: "compiled";
20
20
  compiler_api?: z.infer<typeof WorkflowCompilerApiSchema>;
21
+ purpose?: z.infer<typeof WorkflowPurposeSchema>;
21
22
  label: string;
22
23
  hint: string;
23
24
  extends?: string;
24
25
  stages?: LocalWorkflowStageDefinition[];
25
26
  stage_policy_notes?: Record<string, string[]>;
26
- compiled_schema: WorkflowCompiledSchema;
27
+ workflow_schema: WorkflowCompiledSchema;
27
28
  starter_docs: LocalWorkflowStarterDoc[];
28
29
  directoryPath: string;
29
30
  workflowPath: string;
30
- compiledSchemaPath: string;
31
+ workflowSchemaPath: string;
31
32
  }
32
33
  export declare function workflowDefinitionPath(sourcePath: string, id: string): string;
33
34
  export declare function loadWorkflowDefinitionFromDir(dirPath: string): LocalWorkflowDefinition | null;