@interf/compiler 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +71 -69
  2. package/builtin-workflows/interf/README.md +6 -6
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +7 -7
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +2 -2
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +1 -1
  6. package/builtin-workflows/interf/{workspace.schema.json → compiled.schema.json} +5 -5
  7. package/builtin-workflows/interf/improve/SKILL.md +3 -3
  8. package/builtin-workflows/interf/use/query/SKILL.md +2 -2
  9. package/builtin-workflows/interf/workflow.json +42 -31
  10. package/dist/commands/check-draft.d.ts +19 -0
  11. package/dist/commands/check-draft.js +110 -0
  12. package/dist/commands/compile-controller.d.ts +4 -4
  13. package/dist/commands/compile-controller.js +117 -81
  14. package/dist/commands/compile.d.ts +5 -5
  15. package/dist/commands/compile.js +61 -62
  16. package/dist/commands/compiled-flow.d.ts +23 -0
  17. package/dist/commands/compiled-flow.js +112 -0
  18. package/dist/commands/create-workflow-wizard.d.ts +3 -3
  19. package/dist/commands/create-workflow-wizard.js +11 -11
  20. package/dist/commands/create.d.ts +2 -2
  21. package/dist/commands/create.js +50 -57
  22. package/dist/commands/default.js +2 -2
  23. package/dist/commands/executor-flow.d.ts +20 -1
  24. package/dist/commands/executor-flow.js +67 -7
  25. package/dist/commands/init.js +242 -289
  26. package/dist/commands/list.js +14 -10
  27. package/dist/commands/reset.js +6 -6
  28. package/dist/commands/source-config-wizard.d.ts +12 -8
  29. package/dist/commands/source-config-wizard.js +356 -119
  30. package/dist/commands/status.js +49 -26
  31. package/dist/commands/test-flow.d.ts +23 -10
  32. package/dist/commands/test-flow.js +278 -58
  33. package/dist/commands/test.d.ts +7 -1
  34. package/dist/commands/test.js +264 -65
  35. package/dist/commands/verify.js +23 -14
  36. package/dist/index.d.ts +7 -7
  37. package/dist/index.js +4 -4
  38. package/dist/lib/agent-args.js +2 -1
  39. package/dist/lib/agent-constants.js +1 -1
  40. package/dist/lib/agent-render.js +4 -4
  41. package/dist/lib/agent-shells.d.ts +8 -8
  42. package/dist/lib/agent-shells.js +231 -142
  43. package/dist/lib/compiled-compile.d.ts +52 -0
  44. package/dist/lib/compiled-compile.js +274 -0
  45. package/dist/lib/compiled-home.d.ts +5 -0
  46. package/dist/lib/compiled-home.js +32 -0
  47. package/dist/lib/compiled-layout.d.ts +2 -0
  48. package/dist/lib/compiled-layout.js +60 -0
  49. package/dist/lib/compiled-paths.d.ts +41 -0
  50. package/dist/lib/compiled-paths.js +111 -0
  51. package/dist/lib/{workspace-raw.d.ts → compiled-raw.d.ts} +8 -7
  52. package/dist/lib/{workspace-raw.js → compiled-raw.js} +16 -14
  53. package/dist/lib/compiled-reset.d.ts +1 -0
  54. package/dist/lib/compiled-reset.js +44 -0
  55. package/dist/lib/compiled-schema.d.ts +27 -0
  56. package/dist/lib/compiled-schema.js +110 -0
  57. package/dist/lib/config.d.ts +0 -1
  58. package/dist/lib/config.js +0 -1
  59. package/dist/lib/discovery.d.ts +1 -1
  60. package/dist/lib/discovery.js +3 -3
  61. package/dist/lib/interf-bootstrap.d.ts +1 -1
  62. package/dist/lib/interf-bootstrap.js +4 -4
  63. package/dist/lib/interf-detect.d.ts +10 -10
  64. package/dist/lib/interf-detect.js +78 -56
  65. package/dist/lib/interf-scaffold.d.ts +2 -2
  66. package/dist/lib/interf-scaffold.js +90 -57
  67. package/dist/lib/interf-workflow-package.d.ts +3 -3
  68. package/dist/lib/interf-workflow-package.js +30 -30
  69. package/dist/lib/interf.d.ts +5 -5
  70. package/dist/lib/interf.js +4 -4
  71. package/dist/lib/local-workflows.d.ts +4 -4
  72. package/dist/lib/local-workflows.js +35 -70
  73. package/dist/lib/obsidian.d.ts +1 -1
  74. package/dist/lib/parse.js +92 -1
  75. package/dist/lib/project-paths.d.ts +13 -0
  76. package/dist/lib/project-paths.js +29 -0
  77. package/dist/lib/runtime-acceptance.d.ts +7 -1
  78. package/dist/lib/runtime-acceptance.js +194 -59
  79. package/dist/lib/runtime-contracts.d.ts +2 -4
  80. package/dist/lib/runtime-contracts.js +17 -161
  81. package/dist/lib/runtime-inventory.d.ts +7 -0
  82. package/dist/lib/runtime-inventory.js +29 -0
  83. package/dist/lib/runtime-paths.js +5 -5
  84. package/dist/lib/runtime-prompt.js +9 -6
  85. package/dist/lib/runtime-reconcile.d.ts +2 -3
  86. package/dist/lib/runtime-reconcile.js +92 -171
  87. package/dist/lib/runtime-runs.js +30 -39
  88. package/dist/lib/runtime-types.d.ts +10 -19
  89. package/dist/lib/runtime.d.ts +2 -2
  90. package/dist/lib/runtime.js +1 -1
  91. package/dist/lib/schema.d.ts +163 -140
  92. package/dist/lib/schema.js +163 -124
  93. package/dist/lib/source-config.d.ts +24 -20
  94. package/dist/lib/source-config.js +154 -116
  95. package/dist/lib/state-artifacts.d.ts +5 -5
  96. package/dist/lib/state-artifacts.js +8 -8
  97. package/dist/lib/state-health.d.ts +4 -4
  98. package/dist/lib/state-health.js +108 -126
  99. package/dist/lib/state-io.d.ts +8 -8
  100. package/dist/lib/state-io.js +77 -50
  101. package/dist/lib/state-paths.js +5 -5
  102. package/dist/lib/state-view.d.ts +4 -4
  103. package/dist/lib/state-view.js +52 -55
  104. package/dist/lib/state.d.ts +5 -5
  105. package/dist/lib/state.js +4 -4
  106. package/dist/lib/summarize-plan.d.ts +3 -2
  107. package/dist/lib/summarize-plan.js +18 -16
  108. package/dist/lib/test-execution.js +9 -9
  109. package/dist/lib/test-matrices.d.ts +3 -3
  110. package/dist/lib/test-matrices.js +6 -6
  111. package/dist/lib/test-paths.d.ts +4 -4
  112. package/dist/lib/test-paths.js +16 -10
  113. package/dist/lib/test-sandbox.d.ts +1 -1
  114. package/dist/lib/test-sandbox.js +38 -31
  115. package/dist/lib/test-targets.d.ts +2 -2
  116. package/dist/lib/test-targets.js +11 -11
  117. package/dist/lib/test-types.d.ts +1 -1
  118. package/dist/lib/test.d.ts +1 -1
  119. package/dist/lib/test.js +1 -1
  120. package/dist/lib/util.d.ts +2 -0
  121. package/dist/lib/util.js +14 -1
  122. package/dist/lib/validate-compiled.d.ts +27 -0
  123. package/dist/lib/validate-compiled.js +236 -0
  124. package/dist/lib/validate-helpers.d.ts +0 -8
  125. package/dist/lib/validate-helpers.js +0 -30
  126. package/dist/lib/validate.d.ts +4 -4
  127. package/dist/lib/validate.js +49 -15
  128. package/dist/lib/workflow-abi.d.ts +37 -46
  129. package/dist/lib/workflow-abi.js +51 -76
  130. package/dist/lib/workflow-definitions.d.ts +11 -11
  131. package/dist/lib/workflow-definitions.js +36 -53
  132. package/dist/lib/workflow-helpers.d.ts +2 -3
  133. package/dist/lib/workflow-helpers.js +9 -13
  134. package/dist/lib/workflow-improvement.d.ts +3 -3
  135. package/dist/lib/workflow-improvement.js +48 -48
  136. package/dist/lib/workflow-review-paths.d.ts +3 -3
  137. package/dist/lib/workflow-review-paths.js +11 -11
  138. package/dist/lib/workflow-stage-runner.d.ts +1 -1
  139. package/dist/lib/workflow-stage-runner.js +8 -8
  140. package/dist/lib/workflows.d.ts +9 -9
  141. package/dist/lib/workflows.js +15 -17
  142. package/package.json +10 -9
  143. package/dist/commands/workspace-flow.d.ts +0 -23
  144. package/dist/commands/workspace-flow.js +0 -109
  145. package/dist/lib/registry.d.ts +0 -16
  146. package/dist/lib/registry.js +0 -65
  147. package/dist/lib/validate-workspace.d.ts +0 -121
  148. package/dist/lib/validate-workspace.js +0 -407
  149. package/dist/lib/workspace-compile.d.ts +0 -54
  150. package/dist/lib/workspace-compile.js +0 -476
  151. package/dist/lib/workspace-home.d.ts +0 -5
  152. package/dist/lib/workspace-home.js +0 -32
  153. package/dist/lib/workspace-layout.d.ts +0 -2
  154. package/dist/lib/workspace-layout.js +0 -60
  155. package/dist/lib/workspace-paths.d.ts +0 -41
  156. package/dist/lib/workspace-paths.js +0 -107
  157. package/dist/lib/workspace-reset.d.ts +0 -1
  158. package/dist/lib/workspace-reset.js +0 -43
  159. package/dist/lib/workspace-schema.d.ts +0 -17
  160. package/dist/lib/workspace-schema.js +0 -74
@@ -1,16 +1,17 @@
1
- import { mkdirSync, writeFileSync, } from "node:fs";
2
- import { basename, join } from "node:path";
3
- import { getWorkspaceWorkflow } from "./workflow-definitions.js";
4
- import { refreshWorkspaceArtifacts, saveState, initWorkspaceState, } from "./state.js";
5
- import { saveEmptyWorkspaceInventory } from "./state-io.js";
1
+ import { mkdirSync, existsSync, writeFileSync, } from "node:fs";
2
+ import { basename, join, relative, sep } from "node:path";
3
+ import { getCompiledWorkflow } from "./workflow-definitions.js";
4
+ import { refreshCompiledArtifacts, saveState, initCompiledState, } from "./state.js";
5
+ import { saveEmptyCompiledInventory } from "./state-io.js";
6
6
  import { writeObsidianDefaults } from "./obsidian.js";
7
- import { assertWorkspaceContainer, assertWritableTargetDir, assertWorkspaceName, } from "./interf-detect.js";
8
- import { refreshWorkspaceBootstrapGuidance } from "./interf-bootstrap.js";
9
- import { seedWorkspaceWorkflowPackage } from "./interf-workflow-package.js";
10
- import { syncWorkspaceRawSnapshot } from "./workspace-raw.js";
11
- import { findSourceWorkspaceConfig, loadSourceFolderConfig, saveWorkspaceInterfConfig, } from "./source-config.js";
12
- import { defaultControlPathForWorkspace } from "./workspace-paths.js";
13
- import { renderUncompiledWorkspaceHome } from "./workspace-home.js";
7
+ import { assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
8
+ import { refreshCompiledBootstrapGuidance } from "./interf-bootstrap.js";
9
+ import { seedCompiledWorkflowPackage } from "./interf-workflow-package.js";
10
+ import { compiledCompiledPathForDataset } from "./project-paths.js";
11
+ import { syncCompiledRawSnapshot } from "./compiled-raw.js";
12
+ import { ensureCompiledZoneTargets, readCompiledSchemaFile } from "./compiled-schema.js";
13
+ import { findSourceDatasetConfig, loadSourceFolderConfig, resolveSourceDatasetPath, saveCompiledInterfConfig, } from "./source-config.js";
14
+ import { defaultControlPathForCompiled, workflowPackagePathForCompiled } from "./compiled-paths.js";
14
15
  const DEFAULT_INTERFIGNORE = [
15
16
  ".claude/",
16
17
  ".codex/",
@@ -22,67 +23,99 @@ const DEFAULT_INTERFIGNORE = [
22
23
  ".obsidian/",
23
24
  "",
24
25
  ].join("\n");
25
- export function createWorkspace(name, sourcePath, workflowId = "interf", about) {
26
- assertWorkspaceName(name, "Workspace");
27
- const containerPath = assertWorkspaceContainer(sourcePath);
28
- mkdirSync(containerPath, { recursive: true });
29
- const workspacePath = join(containerPath, name);
30
- assertWritableTargetDir(workspacePath, "Workspace");
31
- mkdirSync(workspacePath, { recursive: true });
32
- const savedWorkspace = findSourceWorkspaceConfig(loadSourceFolderConfig(sourcePath), name);
33
- const selectedWorkflow = getWorkspaceWorkflow(workflowId, { sourcePath });
34
- const resolvedAbout = about ?? savedWorkspace?.about;
35
- saveWorkspaceInterfConfig(workspacePath, {
36
- type: "workspace",
26
+ const UNCOMPILED_COMPILED_PLACEHOLDER = "Not yet compiled. Run `interf compile` to build the compiled dataset.";
27
+ function renderUncompiledCompiledFile(compiledName, relativePath, about) {
28
+ return [
29
+ `# ${compiledName} ${relativePath}`,
30
+ "",
31
+ UNCOMPILED_COMPILED_PLACEHOLDER,
32
+ ...(about ? ["", `About: ${about}`] : []),
33
+ "",
34
+ ].join("\n");
35
+ }
36
+ function compiledGitignoreEntries(compiledPath) {
37
+ const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(compiledPath));
38
+ const zoneEntries = (schema?.zones ?? [])
39
+ .filter((zone) => zone.kind !== "runtime")
40
+ .map((zone) => zone.kind === "file" ? zone.path : `${zone.path}/`);
41
+ return [
42
+ ...zoneEntries,
43
+ ".claude/",
44
+ ".codex/",
45
+ ".agents/",
46
+ ".cursor/",
47
+ ".interf/tests/",
48
+ ".interf/tests/targets/sandboxes/",
49
+ ".interf/runtime/",
50
+ ".obsidian/",
51
+ ];
52
+ }
53
+ function scaffoldCompiledOutputs(compiledPath, compiledName, about) {
54
+ const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(compiledPath));
55
+ if (!schema) {
56
+ throw new Error(`Missing compiled schema at ${workflowPackagePathForCompiled(compiledPath)}.`);
57
+ }
58
+ ensureCompiledZoneTargets(compiledPath, schema);
59
+ for (const zone of schema.zones) {
60
+ if (!zone.required || zone.kind !== "file" || zone.id === "raw")
61
+ continue;
62
+ const targetPath = join(compiledPath, zone.path);
63
+ if (existsSync(targetPath))
64
+ continue;
65
+ writeFileSync(targetPath, renderUncompiledCompiledFile(compiledName, zone.path, about));
66
+ }
67
+ }
68
+ export function createCompiled(name, sourcePath, workflowId = "interf", about, datasetPath = sourcePath) {
69
+ assertCompiledName(name, "Compiled");
70
+ assertCompiledContainer(sourcePath);
71
+ const compiledPath = compiledCompiledPathForDataset(sourcePath, name);
72
+ assertWritableTargetDir(compiledPath, "Compiled");
73
+ mkdirSync(compiledPath, { recursive: true });
74
+ const savedCompiled = findSourceDatasetConfig(loadSourceFolderConfig(sourcePath), name);
75
+ const selectedWorkflow = getCompiledWorkflow(workflowId, { sourcePath });
76
+ const resolvedAbout = about ?? savedCompiled?.about;
77
+ const resolvedDatasetPath = savedCompiled
78
+ ? resolveSourceDatasetPath(sourcePath, savedCompiled)
79
+ : datasetPath;
80
+ saveCompiledInterfConfig(compiledPath, {
81
+ type: "compiled",
37
82
  name,
38
83
  ...(resolvedAbout ? { about: resolvedAbout } : {}),
39
84
  workflow: selectedWorkflow.id,
40
- ...(typeof savedWorkspace?.max_attempts === "number"
41
- ? { max_attempts: savedWorkspace.max_attempts }
85
+ ...(typeof savedCompiled?.max_attempts === "number"
86
+ ? { max_attempts: savedCompiled.max_attempts }
42
87
  : {}),
43
- ...(typeof savedWorkspace?.max_loops === "number"
44
- ? { max_loops: savedWorkspace.max_loops }
88
+ ...(typeof savedCompiled?.max_loops === "number"
89
+ ? { max_loops: savedCompiled.max_loops }
45
90
  : {}),
46
- checks: savedWorkspace?.checks ?? [],
91
+ checks: savedCompiled?.checks ?? [],
47
92
  workflow_origin: {
48
93
  selected: selectedWorkflow.id,
49
94
  local_draft: false,
50
95
  },
51
96
  source: {
52
97
  path: "./raw",
53
- control_path: defaultControlPathForWorkspace(workspacePath),
98
+ control_path: defaultControlPathForCompiled(compiledPath),
99
+ dataset_path: relative(compiledPath, resolvedDatasetPath).split(sep).join("/") || ".",
54
100
  },
55
101
  });
56
- mkdirSync(join(workspacePath, "raw"), { recursive: true });
57
- syncWorkspaceRawSnapshot(workspacePath, sourcePath);
58
- writeFileSync(join(workspacePath, ".interfignore"), DEFAULT_INTERFIGNORE);
59
- seedWorkspaceWorkflowPackage({
60
- workspacePath,
102
+ mkdirSync(join(compiledPath, "raw"), { recursive: true });
103
+ syncCompiledRawSnapshot(compiledPath, resolvedDatasetPath);
104
+ writeFileSync(join(compiledPath, ".interfignore"), DEFAULT_INTERFIGNORE);
105
+ seedCompiledWorkflowPackage({
106
+ compiledPath,
61
107
  sourcePath,
62
108
  workflowId: selectedWorkflow.id,
63
109
  });
64
- refreshWorkspaceBootstrapGuidance(workspacePath);
65
- writeFileSync(join(workspacePath, "home.md"), renderUncompiledWorkspaceHome(name, about));
66
- writeFileSync(join(workspacePath, ".gitignore"), [
67
- "raw/",
68
- "summaries/",
69
- "knowledge/",
70
- ".claude/",
71
- ".codex/",
72
- ".agents/",
73
- ".cursor/",
74
- ".interf/tests/",
75
- ".interf/tests/targets/sandboxes/",
76
- ".interf/runtime/",
77
- ".obsidian/",
78
- "",
79
- ].join("\n"));
80
- saveState(workspacePath, initWorkspaceState());
81
- saveEmptyWorkspaceInventory(workspacePath);
82
- refreshWorkspaceArtifacts(workspacePath, { ensureViewSpec: true });
83
- writeObsidianDefaults(workspacePath, "workspace");
84
- return workspacePath;
110
+ scaffoldCompiledOutputs(compiledPath, name, about);
111
+ refreshCompiledBootstrapGuidance(compiledPath);
112
+ writeFileSync(join(compiledPath, ".gitignore"), [...compiledGitignoreEntries(compiledPath), ""].join("\n"));
113
+ saveState(compiledPath, initCompiledState());
114
+ saveEmptyCompiledInventory(compiledPath);
115
+ refreshCompiledArtifacts(compiledPath, { ensureViewSpec: true });
116
+ writeObsidianDefaults(compiledPath, "compiled");
117
+ return compiledPath;
85
118
  }
86
- export function defaultWorkspaceNameForSource(sourcePath) {
119
+ export function defaultCompiledNameForSource(sourcePath) {
87
120
  return basename(sourcePath);
88
121
  }
@@ -1,10 +1,10 @@
1
1
  import { type WorkflowDefinition } from "./workflow-definitions.js";
2
- export declare function writeWorkspaceWorkflowPackage(workspacePath: string, workflow: WorkflowDefinition<string>): void;
2
+ export declare function writeCompiledWorkflowPackage(compiledPath: string, workflow: WorkflowDefinition<string>): void;
3
3
  export declare function writeWorkflowPackageToDir(workflowDir: string, workflow: WorkflowDefinition<string>, options?: {
4
4
  overwrite?: boolean;
5
5
  }): void;
6
- export declare function seedWorkspaceWorkflowPackage(options: {
7
- workspacePath: string;
6
+ export declare function seedCompiledWorkflowPackage(options: {
7
+ compiledPath: string;
8
8
  sourcePath: string;
9
9
  workflowId: string;
10
10
  }): void;
@@ -1,13 +1,13 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { copyWorkflowPackageDirectory, isPortableWorkflowPackage, patchWorkflowPackageMetadata, resolveWorkflowPackageSourcePath, workflowDefinitionPath, } from "./local-workflows.js";
4
- import { getWorkspaceWorkflow, } from "./workflow-definitions.js";
5
- import { renderWorkspaceQuerySkill } from "./agent-shells.js";
4
+ import { getCompiledWorkflow, } from "./workflow-definitions.js";
5
+ import { renderCompiledQuerySkill } from "./agent-shells.js";
6
6
  import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
7
- import { writeWorkspaceSchemaFile } from "./workspace-schema.js";
8
- import { workflowPackagePathForWorkspace } from "./workspace-paths.js";
7
+ import { writeCompiledSchemaFile } from "./compiled-schema.js";
8
+ import { workflowPackagePathForCompiled } from "./compiled-paths.js";
9
9
  function workflowPackagePath(dirPath) {
10
- return workflowPackagePathForWorkspace(dirPath);
10
+ return workflowPackagePathForCompiled(dirPath);
11
11
  }
12
12
  function mergeWorkflowStagePolicyNotes(stages, baseNotes, nextNotes) {
13
13
  const merged = {};
@@ -37,9 +37,9 @@ function writeWorkflowPackageJson(rootPath, workflow, options) {
37
37
  return;
38
38
  writeFileSync(targetPath, `${JSON.stringify({
39
39
  id: workflow.id,
40
- type: "workspace",
40
+ type: "compiled",
41
41
  compiler_api: workflow.compilerApi ?? {
42
- kind: "workspace",
42
+ kind: "compiled",
43
43
  version: 1,
44
44
  },
45
45
  label: workflow.label,
@@ -69,7 +69,7 @@ function renderWorkflowReadme(workflow) {
69
69
  "## Package",
70
70
  "",
71
71
  "- `workflow.json` = stage graph, compiler API target, and compile contract mapping",
72
- "- `workspace.schema.json` = deterministic workspace output shape",
72
+ "- `compiled.schema.json` = deterministic compiled-dataset output shape",
73
73
  "- `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs",
74
74
  "- Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder",
75
75
  "- Interf Compiler projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops",
@@ -78,7 +78,7 @@ function renderWorkflowReadme(workflow) {
78
78
  "",
79
79
  stageLines,
80
80
  "",
81
- "Interf Compiler runs the workspace-local copy of this package directly from `.interf/workflow/` inside each compiled workspace.",
81
+ "Interf Compiler runs the local copy of this package directly from `.interf/workflow/` inside each compiled dataset.",
82
82
  "",
83
83
  ].join("\n");
84
84
  }
@@ -90,7 +90,7 @@ function renderDerivedWorkflowReadme(options) {
90
90
  "",
91
91
  `This workflow package was copied from \`${options.baseWorkflowId}\` and materialized as a standalone package for this dataset job.`,
92
92
  "",
93
- "Interf Compiler runs the workspace-local copy of this package directly. Keep changes in this folder self-contained instead of relying on runtime inheritance or fallback.",
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.",
94
94
  "",
95
95
  "## Emphasis",
96
96
  "",
@@ -107,13 +107,13 @@ function renderImproveSkill(workflow) {
107
107
  `Workflow: ${workflow.id}`,
108
108
  "",
109
109
  "This file is the editable authoring source for Interf Compiler's generated native workflow-improver shell.",
110
- "The improver edits this workspace-local package directly.",
110
+ "The improver edits this local package directly.",
111
111
  "",
112
112
  "Default loop:",
113
113
  "1. Read the loop context first.",
114
114
  "2. Review preserved stage shells, runtime logs, and saved test runs from failed attempts.",
115
- "3. Edit only the local workflow package for this workspace to create a better workflow variation for this dataset.",
116
- "4. Keep `workflow.json`, `workspace.schema.json`, and any changed stage docs aligned.",
115
+ "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.",
117
117
  "",
118
118
  "Guardrails:",
119
119
  "- do not edit truth checks, test specs, or raw dataset files",
@@ -125,23 +125,23 @@ function renderImproveSkill(workflow) {
125
125
  }
126
126
  function renderStageSkill(workflow, stage) {
127
127
  const notes = workflow.stagePolicyNotes?.[stage.id] ?? [];
128
- const stageSpecificNotes = stage.contractType === "workspace-file-evidence"
128
+ const stageSpecificNotes = stage.contractType === "compiled-file-evidence"
129
129
  ? [
130
130
  "Each summary must use JSON frontmatter and include `source`, `source_kind`, `evidence_tier`, `truth_mode`, `state`, and a non-empty `abstract`.",
131
131
  "Include a clear abstract block in the body so a human can skim the summary quickly.",
132
132
  "Do not skip the abstract just because the overview section is present.",
133
133
  ]
134
- : stage.contractType === "workspace-knowledge-structure"
134
+ : stage.contractType === "compiled-knowledge-structure"
135
135
  ? [
136
136
  "Treat the knowledge layer as retrieval structure, not final truth.",
137
137
  "Prefer durable entity, claim, and index notes over one giant catch-all file.",
138
138
  ]
139
- : stage.contractType === "workspace-query-shape"
139
+ : stage.contractType === "compiled-query-shape"
140
140
  ? [
141
- "Use the workspace focus plus saved truth-check question text to shape `home.md` and retrieval routes.",
141
+ "Use the compiled focus plus saved truth-check question text to shape `home.md` and retrieval routes.",
142
142
  "Rewrite `home.md` into a real entrypoint note. Do not leave the scaffold `Not yet compiled.` placeholder in place.",
143
143
  ...CHART_APPROXIMATION_NOTES,
144
- "Do not copy expected answers into the workspace.",
144
+ "Do not copy expected answers into the compiled dataset.",
145
145
  ]
146
146
  : [];
147
147
  return [
@@ -169,8 +169,8 @@ function renderStageSkill(workflow, stage) {
169
169
  : []),
170
170
  ].join("\n");
171
171
  }
172
- export function writeWorkspaceWorkflowPackage(workspacePath, workflow) {
173
- writeWorkflowPackageToDir(workflowPackagePath(workspacePath), workflow);
172
+ export function writeCompiledWorkflowPackage(compiledPath, workflow) {
173
+ writeWorkflowPackageToDir(workflowPackagePath(compiledPath), workflow);
174
174
  }
175
175
  export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
176
176
  const overwrite = options.overwrite ?? true;
@@ -181,8 +181,8 @@ export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
181
181
  mkdirSync(join(workflowDir, "compile", "stages", stage.skillDir), { recursive: true });
182
182
  }
183
183
  writeWorkflowPackageJson(workflowDir, workflow, { overwrite });
184
- if (overwrite || !existsSync(join(workflowDir, "workspace.schema.json"))) {
185
- writeWorkspaceSchemaFile(workflowDir, workflow.stages, `${workflow.label} workspace schema`);
184
+ if (overwrite || !existsSync(join(workflowDir, "compiled.schema.json"))) {
185
+ writeCompiledSchemaFile(workflowDir, workflow.stages, `${workflow.label} compiled schema`);
186
186
  }
187
187
  if (overwrite || !existsSync(join(workflowDir, "README.md"))) {
188
188
  writeFileSync(join(workflowDir, "README.md"), renderWorkflowReadme(workflow));
@@ -191,7 +191,7 @@ export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
191
191
  writeFileSync(join(workflowDir, "improve", "SKILL.md"), renderImproveSkill(workflow));
192
192
  }
193
193
  if (overwrite || !existsSync(join(workflowDir, "use", "query", "SKILL.md"))) {
194
- writeFileSync(join(workflowDir, "use", "query", "SKILL.md"), renderWorkspaceQuerySkill());
194
+ writeFileSync(join(workflowDir, "use", "query", "SKILL.md"), renderCompiledQuerySkill());
195
195
  }
196
196
  for (const stage of workflow.stages) {
197
197
  const targetPath = join(workflowDir, "compile", "stages", stage.skillDir, "SKILL.md");
@@ -201,20 +201,20 @@ export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
201
201
  }
202
202
  writeWorkflowStarterDocs(workflowDir, workflow.starterDocs, { overwrite });
203
203
  }
204
- export function seedWorkspaceWorkflowPackage(options) {
205
- const resolvedWorkflow = getWorkspaceWorkflow(options.workflowId, {
204
+ export function seedCompiledWorkflowPackage(options) {
205
+ const resolvedWorkflow = getCompiledWorkflow(options.workflowId, {
206
206
  sourcePath: options.sourcePath,
207
207
  });
208
208
  const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, resolvedWorkflow.id);
209
209
  if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
210
210
  // Portable seed packages can be copied directly because compile runs the
211
- // workspace-local package folder without any source-root fallback.
212
- copyWorkflowPackageDirectory(sourceWorkflowPath, workflowPackagePath(options.workspacePath));
211
+ // local package folder without any source-root fallback.
212
+ copyWorkflowPackageDirectory(sourceWorkflowPath, workflowPackagePath(options.compiledPath));
213
213
  return;
214
214
  }
215
215
  // Legacy or partially-defined seed packages are resolved once and
216
- // materialized into a standalone workspace-local package.
217
- writeWorkspaceWorkflowPackage(options.workspacePath, resolvedWorkflow);
216
+ // materialized into a standalone local package.
217
+ writeCompiledWorkflowPackage(options.compiledPath, resolvedWorkflow);
218
218
  }
219
219
  export function createLocalWorkflowPackageFromTemplate(options) {
220
220
  const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, options.baseWorkflowId);
@@ -245,7 +245,7 @@ export function createLocalWorkflowPackageFromTemplate(options) {
245
245
  }
246
246
  // Legacy or inherited base packages are materialized immediately so the new
247
247
  // local workflow package is standalone from its first write.
248
- const baseWorkflow = getWorkspaceWorkflow(options.baseWorkflowId, {
248
+ const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
249
249
  sourcePath: options.sourcePath,
250
250
  });
251
251
  const localWorkflow = {
@@ -1,5 +1,5 @@
1
- export { INTERF_CONTAINER_NAME, WORKSPACE_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, prepareWorkspaceLayout, readInterfConfig, detectInterf, resolveWorkspace, resolveSourceFolderPath, resolveSourceControlPath, listWorkspacesForSourceFolder, hasSourceFolderInput, assertWorkspaceContainer, assertWritableTargetDir, assertWorkspaceName, } from "./interf-detect.js";
2
- export type { InterfConfig, ResolvedWorkspace } from "./interf-detect.js";
3
- export { ensureWorkspaceRawBinding, resolveWorkspaceRawPath, syncWorkspaceRawSnapshot, } from "./workspace-raw.js";
4
- export { refreshWorkspaceBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
5
- export { createWorkspace, defaultWorkspaceNameForSource, } from "./interf-scaffold.js";
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";
2
+ export type { InterfConfig, ResolvedCompiled } from "./interf-detect.js";
3
+ export { ensureCompiledRawBinding, resolveCompiledRawPath, syncCompiledRawSnapshot, } from "./compiled-raw.js";
4
+ export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
5
+ export { createCompiled, defaultCompiledNameForSource, } from "./interf-scaffold.js";
@@ -1,4 +1,4 @@
1
- export { INTERF_CONTAINER_NAME, WORKSPACE_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, prepareWorkspaceLayout, readInterfConfig, detectInterf, resolveWorkspace, resolveSourceFolderPath, resolveSourceControlPath, listWorkspacesForSourceFolder, hasSourceFolderInput, assertWorkspaceContainer, assertWritableTargetDir, assertWorkspaceName, } from "./interf-detect.js";
2
- export { ensureWorkspaceRawBinding, resolveWorkspaceRawPath, syncWorkspaceRawSnapshot, } from "./workspace-raw.js";
3
- export { refreshWorkspaceBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
4
- export { createWorkspace, defaultWorkspaceNameForSource, } from "./interf-scaffold.js";
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";
2
+ export { ensureCompiledRawBinding, resolveCompiledRawPath, syncCompiledRawSnapshot, } from "./compiled-raw.js";
3
+ export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
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 WorkflowWorkspaceSchema } from "./schema.js";
2
+ import { WorkflowCompilerApiSchema, RuntimeContractTypeSchema, RuntimeStageAcceptanceSchema, WorkflowStageZoneAccessSchema, type WorkflowCompiledSchema } from "./schema.js";
3
3
  export interface LocalWorkflowStarterDoc {
4
4
  relativePath: string;
5
5
  content: string;
@@ -16,18 +16,18 @@ export interface LocalWorkflowStageDefinition {
16
16
  }
17
17
  export interface LocalWorkflowDefinition {
18
18
  id: string;
19
- type: "workspace";
19
+ type: "compiled";
20
20
  compiler_api?: z.infer<typeof WorkflowCompilerApiSchema>;
21
21
  label: string;
22
22
  hint: string;
23
23
  extends?: string;
24
24
  stages?: LocalWorkflowStageDefinition[];
25
25
  stage_policy_notes?: Record<string, string[]>;
26
- workspace_schema: WorkflowWorkspaceSchema;
26
+ compiled_schema: WorkflowCompiledSchema;
27
27
  starter_docs: LocalWorkflowStarterDoc[];
28
28
  directoryPath: string;
29
29
  workflowPath: string;
30
- workspaceSchemaPath: string;
30
+ compiledSchemaPath: string;
31
31
  }
32
32
  export declare function workflowDefinitionPath(sourcePath: string, id: string): string;
33
33
  export declare function loadWorkflowDefinitionFromDir(dirPath: string): LocalWorkflowDefinition | null;