@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
@@ -16,17 +16,10 @@ function extractJsonObject(text) {
16
16
  }
17
17
  }
18
18
  function readActionSkill() {
19
- const skillDir = join(PACKAGE_ROOT, "agent-skills", "interf-actions");
19
+ const skillDir = join(PACKAGE_ROOT, "public-repo", "skills", "interf");
20
20
  const skillPath = join(skillDir, "SKILL.md");
21
- const cliReferencePath = join(skillDir, "references", "cli.md");
22
21
  try {
23
- const skill = readFileSync(skillPath, "utf8");
24
- const cliReference = readFileSync(cliReferencePath, "utf8");
25
- return [
26
- skill,
27
- "## Bundled reference: references/cli.md",
28
- cliReference,
29
- ].join("\n\n");
22
+ return readFileSync(skillPath, "utf8");
30
23
  }
31
24
  catch {
32
25
  return [
@@ -96,7 +89,7 @@ JSON schema:
96
89
  {
97
90
  "action_type": "preparation-setup" | "preparation-change" | "compile" | "test" | "readiness-check-draft" | "method-authoring" | "method-change" | "method-improvement" | "clarification",
98
91
  "preparation": "Preparation id if applicable",
99
- "method": "Method id if applicable",
92
+ "method": "Build Plan / Method package id if applicable",
100
93
  "values": {},
101
94
  "title": "short approval card title",
102
95
  "summary": "one sentence describing what will run",
@@ -129,7 +122,7 @@ export async function planActionProposalWithExecutor(options) {
129
122
  return ActionProposalPlanSchema.parse({
130
123
  action_type: "clarification",
131
124
  preparation: options.request.preparation,
132
- assistant_message: "I can help with this Interf Workspace. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Method and I will prepare an approval proposal.",
125
+ assistant_message: "I can help with this Interf instance. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Build Plan and I will prepare an approval proposal.",
133
126
  });
134
127
  }
135
128
  }
@@ -1,15 +1,22 @@
1
1
  import type { MethodImprovementContext } from "../../compile/lib/schema.js";
2
- import type { RuntimeContractType } from "../../../contracts/lib/schema.js";
3
- import type { SourceReadinessCheck } from "../../../project/lib/schema.js";
4
- import { type ContextInterfaceZoneId as MethodZoneId } from "../../../methods/package/context-interface.js";
2
+ import { type ArtifactPathShape, type Check, type RuntimeContractType } from "../../../contracts/lib/schema.js";
3
+ import type { RequestedArtifact, SourceProfile, SourceReadinessCheck } from "../../../project/lib/schema.js";
4
+ import { type ContextInterfaceArtifactId as MethodArtifactId } from "../../../methods/package/context-interface.js";
5
5
  export interface NativeStageDefinition {
6
6
  id: string;
7
7
  label: string;
8
8
  description: string;
9
9
  contractType: RuntimeContractType;
10
10
  skillDir: string;
11
- reads: MethodZoneId[];
12
- writes: MethodZoneId[];
11
+ reads: MethodArtifactId[];
12
+ writes: MethodArtifactId[];
13
+ }
14
+ export interface MethodAuthoringArtifactRequirement {
15
+ id: string;
16
+ description?: string;
17
+ shape: ArtifactPathShape;
18
+ checks: Check[];
19
+ stage_hint?: string;
13
20
  }
14
21
  export declare function writeNativeAgentSurface(rootPath: string, agentsContent: string, skillName: string, skillContent: string): boolean;
15
22
  export declare function renderCompiledAgents(compiledPath: string, name: string, methodId: string, about?: string, options?: {
@@ -27,6 +34,9 @@ export declare function createMethodAuthoringShell(options: {
27
34
  sourceFolderPath: string;
28
35
  taskPrompt: string;
29
36
  checks: SourceReadinessCheck[];
37
+ requestedArtifacts?: RequestedArtifact[];
38
+ sourceProfile?: SourceProfile | null;
39
+ artifactRequirements?: MethodAuthoringArtifactRequirement[];
30
40
  }): {
31
41
  rootPath: string;
32
42
  methodBeforePath: string;
@@ -4,9 +4,10 @@ import { basename, dirname, join, relative, sep as pathSep } from "node:path";
4
4
  import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
5
5
  import { buildCompiledSourceFiles } from "../../compile/source-files.js";
6
6
  import { METHOD_PACKAGE_DIR } from "../../../project/interf-detect.js";
7
- import { CONTEXT_INTERFACE_FILE as METHOD_SCHEMA_FILE, contextInterfaceZoneAbsolutePath as compiledZoneAbsolutePath, readContextInterface as readCompiledSchemaFile, resolveContextInterfacePath as resolveMethodSchemaPath, } from "../../../methods/package/context-interface.js";
7
+ import { CHECK_KINDS, } from "../../../contracts/lib/schema.js";
8
+ import { CONTEXT_INTERFACE_FILE as METHOD_SCHEMA_FILE, contextInterfaceArtifactAbsolutePath as compiledArtifactAbsolutePath, listContextInterfaceArtifacts, readContextInterface as readCompiledSchemaFile, resolveContextInterfacePath as resolveMethodSchemaPath, } from "../../../methods/package/context-interface.js";
8
9
  import { stageExecutionShellsRoot, methodImprovementLoopRoot, methodPackagePathForCompiled, compiledInterfConfigPath, compiledRuntimeRoot, compiledRuntimeSourceSnapshotPath, compiledRuntimeStageInputsPath, } from "../../compile/compiled-paths.js";
9
- import { ensureCompiledZoneTargets } from "../../compile/compiled-schema.js";
10
+ import { ensureCompiledArtifactTargets } from "../../compile/compiled-schema.js";
10
11
  import { listFilesRecursive } from "../../../contracts/utils/filesystem.js";
11
12
  import { resolveMethodImprovementReviewSourcePaths } from "../../../methods/package/method-review-paths.js";
12
13
  const LOCAL_SKILL_ROOTS = [
@@ -26,18 +27,18 @@ export function writeNativeAgentSurface(rootPath, agentsContent, skillName, skil
26
27
  function compiledQuerySkillSourcePath(compiledPath) {
27
28
  return join(methodPackagePathForCompiled(compiledPath), "use", "query", "SKILL.md");
28
29
  }
29
- function compiledZoneSummaryLines(compiledPath) {
30
+ function compiledArtifactSummaryLines(compiledPath) {
30
31
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
31
32
  if (!schema)
32
33
  return ["- No Method schema is available yet."];
33
- return schema.zones
34
- .filter((zone) => zone.kind !== "runtime")
35
- .map((zone) => `- \`${zone.id}\` -> \`${zone.path}\` (${zone.role} ${zone.kind})`);
34
+ return listContextInterfaceArtifacts(schema)
35
+ .filter((artifact) => artifact.kind !== "runtime")
36
+ .map((artifact) => `- \`${artifact.id}\` -> \`${artifact.path}\` (${artifact.role} ${artifact.kind})`);
36
37
  }
37
38
  export function renderCompiledAgents(compiledPath, name, methodId, about, options = {}) {
38
39
  const methodOriginSelected = options.methodOriginSelected ?? methodId;
39
40
  const methodLocalDraft = options.methodLocalDraft === true;
40
- const zoneLines = compiledZoneSummaryLines(compiledPath);
41
+ const artifactLines = compiledArtifactSummaryLines(compiledPath);
41
42
  return [
42
43
  `# ${name}`,
43
44
  "",
@@ -53,18 +54,18 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
53
54
  "## How to use this portable context",
54
55
  "",
55
56
  "1. Use the local native `interf-query` skill that Interf generated for this portable context.",
56
- "2. Let the Method docs and declared output zones guide retrieval instead of assuming a fixed note layout.",
57
+ "2. Let the Method docs and declared Artifacts guide retrieval instead of assuming a fixed note layout.",
57
58
  "3. Use `.interf/runtime/source-snapshot.json` when you need to inspect the source references behind the output.",
58
59
  "",
59
60
  "## How this portable context works",
60
61
  "",
61
62
  "- The Method package defines the context interface this portable context implements on disk.",
62
- "- `.interf/interf.json` records the selected source binding and back-reference to the Interf Workspace.",
63
+ "- `.interf/interf.json` records the selected Source binding and Preparation metadata.",
63
64
  `- Method seed: \`${methodOriginSelected}\`.`,
64
65
  ...(methodLocalDraft
65
66
  ? ["- This portable context now carries a local Method draft improved from that seed. Recompiling this portable context reuses the local `.interf/method/` package."]
66
67
  : []),
67
- `- Active local Method id: \`${methodId}\`.`,
68
+ `- Selected Build Plan / Method package id: \`${methodId}\`.`,
68
69
  "- `.interf/method/` is the local editable Method package for this portable context.",
69
70
  `- \`.interf/method/${METHOD_SCHEMA_FILE}\` is the deterministic context interface for this portable context.`,
70
71
  "- `.interf/method/improve/` is the editable source for Method-improvement loops.",
@@ -72,8 +73,8 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
72
73
  "- `.interf/method/compile/stages/` defines stage-specific docs that Interf projects into native execution shells for automated runs.",
73
74
  "- Native local query skills are generated under local agent skill directories such as `.claude/skills/` and `.codex/skills/`.",
74
75
  "- `.interf/runtime/source-snapshot.json` records the source files assigned to the latest runtime snapshot.",
75
- `- Method zones are declared in \`.interf/method/${METHOD_SCHEMA_FILE}\`.`,
76
- ...zoneLines,
76
+ `- Method Artifacts are declared in \`.interf/method/${METHOD_SCHEMA_FILE}\`.`,
77
+ ...artifactLines,
77
78
  "- `.interf/runtime/` holds runtime artifacts written by Interf.",
78
79
  "- `.interf/tests/` mirrors the latest saved readiness-check run and keeps detailed target runs plus preserved sandboxes.",
79
80
  "- `.interf/tests/targets/` holds detailed source-files and compiled target runs plus preserved test sandboxes.",
@@ -90,7 +91,7 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
90
91
  "",
91
92
  "```",
92
93
  "interf compile build this portable context",
93
- "interf verify run checks against this portable context",
94
+ "interf test run readiness checks against this portable context",
94
95
  "interf status show deterministic health",
95
96
  "```",
96
97
  "",
@@ -110,12 +111,12 @@ export function renderCompiledQuerySkill() {
110
111
  "",
111
112
  "Default loop:",
112
113
  "1. Read `.interf/method/README.md` and this file first.",
113
- `2. Use the Method zones declared in \`.interf/method/${METHOD_SCHEMA_FILE}\` before consulting source references.`,
114
+ `2. Use the Method Artifacts declared in \`.interf/method/${METHOD_SCHEMA_FILE}\` before consulting source references.`,
114
115
  "3. Use `.interf/runtime/source-snapshot.json` for direct quotes, verification, exact lookups, and cases where the portable context is missing the needed evidence or is ambiguous.",
115
116
  "",
116
117
  "Answering rule:",
117
118
  "- do not modify source files while answering",
118
- "- treat the Method as the portable-context contract and use its zones as the working retrieval surface",
119
+ "- treat the Method as the portable-context contract and use its Artifacts as the working retrieval surface",
119
120
  "- say explicitly when an answer depends on approximation, bounded inference, or a source re-check",
120
121
  "- use source references to confirm source page, metric family, provenance, or exact wording when the portable context is missing the needed evidence or is ambiguous",
121
122
  "- do not invent navigation or note structure beyond what this Method declares",
@@ -142,7 +143,7 @@ function renderSourceFilesTestAgents() {
142
143
  "## Rules",
143
144
  "",
144
145
  "- Answer only from source files listed in `runtime/source-files.json`.",
145
- "- There is no portable context here, so do not assume any portable-context output zones exist.",
146
+ "- There is no portable context here, so do not assume any portable-context Artifacts exist.",
146
147
  "- Do not treat hidden runtime files or test artifacts as evidence.",
147
148
  ...chartNotes,
148
149
  "- Write the requested answer and trace files, then stop.",
@@ -181,24 +182,24 @@ function readCompiledQuerySkillSource(compiledPath) {
181
182
  function stageShellMethodRoot(shellRoot) {
182
183
  return join(shellRoot, METHOD_PACKAGE_DIR);
183
184
  }
184
- function shellInputZonePath(shellRoot, zoneId) {
185
- return join(shellRoot, "inputs", zoneId);
185
+ function shellInputArtifactPath(shellRoot, artifactId) {
186
+ return join(shellRoot, "inputs", artifactId);
186
187
  }
187
- function shellOutputZonePath(shellRoot, zoneId) {
188
- return join(shellRoot, "outputs", zoneId);
188
+ function shellOutputArtifactPath(shellRoot, artifactId) {
189
+ return join(shellRoot, "outputs", artifactId);
189
190
  }
190
- function shellZoneAliasMountPath(shellRoot, zone, mountKind) {
191
+ function shellArtifactAliasMountPath(shellRoot, artifact, mountKind) {
191
192
  const mountRoot = mountKind === "inputs"
192
- ? shellInputZonePath(shellRoot, zone.id)
193
- : shellOutputZonePath(shellRoot, zone.id);
194
- return zone.kind === "file"
195
- ? join(mountRoot, basename(zone.path))
193
+ ? shellInputArtifactPath(shellRoot, artifact.id)
194
+ : shellOutputArtifactPath(shellRoot, artifact.id);
195
+ return artifact.kind === "file"
196
+ ? join(mountRoot, basename(artifact.path))
196
197
  : mountRoot;
197
198
  }
198
- function describeShellZoneAliasMountPath(zone, mountKind) {
199
- return zone.kind === "file"
200
- ? `${mountKind}/${zone.id}/${basename(zone.path)}`
201
- : `${mountKind}/${zone.id}`;
199
+ function describeShellArtifactAliasMountPath(artifact, mountKind) {
200
+ return artifact.kind === "file"
201
+ ? `${mountKind}/${artifact.id}/${basename(artifact.path)}`
202
+ : `${mountKind}/${artifact.id}`;
202
203
  }
203
204
  function shellRuntimePath(shellRoot, relativePath) {
204
205
  return join(shellRoot, "runtime", relativePath);
@@ -240,15 +241,15 @@ function loadCompiledSchema(compiledPath) {
240
241
  }
241
242
  return schema;
242
243
  }
243
- function zoneMap(schema) {
244
- return new Map(schema.zones.map((zone) => [zone.id, zone]));
244
+ function artifactMap(schema) {
245
+ return new Map(listContextInterfaceArtifacts(schema).map((artifact) => [artifact.id, artifact]));
245
246
  }
246
- function zoneOrThrow(zones, zoneId) {
247
- const zone = zones.get(zoneId);
248
- if (!zone) {
249
- throw new Error(`Missing Method schema zone "${zoneId}" for stage shell projection.`);
247
+ function artifactOrThrow(artifacts, artifactId) {
248
+ const artifact = artifacts.get(artifactId);
249
+ if (!artifact) {
250
+ throw new Error(`Missing Method schema Artifact "${artifactId}" for stage shell projection.`);
250
251
  }
251
- return zone;
252
+ return artifact;
252
253
  }
253
254
  function normalizeArtifactRelativePath(path) {
254
255
  return path
@@ -263,28 +264,29 @@ function relativePathEqualsOrWithin(basePath, candidatePath) {
263
264
  return false;
264
265
  return candidate === base || candidate.startsWith(`${base}/`);
265
266
  }
266
- function stageWriteZoneSet(schema, stage) {
267
- return new Set(stage.writes.filter((zoneId) => schema.zones.some((zone) => zone.id === zoneId)));
267
+ function stageWriteArtifactSet(schema, stage) {
268
+ const artifacts = listContextInterfaceArtifacts(schema);
269
+ return new Set(stage.writes.filter((artifactId) => artifacts.some((artifact) => artifact.id === artifactId)));
268
270
  }
269
- function stageMaterializedZoneSet(schema, stage, writeArtifacts = []) {
270
- const materialized = stageWriteZoneSet(schema, stage);
271
- for (const zone of schema.zones) {
272
- if (zone.kind === "runtime" && stage.reads.includes(zone.id)) {
273
- materialized.add(zone.id);
271
+ function stageMaterializedArtifactSet(schema, stage, writeArtifacts = []) {
272
+ const materialized = stageWriteArtifactSet(schema, stage);
273
+ for (const artifact of listContextInterfaceArtifacts(schema)) {
274
+ if (artifact.kind === "runtime" && stage.reads.includes(artifact.id)) {
275
+ materialized.add(artifact.id);
274
276
  }
275
277
  }
276
278
  for (const artifactPath of writeArtifacts) {
277
279
  const normalizedArtifactPath = normalizeArtifactRelativePath(artifactPath);
278
280
  if (normalizedArtifactPath.length === 0)
279
281
  continue;
280
- const owner = schema.zones.find((zone) => relativePathEqualsOrWithin(zone.path, normalizedArtifactPath));
282
+ const owner = listContextInterfaceArtifacts(schema).find((artifact) => relativePathEqualsOrWithin(artifact.path, normalizedArtifactPath));
281
283
  if (owner) {
282
284
  materialized.add(owner.id);
283
285
  }
284
286
  }
285
287
  return materialized;
286
288
  }
287
- function ensureShellLocalProjection(sourcePath, targetPath, zone) {
289
+ function ensureShellLocalProjection(sourcePath, targetPath, artifact) {
288
290
  if (existsSync(sourcePath)) {
289
291
  copyResolvedTree({
290
292
  sourcePath,
@@ -293,7 +295,7 @@ function ensureShellLocalProjection(sourcePath, targetPath, zone) {
293
295
  });
294
296
  return;
295
297
  }
296
- if (zone.kind === "file") {
298
+ if (artifact.kind === "file") {
297
299
  mkdirSync(dirname(targetPath), { recursive: true });
298
300
  return;
299
301
  }
@@ -303,7 +305,7 @@ function ensureCompiledExecutionSurface(compiledPath) {
303
305
  mkdirSync(compiledRuntimeRoot(compiledPath), { recursive: true });
304
306
  mkdirSync(methodPackagePathForCompiled(compiledPath), { recursive: true });
305
307
  const schema = loadCompiledSchema(compiledPath);
306
- ensureCompiledZoneTargets(compiledPath, schema);
308
+ ensureCompiledArtifactTargets(compiledPath, schema);
307
309
  return schema;
308
310
  }
309
311
  function readStageMethodDoc(compiledPath, stage) {
@@ -332,12 +334,12 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
332
334
  "",
333
335
  "## Shell ABI",
334
336
  "",
335
- "- `inputs/<zone-id>/` = read mounts for the current stage.",
336
- "- `outputs/<zone-id>/` = write mounts for the current stage.",
337
- "- For file zones, `runtime/paths.json` points to the exact file path inside those mount roots.",
337
+ "- `inputs/<artifact-id>/` = read mounts for the current stage.",
338
+ "- `outputs/<artifact-id>/` = write mounts for the current stage.",
339
+ "- For file Artifacts, `runtime/paths.json` points to the exact file path inside those mount roots.",
338
340
  "- `runtime/source-snapshot.json` = source references captured for this run.",
339
341
  "- `runtime/stage-inputs.json` = exact source references assigned to this stage.",
340
- "- declared compiled zone paths are also projected at the shell root so Method-relative contract paths stay valid.",
342
+ "- declared Artifact paths are also projected at the shell root so Method-relative contract paths stay valid.",
341
343
  "- `runtime/` = stage contract and machine-readable path map for this shell.",
342
344
  "- `method/` = Method metadata, `method.schema.json`, and docs for the current stage only.",
343
345
  "",
@@ -348,9 +350,9 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
348
350
  "- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the portable-context query shell.",
349
351
  "- The portable context root itself is not linked into this shell.",
350
352
  "- Do not switch into query mode or act like a user-facing assistant.",
351
- "- Do not modify files under `inputs/` unless the same zone is also mounted under `outputs/`.",
353
+ "- Do not modify files under `inputs/` unless the same Artifact is also mounted under `outputs/`.",
352
354
  "",
353
- "## Current Stage Zones",
355
+ "## Current Stage Artifacts",
354
356
  "",
355
357
  `- reads: ${stage.reads.join(", ")}`,
356
358
  `- writes: ${stage.writes.join(", ")}`,
@@ -359,7 +361,7 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
359
361
  "",
360
362
  "- complete the current stage",
361
363
  "- honor the deterministic contract",
362
- "- write outputs through the declared zone mounts",
364
+ "- write outputs through the declared Artifact mounts",
363
365
  "- stop when the stage is complete",
364
366
  "",
365
367
  ].join("\n");
@@ -378,7 +380,7 @@ function renderStageExecutionSkill(stage, stageMethodDoc) {
378
380
  "This local native skill exists for automated Interf stage execution.",
379
381
  "Read `runtime/stage-contract.json` first.",
380
382
  "Then read `runtime/source-snapshot.json`, `runtime/stage-inputs.json`, and `runtime/paths.json`.",
381
- "Use the assigned source references and the mounted `inputs/` and `outputs/` zones for this stage.",
383
+ "Use the assigned source references and the mounted `inputs/` and `outputs/` Artifacts for this stage.",
382
384
  "Do not switch into manual query mode.",
383
385
  "",
384
386
  "## Current Stage",
@@ -440,33 +442,33 @@ function projectMethodMetadata(compiledPath, shellRoot, stage) {
440
442
  linkPath(stageDocsPath, join(shellMethodRoot, "compile", "stages", stage.skillDir));
441
443
  }
442
444
  }
443
- function projectCompiledSchemaZones(compiledPath, shellRoot, schema, zoneIds, materializedZoneIds) {
444
- const allowedZoneIds = zoneIds ? new Set(zoneIds) : null;
445
- for (const zone of schema.zones) {
446
- if (allowedZoneIds && !allowedZoneIds.has(zone.id))
445
+ function projectCompiledSchemaArtifacts(compiledPath, shellRoot, schema, artifactIds, materializedArtifactIds) {
446
+ const allowedArtifactIds = artifactIds ? new Set(artifactIds) : null;
447
+ for (const artifact of listContextInterfaceArtifacts(schema)) {
448
+ if (allowedArtifactIds && !allowedArtifactIds.has(artifact.id))
447
449
  continue;
448
- const sourcePath = compiledZoneAbsolutePath(compiledPath, zone);
449
- const targetPath = join(shellRoot, zone.path);
450
- if (materializedZoneIds?.has(zone.id)) {
451
- ensureShellLocalProjection(sourcePath, targetPath, zone);
450
+ const sourcePath = compiledArtifactAbsolutePath(compiledPath, artifact);
451
+ const targetPath = join(shellRoot, artifact.path);
452
+ if (materializedArtifactIds?.has(artifact.id)) {
453
+ ensureShellLocalProjection(sourcePath, targetPath, artifact);
452
454
  continue;
453
455
  }
454
456
  linkPath(sourcePath, targetPath);
455
457
  }
456
458
  }
457
- function buildStageZoneMounts(compiledPath, shellRoot, stage, schema) {
458
- const zones = zoneMap(schema);
459
- const mountFor = (zoneId) => {
460
- const zone = zoneOrThrow(zones, zoneId);
459
+ function buildStageArtifactMounts(compiledPath, shellRoot, stage, schema) {
460
+ const artifacts = artifactMap(schema);
461
+ const mountFor = (artifactId) => {
462
+ const artifact = artifactOrThrow(artifacts, artifactId);
461
463
  return {
462
- zone_id: zone.id,
463
- compiled_path: zone.path,
464
- shell_root_path: zone.path,
465
- input_mount_path: stage.reads.includes(zoneId)
466
- ? describeShellZoneAliasMountPath(zone, "inputs")
464
+ artifact_id: artifact.id,
465
+ artifact_path: artifact.path,
466
+ shell_root_path: artifact.path,
467
+ input_mount_path: stage.reads.includes(artifactId)
468
+ ? describeShellArtifactAliasMountPath(artifact, "inputs")
467
469
  : null,
468
- output_mount_path: stage.writes.includes(zoneId)
469
- ? describeShellZoneAliasMountPath(zone, "outputs")
470
+ output_mount_path: stage.writes.includes(artifactId)
471
+ ? describeShellArtifactAliasMountPath(artifact, "outputs")
470
472
  : null,
471
473
  };
472
474
  };
@@ -475,16 +477,16 @@ function buildStageZoneMounts(compiledPath, shellRoot, stage, schema) {
475
477
  writes: stage.writes.map(mountFor),
476
478
  };
477
479
  }
478
- function projectStageZoneMountAliases(shellRoot, stage, schema) {
479
- const zones = zoneMap(schema);
480
- for (const zoneId of new Set([...stage.reads, ...stage.writes])) {
481
- const zone = zoneOrThrow(zones, zoneId);
482
- const targetPath = join(shellRoot, zone.path);
483
- if (stage.reads.includes(zoneId)) {
484
- linkRelativePath(targetPath, shellZoneAliasMountPath(shellRoot, zone, "inputs"));
480
+ function projectStageArtifactMountAliases(shellRoot, stage, schema) {
481
+ const artifacts = artifactMap(schema);
482
+ for (const artifactId of new Set([...stage.reads, ...stage.writes])) {
483
+ const artifact = artifactOrThrow(artifacts, artifactId);
484
+ const targetPath = join(shellRoot, artifact.path);
485
+ if (stage.reads.includes(artifactId)) {
486
+ linkRelativePath(targetPath, shellArtifactAliasMountPath(shellRoot, artifact, "inputs"));
485
487
  }
486
- if (stage.writes.includes(zoneId)) {
487
- linkRelativePath(targetPath, shellZoneAliasMountPath(shellRoot, zone, "outputs"));
488
+ if (stage.writes.includes(artifactId)) {
489
+ linkRelativePath(targetPath, shellArtifactAliasMountPath(shellRoot, artifact, "outputs"));
488
490
  }
489
491
  }
490
492
  }
@@ -501,46 +503,46 @@ function writeExecutionShellPathsFile(shellRoot, methodId, stage, mounts) {
501
503
  }
502
504
  export function syncStageExecutionShellWrites(compiledPath, shellRoot, stage, writeArtifacts = []) {
503
505
  const schema = ensureCompiledExecutionSurface(compiledPath);
504
- const zones = zoneMap(schema);
505
- const stageWriteZones = Array.from(stageWriteZoneSet(schema, stage))
506
- .map((zoneId) => zoneOrThrow(zones, zoneId));
507
- for (const zone of stageWriteZones) {
508
- const canonicalShellZonePath = join(shellRoot, zone.path);
509
- const outputAliasPath = shellZoneAliasMountPath(shellRoot, zone, "outputs");
510
- const shellZonePath = zone.kind === "file" &&
506
+ const artifacts = artifactMap(schema);
507
+ const stageWriteArtifacts = Array.from(stageWriteArtifactSet(schema, stage))
508
+ .map((artifactId) => artifactOrThrow(artifacts, artifactId));
509
+ for (const artifact of stageWriteArtifacts) {
510
+ const canonicalShellArtifactPath = join(shellRoot, artifact.path);
511
+ const outputAliasPath = shellArtifactAliasMountPath(shellRoot, artifact, "outputs");
512
+ const shellArtifactPath = artifact.kind === "file" &&
511
513
  existsSync(outputAliasPath) &&
512
514
  !lstatSync(outputAliasPath).isSymbolicLink()
513
515
  ? outputAliasPath
514
- : canonicalShellZonePath;
515
- if (!existsSync(shellZonePath))
516
+ : canonicalShellArtifactPath;
517
+ if (!existsSync(shellArtifactPath))
516
518
  continue;
517
- const shellZoneStat = lstatSync(shellZonePath);
518
- if (shellZoneStat.isSymbolicLink())
519
+ const shellArtifactStat = lstatSync(shellArtifactPath);
520
+ if (shellArtifactStat.isSymbolicLink())
519
521
  continue;
520
- const compiledZonePath = compiledZoneAbsolutePath(compiledPath, zone);
521
- if (shellZoneStat.isDirectory()) {
522
- const shellZoneFiles = listFilesRecursive(shellZonePath);
523
- const compiledZoneFiles = existsSync(compiledZonePath)
524
- ? listFilesRecursive(compiledZonePath)
522
+ const compiledArtifactPath = compiledArtifactAbsolutePath(compiledPath, artifact);
523
+ if (shellArtifactStat.isDirectory()) {
524
+ const shellArtifactFiles = listFilesRecursive(shellArtifactPath);
525
+ const compiledArtifactFiles = existsSync(compiledArtifactPath)
526
+ ? listFilesRecursive(compiledArtifactPath)
525
527
  : [];
526
- if (shellZoneFiles.length === 0 && compiledZoneFiles.length > 0) {
528
+ if (shellArtifactFiles.length === 0 && compiledArtifactFiles.length > 0) {
527
529
  continue;
528
530
  }
529
- rmSync(compiledZonePath, { recursive: true, force: true });
530
- mkdirSync(dirname(compiledZonePath), { recursive: true });
531
- cpSync(shellZonePath, compiledZonePath, {
531
+ rmSync(compiledArtifactPath, { recursive: true, force: true });
532
+ mkdirSync(dirname(compiledArtifactPath), { recursive: true });
533
+ cpSync(shellArtifactPath, compiledArtifactPath, {
532
534
  recursive: true,
533
535
  force: true,
534
536
  });
535
537
  continue;
536
538
  }
537
- mkdirSync(dirname(compiledZonePath), { recursive: true });
538
- copyFileSync(shellZonePath, compiledZonePath);
539
+ mkdirSync(dirname(compiledArtifactPath), { recursive: true });
540
+ copyFileSync(shellArtifactPath, compiledArtifactPath);
539
541
  }
540
542
  for (const artifactPath of writeArtifacts) {
541
543
  const normalizedArtifactPath = normalizeArtifactRelativePath(artifactPath);
542
544
  if (normalizedArtifactPath.length === 0 ||
543
- stageWriteZones.some((zone) => relativePathEqualsOrWithin(zone.path, normalizedArtifactPath))) {
545
+ stageWriteArtifacts.some((artifact) => relativePathEqualsOrWithin(artifact.path, normalizedArtifactPath))) {
544
546
  continue;
545
547
  }
546
548
  const shellArtifactPath = join(shellRoot, normalizedArtifactPath);
@@ -747,9 +749,8 @@ function renderMethodAuthoringAgents(options) {
747
749
  "- Edit only files under `method/`.",
748
750
  "- Do not edit source artifacts.",
749
751
  "- Keep the Method package valid for the current compiler API and `method.schema.json`.",
750
- "- Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
751
- "- For acceptance criteria, use `zone_counts_at_least` for numeric fixed minimums and `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`.",
752
- "- For file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`.",
752
+ "- Use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids. Never use underscores.",
753
+ "- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
753
754
  "- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
754
755
  "- Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
755
756
  "",
@@ -757,7 +758,9 @@ function renderMethodAuthoringAgents(options) {
757
758
  "",
758
759
  "- produce one standalone Method package tuned to the source data, desired outputs, and checks in this task",
759
760
  "- replace the neutral scaffold topology with the stage graph this agent work needs",
760
- "- define output zones and stage proof so Interf can show whether the data is ready",
761
+ "- define Artifacts and checks so Interf can show whether the data is ready",
762
+ "- satisfy every `artifact_requirements[]` entry from `runtime/authoring-context.json` when entries are present",
763
+ "- otherwise draft the Build Plan Artifacts from every `requested_artifacts[]` entry; do not ignore or truncate them",
761
764
  "- preserve deterministic stage and context-interface contracts",
762
765
  "- stop once the Method edits are complete",
763
766
  "",
@@ -779,10 +782,13 @@ function renderMethodAuthoringSkill() {
779
782
  "Rules:",
780
783
  "- edit only `method/`",
781
784
  `- keep \`method.json\`, \`${METHOD_SCHEMA_FILE}\`, and any changed stage docs aligned`,
782
- "- use `zone_counts_at_least` for numeric fixed minimums; use `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`",
783
- "- for file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`",
785
+ "- put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks",
786
+ "- use only CheckKind values listed in `runtime/authoring-context.json`; do not invent aliases",
787
+ "- keep Artifact checks aligned with produced outputs; use stage docs to describe the output contract without requiring exact source-specific phrases in the stage docs",
788
+ "- satisfy every `artifact_requirements[]` entry from `runtime/authoring-context.json` when entries are present",
789
+ "- otherwise draft the Build Plan Artifacts from every `requested_artifacts[]` entry; do not ignore or truncate them",
784
790
  "- design the stage graph from the source data and preparation-and-evidence brief",
785
- "- use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids; never use underscores",
791
+ "- use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids; never use underscores",
786
792
  "- replace the placeholder `prepare` stage unless that exact stage is truly the final method",
787
793
  "- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
788
794
  "- do not introduce wikilinks unless the Method also creates the target note by exact basename or explicit relative path",
@@ -790,7 +796,7 @@ function renderMethodAuthoringSkill() {
790
796
  "- prefer conservative routing changes over speculative note sprawl",
791
797
  "- prefer direct file-reading and search tools over shell commands for routine file inspection",
792
798
  "- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
793
- "- do not hardcode readiness-check answers into Method docs",
799
+ "- do not hardcode readiness-check answers into reusable Method docs",
794
800
  "- do not edit source artifacts",
795
801
  "",
796
802
  ].join("\n");
@@ -812,8 +818,12 @@ export function createMethodAuthoringShell(options) {
812
818
  method_label: options.label,
813
819
  ...(options.referenceMethodId ? { reference_method_id: options.referenceMethodId } : {}),
814
820
  task_prompt: options.taskPrompt,
821
+ allowed_check_kinds: CHECK_KINDS,
822
+ requested_artifacts: options.requestedArtifacts ?? [],
823
+ artifact_requirements: options.artifactRequirements ?? [],
815
824
  preparation: {
816
825
  source_folder_path: options.sourceFolderPath,
826
+ source_profile: options.sourceProfile ?? null,
817
827
  checks: {
818
828
  count: options.checks.length,
819
829
  questions: options.checks.map((check, index) => ({
@@ -866,7 +876,7 @@ function renderMethodImprovementAgents(compiledName, methodId, loopIndex) {
866
876
  "- Do not edit checks, test specs, source files, or generated context outputs.",
867
877
  "- Review context outputs under `artifacts/compiled-view/` and test/runtime evidence under `artifacts/`.",
868
878
  "- Keep the Method package valid for the current compiler API and `method.schema.json`.",
869
- "- For acceptance criteria, use `zone_counts_at_least` for numeric fixed minimums and `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`.",
879
+ "- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
870
880
  "",
871
881
  "## Goal",
872
882
  "",
@@ -916,15 +926,15 @@ function renderMethodImprovementSkill(methodId, loopIndex, improvementDoc) {
916
926
  function projectCompiledReviewArtifactsSnapshot(compiledPath, shellRoot, schema) {
917
927
  const compiledViewRoot = join(shellRoot, "artifacts", "compiled-view");
918
928
  mkdirSync(compiledViewRoot, { recursive: true });
919
- for (const zone of schema.zones) {
920
- if (zone.kind === "runtime" || zone.path === "source-files")
929
+ for (const artifact of listContextInterfaceArtifacts(schema)) {
930
+ if (artifact.kind === "runtime" || artifact.path === "source-files")
921
931
  continue;
922
- const sourcePath = compiledZoneAbsolutePath(compiledPath, zone);
932
+ const sourcePath = compiledArtifactAbsolutePath(compiledPath, artifact);
923
933
  if (!existsSync(sourcePath))
924
934
  continue;
925
935
  copyResolvedTree({
926
936
  sourcePath,
927
- targetPath: join(compiledViewRoot, zone.path),
937
+ targetPath: join(compiledViewRoot, artifact.path),
928
938
  shellType: "method-improvement",
929
939
  });
930
940
  }
@@ -970,21 +980,22 @@ export function projectSourceFilesTestQueryShell(rootPath) {
970
980
  }
971
981
  export function createStageExecutionShell(compiledPath, compiledName, methodId, stage, writeArtifacts = []) {
972
982
  const schema = ensureCompiledExecutionSurface(compiledPath);
973
- const materializedZones = stageMaterializedZoneSet(schema, stage, writeArtifacts);
983
+ const materializedArtifacts = stageMaterializedArtifactSet(schema, stage, writeArtifacts);
974
984
  const shellsRoot = stageExecutionShellsRoot(compiledPath);
975
985
  const shellRoot = join(shellsRoot, `${stage.id}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`);
976
986
  mkdirSync(shellRoot, { recursive: true });
977
987
  mkdirSync(join(shellRoot, "runtime"), { recursive: true });
988
+ mkdirSync(join(shellRoot, ".interf", "runtime"), { recursive: true });
978
989
  mkdirSync(join(shellRoot, "inputs"), { recursive: true });
979
990
  mkdirSync(join(shellRoot, "outputs"), { recursive: true });
980
991
  linkPath(compiledInterfConfigPath(compiledPath), join(shellRoot, "interf.json"));
981
992
  linkPath(join(compiledRuntimeRoot(compiledPath), "stage-contract.json"), shellRuntimePath(shellRoot, "stage-contract.json"));
982
993
  linkIfExists(compiledRuntimeSourceSnapshotPath(compiledPath), shellRuntimePath(shellRoot, "source-snapshot.json"));
983
994
  linkIfExists(compiledRuntimeStageInputsPath(compiledPath, stage.id), shellRuntimePath(shellRoot, "stage-inputs.json"));
984
- projectCompiledSchemaZones(compiledPath, shellRoot, schema, new Set([...stage.reads, ...stage.writes]), materializedZones);
995
+ projectCompiledSchemaArtifacts(compiledPath, shellRoot, schema, new Set([...stage.reads, ...stage.writes]), materializedArtifacts);
985
996
  projectMethodMetadata(compiledPath, shellRoot, stage);
986
- projectStageZoneMountAliases(shellRoot, stage, schema);
987
- writeExecutionShellPathsFile(shellRoot, methodId, stage, buildStageZoneMounts(compiledPath, shellRoot, stage, schema));
997
+ projectStageArtifactMountAliases(shellRoot, stage, schema);
998
+ writeExecutionShellPathsFile(shellRoot, methodId, stage, buildStageArtifactMounts(compiledPath, shellRoot, stage, schema));
988
999
  const agentsContent = renderStageExecutionAgents(compiledName, methodId, stage);
989
1000
  writeNativeAgentSurface(shellRoot, agentsContent, "interf-stage", renderStageExecutionSkill(stage, readStageMethodDoc(compiledPath, stage)));
990
1001
  return {
@@ -4,7 +4,7 @@
4
4
  * Bridges the registry layer (`AgentRecord` / `RoleMap`) to the runtime
5
5
  * layer (`MethodExecutor`). Builds a per-agent-name `MethodExecutor`
6
6
  * map up front and exposes a `resolveExecutorForRole(role)` helper that
7
- * the compile / verify pipelines can call per-stage.
7
+ * the compile / readiness-check pipelines can call per-stage.
8
8
  *
9
9
  * Falls back gracefully: when a role isn't mapped, or the mapped agent
10
10
  * is missing, we fall through to `general` and ultimately to the