@interf/compiler 0.16.0 → 0.21.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 (203) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +90 -73
  3. package/TRADEMARKS.md +4 -4
  4. package/dist/cli/commands/mcp.d.ts +0 -34
  5. package/dist/cli/commands/mcp.js +246 -45
  6. package/dist/cli/commands/method.js +261 -15
  7. package/dist/cli/commands/prep.js +116 -15
  8. package/dist/cli/commands/runs.js +103 -9
  9. package/dist/cli/commands/status.js +4 -2
  10. package/dist/cli/commands/test.d.ts +10 -0
  11. package/dist/cli/commands/{verify.js → test.js} +24 -17
  12. package/dist/cli/commands/web.js +82 -8
  13. package/dist/cli/commands/wizard.js +158 -51
  14. package/dist/cli/index.d.ts +2 -2
  15. package/dist/cli/index.js +3 -3
  16. package/dist/compiler-ui/404.html +1 -1
  17. package/dist/compiler-ui/__next.__PAGE__.txt +5 -5
  18. package/dist/compiler-ui/__next._full.txt +13 -12
  19. package/dist/compiler-ui/__next._head.txt +3 -3
  20. package/dist/compiler-ui/__next._index.txt +5 -4
  21. package/dist/compiler-ui/__next._tree.txt +4 -3
  22. package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +1 -0
  23. package/dist/compiler-ui/_next/static/chunks/{0n51hrfoufc7g.js → 02f_.8.ebn556.js} +1 -1
  24. package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +1 -0
  25. package/dist/compiler-ui/_next/static/chunks/{08m7vf5asqlsm.js → 04d0ly-7xb~-j.js} +10 -10
  26. package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +1 -0
  27. package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +2 -0
  28. package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +116 -0
  29. package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +31 -0
  30. package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +1 -0
  31. package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +1 -0
  32. package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +1 -0
  33. package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +1 -0
  34. package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +1 -0
  35. package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +5 -0
  36. package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +1 -0
  37. package/dist/compiler-ui/_next/static/chunks/{turbopack-0.uq1k8c0j4s..js → turbopack-02-3e_c-yz~5g.js} +1 -1
  38. package/dist/compiler-ui/_next/static/chunks/{turbopack-10e~t1yzi4svj.js → turbopack-0apv8vb-nczuy.js} +1 -1
  39. package/dist/compiler-ui/_not-found/__next._full.txt +10 -9
  40. package/dist/compiler-ui/_not-found/__next._head.txt +3 -3
  41. package/dist/compiler-ui/_not-found/__next._index.txt +5 -4
  42. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +2 -2
  43. package/dist/compiler-ui/_not-found/__next._not-found.txt +3 -3
  44. package/dist/compiler-ui/_not-found/__next._tree.txt +3 -2
  45. package/dist/compiler-ui/_not-found.html +1 -1
  46. package/dist/compiler-ui/_not-found.txt +10 -9
  47. package/dist/compiler-ui/index.html +1 -1
  48. package/dist/compiler-ui/index.txt +13 -12
  49. package/dist/packages/contracts/index.d.ts +2 -2
  50. package/dist/packages/contracts/index.js +1 -1
  51. package/dist/packages/contracts/lib/schema.d.ts +275 -72
  52. package/dist/packages/contracts/lib/schema.js +244 -83
  53. package/dist/packages/engine/action-definitions.d.ts +174 -13
  54. package/dist/packages/engine/action-definitions.js +125 -122
  55. package/dist/packages/engine/action-planner.js +4 -11
  56. package/dist/packages/engine/agents/lib/shells.d.ts +15 -5
  57. package/dist/packages/engine/agents/lib/shells.js +134 -123
  58. package/dist/packages/engine/agents/role-executors.js +1 -1
  59. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  60. package/dist/packages/engine/cloud-seams.js +84 -0
  61. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -1
  62. package/dist/packages/engine/compile/artifact-counts.js +3 -3
  63. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  64. package/dist/packages/engine/compile/artifact-status.js +166 -0
  65. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  66. package/dist/packages/engine/compile/billing-events.js +74 -0
  67. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  68. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  69. package/dist/packages/engine/compile/compiled-paths.js +6 -6
  70. package/dist/packages/engine/compile/compiled-schema.d.ts +7 -17
  71. package/dist/packages/engine/compile/compiled-schema.js +55 -70
  72. package/dist/packages/engine/compile/compiled-stage-plan.d.ts +1 -0
  73. package/dist/packages/engine/compile/compiled-stage-plan.js +32 -15
  74. package/dist/packages/engine/compile/compiled-stage-runner.js +1 -1
  75. package/dist/packages/engine/compile/index.d.ts +0 -1
  76. package/dist/packages/engine/compile/index.js +0 -1
  77. package/dist/packages/engine/compile/lib/schema.d.ts +111 -92
  78. package/dist/packages/engine/compile/lib/schema.js +35 -39
  79. package/dist/packages/engine/compile/method-primitives.d.ts +2 -2
  80. package/dist/packages/engine/compile/method-primitives.js +1 -1
  81. package/dist/packages/engine/compile/reset.js +4 -4
  82. package/dist/packages/engine/compile/runtime-contracts.js +2 -1
  83. package/dist/packages/engine/compile/runtime-prompt.js +3 -2
  84. package/dist/packages/engine/compile/runtime-reconcile.js +35 -35
  85. package/dist/packages/engine/compile/runtime-runs.js +0 -1
  86. package/dist/packages/engine/compile/runtime-types.d.ts +7 -8
  87. package/dist/packages/engine/compile/runtime.d.ts +1 -2
  88. package/dist/packages/engine/compile/runtime.js +0 -1
  89. package/dist/packages/engine/compile/state-health.js +6 -6
  90. package/dist/packages/engine/compile/state-view.js +7 -6
  91. package/dist/packages/engine/compile/validate-compiled.js +61 -30
  92. package/dist/packages/engine/compile/validate.js +26 -24
  93. package/dist/packages/engine/connection-config.js +1 -1
  94. package/dist/packages/engine/execution/lib/schema.d.ts +89 -33
  95. package/dist/packages/engine/execution/lib/schema.js +13 -5
  96. package/dist/packages/engine/index.d.ts +2 -2
  97. package/dist/packages/engine/index.js +1 -1
  98. package/dist/packages/engine/instance-paths.d.ts +15 -9
  99. package/dist/packages/engine/instance-paths.js +15 -9
  100. package/dist/packages/engine/lib/schema.d.ts +1316 -351
  101. package/dist/packages/engine/lib/schema.js +99 -36
  102. package/dist/packages/engine/native-run-handlers.js +25 -15
  103. package/dist/packages/engine/preparation-store.d.ts +9 -7
  104. package/dist/packages/engine/preparation-store.js +20 -0
  105. package/dist/packages/engine/requested-artifacts.d.ts +5 -0
  106. package/dist/packages/engine/requested-artifacts.js +36 -0
  107. package/dist/packages/engine/routes.d.ts +7 -1
  108. package/dist/packages/engine/routes.js +7 -1
  109. package/dist/packages/engine/run-observability.js +4 -4
  110. package/dist/packages/engine/runtime-event-applier.js +7 -0
  111. package/dist/packages/engine/runtime-proposal-helpers.d.ts +2 -2
  112. package/dist/packages/engine/runtime-proposal-helpers.js +6 -8
  113. package/dist/packages/engine/runtime-resource-builders.d.ts +11 -6
  114. package/dist/packages/engine/runtime-resource-builders.js +18 -6
  115. package/dist/packages/engine/runtime.d.ts +70 -8
  116. package/dist/packages/engine/runtime.js +304 -49
  117. package/dist/packages/engine/server.d.ts +25 -0
  118. package/dist/packages/engine/server.js +161 -50
  119. package/dist/packages/engine/verify/index.d.ts +10 -10
  120. package/dist/packages/engine/verify/index.js +8 -8
  121. package/dist/packages/engine/verify/readiness-check-run.d.ts +27 -4
  122. package/dist/packages/engine/verify/readiness-check-run.js +92 -24
  123. package/dist/packages/engine/verify/{test-execution.d.ts → verify-execution.d.ts} +2 -2
  124. package/dist/packages/engine/verify/{test-execution.js → verify-execution.js} +3 -3
  125. package/dist/packages/engine/verify/{test-paths.d.ts → verify-paths.d.ts} +1 -1
  126. package/dist/packages/engine/verify/{test-sandbox.d.ts → verify-sandbox.d.ts} +1 -1
  127. package/dist/packages/engine/verify/{test-specs.d.ts → verify-specs.d.ts} +1 -1
  128. package/dist/packages/engine/verify/{test-specs.js → verify-specs.js} +1 -1
  129. package/dist/packages/engine/verify/{test-targets.d.ts → verify-targets.d.ts} +1 -1
  130. package/dist/packages/engine/verify/{test.d.ts → verify.d.ts} +4 -4
  131. package/dist/packages/engine/verify/{test.js → verify.js} +3 -3
  132. package/dist/packages/engine/wire-schemas.d.ts +549 -0
  133. package/dist/packages/engine/wire-schemas.js +59 -0
  134. package/dist/packages/methods/authoring/method-authoring.d.ts +5 -1
  135. package/dist/packages/methods/authoring/method-authoring.js +68 -18
  136. package/dist/packages/methods/authoring/method-edit-session.js +5 -5
  137. package/dist/packages/methods/authoring/method-improvement.js +1 -1
  138. package/dist/packages/methods/package/builtin-compiled-method.d.ts +12 -12
  139. package/dist/packages/methods/package/builtin-compiled-method.js +26 -23
  140. package/dist/packages/methods/package/context-interface.d.ts +39 -26
  141. package/dist/packages/methods/package/context-interface.js +48 -39
  142. package/dist/packages/methods/package/interf-method-package.js +28 -47
  143. package/dist/packages/methods/package/local-methods.d.ts +4 -4
  144. package/dist/packages/methods/package/local-methods.js +53 -66
  145. package/dist/packages/methods/package/method-definitions.d.ts +4 -6
  146. package/dist/packages/methods/package/method-definitions.js +1 -5
  147. package/dist/packages/methods/package/method-helpers.d.ts +0 -2
  148. package/dist/packages/methods/package/method-helpers.js +0 -4
  149. package/dist/packages/project/interf-detect.js +6 -6
  150. package/dist/packages/project/interf-scaffold.js +12 -12
  151. package/dist/packages/project/lib/schema.d.ts +193 -0
  152. package/dist/packages/project/lib/schema.js +46 -1
  153. package/dist/packages/project/source-config.js +6 -1
  154. package/dist/packages/project/source-folders.js +1 -1
  155. package/package.json +12 -23
  156. package/public-repo/CONTRIBUTING.md +47 -0
  157. package/public-repo/LICENSE.md +1 -0
  158. package/public-repo/README.md +325 -0
  159. package/public-repo/SECURITY.md +67 -0
  160. package/public-repo/TRADEMARKS.md +8 -0
  161. package/{builtin-methods → public-repo/methods}/interf-default/README.md +10 -7
  162. package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/shape/SKILL.md +4 -8
  163. package/{builtin-methods → public-repo/methods}/interf-default/method.json +8 -69
  164. package/public-repo/methods/interf-default/method.schema.json +75 -0
  165. package/public-repo/methods/interf-default/use/query/SKILL.md +23 -0
  166. package/public-repo/plugins/README.md +9 -0
  167. package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
  168. package/public-repo/plugins/interf/.mcp.json +12 -0
  169. package/public-repo/plugins/interf/README.md +29 -0
  170. package/public-repo/plugins/interf/skills/interf/SKILL.md +477 -0
  171. package/public-repo/skills/interf/SKILL.md +477 -0
  172. package/agent-skills/interf-actions/SKILL.md +0 -185
  173. package/agent-skills/interf-actions/references/cli.md +0 -243
  174. package/builtin-methods/interf-default/method.schema.json +0 -73
  175. package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
  176. package/dist/cli/commands/verify.d.ts +0 -8
  177. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
  178. package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
  179. package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +0 -1
  180. package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +0 -1
  181. package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
  182. package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
  183. package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
  184. package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
  185. package/dist/compiler-ui/_next/static/chunks/0jipmpez3_ehh.js +0 -89
  186. package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
  187. package/dist/compiler-ui/_next/static/chunks/13awzu4tooflw.css +0 -3
  188. package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
  189. package/dist/packages/engine/compile/runtime-acceptance.d.ts +0 -9
  190. package/dist/packages/engine/compile/runtime-acceptance.js +0 -265
  191. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → tYHMLL9oKds1yDoNYgkPV}/_buildManifest.js +0 -0
  192. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → tYHMLL9oKds1yDoNYgkPV}/_clientMiddlewareManifest.js +0 -0
  193. /package/dist/compiler-ui/_next/static/{a3UiUF0DiMEbfWy_0gihg → tYHMLL9oKds1yDoNYgkPV}/_ssgManifest.js +0 -0
  194. /package/dist/packages/engine/verify/{test-paths.js → verify-paths.js} +0 -0
  195. /package/dist/packages/engine/verify/{test-profile-presets.d.ts → verify-profile-presets.d.ts} +0 -0
  196. /package/dist/packages/engine/verify/{test-profile-presets.js → verify-profile-presets.js} +0 -0
  197. /package/dist/packages/engine/verify/{test-sandbox.js → verify-sandbox.js} +0 -0
  198. /package/dist/packages/engine/verify/{test-targets.js → verify-targets.js} +0 -0
  199. /package/dist/packages/engine/verify/{test-types.d.ts → verify-types.d.ts} +0 -0
  200. /package/dist/packages/engine/verify/{test-types.js → verify-types.js} +0 -0
  201. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/structure/SKILL.md +0 -0
  202. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/summarize/SKILL.md +0 -0
  203. /package/{builtin-methods → public-repo/methods}/interf-default/improve/SKILL.md +0 -0
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync, statSync, writeFileSync, } from "node:fs";
2
2
  import { extname, join, relative } from "node:path";
3
3
  import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
4
- import { compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
4
+ import { compiledArtifactAbsolutePath, findCompiledSchemaArtifact, readCompiledSchemaFile, } from "./compiled-schema.js";
5
5
  import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
6
6
  import { loadRuntimeRun } from "./runtime.js";
7
7
  import { initCompiledState, loadState, refreshCompiledArtifacts, saveState, } from "./state.js";
@@ -38,8 +38,8 @@ function anyPathUpdatedSince(absolutePath, sinceMs) {
38
38
  }
39
39
  return false;
40
40
  }
41
- function zoneArtifactCount(dirPath, zonePath, kind) {
42
- const absolutePath = compiledZoneAbsolutePath(dirPath, { path: zonePath });
41
+ function artifactCount(dirPath, artifactPath, kind) {
42
+ const absolutePath = compiledArtifactAbsolutePath(dirPath, { path: artifactPath });
43
43
  if (!existsSync(absolutePath))
44
44
  return 0;
45
45
  if (kind === "file")
@@ -52,11 +52,11 @@ function summaryAbstract(content) {
52
52
  return null;
53
53
  return extractSynthAbstract(parsed.frontmatter, parsed.body);
54
54
  }
55
- function listZoneArtifacts(dirPath, zone) {
56
- const absolutePath = compiledZoneAbsolutePath(dirPath, zone);
57
- if (!existsSync(absolutePath) || zone.kind === "runtime")
55
+ function listZoneArtifacts(dirPath, artifact) {
56
+ const absolutePath = compiledArtifactAbsolutePath(dirPath, artifact);
57
+ if (!existsSync(absolutePath) || artifact.kind === "runtime")
58
58
  return [];
59
- if (zone.kind === "file") {
59
+ if (artifact.kind === "file") {
60
60
  try {
61
61
  return statSync(absolutePath).isFile() ? [absolutePath] : [];
62
62
  }
@@ -68,8 +68,8 @@ function listZoneArtifacts(dirPath, zone) {
68
68
  }
69
69
  function buildInventoryMetadata(options) {
70
70
  const metadata = {
71
- zone_id: options.zoneId,
72
- zone_kind: options.zoneKind,
71
+ artifact_id: options.artifactId,
72
+ artifact_kind: options.artifactKind,
73
73
  file_extension: extname(options.filePath).toLowerCase() || null,
74
74
  };
75
75
  if (!options.parsedFrontmatter) {
@@ -98,16 +98,16 @@ function buildStageInventoryEntries(dirPath, stage) {
98
98
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
99
99
  if (!schema)
100
100
  return [];
101
- const readableInputZones = stage.reads
102
- .map((zoneId) => findCompiledSchemaZone(schema, zoneId))
103
- .filter((zone) => zone !== null && zone.kind !== "runtime");
104
- const outputZones = stage.writes
105
- .map((zoneId) => findCompiledSchemaZone(schema, zoneId))
106
- .filter((zone) => zone !== null && zone.kind !== "runtime");
107
- if (outputZones.length === 0)
101
+ const readableInputArtifacts = stage.reads
102
+ .map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
103
+ .filter((artifact) => artifact !== null && artifact.kind !== "runtime");
104
+ const outputArtifacts = stage.writes
105
+ .map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
106
+ .filter((artifact) => artifact !== null && artifact.kind !== "runtime");
107
+ if (outputArtifacts.length === 0)
108
108
  return [];
109
109
  const entries = [];
110
- for (const outputZone of outputZones) {
110
+ for (const outputZone of outputArtifacts) {
111
111
  for (const filePath of listZoneArtifacts(dirPath, outputZone)) {
112
112
  const relativeOutputPath = relative(dirPath, filePath).replaceAll("\\", "/");
113
113
  const parsed = isOutputMarkdownFile(filePath)
@@ -116,36 +116,36 @@ function buildStageInventoryEntries(dirPath, stage) {
116
116
  const sourcePath = typeof parsed?.frontmatter.source === "string"
117
117
  ? parsed.frontmatter.source.trim()
118
118
  : "";
119
- const sourceZoneId = typeof parsed?.frontmatter.source_zone === "string"
120
- ? parsed.frontmatter.source_zone.trim()
119
+ const sourceArtifactId = typeof parsed?.frontmatter.source_artifact === "string"
120
+ ? parsed.frontmatter.source_artifact.trim()
121
121
  : "";
122
- const inputZone = sourceZoneId.length > 0
123
- ? readableInputZones.find((zone) => zone.id === sourceZoneId) ?? null
124
- : readableInputZones.length === 1
125
- ? readableInputZones[0]
122
+ const inputZone = sourceArtifactId.length > 0
123
+ ? readableInputArtifacts.find((artifact) => artifact.id === sourceArtifactId) ?? null
124
+ : readableInputArtifacts.length === 1
125
+ ? readableInputArtifacts[0]
126
126
  : null;
127
127
  entries.push({
128
128
  ...(inputZone && sourcePath.length > 0
129
129
  ? {
130
- input_zone: inputZone.id,
130
+ input_artifact: inputZone.id,
131
131
  input_path: sourcePath,
132
132
  }
133
133
  : {}),
134
- output_zone: outputZone.id,
134
+ output_artifact: outputZone.id,
135
135
  output_path: relativeOutputPath,
136
136
  ...(typeof parsed?.frontmatter.state === "string"
137
137
  ? { state: parsed.frontmatter.state }
138
138
  : {}),
139
139
  metadata: buildInventoryMetadata({
140
- zoneId: outputZone.id,
141
- zoneKind: outputZone.kind,
140
+ artifactId: outputZone.id,
141
+ artifactKind: outputZone.kind,
142
142
  filePath,
143
143
  parsedFrontmatter: parsed,
144
144
  }),
145
145
  });
146
146
  }
147
147
  }
148
- return entries.sort((left, right) => `${left.output_zone}:${left.output_path}`.localeCompare(`${right.output_zone}:${right.output_path}`));
148
+ return entries.sort((left, right) => `${left.output_artifact}:${left.output_path}`.localeCompare(`${right.output_artifact}:${right.output_path}`));
149
149
  }
150
150
  function writeStageInventory(dirPath, stageId, entries) {
151
151
  writeFileSync(join(compiledRuntimeRoot(dirPath), "inventory.json"), JSON.stringify(compiledInventoryFromEntries(entries, stageId), null, 2) + "\n");
@@ -160,12 +160,12 @@ export function reconcileCompiledStageRun(dirPath, stage) {
160
160
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
161
161
  if (!schema)
162
162
  return false;
163
- const writeZones = stage.writes
164
- .map((zoneId) => findCompiledSchemaZone(schema, zoneId))
165
- .filter((zone) => zone !== null);
166
- if (writeZones.length === 0)
163
+ const writeArtifacts = stage.writes
164
+ .map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
165
+ .filter((artifact) => artifact !== null);
166
+ if (writeArtifacts.length === 0)
167
167
  return false;
168
- if (!writeZones.some((zone) => anyPathUpdatedSince(compiledZoneAbsolutePath(dirPath, zone), startedAtMs))) {
168
+ if (!writeArtifacts.some((artifact) => anyPathUpdatedSince(compiledArtifactAbsolutePath(dirPath, artifact), startedAtMs))) {
169
169
  return false;
170
170
  }
171
171
  writeStageInventory(dirPath, stage.id, buildStageInventoryEntries(dirPath, stage));
@@ -183,8 +183,8 @@ export function reconcileCompiledStageRun(dirPath, stage) {
183
183
  started_at: loadRuntimeRun(dirPath)?.started_at ?? now,
184
184
  finished_at: now,
185
185
  counts: activeRunCounts(dirPath),
186
- zone_counts: Object.fromEntries(writeZones.map((zone) => [zone.id, zoneArtifactCount(dirPath, zone.path, zone.kind)])),
187
- artifacts: writeZones.map((zone) => zone.kind === "file" ? zone.path : `${zone.path}/`),
186
+ artifact_counts: Object.fromEntries(writeArtifacts.map((artifact) => [artifact.id, artifactCount(dirPath, artifact.path, artifact.kind)])),
187
+ artifacts: writeArtifacts.map((artifact) => artifact.kind === "file" ? artifact.path : `${artifact.path}/`),
188
188
  summary: loadRuntimeRun(dirPath)?.summary ?? null,
189
189
  run_id: loadRuntimeRun(dirPath)?.run_id ?? null,
190
190
  };
@@ -129,7 +129,6 @@ function startRuntimeRun(options) {
129
129
  executor: buildRuntimeExecutorInfo(options.executor),
130
130
  instructions: options.contract.instructions,
131
131
  counts: options.contract.counts,
132
- ...(options.contract.acceptance ? { acceptance: options.contract.acceptance } : {}),
133
132
  artifacts: options.contract.artifacts,
134
133
  policies: options.contract.policies,
135
134
  };
@@ -1,6 +1,6 @@
1
1
  import { type MethodExecutor } from "../agents/lib/executors.js";
2
- import { type RuntimeRun, type RuntimeStageAcceptance, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
3
- import type { MethodId, RuntimeContractType, RuntimeStage } from "../../contracts/lib/schema.js";
2
+ import { type RuntimeRun, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
3
+ import type { Check, MethodId, RuntimeContractType, RuntimeStage } from "../../contracts/lib/schema.js";
4
4
  export type RuntimeRunStatus = "running" | "succeeded" | "failed";
5
5
  export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "method" | "stage" | "stage_label" | "contract_type" | "executor">;
6
6
  export interface RuntimeStageExecutionOptions {
@@ -19,11 +19,6 @@ export interface RuntimeStageExecutionOptions {
19
19
  completionCheck?: (() => boolean) | null;
20
20
  onStatus?: (line: string) => void;
21
21
  }
22
- export interface RuntimeStageAcceptanceValidation {
23
- ok: boolean;
24
- summary: string;
25
- failures: string[];
26
- }
27
22
  export interface RuntimeStageContractOptions {
28
23
  compiledName: string;
29
24
  stageId: string;
@@ -32,10 +27,14 @@ export interface RuntimeStageContractOptions {
32
27
  extraReadArtifacts?: string[];
33
28
  stageReadArtifacts: string[];
34
29
  stageWriteArtifacts: string[];
30
+ stageWriteContracts?: Array<{
31
+ artifact_id: string;
32
+ path: string;
33
+ checks: Check[];
34
+ }>;
35
35
  methodNotes?: string[];
36
36
  localSkillDocs?: string[];
37
37
  instructions: RuntimeStageInstructions;
38
- acceptance?: RuntimeStageAcceptance;
39
38
  }
40
39
  export interface RuntimeRunPatch extends Partial<Pick<RuntimeRun, "counts" | "summary" | "status" | "error" | "exit_code" | "finished_at">> {
41
40
  }
@@ -1,6 +1,5 @@
1
- export type { RuntimeRunPatch, RuntimeRunStatus, RuntimeStageAcceptanceValidation, RuntimeStageContractDraft, RuntimeStageExecutionOptions, RuntimeStageContractOptions, } from "./runtime-types.js";
1
+ export type { RuntimeRunPatch, RuntimeRunStatus, RuntimeStageContractDraft, RuntimeStageExecutionOptions, RuntimeStageContractOptions, } from "./runtime-types.js";
2
2
  export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
3
- export { validateStageContractAcceptance } from "./runtime-acceptance.js";
4
3
  export { buildStagePrompt } from "./runtime-prompt.js";
5
4
  export { buildRuntimeStageContract, } from "./runtime-contracts.js";
6
5
  export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
@@ -1,5 +1,4 @@
1
1
  export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
2
- export { validateStageContractAcceptance } from "./runtime-acceptance.js";
3
2
  export { buildStagePrompt } from "./runtime-prompt.js";
4
3
  export { buildRuntimeStageContract, } from "./runtime-contracts.js";
5
4
  export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
@@ -4,10 +4,10 @@ import { discoverSourceFiles } from "./discovery.js";
4
4
  import { loadRuntimeRun } from "./runtime.js";
5
5
  import { loadState } from "./state-io.js";
6
6
  import { validateCompiled, validateCompiledStage, validateCompiledMethod, } from "./validate.js";
7
- import { readCompiledSchemaFile } from "./compiled-schema.js";
7
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
8
8
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
9
  import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../../methods/package/method-definitions.js";
10
- import { countCompiledZoneArtifacts } from "./artifact-counts.js";
10
+ import { countCompiledArtifactsAtPath } from "./artifact-counts.js";
11
11
  export function computeCompiledHealth(dirPath) {
12
12
  const now = new Date().toISOString();
13
13
  const config = readInterfConfig(dirPath);
@@ -37,9 +37,9 @@ export function computeCompiledHealth(dirPath) {
37
37
  const firstFailed = stageResults.find((entry) => !entry.validation.ok) ?? null;
38
38
  const methodValidation = validateCompiledMethod(dirPath);
39
39
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
40
- const zoneMetrics = Object.fromEntries((schema?.zones ?? []).map((zone) => [
41
- `zone_${zone.id}`,
42
- countCompiledZoneArtifacts(dirPath, zone.path, zone.kind),
40
+ const artifactMetrics = Object.fromEntries((schema ? listCompiledSchemaArtifacts(schema) : []).map((artifact) => [
41
+ `artifact_${artifact.id}`,
42
+ countCompiledArtifactsAtPath(dirPath, artifact.path, artifact.kind),
43
43
  ]));
44
44
  let status = "idle";
45
45
  let stage = "idle";
@@ -98,7 +98,7 @@ export function computeCompiledHealth(dirPath) {
98
98
  completed_stages: completedStages,
99
99
  warnings: state?.warning_count ?? 0,
100
100
  errors: (state?.error_count ?? 0) + errors,
101
- ...zoneMetrics,
101
+ ...artifactMetrics,
102
102
  },
103
103
  checks,
104
104
  };
@@ -2,7 +2,7 @@ import { basename } from "node:path";
2
2
  import { readInterfConfig, resolveSourceFolderPath } from "../../project/interf-detect.js";
3
3
  import { loadCompiledSourceSnapshot, loadCompiledViewSpec, saveCompiledViewSpec, } from "./state-io.js";
4
4
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
5
- import { readCompiledSchemaFile } from "./compiled-schema.js";
5
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
6
6
  import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../../methods/package/method-definitions.js";
7
7
  import { writeCompiledSourceFiles, writeCompiledSourceSnapshot, } from "./source-files.js";
8
8
  export function ensureCompiledViewSpec(dirPath) {
@@ -63,10 +63,11 @@ function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
63
63
  resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${dirPath}`);
64
64
  const method = getActiveCompiledMethod(dirPath);
65
65
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
66
- const outputDocumentPaths = (schema?.zones ?? [])
67
- .filter((zone) => zone.role === "output" && zone.kind !== "runtime")
68
- .map((zone) => zone.path);
69
- const defaultNote = (schema?.zones ?? []).find((zone) => zone.role === "output" && zone.kind === "file")?.path ?? null;
66
+ const schemaArtifacts = schema ? listCompiledSchemaArtifacts(schema) : [];
67
+ const outputDocumentPaths = schemaArtifacts
68
+ .filter((artifact) => artifact.role === "output" && artifact.kind !== "runtime")
69
+ .map((artifact) => artifact.path);
70
+ const defaultNote = schemaArtifacts.find((artifact) => artifact.role === "output" && artifact.kind === "file")?.path ?? null;
70
71
  return {
71
72
  kind: "compiled-view-spec",
72
73
  version: 2,
@@ -85,7 +86,7 @@ function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
85
86
  { id: "status", type: "status", title: "Compile Status", path: ".interf/runtime/health.json" },
86
87
  { id: "cards", type: "cards", title: "Key Metrics", path: ".interf/runtime/health.json" },
87
88
  ...(outputDocumentPaths.length > 0
88
- ? [{ id: "outputs", type: "documents", title: "Output Zones", paths: outputDocumentPaths }]
89
+ ? [{ id: "outputs", type: "documents", title: "Output Artifacts", paths: outputDocumentPaths }]
89
90
  : []),
90
91
  { id: "method", type: "documents", title: "Method Docs", paths: ["method/README.md", ...method.stages.map((stage) => `method/compile/stages/${stage.skillDir}`)] },
91
92
  ],
@@ -1,13 +1,13 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { discoverSourceFiles } from "./discovery.js";
3
- import { METHOD_SCHEMA_FILE, findCompiledSchemaZone, readCompiledSchemaFile, methodSchemaExists, } from "./compiled-schema.js";
3
+ import { METHOD_SCHEMA_FILE, findCompiledSchemaArtifact, readCompiledSchemaFile, methodSchemaExists, } from "./compiled-schema.js";
4
4
  import { resolveSourceFolderPath } from "../../project/interf-detect.js";
5
5
  import { compiledInterfConfigPath, methodPackagePathForCompiled } from "./compiled-paths.js";
6
6
  import { readCompiledConfig } from "./validate.js";
7
7
  import { loadState } from "./state.js";
8
- import { validateResolvedStageAcceptance, stageRecordFromState } from "./runtime-acceptance.js";
9
8
  import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../../methods/package/method-definitions.js";
10
- import { countCompiledZoneArtifacts } from "./artifact-counts.js";
9
+ import { countCompiledArtifactsAtPath } from "./artifact-counts.js";
10
+ import { evaluateChecks } from "./check-evaluator.js";
11
11
  function methodSchemaPresent(dirPath) {
12
12
  return methodSchemaExists(methodPackagePathForCompiled(dirPath));
13
13
  }
@@ -45,23 +45,57 @@ function readMethodContext(dirPath) {
45
45
  function stageRequired(sourceTotal, writeCounts, stageRecordPresent) {
46
46
  return sourceTotal > 0 || writeCounts > 0 || stageRecordPresent;
47
47
  }
48
- function zoneWriteCount(compiledPath, schema, stage) {
49
- const zoneCounts = {};
48
+ function artifactWriteCount(compiledPath, schema, stage) {
49
+ const artifactCounts = {};
50
50
  let total = 0;
51
- for (const zoneId of stage.writes) {
52
- const zone = findCompiledSchemaZone(schema, zoneId);
53
- if (!zone)
51
+ for (const artifactId of stage.writes) {
52
+ const artifact = findCompiledSchemaArtifact(schema, artifactId);
53
+ if (!artifact)
54
54
  continue;
55
- const count = countCompiledZoneArtifacts(compiledPath, zone.path, zone.kind);
56
- zoneCounts[zoneId] = count;
55
+ const count = countCompiledArtifactsAtPath(compiledPath, artifact.path, artifact.kind);
56
+ artifactCounts[artifactId] = count;
57
57
  total += count;
58
58
  }
59
- return { total, zoneCounts };
59
+ return { total, artifactCounts };
60
60
  }
61
- function mergeValidationCounts(sourceTotal, stageRecord, zoneCounts) {
61
+ function stageRecordFromState(state, stageId) {
62
+ const stages = state?.stages;
63
+ if (!stages || typeof stages !== "object")
64
+ return null;
65
+ const stage = stages[stageId];
66
+ if (!stage || typeof stage !== "object" || Array.isArray(stage))
67
+ return null;
68
+ return stage;
69
+ }
70
+ function artifactsBuiltByStage(schema, stage) {
71
+ return (schema.artifacts ?? []).filter((artifact) => {
72
+ if (artifact.built_by_stages.includes(stage.id))
73
+ return true;
74
+ if (stage.writes.includes(artifact.id))
75
+ return true;
76
+ return artifact.shape.kind === "path" && (stage.writes.includes(artifact.id) || stage.writes.includes(artifact.shape.path));
77
+ });
78
+ }
79
+ function artifactCheckFailures(compiledPath, artifacts, counts) {
80
+ const failures = [];
81
+ for (const artifact of artifacts) {
82
+ const checks = artifact.checks ?? [];
83
+ if (checks.length === 0)
84
+ continue;
85
+ const targetPath = artifact.shape.kind === "path" ? artifact.shape.path : undefined;
86
+ const result = evaluateChecks(checks, {
87
+ rootPath: compiledPath,
88
+ targetPath,
89
+ counts,
90
+ });
91
+ failures.push(...result.failures);
92
+ }
93
+ return failures;
94
+ }
95
+ function mergeValidationCounts(sourceTotal, stageRecord, artifactCounts) {
62
96
  const merged = {
63
97
  source_total: sourceTotal,
64
- ...zoneCounts,
98
+ ...artifactCounts,
65
99
  };
66
100
  const stageCounts = stageRecord?.counts;
67
101
  if (stageCounts && typeof stageCounts === "object" && !Array.isArray(stageCounts)) {
@@ -121,22 +155,19 @@ export function validateCompiledStage(dirPath, stageId) {
121
155
  checks.stage_finished = Boolean(stageRecord?.finished_at);
122
156
  checks.stage_succeeded = stageRecord?.status === "succeeded";
123
157
  const writeCounts = methodStage && context.schema
124
- ? zoneWriteCount(dirPath, context.schema, methodStage)
125
- : { total: 0, zoneCounts: {} };
126
- const acceptanceCounts = mergeValidationCounts(context.sourceTotal, stageRecord, writeCounts.zoneCounts);
158
+ ? artifactWriteCount(dirPath, context.schema, methodStage)
159
+ : { total: 0, artifactCounts: {} };
160
+ const artifactCounts = mergeValidationCounts(context.sourceTotal, stageRecord, writeCounts.artifactCounts);
127
161
  const required = stageRequired(context.sourceTotal, writeCounts.total, checks.stage_record_present);
128
- let acceptanceErrors = [];
162
+ let artifactErrors = [];
129
163
  if (methodStage && context.schema) {
130
- const acceptanceValidation = validateResolvedStageAcceptance(dirPath, {
131
- stageId,
132
- acceptance: methodStage.acceptance,
133
- counts: acceptanceCounts,
134
- });
135
- checks.acceptance_ok = acceptanceValidation.ok;
136
- acceptanceErrors = acceptanceValidation.failures;
164
+ const artifacts = artifactsBuiltByStage(context.schema, methodStage);
165
+ const failures = artifactCheckFailures(dirPath, artifacts, artifactCounts);
166
+ checks.artifact_checks_ok = failures.length === 0;
167
+ artifactErrors = failures.map((proof) => `Artifact check "${proof.check_id}" failed for ${proof.kind}: ${proof.summary}`);
137
168
  }
138
169
  else {
139
- checks.acceptance_ok = false;
170
+ checks.artifact_checks_ok = false;
140
171
  }
141
172
  if (required && checks.stage_record_present && !checks.stage_finished) {
142
173
  errors.push(`Stage "${stageId}" has no finished_at proof in runtime state.`);
@@ -145,23 +176,23 @@ export function validateCompiledStage(dirPath, stageId) {
145
176
  errors.push(`Stage "${stageId}" is not marked succeeded in runtime state.`);
146
177
  }
147
178
  if (required) {
148
- errors.push(...acceptanceErrors);
179
+ errors.push(...artifactErrors);
149
180
  }
150
181
  const ok = required ? errors.length === 0 : errors.length === 0;
151
182
  const summary = !required
152
183
  ? `Stage "${stageId}" is not required yet.`
153
184
  : ok
154
185
  ? `Stage "${stageId}" verified.`
155
- : `Stage "${stageId}" failed — ${errors[0] ?? "acceptance not satisfied."}`;
186
+ : `Stage "${stageId}" failed — ${errors[0] ?? "artifact checks not satisfied."}`;
156
187
  return {
157
188
  ok,
158
189
  required,
159
190
  stage: stageId,
160
191
  summary,
161
192
  counts: {
162
- ...acceptanceCounts,
193
+ ...artifactCounts,
163
194
  write_artifacts: writeCounts.total,
164
- declared_write_zones: methodStage?.writes.length ?? 0,
195
+ declared_write_artifacts: methodStage?.writes.length ?? 0,
165
196
  },
166
197
  checks,
167
198
  errors,
@@ -213,7 +244,7 @@ export function validateCompiledMethod(dirPath) {
213
244
  stage: failedStage,
214
245
  summary: ok
215
246
  ? `Compiled Method verified — ${completedStages}/${context.method.stages.length} stages satisfied.`
216
- : `Compiled Method failed — ${errors[0] ?? "stage acceptance not satisfied."}`,
247
+ : `Compiled Method failed — ${errors[0] ?? "stage artifact checks not satisfied."}`,
217
248
  counts: {
218
249
  source_total: context.sourceTotal,
219
250
  stage_total: context.method.stages.length,
@@ -1,7 +1,6 @@
1
1
  import { existsSync, readFileSync, statSync, } from "node:fs";
2
2
  import { basename, dirname, extname, join, resolve } from "node:path";
3
- import { readCompiledSchemaFile } from "./compiled-schema.js";
4
- import { compiledKnowledgeRootPath } from "./compiled-schema.js";
3
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
5
4
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
6
5
  import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
7
6
  import { readInterfConfig } from "../../project/interf-detect.js";
@@ -53,8 +52,8 @@ export function validateSynthFiles(files, options) {
53
52
  };
54
53
  }
55
54
  export function countBrokenWikilinks(compiledRoot, noteIndexRoots, linkScanRoots) {
56
- const zonePathById = compiledZoneDirectoryPaths(compiledRoot);
57
- const knowledgeRelativePrefixes = compiledKnowledgeRelativePrefixes(zonePathById);
55
+ const artifactPathById = compiledArtifactDirectoryPaths(compiledRoot);
56
+ const directoryLeafParents = compiledDirectoryLeafParents(artifactPathById);
58
57
  const noteIndex = new Set();
59
58
  for (const filePath of dedupeFiles(noteIndexRoots)) {
60
59
  for (const target of collectWikilinkTargets(filePath)) {
@@ -75,15 +74,15 @@ export function countBrokenWikilinks(compiledRoot, noteIndexRoots, linkScanRoots
75
74
  if (!target)
76
75
  continue;
77
76
  if (target.includes("/")) {
78
- if (!wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath)) {
77
+ if (!wikilinkPathExists(compiledRoot, target, artifactPathById, directoryLeafParents, filePath)) {
79
78
  brokenLinks += 1;
80
79
  }
81
80
  continue;
82
81
  }
83
82
  if (!noteIndex.has(target.toLowerCase()) &&
84
83
  !noteIndex.has(noteName(target).toLowerCase()) &&
85
- !wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath) &&
86
- !wikilinkPathExists(compiledRoot, noteName(target), zonePathById, knowledgeRelativePrefixes, filePath)) {
84
+ !wikilinkPathExists(compiledRoot, target, artifactPathById, directoryLeafParents, filePath) &&
85
+ !wikilinkPathExists(compiledRoot, noteName(target), artifactPathById, directoryLeafParents, filePath)) {
87
86
  brokenLinks += 1;
88
87
  }
89
88
  }
@@ -172,22 +171,25 @@ function countWords(text) {
172
171
  function noteName(filePath) {
173
172
  return basename(filePath, extname(filePath));
174
173
  }
175
- function wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
176
- return linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath)
174
+ function wikilinkPathExists(compiledRoot, target, artifactPathById, directoryLeafParents, sourceFilePath) {
175
+ return linkPathCandidates(compiledRoot, target, artifactPathById, directoryLeafParents, sourceFilePath)
177
176
  .some((candidate) => existsSync(candidate));
178
177
  }
179
- function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
178
+ function linkPathCandidates(compiledRoot, target, artifactPathById, directoryLeafParents, sourceFilePath) {
180
179
  const candidates = new Set();
181
180
  addPathCandidate(candidates, join(compiledRoot, target));
182
181
  if (sourceFilePath && (target.startsWith("./") || target.startsWith("../"))) {
183
182
  addPathCandidateIfInside(candidates, compiledRoot, resolve(dirname(sourceFilePath), target));
184
183
  }
185
184
  const [firstSegment] = target.split("/");
186
- if (firstSegment && knowledgeRelativePrefixes.has(firstSegment)) {
187
- addPathCandidate(candidates, join(compiledKnowledgeRootPath(compiledRoot), target));
185
+ if (firstSegment) {
186
+ const parentPath = directoryLeafParents.get(firstSegment);
187
+ if (parentPath) {
188
+ addPathCandidate(candidates, join(compiledRoot, parentPath, target));
189
+ }
188
190
  }
189
191
  if (firstSegment) {
190
- const normalizedPrefix = zonePathById.get(firstSegment);
192
+ const normalizedPrefix = artifactPathById.get(firstSegment);
191
193
  if (normalizedPrefix) {
192
194
  const remainder = target.slice(firstSegment.length).replace(/^\/+/, "");
193
195
  addPathCandidate(candidates, join(compiledRoot, normalizedPrefix, remainder));
@@ -206,24 +208,24 @@ function addPathCandidateIfInside(candidates, compiledRoot, absolutePath) {
206
208
  return;
207
209
  addPathCandidate(candidates, candidate);
208
210
  }
209
- function compiledZoneDirectoryPaths(compiledRoot) {
211
+ function compiledArtifactDirectoryPaths(compiledRoot) {
210
212
  const methodRoot = methodPackagePathForCompiled(compiledRoot);
211
213
  const schema = readCompiledSchemaFile(methodRoot);
212
214
  if (!schema)
213
215
  return new Map();
214
- return new Map(schema.zones
215
- .filter((zone) => zone.kind === "directory")
216
- .map((zone) => [zone.id, zone.path]));
216
+ return new Map(listCompiledSchemaArtifacts(schema)
217
+ .filter((artifact) => artifact.kind === "directory")
218
+ .map((artifact) => [artifact.id, artifact.path]));
217
219
  }
218
- function compiledKnowledgeRelativePrefixes(zonePathById) {
219
- const prefixes = new Set();
220
- for (const zonePath of zonePathById.values()) {
221
- const [root, leaf, ...rest] = zonePath.split("/");
222
- if (root !== "knowledge" || !leaf || rest.length > 0)
220
+ function compiledDirectoryLeafParents(artifactPathById) {
221
+ const parents = new Map();
222
+ for (const artifactPath of artifactPathById.values()) {
223
+ const [root, leaf, ...rest] = artifactPath.split("/");
224
+ if (!root || !leaf || rest.length > 0)
223
225
  continue;
224
- prefixes.add(leaf);
226
+ parents.set(leaf, root);
225
227
  }
226
- return prefixes;
228
+ return parents;
227
229
  }
228
230
  function collectWikilinkTargets(filePath) {
229
231
  const targets = new Set();
@@ -72,4 +72,4 @@ export function ensureInterfHome() {
72
72
  }
73
73
  /** Canonical message printed when a CLI command needs a connection but has none. */
74
74
  export const CONNECT_OR_ERROR_HINT = "Not connected to any Interf instance.\n" +
75
- "Start one with `interf web`, or set --url / `interf login` for a remote one.";
75
+ "Start one with `interf web` or `interf web start`, or set --url / `interf login` for a remote one.";