@interf/compiler 0.2.4 → 0.3.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 (240) hide show
  1. package/README.md +194 -148
  2. package/dist/commands/benchmark.d.ts.map +1 -1
  3. package/dist/commands/benchmark.js +60 -351
  4. package/dist/commands/benchmark.js.map +1 -1
  5. package/dist/commands/compile.d.ts.map +1 -1
  6. package/dist/commands/compile.js +43 -110
  7. package/dist/commands/compile.js.map +1 -1
  8. package/dist/commands/create-workflow-wizard.d.ts +4 -25
  9. package/dist/commands/create-workflow-wizard.d.ts.map +1 -1
  10. package/dist/commands/create-workflow-wizard.js +29 -214
  11. package/dist/commands/create-workflow-wizard.js.map +1 -1
  12. package/dist/commands/create.d.ts +2 -11
  13. package/dist/commands/create.d.ts.map +1 -1
  14. package/dist/commands/create.js +72 -455
  15. package/dist/commands/create.js.map +1 -1
  16. package/dist/commands/default.d.ts.map +1 -1
  17. package/dist/commands/default.js +16 -28
  18. package/dist/commands/default.js.map +1 -1
  19. package/dist/commands/init.d.ts.map +1 -1
  20. package/dist/commands/init.js +71 -337
  21. package/dist/commands/init.js.map +1 -1
  22. package/dist/commands/list.d.ts.map +1 -1
  23. package/dist/commands/list.js +12 -22
  24. package/dist/commands/list.js.map +1 -1
  25. package/dist/commands/reset.d.ts.map +1 -1
  26. package/dist/commands/reset.js +27 -124
  27. package/dist/commands/reset.js.map +1 -1
  28. package/dist/commands/source-config-wizard.d.ts +13 -6
  29. package/dist/commands/source-config-wizard.d.ts.map +1 -1
  30. package/dist/commands/source-config-wizard.js +93 -59
  31. package/dist/commands/source-config-wizard.js.map +1 -1
  32. package/dist/commands/status.d.ts.map +1 -1
  33. package/dist/commands/status.js +60 -56
  34. package/dist/commands/status.js.map +1 -1
  35. package/dist/commands/verify.d.ts.map +1 -1
  36. package/dist/commands/verify.js +59 -98
  37. package/dist/commands/verify.js.map +1 -1
  38. package/dist/index.d.ts +7 -7
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +4 -6
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/agent-constants.js +1 -1
  43. package/dist/lib/agent-constants.js.map +1 -1
  44. package/dist/lib/benchmark-execution.d.ts.map +1 -1
  45. package/dist/lib/benchmark-execution.js +7 -16
  46. package/dist/lib/benchmark-execution.js.map +1 -1
  47. package/dist/lib/benchmark-targets.d.ts +3 -4
  48. package/dist/lib/benchmark-targets.d.ts.map +1 -1
  49. package/dist/lib/benchmark-targets.js +9 -55
  50. package/dist/lib/benchmark-targets.js.map +1 -1
  51. package/dist/lib/benchmark-types.d.ts +2 -3
  52. package/dist/lib/benchmark-types.d.ts.map +1 -1
  53. package/dist/lib/benchmark.d.ts +1 -1
  54. package/dist/lib/benchmark.d.ts.map +1 -1
  55. package/dist/lib/benchmark.js +1 -1
  56. package/dist/lib/benchmark.js.map +1 -1
  57. package/dist/lib/config.d.ts +1 -2
  58. package/dist/lib/config.d.ts.map +1 -1
  59. package/dist/lib/config.js +2 -4
  60. package/dist/lib/config.js.map +1 -1
  61. package/dist/lib/discovery.d.ts +1 -1
  62. package/dist/lib/discovery.d.ts.map +1 -1
  63. package/dist/lib/discovery.js +7 -2
  64. package/dist/lib/discovery.js.map +1 -1
  65. package/dist/lib/eval-packs.d.ts +6 -52
  66. package/dist/lib/eval-packs.d.ts.map +1 -1
  67. package/dist/lib/eval-packs.js +11 -39
  68. package/dist/lib/eval-packs.js.map +1 -1
  69. package/dist/lib/interf-bootstrap.d.ts +3 -5
  70. package/dist/lib/interf-bootstrap.d.ts.map +1 -1
  71. package/dist/lib/interf-bootstrap.js +10 -57
  72. package/dist/lib/interf-bootstrap.js.map +1 -1
  73. package/dist/lib/interf-detect.d.ts +13 -11
  74. package/dist/lib/interf-detect.d.ts.map +1 -1
  75. package/dist/lib/interf-detect.js +59 -45
  76. package/dist/lib/interf-detect.js.map +1 -1
  77. package/dist/lib/interf-scaffold.d.ts +2 -5
  78. package/dist/lib/interf-scaffold.d.ts.map +1 -1
  79. package/dist/lib/interf-scaffold.js +98 -235
  80. package/dist/lib/interf-scaffold.js.map +1 -1
  81. package/dist/lib/interf-workflow-package.d.ts +1 -2
  82. package/dist/lib/interf-workflow-package.d.ts.map +1 -1
  83. package/dist/lib/interf-workflow-package.js +94 -90
  84. package/dist/lib/interf-workflow-package.js.map +1 -1
  85. package/dist/lib/interf.d.ts +4 -5
  86. package/dist/lib/interf.d.ts.map +1 -1
  87. package/dist/lib/interf.js +3 -6
  88. package/dist/lib/interf.js.map +1 -1
  89. package/dist/lib/local-workflows.d.ts +9 -8
  90. package/dist/lib/local-workflows.d.ts.map +1 -1
  91. package/dist/lib/local-workflows.js +42 -94
  92. package/dist/lib/local-workflows.js.map +1 -1
  93. package/dist/lib/obsidian.d.ts +1 -5
  94. package/dist/lib/obsidian.d.ts.map +1 -1
  95. package/dist/lib/obsidian.js +11 -165
  96. package/dist/lib/obsidian.js.map +1 -1
  97. package/dist/lib/registry.d.ts +6 -17
  98. package/dist/lib/registry.d.ts.map +1 -1
  99. package/dist/lib/registry.js +36 -50
  100. package/dist/lib/registry.js.map +1 -1
  101. package/dist/lib/runtime-contracts.d.ts +2 -3
  102. package/dist/lib/runtime-contracts.d.ts.map +1 -1
  103. package/dist/lib/runtime-contracts.js +10 -9
  104. package/dist/lib/runtime-contracts.js.map +1 -1
  105. package/dist/lib/runtime-reconcile.d.ts +2 -5
  106. package/dist/lib/runtime-reconcile.d.ts.map +1 -1
  107. package/dist/lib/runtime-reconcile.js +23 -176
  108. package/dist/lib/runtime-reconcile.js.map +1 -1
  109. package/dist/lib/runtime-runs.d.ts.map +1 -1
  110. package/dist/lib/runtime-runs.js +52 -57
  111. package/dist/lib/runtime-runs.js.map +1 -1
  112. package/dist/lib/runtime-types.d.ts +5 -6
  113. package/dist/lib/runtime-types.d.ts.map +1 -1
  114. package/dist/lib/runtime.d.ts +2 -2
  115. package/dist/lib/runtime.d.ts.map +1 -1
  116. package/dist/lib/runtime.js +1 -1
  117. package/dist/lib/runtime.js.map +1 -1
  118. package/dist/lib/schema.d.ts +53 -312
  119. package/dist/lib/schema.d.ts.map +1 -1
  120. package/dist/lib/schema.js +39 -206
  121. package/dist/lib/schema.js.map +1 -1
  122. package/dist/lib/source-config.d.ts +7 -7
  123. package/dist/lib/source-config.d.ts.map +1 -1
  124. package/dist/lib/source-config.js +55 -62
  125. package/dist/lib/source-config.js.map +1 -1
  126. package/dist/lib/state-artifacts.d.ts +5 -11
  127. package/dist/lib/state-artifacts.d.ts.map +1 -1
  128. package/dist/lib/state-artifacts.js +8 -18
  129. package/dist/lib/state-artifacts.js.map +1 -1
  130. package/dist/lib/state-health.d.ts +4 -8
  131. package/dist/lib/state-health.d.ts.map +1 -1
  132. package/dist/lib/state-health.js +27 -223
  133. package/dist/lib/state-health.js.map +1 -1
  134. package/dist/lib/state-io.d.ts +7 -12
  135. package/dist/lib/state-io.d.ts.map +1 -1
  136. package/dist/lib/state-io.js +26 -93
  137. package/dist/lib/state-io.js.map +1 -1
  138. package/dist/lib/state-view.d.ts +4 -6
  139. package/dist/lib/state-view.d.ts.map +1 -1
  140. package/dist/lib/state-view.js +62 -101
  141. package/dist/lib/state-view.js.map +1 -1
  142. package/dist/lib/state.d.ts +5 -5
  143. package/dist/lib/state.d.ts.map +1 -1
  144. package/dist/lib/state.js +4 -4
  145. package/dist/lib/state.js.map +1 -1
  146. package/dist/lib/summarize-plan.d.ts +2 -2
  147. package/dist/lib/summarize-plan.d.ts.map +1 -1
  148. package/dist/lib/summarize-plan.js +13 -13
  149. package/dist/lib/summarize-plan.js.map +1 -1
  150. package/dist/lib/{validate-kb.d.ts → validate-workspace.d.ts} +8 -8
  151. package/dist/lib/validate-workspace.d.ts.map +1 -0
  152. package/dist/lib/{validate-kb.js → validate-workspace.js} +44 -46
  153. package/dist/lib/validate-workspace.js.map +1 -0
  154. package/dist/lib/validate.d.ts +5 -7
  155. package/dist/lib/validate.d.ts.map +1 -1
  156. package/dist/lib/validate.js +6 -19
  157. package/dist/lib/validate.js.map +1 -1
  158. package/dist/lib/workflow-definitions.d.ts +14 -50
  159. package/dist/lib/workflow-definitions.d.ts.map +1 -1
  160. package/dist/lib/workflow-definitions.js +74 -349
  161. package/dist/lib/workflow-definitions.js.map +1 -1
  162. package/dist/lib/workflow-helpers.d.ts +3 -4
  163. package/dist/lib/workflow-helpers.d.ts.map +1 -1
  164. package/dist/lib/workflow-helpers.js +15 -49
  165. package/dist/lib/workflow-helpers.js.map +1 -1
  166. package/dist/lib/workflow-stage-runner.d.ts +1 -2
  167. package/dist/lib/workflow-stage-runner.d.ts.map +1 -1
  168. package/dist/lib/workflow-stage-runner.js +4 -6
  169. package/dist/lib/workflow-stage-runner.js.map +1 -1
  170. package/dist/lib/workflow-starter-docs.d.ts +3 -5
  171. package/dist/lib/workflow-starter-docs.d.ts.map +1 -1
  172. package/dist/lib/workflow-starter-docs.js +2 -17
  173. package/dist/lib/workflow-starter-docs.js.map +1 -1
  174. package/dist/lib/workflows.d.ts +9 -14
  175. package/dist/lib/workflows.d.ts.map +1 -1
  176. package/dist/lib/workflows.js +13 -30
  177. package/dist/lib/workflows.js.map +1 -1
  178. package/dist/lib/workspace-compile.d.ts +50 -0
  179. package/dist/lib/workspace-compile.d.ts.map +1 -0
  180. package/dist/lib/{workflows-kb.js → workspace-compile.js} +81 -89
  181. package/dist/lib/workspace-compile.js.map +1 -0
  182. package/package.json +9 -9
  183. package/skills/benchmark/SKILL.md +16 -24
  184. package/skills/workflow/create/SKILL.md +7 -14
  185. package/templates/workspace/README.md +23 -0
  186. package/templates/workspace/interfignore +2 -0
  187. package/dist/lib/bundled-templates.d.ts +0 -5
  188. package/dist/lib/bundled-templates.d.ts.map +0 -1
  189. package/dist/lib/bundled-templates.js +0 -23
  190. package/dist/lib/bundled-templates.js.map +0 -1
  191. package/dist/lib/interf-compile-plan.d.ts +0 -12
  192. package/dist/lib/interf-compile-plan.d.ts.map +0 -1
  193. package/dist/lib/interf-compile-plan.js +0 -143
  194. package/dist/lib/interf-compile-plan.js.map +0 -1
  195. package/dist/lib/validate-interface.d.ts +0 -79
  196. package/dist/lib/validate-interface.d.ts.map +0 -1
  197. package/dist/lib/validate-interface.js +0 -535
  198. package/dist/lib/validate-interface.js.map +0 -1
  199. package/dist/lib/validate-kb.d.ts.map +0 -1
  200. package/dist/lib/validate-kb.js.map +0 -1
  201. package/dist/lib/workflows-interface-contracts.d.ts +0 -24
  202. package/dist/lib/workflows-interface-contracts.d.ts.map +0 -1
  203. package/dist/lib/workflows-interface-contracts.js +0 -304
  204. package/dist/lib/workflows-interface-contracts.js.map +0 -1
  205. package/dist/lib/workflows-interface.d.ts +0 -72
  206. package/dist/lib/workflows-interface.d.ts.map +0 -1
  207. package/dist/lib/workflows-interface.js +0 -377
  208. package/dist/lib/workflows-interface.js.map +0 -1
  209. package/dist/lib/workflows-kb.d.ts +0 -50
  210. package/dist/lib/workflows-kb.d.ts.map +0 -1
  211. package/dist/lib/workflows-kb.js.map +0 -1
  212. package/skills/interface/analyze/SKILL.md +0 -191
  213. package/skills/interface/compile/SKILL.md +0 -152
  214. package/skills/interface/compile/references/output-format.md +0 -48
  215. package/skills/interface/create/SKILL.md +0 -87
  216. package/skills/interface/create/references/compile-plan-format.md +0 -109
  217. package/skills/interface/create/references/workflows.md +0 -35
  218. package/skills/interface/query/SKILL.md +0 -48
  219. package/skills/interface/retrieve/SKILL.md +0 -133
  220. package/skills/knowledge-base/compile/SKILL.md +0 -196
  221. package/skills/knowledge-base/compile/references/output-format.md +0 -48
  222. package/skills/knowledge-base/compile/references/stage-claims.md +0 -60
  223. package/skills/knowledge-base/compile/references/stage-entities.md +0 -46
  224. package/skills/knowledge-base/query/SKILL.md +0 -45
  225. package/skills/knowledge-base/summarize/SKILL.md +0 -152
  226. package/templates/interface/README.md +0 -159
  227. package/templates/interface/interfaces.md +0 -102
  228. package/templates/knowledge-base/README.md +0 -137
  229. package/templates/knowledge-base/interfignore +0 -19
  230. package/templates/knowledge-base/registry.md +0 -118
  231. package/templates/workflow-package/README.md +0 -16
  232. package/templates/workflow-package/create/SKILL.md +0 -8
  233. package/templates/workflow-package/interface-query/SKILL.md +0 -29
  234. package/templates/workflow-package/interface-stage/SKILL.md +0 -13
  235. package/templates/workflow-package/knowledge-base-query/SKILL.md +0 -36
  236. package/templates/workflow-package/knowledge-base-stage/SKILL.md +0 -13
  237. package/templates/workflow-starters/interface/interf/README.md +0 -13
  238. package/templates/workflow-starters/interface/interf/create/SKILL.md +0 -15
  239. package/templates/workflow-starters/knowledge-base/interf/README.md +0 -13
  240. package/templates/workflow-starters/knowledge-base/karpathy/README.md +0 -13
@@ -1,32 +1,30 @@
1
1
  import { join } from "node:path";
2
2
  import { countFilesRecursive } from "./filesystem.js";
3
- import { readInterfConfig, refreshWorkspaceBootstrapGuidance, resolveKnowledgeBaseSourcePath, } from "./interf.js";
3
+ import { readInterfConfig, refreshWorkspaceBootstrapGuidance, resolveSourceFolderPath, } from "./interf.js";
4
4
  import { buildSummarizePlan, writeSummarizePlan } from "./summarize-plan.js";
5
- import { reconcileKnowledgeBaseCompileRun, reconcileKnowledgeBaseSummarizeRun, } from "./runtime-reconcile.js";
6
- import { loadState, refreshKnowledgeBaseArtifacts, } from "./state.js";
7
- import { buildKnowledgeBaseSummarizeContract, validateStageContractAcceptance, } from "./runtime.js";
5
+ import { reconcileWorkspaceCompileRun, reconcileWorkspaceSummarizeRun, } from "./runtime-reconcile.js";
6
+ import { loadState, refreshWorkspaceArtifacts, } from "./state.js";
7
+ import { buildWorkspaceSummarizeContract, validateStageContractAcceptance, } from "./runtime.js";
8
8
  import { readJsonFileUnchecked } from "./parse.js";
9
- import { formatKnowledgeBaseWorkflowStageStep, getKnowledgeBaseWorkflow, getWorkflowStagePolicyNotes, resolveKnowledgeBaseWorkflowFromConfig, } from "./workflow-definitions.js";
10
- import { validateKnowledgeBaseSummarize, validateKnowledgeBaseCompile, } from "./validate.js";
11
- import { reportLine, reportBlankLine, reportValidationFailure, buildLocalSkillContractExtension, buildStageInstructions, bundledSkillForContractType, resolveStageAcceptance, workflowCompileStageDirectory, } from "./workflow-helpers.js";
9
+ import { formatWorkspaceWorkflowStageStep, getWorkflowStagePolicyNotes, getWorkspaceWorkflow, resolveWorkspaceWorkflowFromConfig, } from "./workflow-definitions.js";
10
+ import { validateWorkspaceSummarize, validateWorkspaceCompile, } from "./validate.js";
11
+ import { reportBlankLine, reportLine, reportValidationFailure, buildLocalSkillContractExtension, buildStageInstructions, bundledSkillForContractType, resolveStageAcceptance, workflowCompileStageDirectory, } from "./workflow-helpers.js";
12
12
  import { executeValidatedStage, executeValidatedSummarizeStage, findStageByContractType, } from "./workflow-stage-runner.js";
13
- // ---------------------------------------------------------------------------
14
- // KB-specific helpers
15
- // ---------------------------------------------------------------------------
16
- export function resolveKnowledgeBaseContext(knowledgeBasePath) {
17
- const config = readInterfConfig(knowledgeBasePath);
18
- const workflowId = resolveKnowledgeBaseWorkflowFromConfig(config);
13
+ export function resolveWorkspaceContext(workspacePath) {
14
+ const config = readInterfConfig(workspacePath);
15
+ const workflowId = resolveWorkspaceWorkflowFromConfig(config);
19
16
  return {
20
- knowledgeBaseName: config?.name ?? "knowledge-base",
21
- sourcePath: resolveKnowledgeBaseSourcePath(knowledgeBasePath, config),
17
+ workspaceName: config?.name ?? "workspace",
18
+ sourcePath: resolveSourceFolderPath(workspacePath, config),
22
19
  workflowId,
23
20
  };
24
21
  }
25
- export function knowledgeBaseExecutionStages(workflowId, knowledgeBasePath) {
26
- return getKnowledgeBaseWorkflow(workflowId, { workspacePath: knowledgeBasePath }).stages;
22
+ export function workspaceExecutionStages(workflowId, workspacePath) {
23
+ return getWorkspaceWorkflow(workflowId, { sourcePath: resolveSourceFolderPath(workspacePath) })
24
+ .stages;
27
25
  }
28
- function readKnowledgeBaseInventoryTotal(knowledgeBasePath) {
29
- const inventory = readJsonFileUnchecked(join(knowledgeBasePath, ".interf", "inventory.json"), "knowledge-base inventory");
26
+ function readWorkspaceInventoryTotal(workspacePath) {
27
+ const inventory = readJsonFileUnchecked(join(workspacePath, ".interf", "inventory.json"), "workspace inventory");
30
28
  if (!inventory)
31
29
  return 0;
32
30
  if (typeof inventory.total === "number")
@@ -39,13 +37,15 @@ function readKnowledgeBaseInventoryTotal(knowledgeBasePath) {
39
37
  return inventory.summaries.length;
40
38
  if (Array.isArray(inventory.files))
41
39
  return inventory.files.length;
40
+ if (Array.isArray(inventory.items))
41
+ return inventory.items.length;
42
42
  return 0;
43
43
  }
44
- function isKnowledgeBaseSummarizeStageComplete(knowledgeBasePath, expectedSummaryTotal) {
45
- const validation = validateKnowledgeBaseSummarize(knowledgeBasePath);
46
- const acceptance = validateStageContractAcceptance(knowledgeBasePath);
47
- const state = loadState(knowledgeBasePath);
48
- const inventoryTotal = readKnowledgeBaseInventoryTotal(knowledgeBasePath);
44
+ function isWorkspaceSummarizeStageComplete(workspacePath, expectedSummaryTotal) {
45
+ const validation = validateWorkspaceSummarize(workspacePath);
46
+ const acceptance = validateStageContractAcceptance(workspacePath);
47
+ const state = loadState(workspacePath);
48
+ const inventoryTotal = readWorkspaceInventoryTotal(workspacePath);
49
49
  return Boolean(validation.ok &&
50
50
  acceptance.ok &&
51
51
  state?.inventory_complete === true &&
@@ -54,13 +54,10 @@ function isKnowledgeBaseSummarizeStageComplete(knowledgeBasePath, expectedSummar
54
54
  (state.summarized ?? 0) >= expectedSummaryTotal &&
55
55
  inventoryTotal >= expectedSummaryTotal);
56
56
  }
57
- // ---------------------------------------------------------------------------
58
- // KB compile contract builder
59
- // ---------------------------------------------------------------------------
60
- export function buildKnowledgeBaseCompileContract(knowledgeBasePath, workflowId, summaryCount, instructions, stageId = "compile", stageSkillDir = "compile") {
61
- const sourcePath = resolveKnowledgeBaseSourcePath(knowledgeBasePath);
62
- const acceptance = resolveStageAcceptance("knowledge-base", workflowId, stageId, sourcePath, knowledgeBasePath);
63
- const localSkills = buildLocalSkillContractExtension(knowledgeBasePath, [workflowCompileStageDirectory(stageSkillDir)], "Use them to refine knowledge-base compile behavior, entity/claim extraction, and retrieval structure.");
57
+ export function buildWorkspaceCompileContract(workspacePath, workflowId, summaryCount, instructions, stageId = "compile", stageSkillDir = "compile") {
58
+ const sourcePath = resolveSourceFolderPath(workspacePath);
59
+ const acceptance = resolveStageAcceptance(workflowId, stageId, sourcePath);
60
+ const localSkills = buildLocalSkillContractExtension(workspacePath, [workflowCompileStageDirectory(stageSkillDir)], "Use them to refine workspace compile behavior, entity extraction, claim extraction, and retrieval structure.");
64
61
  return {
65
62
  instructions,
66
63
  counts: {
@@ -91,20 +88,20 @@ export function buildKnowledgeBaseCompileContract(knowledgeBasePath, workflowId,
91
88
  notes: [
92
89
  "Build or refresh `.interf/inventory.json` first, then use it as the progress ledger for the rest of the run.",
93
90
  "Prefer the current inventory runtime shape: `.interf/inventory.json` should use `entries` plus `total`, and each entry should carry `source`, `summary`, `frontmatter_scanned: true`, and the abstract/overview-read proof needed for compile verification.",
94
- "This stage is the knowledge-base compile pass. Treat synthesis outputs as evidence objects, not final truth.",
91
+ "This stage is the cross-file workspace compile pass. Treat synthesis outputs as working retrieval artifacts, not final truth.",
95
92
  "Use a multi-pass approach: inventory -> local evidence reading -> canonicalization -> retrieval optimization.",
96
- "Build retrieval-oriented outputs: canonical entities, cross-file claims, timelines, themes, and navigation indexes that make interface retrieval easier later.",
93
+ "Build retrieval-oriented outputs: canonical entities, cross-file claims, timelines, themes, and navigation indexes.",
97
94
  "Write structured knowledge outputs under `knowledge/entities/`, `knowledge/claims/`, and `knowledge/indexes/`.",
98
- "Do not collapse the knowledge-base knowledge layer into flat files like `knowledge/entities.md` or `knowledge/claims.md`.",
95
+ "Do not collapse the knowledge layer into flat files like `knowledge/entities.md` or `knowledge/claims.md`.",
99
96
  "Do not start compile by deleting prior outputs with `rm`, wildcard cleanup, `;`, or `&&` chains. Rewrite the required files directly and remove stale artifacts only with narrow, explicit path writes when truly needed.",
100
97
  ...(summaryCount <= 3
101
98
  ? [
102
99
  `This run has ${summaryCount} summary file${summaryCount === 1 ? "" : "s"}. Treat it as a tiny compile: read every summary overview, write the smallest truthful substrate immediately, then stop.`,
103
- "For a tiny compile, do not spend time designing a broad ontology or rereading the same evidence loop. A compact landing layer plus a small grounded retrieval surface is enough.",
100
+ "For a tiny compile, do not spend time designing a broad ontology or rereading the same evidence loop.",
104
101
  "For a tiny compile, finish as soon as `home.md`, the stable core indexes, and at least one grounded entity or claim note exist together with a valid inventory.",
105
102
  ]
106
103
  : []),
107
- ...getWorkflowStagePolicyNotes("knowledge-base", workflowId, stageId, sourcePath, knowledgeBasePath),
104
+ ...getWorkflowStagePolicyNotes(workflowId, stageId, sourcePath),
108
105
  ...localSkills.notes,
109
106
  ],
110
107
  evidence_weighting: {
@@ -118,28 +115,25 @@ export function buildKnowledgeBaseCompileContract(knowledgeBasePath, workflowId,
118
115
  },
119
116
  };
120
117
  }
121
- // ---------------------------------------------------------------------------
122
- // KB orchestration functions
123
- // ---------------------------------------------------------------------------
124
- export async function runKnowledgeBaseSummarize(options) {
125
- const context = resolveKnowledgeBaseContext(options.knowledgeBasePath);
118
+ export async function runWorkspaceSummarize(options) {
119
+ const context = resolveWorkspaceContext(options.workspacePath);
126
120
  const sourcePath = options.sourcePath ?? context.sourcePath;
127
121
  const workflowId = context.workflowId;
128
- const stageDefinition = options.stageDefinition ?? findStageByContractType(knowledgeBaseExecutionStages(workflowId, options.knowledgeBasePath), "kb-file-evidence");
122
+ const stageDefinition = options.stageDefinition ?? findStageByContractType(workspaceExecutionStages(workflowId, options.workspacePath), "workspace-file-evidence");
129
123
  const stageStatusLabel = stageDefinition.label.toLowerCase();
130
- const plan = buildSummarizePlan(sourcePath, options.knowledgeBasePath, options.fullPass ? "all" : "pending");
124
+ const plan = buildSummarizePlan(sourcePath, options.workspacePath, options.fullPass ? "all" : "pending");
131
125
  const expectedSummaryTotal = plan.summaryCount + plan.targetCount;
132
- const planPath = writeSummarizePlan(options.knowledgeBasePath, plan);
133
- const localSkills = buildLocalSkillContractExtension(options.knowledgeBasePath, [workflowCompileStageDirectory(stageDefinition.skillDir)], "Use them to refine summary structure, evidence grouping, and summarization heuristics.");
126
+ const planPath = writeSummarizePlan(options.workspacePath, plan);
127
+ const localSkills = buildLocalSkillContractExtension(options.workspacePath, [workflowCompileStageDirectory(stageDefinition.skillDir)], "Use them to refine summary structure, evidence grouping, and summarization heuristics.");
134
128
  const instructions = buildStageInstructions(bundledSkillForContractType(stageDefinition.contractType), localSkills);
135
129
  if (options.reportSummary !== false) {
136
130
  reportLine(options.reporter, `${plan.sourceCount} source files, ${plan.summaryCount} summarized, ${plan.targetCount} to summarize`);
137
131
  }
138
132
  if (plan.targetCount === 0) {
139
- refreshKnowledgeBaseArtifacts(options.knowledgeBasePath, { ensureViewSpec: true });
140
- const validation = validateKnowledgeBaseSummarize(options.knowledgeBasePath);
133
+ refreshWorkspaceArtifacts(options.workspacePath, { ensureViewSpec: true });
134
+ const validation = validateWorkspaceSummarize(options.workspacePath);
141
135
  if (options.reportStep !== false) {
142
- reportLine(options.reporter, `${formatKnowledgeBaseWorkflowStageStep(workflowId, stageDefinition.id, { sourcePath })} skipped (no work required)`);
136
+ reportLine(options.reporter, `${formatWorkspaceWorkflowStageStep(workflowId, stageDefinition.id, { sourcePath })} skipped (no work required)`);
143
137
  }
144
138
  if (!validation.ok) {
145
139
  reportValidationFailure(options.reporter, validation.summary);
@@ -152,28 +146,27 @@ export async function runKnowledgeBaseSummarize(options) {
152
146
  };
153
147
  }
154
148
  if (options.reportStep !== false) {
155
- reportLine(options.reporter, `${formatKnowledgeBaseWorkflowStageStep(workflowId, stageDefinition.id, { sourcePath })} (${plan.targetCount} files)`);
149
+ reportLine(options.reporter, `${formatWorkspaceWorkflowStageStep(workflowId, stageDefinition.id, { sourcePath })} (${plan.targetCount} files)`);
156
150
  }
157
151
  const stageResult = await executeValidatedSummarizeStage({
158
152
  executor: options.executor,
159
- workspacePath: options.knowledgeBasePath,
160
- targetType: "knowledge-base",
161
- targetName: context.knowledgeBaseName,
153
+ workspacePath: options.workspacePath,
154
+ targetName: context.workspaceName,
162
155
  workflow: workflowId,
163
156
  workflowSourcePath: sourcePath,
164
157
  stageDefinition,
165
158
  instructions,
166
159
  summary: `Preparing ${stageDefinition.label.toLowerCase()} for ${plan.targetCount} source files.`,
167
- contract: buildKnowledgeBaseSummarizeContract({
168
- knowledgeBaseName: context.knowledgeBaseName,
160
+ contract: buildWorkspaceSummarizeContract({
161
+ workspaceName: context.workspaceName,
169
162
  targetCount: plan.targetCount,
170
163
  expectedSummaryTotal,
171
164
  sourcePath,
172
165
  planPath,
173
- workflowNotes: getWorkflowStagePolicyNotes("knowledge-base", workflowId, stageDefinition.id, sourcePath, options.knowledgeBasePath),
166
+ workflowNotes: getWorkflowStagePolicyNotes(workflowId, stageDefinition.id, sourcePath),
174
167
  localSkillDocs: localSkills.reads,
175
168
  instructions,
176
- acceptance: resolveStageAcceptance("knowledge-base", workflowId, stageDefinition.id, sourcePath, options.knowledgeBasePath),
169
+ acceptance: resolveStageAcceptance(workflowId, stageDefinition.id, sourcePath),
177
170
  }),
178
171
  statusLines: [
179
172
  `Emit exactly one startup line: STATUS: loaded ${stageStatusLabel} plan ${plan.targetCount} files.`,
@@ -183,10 +176,10 @@ export async function runKnowledgeBaseSummarize(options) {
183
176
  `Emit DONE: ${stageStatusLabel} complete ${plan.targetCount}/${plan.targetCount} when finished.`,
184
177
  ],
185
178
  reporter: options.reporter,
186
- completionCheck: () => isKnowledgeBaseSummarizeStageComplete(options.knowledgeBasePath, expectedSummaryTotal),
187
- reconcile: () => reconcileKnowledgeBaseSummarizeRun(options.knowledgeBasePath, expectedSummaryTotal),
188
- refreshArtifacts: () => refreshKnowledgeBaseArtifacts(options.knowledgeBasePath, { ensureViewSpec: true }),
189
- validate: () => validateKnowledgeBaseSummarize(options.knowledgeBasePath),
179
+ completionCheck: () => isWorkspaceSummarizeStageComplete(options.workspacePath, expectedSummaryTotal),
180
+ reconcile: () => reconcileWorkspaceSummarizeRun(options.workspacePath, expectedSummaryTotal),
181
+ refreshArtifacts: () => refreshWorkspaceArtifacts(options.workspacePath, { ensureViewSpec: true }),
182
+ validate: () => validateWorkspaceSummarize(options.workspacePath),
190
183
  startingSummaryCount: plan.summaryCount,
191
184
  targetCount: plan.targetCount,
192
185
  });
@@ -205,30 +198,29 @@ export async function runKnowledgeBaseSummarize(options) {
205
198
  plan,
206
199
  };
207
200
  }
208
- export async function runKnowledgeBaseCompile(options) {
209
- const knowledgeBaseConfig = readInterfConfig(options.knowledgeBasePath);
210
- const knowledgeBaseName = knowledgeBaseConfig?.name ?? "knowledge-base";
211
- const workflowId = resolveKnowledgeBaseWorkflowFromConfig(knowledgeBaseConfig);
212
- const sourcePath = options.sourcePath ?? resolveKnowledgeBaseSourcePath(options.knowledgeBasePath, knowledgeBaseConfig);
213
- const stageDefinition = options.stageDefinition ?? findStageByContractType(knowledgeBaseExecutionStages(workflowId, options.knowledgeBasePath), "kb-knowledge-layer");
201
+ export async function runWorkspaceCompile(options) {
202
+ const workspaceConfig = readInterfConfig(options.workspacePath);
203
+ const workspaceName = workspaceConfig?.name ?? "workspace";
204
+ const workflowId = resolveWorkspaceWorkflowFromConfig(workspaceConfig);
205
+ const sourcePath = options.sourcePath ?? resolveSourceFolderPath(options.workspacePath, workspaceConfig);
206
+ const stageDefinition = options.stageDefinition ?? findStageByContractType(workspaceExecutionStages(workflowId, options.workspacePath), "workspace-knowledge-layer");
214
207
  const stageStatusLabel = stageDefinition.label.toLowerCase();
215
- const summaryCount = countFilesRecursive(join(options.knowledgeBasePath, "summaries"));
208
+ const summaryCount = countFilesRecursive(join(options.workspacePath, "summaries"));
216
209
  if (options.reportStep !== false) {
217
210
  reportBlankLine(options.reporter);
218
- reportLine(options.reporter, `${formatKnowledgeBaseWorkflowStageStep(workflowId, stageDefinition.id, { sourcePath })} (building graph)`);
211
+ reportLine(options.reporter, `${formatWorkspaceWorkflowStageStep(workflowId, stageDefinition.id, { sourcePath })} (building knowledge layer)`);
219
212
  }
220
- const instructions = buildStageInstructions(bundledSkillForContractType(stageDefinition.contractType), buildLocalSkillContractExtension(options.knowledgeBasePath, [workflowCompileStageDirectory(stageDefinition.skillDir)], "Use them to refine knowledge-base compile behavior, entity/claim extraction, and retrieval structure."));
213
+ const instructions = buildStageInstructions(bundledSkillForContractType(stageDefinition.contractType), buildLocalSkillContractExtension(options.workspacePath, [workflowCompileStageDirectory(stageDefinition.skillDir)], "Use them to refine workspace compile behavior, entity extraction, claim extraction, and retrieval structure."));
221
214
  return executeValidatedStage({
222
215
  executor: options.executor,
223
- workspacePath: options.knowledgeBasePath,
224
- targetType: "knowledge-base",
225
- targetName: knowledgeBaseName,
216
+ workspacePath: options.workspacePath,
217
+ targetName: workspaceName,
226
218
  workflow: workflowId,
227
219
  workflowSourcePath: sourcePath,
228
220
  stageDefinition,
229
221
  instructions,
230
222
  summary: `Preparing ${stageDefinition.label.toLowerCase()} for ${summaryCount} summary files.`,
231
- contract: buildKnowledgeBaseCompileContract(options.knowledgeBasePath, workflowId, summaryCount, instructions, stageDefinition.id, stageDefinition.skillDir),
223
+ contract: buildWorkspaceCompileContract(options.workspacePath, workflowId, summaryCount, instructions, stageDefinition.id, stageDefinition.skillDir),
232
224
  statusLines: [
233
225
  `Emit exactly one startup line: STATUS: loaded ${stageStatusLabel} plan ${summaryCount} summary files.`,
234
226
  `Emit STATUS: inventoried summaries ${summaryCount}/${summaryCount} after the inventory pass completes.`,
@@ -237,30 +229,30 @@ export async function runKnowledgeBaseCompile(options) {
237
229
  `Emit DONE: ${stageStatusLabel} complete ${summaryCount}/${summaryCount} when the required outputs are on disk.`,
238
230
  ],
239
231
  reporter: options.reporter,
240
- completionCheck: () => validateKnowledgeBaseCompile(options.knowledgeBasePath).ok &&
241
- validateStageContractAcceptance(options.knowledgeBasePath).ok,
242
- reconcile: () => reconcileKnowledgeBaseCompileRun(options.knowledgeBasePath),
243
- refreshArtifacts: () => refreshKnowledgeBaseArtifacts(options.knowledgeBasePath, { ensureViewSpec: true }),
244
- validate: () => validateKnowledgeBaseCompile(options.knowledgeBasePath),
232
+ completionCheck: () => validateWorkspaceCompile(options.workspacePath).ok &&
233
+ validateStageContractAcceptance(options.workspacePath).ok,
234
+ reconcile: () => reconcileWorkspaceCompileRun(options.workspacePath),
235
+ refreshArtifacts: () => refreshWorkspaceArtifacts(options.workspacePath, { ensureViewSpec: true }),
236
+ validate: () => validateWorkspaceCompile(options.workspacePath),
245
237
  });
246
238
  }
247
- export async function compileKnowledgeBase(options) {
248
- refreshWorkspaceBootstrapGuidance(options.knowledgeBasePath);
249
- const { sourcePath, workflowId } = resolveKnowledgeBaseContext(options.knowledgeBasePath);
250
- const stages = knowledgeBaseExecutionStages(workflowId, options.knowledgeBasePath);
239
+ export async function compileWorkspace(options) {
240
+ refreshWorkspaceBootstrapGuidance(options.workspacePath);
241
+ const { sourcePath, workflowId } = resolveWorkspaceContext(options.workspacePath);
242
+ const stages = workspaceExecutionStages(workflowId, options.workspacePath);
251
243
  let summarize = {
252
244
  ok: true,
253
245
  code: 0,
254
246
  skipped: true,
255
- plan: buildSummarizePlan(sourcePath, options.knowledgeBasePath),
247
+ plan: buildSummarizePlan(sourcePath, options.workspacePath),
256
248
  };
257
249
  let compile = null;
258
250
  let evidencePassCount = 0;
259
251
  for (const stageDefinition of stages) {
260
- if (stageDefinition.contractType === "kb-file-evidence") {
261
- summarize = await runKnowledgeBaseSummarize({
252
+ if (stageDefinition.contractType === "workspace-file-evidence") {
253
+ summarize = await runWorkspaceSummarize({
262
254
  executor: options.executor,
263
- knowledgeBasePath: options.knowledgeBasePath,
255
+ workspacePath: options.workspacePath,
264
256
  sourcePath,
265
257
  reporter: options.reporter,
266
258
  reportSummary: evidencePassCount === 0,
@@ -279,9 +271,9 @@ export async function compileKnowledgeBase(options) {
279
271
  }
280
272
  continue;
281
273
  }
282
- compile = await runKnowledgeBaseCompile({
274
+ compile = await runWorkspaceCompile({
283
275
  executor: options.executor,
284
- knowledgeBasePath: options.knowledgeBasePath,
276
+ workspacePath: options.workspacePath,
285
277
  sourcePath,
286
278
  reporter: options.reporter,
287
279
  reportStep: true,
@@ -303,4 +295,4 @@ export async function compileKnowledgeBase(options) {
303
295
  failedStage: null,
304
296
  };
305
297
  }
306
- //# sourceMappingURL=workflows-kb.js.map
298
+ //# sourceMappingURL=workspace-compile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-compile.js","sourceRoot":"","sources":["../../src/lib/workspace-compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EACL,gBAAgB,EAChB,iCAAiC,EACjC,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AACjG,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,yBAAyB,GAE1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAEhC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oBAAoB,EACpB,kCAAkC,GAGnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAkBpC,MAAM,UAAU,uBAAuB,CAAC,aAAqB;IAK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;gBACT,OAAO;gBACP,WAAW,EAAE,eAAe,CAAC,EAAE;aAChC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,SAAS,CAAC,EAAE;QAC/B,SAAS;QACT,OAAO;QACP,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@interf/compiler",
3
- "version": "0.2.4",
4
- "description": "Knowledge compiler that prepares local folders for agent use and lets you test the result on your evals.",
3
+ "version": "0.3.0",
4
+ "description": "Open-source knowledge compiler that measures local-agent accuracy on your files and builds compiled workspaces on top of them.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "interf": "dist/bin.js"
@@ -26,9 +26,9 @@
26
26
  "test:e2e": "npm run test:acceptance-live",
27
27
  "test:e2e:claude": "npm run test:acceptance-live -- --agent claude-code",
28
28
  "test:e2e:codex": "npm run test:acceptance-live -- --agent codex",
29
- "test:e2e:quick": "npm run test:acceptance-quick:create-interface && npm run test:acceptance-quick:query-interface",
30
- "test:e2e:quick:claude": "npm run test:acceptance-quick:create-interface -- --agent claude-code && npm run test:acceptance-quick:query-interface -- --agent claude-code",
31
- "test:e2e:quick:codex": "npm run test:acceptance-quick:create-interface -- --agent codex && npm run test:acceptance-quick:query-interface -- --agent codex",
29
+ "test:e2e:quick": "npm run test:acceptance-quick:create-workspace && npm run test:acceptance-quick:query-workspace",
30
+ "test:e2e:quick:claude": "npm run test:acceptance-quick:create-workspace -- --agent claude-code && npm run test:acceptance-quick:query-workspace -- --agent claude-code",
31
+ "test:e2e:quick:codex": "npm run test:acceptance-quick:create-workspace -- --agent codex && npm run test:acceptance-quick:query-workspace -- --agent codex",
32
32
  "test:e2e:quick:matrix": "npm run test:e2e:quick:claude && npm run test:e2e:quick:codex",
33
33
  "test:e2e:compare": "npm run test:acceptance-compare",
34
34
  "test:e2e:release:claude": "npm run test:acceptance-live -- --agent claude-code",
@@ -37,11 +37,11 @@
37
37
  "test:release:evals": "npm run eval:pack -- --pack internal/eval-packs/cbre-chart-sanity.json",
38
38
  "test:release": "npm test && npm run test:e2e:release:claude && npm run test:e2e:release:codex && npm run test:release:evals",
39
39
  "test:acceptance-live": "npm run build && node scripts/acceptance-live.mjs",
40
- "test:acceptance-compare": "npm run build && node scripts/acceptance-live.mjs --compare",
41
- "test:acceptance-matrix": "npm run build && node scripts/acceptance-live.mjs --full-matrix",
40
+ "test:acceptance-compare": "npm run build && node scripts/acceptance-live.mjs --with-benchmark",
41
+ "test:acceptance-matrix": "npm run build && node scripts/acceptance-live.mjs --with-benchmark",
42
42
  "test:acceptance-cache:refresh": "npm run build && node scripts/acceptance-live.mjs --output-root .interf-test-cache/latest-quick",
43
- "test:acceptance-quick:create-interface": "npm run build && node scripts/acceptance-targeted.mjs create-interface",
44
- "test:acceptance-quick:query-interface": "npm run build && node scripts/acceptance-targeted.mjs interface-query",
43
+ "test:acceptance-quick:create-workspace": "npm run build && node scripts/acceptance-targeted.mjs create-workspace",
44
+ "test:acceptance-quick:query-workspace": "npm run build && node scripts/acceptance-targeted.mjs workspace-query",
45
45
  "prepublishOnly": "node scripts/prepublish-gate.mjs"
46
46
  },
47
47
  "files": [
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  {
3
3
  "name": "benchmark",
4
- "description": "Compare compiled knowledge bases or interfaces with Interf's file-based benchmark specs. Use when asked to benchmark, compare workflows, compare interfaces, or run evals on already-compiled Interf targets."
4
+ "description": "Compare compiled workspaces with Interf's file-based benchmark specs. Use when asked to benchmark, compare workflows, compare compiled workspaces, or run checks on already-compiled Interf targets."
5
5
  }
6
6
  ---
7
7
 
8
- # Benchmark Compiled Knowledge Bases or Interfaces
8
+ # Benchmark Compiled Workspaces
9
9
 
10
10
  Use this skill when the job is to compare compiled Interf outputs, not to build them from scratch.
11
11
 
@@ -16,14 +16,12 @@ interf benchmark [type]
16
16
  ```
17
17
 
18
18
  This skill is for:
19
- - comparing knowledge bases built from the same source folder
20
- - comparing interfaces built on top of the same knowledge base
19
+ - comparing compiled workspaces built from the same source folder
21
20
  - creating or refining simple benchmark specs under `interf/benchmarks/`
22
- - summarizing which workflow or interface performed better on deterministic checks
21
+ - summarizing which workflow or compiled workspace performed better on deterministic checks
23
22
 
24
23
  This skill is **not** for:
25
- - compiling a knowledge base
26
- - compiling an interface
24
+ - compiling a workspace
27
25
  - inventing a second benchmark system outside Interf's filesystem contract
28
26
 
29
27
  ## Source of truth
@@ -39,32 +37,26 @@ When this skill is used inside a generated workspace, do not try to open SDK rep
39
37
 
40
38
  Interf benchmark specs are file-first and deterministic by default.
41
39
 
42
- They live under:
40
+ They live under `interf/benchmarks/`.
43
41
 
44
- - `interf/benchmarks/knowledge-base/*.json`
45
- - `interf/benchmarks/interface/*.json`
46
-
47
- Saved benchmark runs live under:
48
-
49
- - `interf/benchmarks/runs/knowledge-base/*.json`
50
- - `interf/benchmarks/runs/interface/*.json`
42
+ Saved benchmark runs live under `interf/benchmarks/runs/workspace/`.
51
43
 
52
44
  Minimal example:
53
45
 
54
46
  ```json
55
47
  {
56
- "type": "interface",
48
+ "type": "workspace",
57
49
  "name": "Weekly Brief Quality",
58
- "description": "Compare weekly briefing interfaces.",
50
+ "description": "Compare weekly briefing workspaces.",
59
51
  "cases": [
60
52
  {
61
53
  "id": "current-state",
62
- "question": "Does this interface clearly say what changed and what matters next?",
63
- "file": "briefs/current-state.md",
54
+ "question": "Does this workspace clearly say what changed and what matters next?",
55
+ "file": "home.md",
64
56
  "expect": {
65
- "must_include": ["what changed", "next steps"],
57
+ "must_include": ["launch", "people"],
66
58
  "must_not_include": ["TODO"],
67
- "min_words": 150
59
+ "min_words": 5
68
60
  }
69
61
  }
70
62
  ]
@@ -95,7 +87,7 @@ If a target is `stale`, `failed`, or `idle`, do not benchmark it yet. Recompile
95
87
  ## Recommended flow
96
88
 
97
89
  1. Confirm the source folder and target type.
98
- 2. Confirm the selected knowledge bases or interfaces are compiled.
90
+ 2. Confirm the selected workspaces are compiled.
99
91
  3. Reuse an existing benchmark spec if one already expresses the user's assertion.
100
92
  4. Otherwise create a small benchmark spec with:
101
93
  - one clear question per case
@@ -103,7 +95,7 @@ If a target is `stale`, `failed`, or `idle`, do not benchmark it yet. Recompile
103
95
  - a few deterministic checks
104
96
  5. Run `interf benchmark`.
105
97
  6. Read the saved run artifact under `interf/benchmarks/runs/`.
106
- 7. Summarize pass/fail differences and what they imply about the workflow or interface.
98
+ 7. Summarize pass/fail differences and what they imply about the workflow or workspace.
107
99
 
108
100
  ## Authoring guidance
109
101
 
@@ -125,5 +117,5 @@ When summarizing a benchmark run:
125
117
  - say which targets were compared
126
118
  - say which cases passed or failed
127
119
  - point to the saved run file
128
- - explain what the failures imply about the current workflow or interface
120
+ - explain what the failures imply about the current workflow or workspace
129
121
  - keep benchmark conclusions separate from subjective product opinions
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  {
3
3
  "name": "workflow/create",
4
- "description": "Create or refine an Interf workflow package. Use when asked to define a KB or interface workflow, author workflow.json, shape compile stages, or add declarative stage acceptance criteria."
4
+ "description": "Create or refine an Interf workflow package. Use when asked to define a workspace workflow, author workflow.json, shape compile stages, or add declarative stage acceptance criteria."
5
5
  }
6
6
  ---
7
7
 
@@ -18,7 +18,7 @@ interf create workflow
18
18
  That wizard should create the initial package under:
19
19
 
20
20
  ```text
21
- interf/workflows/<type>/<workflow-id>/
21
+ interf/workflows/<workflow-id>/
22
22
  ```
23
23
 
24
24
  Then refine the package in place.
@@ -35,7 +35,7 @@ It has two layers:
35
35
  Typical shape:
36
36
 
37
37
  ```text
38
- interf/workflows/knowledge-base/<workflow-id>/
38
+ interf/workflows/<workflow-id>/
39
39
  workflow.json
40
40
  README.md
41
41
  create/
@@ -58,7 +58,6 @@ Keep it declarative.
58
58
  - `label`
59
59
  - `hint`
60
60
  - optional `extends`
61
- - optional `placeholder`
62
61
  - optional `stages`
63
62
  - optional `stage_policy_notes`
64
63
 
@@ -73,16 +72,10 @@ Each stage can define:
73
72
 
74
73
  ## Contract kinds
75
74
 
76
- Use the shipped contract families only.
75
+ Use the shipped workspace contract families only:
77
76
 
78
- Knowledge-base stages:
79
- - `kb-file-evidence`
80
- - `kb-knowledge-layer`
81
-
82
- Interface stages:
83
- - `interface-retrieval`
84
- - `interface-analysis`
85
- - `interface-output`
77
+ - `workspace-file-evidence`
78
+ - `workspace-knowledge-layer`
86
79
 
87
80
  Do not invent new engine contract kinds in a local workflow package.
88
81
 
@@ -102,7 +95,7 @@ Use dynamic counts when possible.
102
95
 
103
96
  Good:
104
97
  - `"summarized": "target_files"`
105
- - `"frontmatter_scanned": "knowledge_base_summary_total"`
98
+ - `"compiled": "summary_total"`
106
99
 
107
100
  Avoid hardcoding fixed file counts unless the workflow really requires them.
108
101
 
@@ -0,0 +1,23 @@
1
+ # Workspace Template
2
+
3
+ This directory contains bundled helper files for compiled workspaces.
4
+
5
+ Interf creates compiled workspaces under:
6
+
7
+ ```text
8
+ interf/workspaces/<name>/
9
+ ```
10
+
11
+ The generated workspace is a file-based layer on top of your raw files.
12
+
13
+ Interf scaffolds:
14
+
15
+ - `interf.json`
16
+ - `AGENTS.md`
17
+ - `CLAUDE.md`
18
+ - `home.md`
19
+ - `workflow/`
20
+ - `.interf/`
21
+ - `.interfignore`
22
+
23
+ The source folder remains the human control plane. The compiled workspace is the agent-facing surface.
@@ -0,0 +1,2 @@
1
+ .obsidian/
2
+ .DS_Store
@@ -1,5 +0,0 @@
1
- type TemplateValue = string | number | Array<string | number> | null | undefined;
2
- export declare function loadBundledTemplate(relativePath: string): string;
3
- export declare function renderBundledTemplate(relativePath: string, replacements?: Record<string, TemplateValue>): string;
4
- export {};
5
- //# sourceMappingURL=bundled-templates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundled-templates.d.ts","sourceRoot":"","sources":["../../src/lib/bundled-templates.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAYjF,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAM,GAC/C,MAAM,CAMR"}
@@ -1,23 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { TEMPLATES_DIR } from "./config.js";
4
- function normalizeTemplateValue(value) {
5
- if (Array.isArray(value)) {
6
- return value.map((entry) => String(entry)).join("\n");
7
- }
8
- if (value === null || value === undefined) {
9
- return "";
10
- }
11
- return String(value);
12
- }
13
- export function loadBundledTemplate(relativePath) {
14
- return readFileSync(join(TEMPLATES_DIR, relativePath), "utf8");
15
- }
16
- export function renderBundledTemplate(relativePath, replacements = {}) {
17
- let content = loadBundledTemplate(relativePath);
18
- for (const [key, value] of Object.entries(replacements)) {
19
- content = content.replaceAll(`{{${key}}}`, normalizeTemplateValue(value));
20
- }
21
- return content.endsWith("\n") ? content : `${content}\n`;
22
- }
23
- //# sourceMappingURL=bundled-templates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundled-templates.js","sourceRoot":"","sources":["../../src/lib/bundled-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,SAAS,sBAAsB,CAAC,KAAoB;IAClD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,YAAoB;IACtD,OAAO,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,YAAoB,EACpB,eAA8C,EAAE;IAEhD,IAAI,OAAO,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAChD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACxD,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC;AAC3D,CAAC"}
@@ -1,12 +0,0 @@
1
- import { type InterfaceWorkflowId, type WorkflowStageDefinition } from "./workflow-definitions.js";
2
- export declare function buildInterfaceStagePolicySection(notes: string[] | undefined): string[];
3
- export declare function formatWorkflowStageFolders(stages: WorkflowStageDefinition[]): string;
4
- export declare function formatWorkflowStageSequence(stages: WorkflowStageDefinition[]): string;
5
- export declare function writeInterfaceCompilePlanTemplate(dirPath: string, options: {
6
- workflowId: InterfaceWorkflowId;
7
- sourcePath?: string;
8
- interfaceName?: string;
9
- useCase?: string;
10
- targetQuestions?: string[];
11
- }): void;
12
- //# sourceMappingURL=interf-compile-plan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interf-compile-plan.d.ts","sourceRoot":"","sources":["../../src/lib/interf-compile-plan.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC7B,MAAM,2BAA2B,CAAC;AAGnC,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAQtF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,uBAAuB,EAAE,GAAG,MAAM,CAEpF;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,uBAAuB,EAAE,GAAG,MAAM,CAErF;AAiID,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IACP,UAAU,EAAE,mBAAmB,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,GACA,IAAI,CAmBN"}