@interf/compiler 0.9.4 → 0.13.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 (222) hide show
  1. package/README.md +96 -91
  2. package/TRADEMARKS.md +2 -13
  3. package/agent-skills/interf-actions/SKILL.md +97 -32
  4. package/agent-skills/interf-actions/references/cli.md +124 -71
  5. package/builtin-methods/interf-default/README.md +3 -4
  6. package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
  7. package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
  8. package/builtin-methods/interf-default/improve/SKILL.md +1 -1
  9. package/builtin-methods/interf-default/method.json +10 -4
  10. package/builtin-methods/interf-default/method.schema.json +0 -9
  11. package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
  12. package/dist/cli/commands/compile.d.ts +9 -31
  13. package/dist/cli/commands/compile.js +75 -388
  14. package/dist/cli/commands/doctor.js +1 -1
  15. package/dist/cli/commands/login.d.ts +7 -0
  16. package/dist/cli/commands/login.js +39 -0
  17. package/dist/cli/commands/logout.d.ts +2 -0
  18. package/dist/cli/commands/logout.js +16 -0
  19. package/dist/cli/commands/method.d.ts +2 -0
  20. package/dist/cli/commands/method.js +113 -0
  21. package/dist/cli/commands/prep.d.ts +2 -0
  22. package/dist/cli/commands/prep.js +134 -0
  23. package/dist/cli/commands/reset.d.ts +8 -1
  24. package/dist/cli/commands/reset.js +47 -15
  25. package/dist/cli/commands/runs.d.ts +2 -0
  26. package/dist/cli/commands/runs.js +120 -0
  27. package/dist/cli/commands/status.d.ts +6 -1
  28. package/dist/cli/commands/status.js +61 -220
  29. package/dist/cli/commands/test.d.ts +6 -15
  30. package/dist/cli/commands/test.js +63 -342
  31. package/dist/cli/commands/web.d.ts +0 -9
  32. package/dist/cli/commands/web.js +140 -367
  33. package/dist/cli/commands/wizard.d.ts +9 -0
  34. package/dist/cli/commands/wizard.js +442 -0
  35. package/dist/cli/index.d.ts +7 -6
  36. package/dist/cli/index.js +13 -10
  37. package/dist/compiler-ui/404.html +1 -1
  38. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  39. package/dist/compiler-ui/__next._full.txt +3 -3
  40. package/dist/compiler-ui/__next._head.txt +1 -1
  41. package/dist/compiler-ui/__next._index.txt +2 -2
  42. package/dist/compiler-ui/__next._tree.txt +2 -2
  43. package/dist/compiler-ui/_next/static/chunks/045gole2ojo3g.css +3 -0
  44. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +89 -0
  45. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  46. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  47. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  48. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  49. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  50. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  51. package/dist/compiler-ui/_not-found.html +1 -1
  52. package/dist/compiler-ui/_not-found.txt +2 -2
  53. package/dist/compiler-ui/index.html +1 -1
  54. package/dist/compiler-ui/index.txt +3 -3
  55. package/dist/index.d.ts +0 -23
  56. package/dist/index.js +0 -16
  57. package/dist/packages/agents/lib/shells.d.ts +1 -1
  58. package/dist/packages/agents/lib/shells.js +113 -54
  59. package/dist/packages/agents/lib/user-config.d.ts +4 -2
  60. package/dist/packages/agents/lib/user-config.js +15 -7
  61. package/dist/packages/compiler/compiled-paths.d.ts +9 -2
  62. package/dist/packages/compiler/compiled-paths.js +30 -15
  63. package/dist/packages/compiler/compiled-pipeline.js +23 -3
  64. package/dist/packages/compiler/compiled-stage-plan.js +4 -0
  65. package/dist/packages/compiler/compiled-target.d.ts +1 -1
  66. package/dist/packages/compiler/compiled-target.js +1 -1
  67. package/dist/packages/compiler/index.d.ts +1 -0
  68. package/dist/packages/compiler/index.js +1 -0
  69. package/dist/packages/compiler/lib/schema.d.ts +27 -32
  70. package/dist/packages/compiler/lib/schema.js +2 -13
  71. package/dist/packages/compiler/method-runs.d.ts +2 -3
  72. package/dist/packages/compiler/method-runs.js +2 -3
  73. package/dist/packages/compiler/reset.js +3 -1
  74. package/dist/packages/compiler/runtime-contracts.js +0 -3
  75. package/dist/packages/compiler/runtime-prompt.js +1 -1
  76. package/dist/packages/compiler/source-files.d.ts +46 -0
  77. package/dist/packages/compiler/source-files.js +149 -0
  78. package/dist/packages/compiler/state-artifacts.d.ts +3 -2
  79. package/dist/packages/compiler/state-artifacts.js +4 -3
  80. package/dist/packages/compiler/state-io.d.ts +3 -2
  81. package/dist/packages/compiler/state-io.js +11 -5
  82. package/dist/packages/compiler/state-paths.d.ts +2 -1
  83. package/dist/packages/compiler/state-paths.js +6 -3
  84. package/dist/packages/compiler/state-view.d.ts +3 -2
  85. package/dist/packages/compiler/state-view.js +18 -28
  86. package/dist/packages/compiler/state.d.ts +4 -4
  87. package/dist/packages/compiler/state.js +3 -3
  88. package/dist/packages/contracts/index.d.ts +1 -1
  89. package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
  90. package/dist/packages/contracts/lib/preparation-paths.js +177 -0
  91. package/dist/packages/contracts/lib/schema.d.ts +85 -6
  92. package/dist/packages/contracts/lib/schema.js +46 -2
  93. package/dist/packages/execution/lib/schema.d.ts +50 -57
  94. package/dist/packages/execution/lib/schema.js +1 -2
  95. package/dist/packages/local-service/action-definitions.d.ts +246 -0
  96. package/dist/packages/local-service/action-definitions.js +1147 -0
  97. package/dist/packages/local-service/action-planner.d.ts +9 -0
  98. package/dist/packages/local-service/action-planner.js +135 -0
  99. package/dist/packages/local-service/action-values.d.ts +1 -23
  100. package/dist/packages/local-service/action-values.js +1 -31
  101. package/dist/packages/local-service/client.d.ts +76 -46
  102. package/dist/packages/local-service/client.js +184 -149
  103. package/dist/packages/local-service/connection-config.d.ts +38 -0
  104. package/dist/packages/local-service/connection-config.js +75 -0
  105. package/dist/packages/local-service/index.d.ts +14 -7
  106. package/dist/packages/local-service/index.js +8 -4
  107. package/dist/packages/local-service/instance-paths.d.ts +100 -0
  108. package/dist/packages/local-service/instance-paths.js +165 -0
  109. package/dist/packages/local-service/lib/schema.d.ts +689 -2575
  110. package/dist/packages/local-service/lib/schema.js +260 -101
  111. package/dist/packages/local-service/native-run-handlers.d.ts +23 -0
  112. package/dist/{cli/commands/compile-controller.js → packages/local-service/native-run-handlers.js} +204 -20
  113. package/dist/packages/local-service/preparation-store.d.ts +92 -0
  114. package/dist/packages/local-service/preparation-store.js +171 -0
  115. package/dist/{cli/commands/check-draft.d.ts → packages/local-service/readiness-check-draft.d.ts} +2 -2
  116. package/dist/packages/local-service/routes.d.ts +33 -11
  117. package/dist/packages/local-service/routes.js +44 -15
  118. package/dist/packages/local-service/run-observability.js +25 -27
  119. package/dist/packages/local-service/runtime-caches.d.ts +76 -0
  120. package/dist/packages/local-service/runtime-caches.js +191 -0
  121. package/dist/packages/local-service/runtime-event-applier.d.ts +12 -0
  122. package/dist/packages/local-service/runtime-event-applier.js +177 -0
  123. package/dist/packages/local-service/runtime-persistence.d.ts +47 -0
  124. package/dist/packages/local-service/runtime-persistence.js +137 -0
  125. package/dist/packages/local-service/runtime-proposal-helpers.d.ts +35 -0
  126. package/dist/packages/local-service/runtime-proposal-helpers.js +251 -0
  127. package/dist/packages/local-service/runtime-resource-builders.d.ts +52 -0
  128. package/dist/packages/local-service/runtime-resource-builders.js +149 -0
  129. package/dist/packages/local-service/runtime.d.ts +201 -44
  130. package/dist/packages/local-service/runtime.js +1062 -1106
  131. package/dist/packages/local-service/server.d.ts +15 -0
  132. package/dist/packages/local-service/server.js +651 -233
  133. package/dist/packages/local-service/service-registry.d.ts +47 -0
  134. package/dist/packages/local-service/service-registry.js +137 -0
  135. package/dist/packages/method-authoring/method-authoring.d.ts +1 -1
  136. package/dist/packages/method-authoring/method-authoring.js +2 -2
  137. package/dist/packages/method-authoring/method-improvement.js +1 -1
  138. package/dist/packages/method-package/builtin-compiled-method.d.ts +4 -5
  139. package/dist/packages/method-package/builtin-compiled-method.js +8 -14
  140. package/dist/packages/method-package/context-interface.d.ts +4 -40
  141. package/dist/packages/method-package/context-interface.js +1 -23
  142. package/dist/packages/method-package/interf-method-package.d.ts +4 -4
  143. package/dist/packages/method-package/interf-method-package.js +21 -33
  144. package/dist/packages/method-package/local-methods.d.ts +10 -6
  145. package/dist/packages/method-package/local-methods.js +57 -39
  146. package/dist/packages/method-package/method-definitions.d.ts +8 -34
  147. package/dist/packages/method-package/method-definitions.js +49 -37
  148. package/dist/packages/method-package/method-helpers.d.ts +1 -13
  149. package/dist/packages/method-package/method-helpers.js +8 -42
  150. package/dist/packages/method-package/method-review-paths.d.ts +1 -1
  151. package/dist/packages/method-package/method-review-paths.js +5 -5
  152. package/dist/packages/method-package/method-stage-runner.js +2 -2
  153. package/dist/packages/method-package/user-methods.d.ts +17 -0
  154. package/dist/packages/method-package/user-methods.js +77 -0
  155. package/dist/packages/project-model/index.d.ts +1 -1
  156. package/dist/packages/project-model/index.js +1 -1
  157. package/dist/packages/project-model/interf-detect.d.ts +8 -3
  158. package/dist/packages/project-model/interf-detect.js +34 -34
  159. package/dist/packages/project-model/interf-scaffold.d.ts +3 -3
  160. package/dist/packages/project-model/interf-scaffold.js +23 -32
  161. package/dist/packages/project-model/lib/schema.js +38 -1
  162. package/dist/packages/project-model/preparation-entries.d.ts +11 -0
  163. package/dist/packages/project-model/preparation-entries.js +49 -0
  164. package/dist/packages/project-model/source-config.d.ts +11 -10
  165. package/dist/packages/project-model/source-config.js +83 -44
  166. package/dist/packages/project-model/source-folders.d.ts +5 -5
  167. package/dist/packages/project-model/source-folders.js +14 -14
  168. package/dist/packages/shared/filesystem.d.ts +7 -0
  169. package/dist/packages/shared/filesystem.js +97 -10
  170. package/dist/packages/testing/lib/schema.d.ts +12 -13
  171. package/dist/packages/testing/lib/schema.js +4 -5
  172. package/dist/packages/testing/readiness-check-run.d.ts +7 -7
  173. package/dist/packages/testing/readiness-check-run.js +46 -51
  174. package/dist/packages/testing/test-execution.js +6 -6
  175. package/dist/packages/testing/test-paths.js +4 -3
  176. package/dist/packages/testing/test-sandbox.d.ts +0 -1
  177. package/dist/packages/testing/test-sandbox.js +14 -30
  178. package/dist/packages/testing/test-targets.d.ts +1 -1
  179. package/dist/packages/testing/test-targets.js +6 -6
  180. package/dist/packages/testing/test.d.ts +1 -1
  181. package/dist/packages/testing/test.js +1 -1
  182. package/package.json +6 -26
  183. package/LICENSE +0 -183
  184. package/dist/cli/commands/compile-controller.d.ts +0 -17
  185. package/dist/cli/commands/compiled-flow.d.ts +0 -25
  186. package/dist/cli/commands/compiled-flow.js +0 -112
  187. package/dist/cli/commands/control-path.d.ts +0 -11
  188. package/dist/cli/commands/control-path.js +0 -72
  189. package/dist/cli/commands/create-method-wizard.d.ts +0 -76
  190. package/dist/cli/commands/create-method-wizard.js +0 -465
  191. package/dist/cli/commands/create.d.ts +0 -8
  192. package/dist/cli/commands/create.js +0 -189
  193. package/dist/cli/commands/default.d.ts +0 -2
  194. package/dist/cli/commands/default.js +0 -39
  195. package/dist/cli/commands/executor-flow.d.ts +0 -29
  196. package/dist/cli/commands/executor-flow.js +0 -163
  197. package/dist/cli/commands/init.d.ts +0 -11
  198. package/dist/cli/commands/init.js +0 -784
  199. package/dist/cli/commands/list.d.ts +0 -2
  200. package/dist/cli/commands/list.js +0 -30
  201. package/dist/cli/commands/preparation-selection.d.ts +0 -6
  202. package/dist/cli/commands/preparation-selection.js +0 -11
  203. package/dist/cli/commands/source-config-wizard.d.ts +0 -52
  204. package/dist/cli/commands/source-config-wizard.js +0 -680
  205. package/dist/cli/commands/test-flow.d.ts +0 -58
  206. package/dist/cli/commands/test-flow.js +0 -231
  207. package/dist/cli/commands/verify.d.ts +0 -2
  208. package/dist/cli/commands/verify.js +0 -94
  209. package/dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js +0 -118
  210. package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +0 -3
  211. package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
  212. package/dist/packages/compiler/raw-snapshot.js +0 -101
  213. package/dist/packages/method-package/index.d.ts +0 -11
  214. package/dist/packages/method-package/index.js +0 -11
  215. package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
  216. package/dist/packages/method-package/method-stage-policy.js +0 -31
  217. package/dist/packages/project-model/project-paths.d.ts +0 -12
  218. package/dist/packages/project-model/project-paths.js +0 -33
  219. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_buildManifest.js +0 -0
  220. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_clientMiddlewareManifest.js +0 -0
  221. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_ssgManifest.js +0 -0
  222. /package/dist/{cli/commands/check-draft.js → packages/local-service/readiness-check-draft.js} +0 -0
@@ -14,21 +14,21 @@ export interface ReadinessCheckRunResult {
14
14
  preparationConfig: SourcePreparationConfig;
15
15
  portableContextPath: string | null;
16
16
  mode: TestRunMode;
17
- rawOutcome: SavedReadinessCheckOutcome | null;
17
+ sourceFilesOutcome: SavedReadinessCheckOutcome | null;
18
18
  compiledOutcome: SavedReadinessCheckOutcome | null;
19
- comparisonRunPath: string | null;
20
- comparison: ReadinessCheckRun | null;
19
+ readinessRunPath: string | null;
20
+ readinessRun: ReadinessCheckRun | null;
21
21
  }
22
22
  export declare function readinessPassRate(outcome: SavedReadinessCheckOutcome): number;
23
- export declare function readSavedReadinessCheckRun(projectPath: string, preparationName: string): ReadinessCheckRun | null;
23
+ export declare function readSavedReadinessCheckRun(prepDataDir: string, preparationName: string): ReadinessCheckRun | null;
24
24
  export declare function parseReadinessCheckRun(value: unknown): ReadinessCheckRun | null;
25
25
  export declare function readReadinessCheckRunAtPath(filePath: string, label?: string): ReadinessCheckRun | null;
26
26
  export declare function readCurrentSavedReadinessCheckRun(options: {
27
- projectPath: string;
27
+ prepDataDir: string;
28
28
  preparationName: string;
29
29
  checks: SourcePreparationConfig["checks"];
30
30
  }): {
31
- comparison: ReadinessCheckRun | null;
31
+ readinessRun: ReadinessCheckRun | null;
32
32
  stale: boolean;
33
33
  };
34
34
  export declare function saveReadinessCheckRun(options: {
@@ -37,7 +37,7 @@ export declare function saveReadinessCheckRun(options: {
37
37
  preparationName: string;
38
38
  checksFingerprint: string;
39
39
  mode: TestRunMode;
40
- rawOutcome: SavedReadinessCheckOutcome | null;
40
+ sourceFilesOutcome: SavedReadinessCheckOutcome | null;
41
41
  compiledOutcome: SavedReadinessCheckOutcome | null;
42
42
  }): string;
43
43
  export declare function runSavedSourceFilesCheck(options: {
@@ -1,11 +1,11 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { buildTestSpecFromCompiledPreparationConfig, buildTestSpecFromSourceFolderConfig, fingerprintReadinessChecks, resolveSourcePreparationPath, } from "../project-model/source-config.js";
4
- import { preparationLatestReadinessRunPath, preparationLatestReadinessSummaryPath, preparationTestRunPath, preparationTestRunsRoot, normalizePreparationTestRunId, portableContextPath, } from "../project-model/project-paths.js";
4
+ import { asPreparationDataDir, preparationLatestReadinessRunPath, preparationLatestReadinessSummaryPath, preparationTestRunPath, preparationTestRunsRoot, normalizePreparationTestRunId, preparationPortableContextPath, } from "../contracts/lib/preparation-paths.js";
5
5
  import { testRootForCompiled } from "../compiler/compiled-paths.js";
6
6
  import { readJsonFileWithSchema } from "../shared/parse.js";
7
7
  import { resolveMethodId } from "../methods/method-resolution.js";
8
- import { createCompiledTestTarget, createRawTestTarget, runTargetTestsAuto, saveTargetTestRun, } from "./test.js";
8
+ import { createCompiledTestTarget, createSourceFilesTestTarget, runTargetTestsAuto, saveTargetTestRun, } from "./test.js";
9
9
  import { ReadinessCheckRunSchema, } from "./lib/schema.js";
10
10
  export function readinessPassRate(outcome) {
11
11
  return outcome.result.totalCases > 0
@@ -28,9 +28,9 @@ function summarizeSavedTestOutcome(label, outcome) {
28
28
  };
29
29
  }
30
30
  function writePreparationTargetRun(options) {
31
- const dirPath = preparationTestRunsRoot(options.projectPath, options.preparationName, options.target);
31
+ const dirPath = preparationTestRunsRoot(asPreparationDataDir(options.prepDataDir), options.preparationName, options.target);
32
32
  mkdirSync(dirPath, { recursive: true });
33
- const runPath = preparationTestRunPath(options.projectPath, options.preparationName, options.target, options.generatedAt, options.runId, options.runSuffix);
33
+ const runPath = preparationTestRunPath(asPreparationDataDir(options.prepDataDir), options.preparationName, options.target, options.generatedAt, options.runId, options.runSuffix);
34
34
  writeFileSync(runPath, `${JSON.stringify(options.payload, null, 2)}\n`);
35
35
  return runPath;
36
36
  }
@@ -41,27 +41,23 @@ function renderLatestSummaryMarkdown(payload) {
41
41
  "| Target | Readiness checks |",
42
42
  "| --- | --- |",
43
43
  ];
44
- if (payload.raw) {
45
- lines.push(`| Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
44
+ if (payload.source_files) {
45
+ lines.push(`| Source files | \`${payload.source_files.passed_cases}/${payload.source_files.total_cases}\` |`);
46
46
  }
47
47
  if (payload.compiled) {
48
48
  lines.push(`| Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
49
49
  }
50
50
  lines.push("");
51
- if (payload.summary.raw_pass_rate != null && payload.summary.compiled_pass_rate != null) {
52
- const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
53
- lines.push(`Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`, "");
54
- }
55
- if (payload.raw) {
56
- lines.push(`- Latest source-files run: ${payload.raw.run_path}`);
51
+ if (payload.source_files) {
52
+ lines.push(`- Latest source-files run: ${payload.source_files.run_path}`);
57
53
  }
58
54
  if (payload.compiled) {
59
55
  lines.push(`- Latest portable-context run: ${payload.compiled.run_path}`);
60
56
  }
61
57
  return `${lines.join("\n")}\n`;
62
58
  }
63
- export function readSavedReadinessCheckRun(projectPath, preparationName) {
64
- const latestPath = preparationLatestReadinessRunPath(projectPath, preparationName);
59
+ export function readSavedReadinessCheckRun(prepDataDir, preparationName) {
60
+ const latestPath = preparationLatestReadinessRunPath(asPreparationDataDir(prepDataDir), preparationName);
65
61
  if (!existsSync(latestPath))
66
62
  return null;
67
63
  return readReadinessCheckRunAtPath(latestPath, "latest readiness-check run");
@@ -74,31 +70,31 @@ export function readReadinessCheckRunAtPath(filePath, label = "readiness-check r
74
70
  return readJsonFileWithSchema(filePath, label, ReadinessCheckRunSchema);
75
71
  }
76
72
  export function readCurrentSavedReadinessCheckRun(options) {
77
- const latestComparison = readSavedReadinessCheckRun(options.projectPath, options.preparationName);
78
- if (!latestComparison) {
79
- return { comparison: null, stale: false };
73
+ const latestRun = readSavedReadinessCheckRun(options.prepDataDir, options.preparationName);
74
+ if (!latestRun) {
75
+ return { readinessRun: null, stale: false };
80
76
  }
81
77
  const currentFingerprint = fingerprintReadinessChecks(options.checks);
82
- if (!latestComparison.checks_fingerprint || latestComparison.checks_fingerprint !== currentFingerprint) {
83
- return { comparison: null, stale: true };
78
+ if (!latestRun.checks_fingerprint || latestRun.checks_fingerprint !== currentFingerprint) {
79
+ return { readinessRun: null, stale: true };
84
80
  }
85
- return { comparison: latestComparison, stale: false };
81
+ return { readinessRun: latestRun, stale: false };
86
82
  }
87
83
  export function saveReadinessCheckRun(options) {
88
84
  const generatedAt = new Date().toISOString();
89
- const rawSummary = options.rawOutcome
90
- ? summarizeSavedTestOutcome("Source files", options.rawOutcome)
85
+ const sourceFilesSummary = options.sourceFilesOutcome
86
+ ? summarizeSavedTestOutcome("Source files", options.sourceFilesOutcome)
91
87
  : null;
92
88
  const compiledSummary = options.compiledOutcome
93
89
  ? summarizeSavedTestOutcome("Portable Context", options.compiledOutcome)
94
90
  : null;
95
- const effectiveMode = rawSummary && compiledSummary
91
+ const effectiveMode = sourceFilesSummary && compiledSummary
96
92
  ? "both"
97
- : rawSummary
98
- ? "raw"
93
+ : sourceFilesSummary
94
+ ? "source-files"
99
95
  : "compiled";
100
- const rawPassRate = rawSummary
101
- ? Math.round((rawSummary.passed_cases / rawSummary.total_cases) * 100)
96
+ const sourceFilesPassRate = sourceFilesSummary
97
+ ? Math.round((sourceFilesSummary.passed_cases / sourceFilesSummary.total_cases) * 100)
102
98
  : null;
103
99
  const compiledPassRate = compiledSummary
104
100
  ? Math.round((compiledSummary.passed_cases / compiledSummary.total_cases) * 100)
@@ -114,18 +110,17 @@ export function saveReadinessCheckRun(options) {
114
110
  name: options.preparationName,
115
111
  portable_context_path: options.portableContextPath,
116
112
  },
117
- raw: rawSummary,
113
+ source_files: sourceFilesSummary,
118
114
  compiled: compiledSummary,
119
115
  summary: {
120
- raw_pass_rate: rawPassRate,
121
- compiled_pass_rate: compiledPassRate,
122
- pass_rate_delta: rawPassRate !== null && compiledPassRate !== null ? compiledPassRate - rawPassRate : null,
116
+ source_files_pass_rate: sourceFilesPassRate,
117
+ portable_context_pass_rate: compiledPassRate,
123
118
  },
124
119
  };
125
- const latestStatePath = preparationLatestReadinessRunPath(options.sourcePath, options.preparationName);
120
+ const latestStatePath = preparationLatestReadinessRunPath(asPreparationDataDir(options.sourcePath), options.preparationName);
126
121
  mkdirSync(dirname(latestStatePath), { recursive: true });
127
122
  writeFileSync(latestStatePath, `${JSON.stringify(payload, null, 2)}\n`);
128
- writeFileSync(preparationLatestReadinessSummaryPath(options.sourcePath, options.preparationName), renderLatestSummaryMarkdown(payload));
123
+ writeFileSync(preparationLatestReadinessSummaryPath(asPreparationDataDir(options.sourcePath), options.preparationName), renderLatestSummaryMarkdown(payload));
129
124
  if (options.portableContextPath) {
130
125
  mkdirSync(testRootForCompiled(options.portableContextPath), { recursive: true });
131
126
  writeFileSync(join(testRootForCompiled(options.portableContextPath), "latest.json"), `${JSON.stringify(payload, null, 2)}\n`);
@@ -134,15 +129,15 @@ export function saveReadinessCheckRun(options) {
134
129
  }
135
130
  export async function runSavedSourceFilesCheck(options) {
136
131
  const spec = buildTestSpecFromSourceFolderConfig({
137
- sourcePath: options.sourcePath,
132
+ prepDataDir: options.sourcePath,
138
133
  targetName: options.preparationConfig.name,
139
- targetType: "raw",
134
+ targetType: "source-files",
140
135
  });
141
136
  if (!spec)
142
137
  return null;
143
138
  const sourceFolderPath = resolveSourcePreparationPath(options.sourcePath, options.preparationConfig);
144
- const target = createRawTestTarget(sourceFolderPath);
145
- const artifactRoot = preparationLatestReadinessRunPath(options.sourcePath, options.preparationConfig.name);
139
+ const target = createSourceFilesTestTarget(sourceFolderPath);
140
+ const artifactRoot = preparationLatestReadinessRunPath(asPreparationDataDir(options.sourcePath), options.preparationConfig.name);
146
141
  const run = await runTargetTestsAuto(sourceFolderPath, spec, [target], {
147
142
  executor: options.executor,
148
143
  preserveSandboxes: options.preserveSandboxes ?? "on-failure",
@@ -152,9 +147,9 @@ export async function runSavedSourceFilesCheck(options) {
152
147
  if (!result)
153
148
  return null;
154
149
  const preparationRunPath = writePreparationTargetRun({
155
- projectPath: options.sourcePath,
150
+ prepDataDir: options.sourcePath,
156
151
  preparationName: options.preparationConfig.name,
157
- target: "file-as-is",
152
+ target: "source-files",
158
153
  generatedAt: run.generated_at,
159
154
  runId: normalizePreparationTestRunId(spec.id),
160
155
  runSuffix: options.runSuffix,
@@ -188,7 +183,7 @@ export async function runSavedPortableContextCheck(options) {
188
183
  return null;
189
184
  const compiledRunPath = saveTargetTestRun(portableContextPath, run);
190
185
  const preparationRunPath = writePreparationTargetRun({
191
- projectPath: options.sourcePath,
186
+ prepDataDir: options.sourcePath,
192
187
  preparationName: options.preparationConfig.name,
193
188
  target: "compiled",
194
189
  generatedAt: run.generated_at,
@@ -204,7 +199,7 @@ export async function runSavedPortableContextCheck(options) {
204
199
  };
205
200
  }
206
201
  export async function runReadinessChecksForExecutor(options) {
207
- const rawPromise = options.mode === "raw" || options.mode === "both"
202
+ const sourceFilesPromise = options.mode === "source-files" || options.mode === "both"
208
203
  ? runSavedSourceFilesCheck({
209
204
  sourcePath: options.sourcePath,
210
205
  preparationConfig: options.preparationConfig,
@@ -223,23 +218,23 @@ export async function runReadinessChecksForExecutor(options) {
223
218
  runSuffix: options.runSuffix,
224
219
  })
225
220
  : Promise.resolve(null);
226
- const [rawOutcome, compiledOutcome] = await Promise.all([rawPromise, compiledPromise]);
227
- const modeSatisfied = (options.mode !== "raw" || Boolean(rawOutcome)) &&
221
+ const [sourceFilesOutcome, compiledOutcome] = await Promise.all([sourceFilesPromise, compiledPromise]);
222
+ const modeSatisfied = (options.mode !== "source-files" || Boolean(sourceFilesOutcome)) &&
228
223
  (options.mode !== "compiled" || Boolean(compiledOutcome)) &&
229
- (options.mode !== "both" || (Boolean(rawOutcome) && Boolean(compiledOutcome)));
224
+ (options.mode !== "both" || (Boolean(sourceFilesOutcome) && Boolean(compiledOutcome)));
230
225
  const shouldSave = options.saveLatest !== false;
231
- const comparisonRunPath = shouldSave && modeSatisfied
226
+ const readinessRunPath = shouldSave && modeSatisfied
232
227
  ? saveReadinessCheckRun({
233
228
  sourcePath: options.sourcePath,
234
229
  portableContextPath: options.portableContextPath,
235
230
  preparationName: options.preparationConfig.name,
236
231
  checksFingerprint: fingerprintReadinessChecks(options.preparationConfig.checks),
237
232
  mode: options.mode,
238
- rawOutcome,
233
+ sourceFilesOutcome,
239
234
  compiledOutcome,
240
235
  })
241
236
  : null;
242
- const comparison = shouldSave && modeSatisfied
237
+ const readinessRun = shouldSave && modeSatisfied
243
238
  ? readSavedReadinessCheckRun(options.sourcePath, options.preparationConfig.name)
244
239
  : null;
245
240
  return {
@@ -247,12 +242,12 @@ export async function runReadinessChecksForExecutor(options) {
247
242
  preparationConfig: options.preparationConfig,
248
243
  portableContextPath: options.portableContextPath,
249
244
  mode: options.mode,
250
- rawOutcome,
245
+ sourceFilesOutcome,
251
246
  compiledOutcome,
252
- comparisonRunPath,
253
- comparison,
247
+ readinessRunPath,
248
+ readinessRun,
254
249
  };
255
250
  }
256
251
  function portableContextPathForPreparation(sourcePath, preparationName) {
257
- return portableContextPath(sourcePath, preparationName);
252
+ return preparationPortableContextPath(asPreparationDataDir(sourcePath), preparationName);
258
253
  }
@@ -201,16 +201,16 @@ function buildTestQueryPrompt(target, testCase, answerPath, tracePath) {
201
201
  "Read `AGENTS.md` first.",
202
202
  "Use the local native `interf-query` skill available in this portable context.",
203
203
  "Answer the check question the same way you would answer a real user inside this portable context.",
204
- "Prefer the Method-declared portable-context outputs before consulting `raw/`.",
205
- "This sandbox is self-contained: the copied portable context has sanitized source files under `raw/` via `.interf/interf.json` `source.path`.",
206
- "The original Interf Workspace is intentionally absent from this sandbox. Work only from this sandboxed portable context and its embedded raw files.",
204
+ "Prefer the Method-declared portable-context outputs before consulting source references.",
205
+ "This sandbox is self-contained: the copied portable context has source references in `.interf/runtime/source-snapshot.json`.",
206
+ "The original Interf Workspace is intentionally absent from this sandbox. Use the source locators only when the portable context needs verification.",
207
207
  ]
208
208
  : [
209
- "You are running an Interf baseline test inside an isolated raw test shell.",
209
+ "You are running an Interf baseline test inside an isolated source-files test shell.",
210
210
  "Read `AGENTS.md` first.",
211
211
  "Use the local native `interf-query` skill available in this shell.",
212
212
  "There is no portable context in this sandbox.",
213
- "Answer only from `raw/` inside this shell.",
213
+ "Answer only from source references listed in `runtime/source-files.json` inside this shell.",
214
214
  "The original control plane folder is intentionally absent from this sandbox.",
215
215
  ];
216
216
  return [
@@ -218,7 +218,7 @@ function buildTestQueryPrompt(target, testCase, answerPath, tracePath) {
218
218
  "Emit only STATUS:, DONE:, BLOCKED:, or ERROR: lines.",
219
219
  "Do not ask follow-up questions.",
220
220
  `Write the answer to ${JSON.stringify(answerPath)}.`,
221
- `Write the trace to ${JSON.stringify(tracePath)} with keys: case_id, target, artifacts_consulted, raw_paths_read, used_source_files, answer_summary.`,
221
+ `Write the trace to ${JSON.stringify(tracePath)} with keys: case_id, target, artifacts_consulted, source_paths_read, used_source_files, answer_summary.`,
222
222
  `Set \`case_id\` to ${JSON.stringify(testCase.id)}.`,
223
223
  `Set \`target\` to ${JSON.stringify(target.type)}.`,
224
224
  `Question: ${testCase.question}`,
@@ -1,10 +1,11 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { basename, dirname, join } from "node:path";
3
3
  import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compiler/compiled-paths.js";
4
+ import { asPreparationDataDir, preparationTestsSpecsRoot, } from "../contracts/lib/preparation-paths.js";
4
5
  const TEST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,79}$/;
5
6
  export const TEST_SPEC_EXTENSIONS = new Set([".json"]);
6
7
  export function testSpecRootPath(sourcePath) {
7
- return join(sourcePath, "interf", "tests", "specs");
8
+ return preparationTestsSpecsRoot(asPreparationDataDir(sourcePath));
8
9
  }
9
10
  export function testSpecTypePath(sourcePath, type) {
10
11
  return join(testSpecRootPath(sourcePath), type);
@@ -18,7 +19,7 @@ export function targetTestRunsPath(compiledPath, type) {
18
19
  return join(targetTestRunsRootForCompiled(compiledPath), type);
19
20
  }
20
21
  if (isPreparationTestsRootPath(compiledPath)) {
21
- return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "runs");
22
+ return join(compiledPath, type === "source-files" ? "source-files" : "compiled", "runs");
22
23
  }
23
24
  throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected portable context or interf/<preparation>/.interf/tests root.`);
24
25
  }
@@ -30,7 +31,7 @@ export function targetTestSandboxesPath(compiledPath, type) {
30
31
  return join(targetTestSandboxesRootForCompiled(compiledPath), type);
31
32
  }
32
33
  if (isPreparationTestsRootPath(compiledPath)) {
33
- return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "sandboxes");
34
+ return join(compiledPath, type === "source-files" ? "source-files" : "compiled", "sandboxes");
34
35
  }
35
36
  throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected portable context or interf/<preparation>/.interf/tests root.`);
36
37
  }
@@ -2,7 +2,6 @@ import type { TestTargetCandidate } from "./test-types.js";
2
2
  export type TestSandboxRetentionMode = "on-failure" | "always";
3
3
  export interface TestSandbox {
4
4
  rootPath: string;
5
- rawPath: string;
6
5
  targetPath: string;
7
6
  compiledPath: string | null;
8
7
  preserve(destinationPath: string): string;
@@ -1,17 +1,14 @@
1
- import { cpSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, } from "node:fs";
1
+ import { cpSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync, } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
- import { dirname, join, relative, sep } from "node:path";
3
+ import { dirname, join } from "node:path";
4
4
  import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
5
- import { readInterfConfig } from "../project-model/interf.js";
6
- import { projectRawTestQueryShell } from "../agents/lib/shells.js";
7
- import { portableContextPath } from "../project-model/project-paths.js";
5
+ import { readInterfConfig, resolveSourceInputPath } from "../project-model/interf.js";
6
+ import { projectSourceFilesTestQueryShell } from "../agents/lib/shells.js";
7
+ import { asPreparationDataDir, preparationPortableContextPath, } from "../contracts/lib/preparation-paths.js";
8
8
  import { saveCompiledInterfConfig } from "../project-model/source-config.js";
9
- import { projectRawSnapshot, resolveCompiledRawPath } from "../compiler/raw-snapshot.js";
9
+ import { buildCompiledSourceFiles } from "../compiler/source-files.js";
10
10
  import { refreshCompiledArtifacts } from "../compiler/state.js";
11
11
  import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../compiler/compiled-paths.js";
12
- function toPortableRelativePath(fromPath, toPath) {
13
- return relative(fromPath, toPath).split(sep).join("/");
14
- }
15
12
  function sanitizeCompiledArtifacts(compiledPath) {
16
13
  for (const absolutePath of [
17
14
  testRootForCompiled(compiledPath),
@@ -28,16 +25,14 @@ export function createTestSandbox(target) {
28
25
  let sandboxRoot = mkdtempSync(join(tmpdir(), "interf-test-sandbox-"));
29
26
  let preserved = false;
30
27
  const sandboxCompiledPath = () => (target.type === "compiled"
31
- ? portableContextPath(sandboxRoot, target.name)
28
+ ? preparationPortableContextPath(asPreparationDataDir(sandboxRoot), target.name)
32
29
  : null);
33
- const sandboxRawPath = () => (target.type === "compiled"
34
- ? join(portableContextPath(sandboxRoot, target.name), "raw")
35
- : join(sandboxRoot, "raw"));
36
30
  const sandboxTargetPath = () => (target.type === "compiled"
37
- ? portableContextPath(sandboxRoot, target.name)
31
+ ? preparationPortableContextPath(asPreparationDataDir(sandboxRoot), target.name)
38
32
  : sandboxRoot);
39
33
  try {
40
34
  if (target.type === "compiled") {
35
+ const sourceInputPath = resolveSourceInputPath(target.path);
41
36
  mkdirSync(dirname(sandboxTargetPath()), { recursive: true });
42
37
  cpSync(target.path, sandboxTargetPath(), { recursive: true });
43
38
  sanitizeCompiledArtifacts(sandboxTargetPath());
@@ -45,29 +40,21 @@ export function createTestSandbox(target) {
45
40
  if (!sandboxConfig) {
46
41
  throw new Error(`Sandbox portable context is missing interf.json: ${sandboxTargetPath()}`);
47
42
  }
48
- if (!existsSync(resolveCompiledRawPath(sandboxTargetPath(), sandboxConfig))) {
49
- throw new Error(`Sandbox portable context is missing its local raw snapshot: ${sandboxTargetPath()}. Rebuild the portable context before testing it.`);
50
- }
51
43
  saveCompiledInterfConfig(sandboxTargetPath(), {
52
44
  ...sandboxConfig,
53
45
  checks: [],
54
46
  source: {
55
- path: toPortableRelativePath(sandboxTargetPath(), sandboxRawPath()),
47
+ path: sourceInputPath,
48
+ preparation_path: sourceInputPath,
56
49
  },
57
50
  });
58
51
  refreshCompiledBootstrapGuidance(sandboxTargetPath());
59
52
  refreshCompiledArtifacts(sandboxTargetPath(), { ensureViewSpec: true });
60
53
  }
61
54
  else {
62
- projectRawSnapshot({
63
- sourcePath: target.path,
64
- destinationPath: sandboxRawPath(),
65
- compiledPath: target.path,
66
- mode: "link-or-copy",
67
- prune: false,
68
- preserveTimestamps: false,
69
- });
70
- projectRawTestQueryShell(sandboxTargetPath());
55
+ mkdirSync(join(sandboxTargetPath(), "runtime"), { recursive: true });
56
+ writeFileSync(join(sandboxTargetPath(), "runtime", "source-files.json"), `${JSON.stringify(buildCompiledSourceFiles(sandboxTargetPath(), target.path), null, 2)}\n`);
57
+ projectSourceFilesTestQueryShell(sandboxTargetPath());
71
58
  }
72
59
  }
73
60
  catch (error) {
@@ -78,9 +65,6 @@ export function createTestSandbox(target) {
78
65
  get rootPath() {
79
66
  return sandboxRoot;
80
67
  },
81
- get rawPath() {
82
- return sandboxRawPath();
83
- },
84
68
  get targetPath() {
85
69
  return sandboxTargetPath();
86
70
  },
@@ -1,5 +1,5 @@
1
1
  import type { TestTargetCandidate } from "./test-types.js";
2
2
  export declare function listCompiledTestTargets(sourcePath: string): TestTargetCandidate[];
3
3
  export declare function createCompiledTestTarget(compiledPath: string, compiledName: string, methodId?: string): TestTargetCandidate;
4
- export declare function createRawTestTarget(sourcePath: string): TestTargetCandidate;
4
+ export declare function createSourceFilesTestTarget(sourcePath: string): TestTargetCandidate;
5
5
  export declare function listTestTargets(sourcePath: string): TestTargetCandidate[];
@@ -22,15 +22,15 @@ export function createCompiledTestTarget(compiledPath, compiledName, methodId =
22
22
  eligible: health.status === "compiled",
23
23
  };
24
24
  }
25
- export function createRawTestTarget(sourcePath) {
25
+ export function createSourceFilesTestTarget(sourcePath) {
26
26
  return {
27
- type: "raw",
28
- name: "raw",
27
+ type: "source-files",
28
+ name: "source-files",
29
29
  path: sourcePath,
30
- method: "raw",
30
+ method: "source-files",
31
31
  status: "compiled",
32
- stage: "raw",
33
- summary: "Run the checks against an isolated sandbox of the raw files.",
32
+ stage: "source-files",
33
+ summary: "Run the checks against source file references in an isolated test shell.",
34
34
  eligible: true,
35
35
  };
36
36
  }
@@ -1,4 +1,4 @@
1
1
  export type { TestCaseExpect, TestCase, TestSpec, TestCheckResult, TestCaseResult, TestTargetResult, TestTargetRun, TestTargetType, LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
2
2
  export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
3
- export { createRawTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
3
+ export { createSourceFilesTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
4
4
  export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
@@ -1,3 +1,3 @@
1
1
  export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
2
- export { createRawTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
2
+ export { createSourceFilesTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
3
3
  export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interf/compiler",
3
- "version": "0.9.4",
3
+ "version": "0.13.0",
4
4
  "description": "Interf prepares data for agent work. It runs locally, processes your files, shows evidence that your data is ready, and writes portable context: a local folder with verifiable outputs agents can use.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,17 +14,9 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "import": "./dist/index.js"
16
16
  },
17
- "./compiler": {
18
- "types": "./dist/packages/compiler/index.d.ts",
19
- "import": "./dist/packages/compiler/index.js"
20
- },
21
- "./method-package": {
22
- "types": "./dist/packages/method-package/index.d.ts",
23
- "import": "./dist/packages/method-package/index.js"
24
- },
25
- "./method-authoring": {
26
- "types": "./dist/packages/method-authoring/index.d.ts",
27
- "import": "./dist/packages/method-authoring/index.js"
17
+ "./contracts": {
18
+ "types": "./dist/packages/contracts/index.d.ts",
19
+ "import": "./dist/packages/contracts/index.js"
28
20
  },
29
21
  "./execution": {
30
22
  "types": "./dist/packages/execution/index.d.ts",
@@ -34,22 +26,10 @@
34
26
  "types": "./dist/packages/local-service/index.d.ts",
35
27
  "import": "./dist/packages/local-service/index.js"
36
28
  },
37
- "./project-model": {
38
- "types": "./dist/packages/project-model/index.d.ts",
39
- "import": "./dist/packages/project-model/index.js"
40
- },
41
- "./agents": {
42
- "types": "./dist/packages/agents/index.d.ts",
43
- "import": "./dist/packages/agents/index.js"
44
- },
45
- "./testing": {
46
- "types": "./dist/packages/testing/index.d.ts",
47
- "import": "./dist/packages/testing/index.js"
48
- },
49
29
  "./package.json": "./package.json"
50
30
  },
51
31
  "scripts": {
52
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && chmod 755 dist/bin.js",
32
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true});require('fs').rmSync('.tsbuildinfo',{force:true})\" && tsc && chmod 755 dist/bin.js",
53
33
  "dev": "tsc --watch",
54
34
  "web:dev": "npm --prefix apps/compiler-ui run dev",
55
35
  "web:typecheck": "npm --prefix apps/compiler-ui run typecheck",
@@ -87,7 +67,7 @@
87
67
  "claude",
88
68
  "codex"
89
69
  ],
90
- "license": "Apache-2.0",
70
+ "license": "UNLICENSED",
91
71
  "repository": {
92
72
  "type": "git",
93
73
  "url": "git+https://github.com/interf-labs/interf.git"