@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
@@ -1,58 +0,0 @@
1
- import type { TestTargetCandidate, TestTargetResult } from "../../packages/testing/test.js";
2
- import type { MethodExecutionProfile, MethodExecutor } from "../../packages/agents/lib/executors.js";
3
- import type { TestSandboxRetentionMode } from "../../packages/testing/test-sandbox.js";
4
- import type { SourcePreparationConfig } from "../../packages/project-model/lib/schema.js";
5
- import type { ReadinessCheckRun, TestRunMode } from "../../packages/testing/lib/schema.js";
6
- export interface SavedTestOutcome {
7
- runPath: string;
8
- displayRunPath?: string;
9
- target: TestTargetCandidate;
10
- result: TestTargetResult;
11
- }
12
- export interface AgentTestMatrixRow {
13
- agentLabel: string;
14
- rawOutcome?: SavedTestOutcome | null;
15
- compiledOutcome?: SavedTestOutcome | null;
16
- }
17
- export declare function readinessPassRate(outcome: SavedTestOutcome): number;
18
- export declare function readSavedTestComparison(projectPath: string, preparationName: string): ReadinessCheckRun | null;
19
- export declare function readCurrentSavedTestComparison(options: {
20
- projectPath: string;
21
- preparationName: string;
22
- checks: SourcePreparationConfig["checks"];
23
- }): {
24
- comparison: ReadinessCheckRun | null;
25
- stale: boolean;
26
- };
27
- export declare function printSavedTestComparisonState(payload: ReadinessCheckRun, comparisonRunPath?: string | null): void;
28
- export declare function printAgentTestMatrix(rows: AgentTestMatrixRow[]): void;
29
- export declare function printAgentTestFailures(rows: AgentTestMatrixRow[]): void;
30
- export declare function printSavedTestOutcome(prefix: string, outcome: SavedTestOutcome): void;
31
- export declare function printSavedTestComparison(rawOutcome: SavedTestOutcome | null, compiledOutcome: SavedTestOutcome | null, comparisonRunPath?: string | null): void;
32
- export declare function printSavedTestComparisonSummary(rawOutcome: SavedTestOutcome | null, compiledOutcome: SavedTestOutcome | null, comparisonRunPath?: string | null): void;
33
- export declare function saveTestComparisonRun(options: {
34
- sourcePath: string;
35
- compiledPath: string | null;
36
- compiledName: string;
37
- checksFingerprint: string;
38
- mode: TestRunMode;
39
- rawOutcome: SavedTestOutcome | null;
40
- compiledOutcome: SavedTestOutcome | null;
41
- }): string;
42
- export declare function runSavedRawTest(options: {
43
- sourcePath: string;
44
- preparationConfig: SourcePreparationConfig;
45
- executor?: MethodExecutor | null;
46
- executionProfile?: MethodExecutionProfile;
47
- preserveSandboxes?: TestSandboxRetentionMode;
48
- runSuffix?: string | null;
49
- }): Promise<SavedTestOutcome | null>;
50
- export declare function runSavedCompiledTest(options: {
51
- sourcePath: string;
52
- preparationConfig: SourcePreparationConfig;
53
- executor?: MethodExecutor | null;
54
- executionProfile?: MethodExecutionProfile;
55
- compiledPath?: string | null;
56
- preserveSandboxes?: TestSandboxRetentionMode;
57
- runSuffix?: string | null;
58
- }): Promise<SavedTestOutcome | null>;
@@ -1,231 +0,0 @@
1
- import chalk from "chalk";
2
- import { readinessPassRate as readinessPassRateForOutcome, readCurrentSavedReadinessCheckRun, readSavedReadinessCheckRun, runSavedPortableContextCheck, runSavedSourceFilesCheck, saveReadinessCheckRun, } from "../../packages/testing/readiness-check-run.js";
3
- import { findBuiltCompiledPath } from "./compiled-flow.js";
4
- export function readinessPassRate(outcome) {
5
- return readinessPassRateForOutcome(outcome);
6
- }
7
- function visibleRunPath(outcome) {
8
- return outcome.displayRunPath ?? outcome.runPath;
9
- }
10
- function loadLatestComparison(projectPath, preparationName) {
11
- return readSavedReadinessCheckRun(projectPath, preparationName);
12
- }
13
- export function readSavedTestComparison(projectPath, preparationName) {
14
- return loadLatestComparison(projectPath, preparationName);
15
- }
16
- export function readCurrentSavedTestComparison(options) {
17
- return readCurrentSavedReadinessCheckRun({
18
- projectPath: options.projectPath,
19
- preparationName: options.preparationName,
20
- checks: options.checks,
21
- });
22
- }
23
- export function printSavedTestComparisonState(payload, comparisonRunPath) {
24
- console.log();
25
- console.log(chalk.bold(" Latest readiness results"));
26
- console.log();
27
- console.log(" | Target | Readiness checks |");
28
- console.log(" | --- | --- |");
29
- if (payload.raw) {
30
- console.log(` | Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
31
- }
32
- if (payload.compiled) {
33
- console.log(` | Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
34
- }
35
- if (!payload.raw || !payload.compiled) {
36
- console.log();
37
- if (!payload.raw) {
38
- console.log(chalk.dim(" No saved source-files baseline yet."));
39
- }
40
- if (!payload.compiled) {
41
- console.log(chalk.dim(" No saved portable-context run yet."));
42
- }
43
- }
44
- if (payload.summary.raw_pass_rate != null && payload.summary.compiled_pass_rate != null) {
45
- const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
46
- const color = (payload.summary.pass_rate_delta ?? 0) >= 0 ? chalk.green : chalk.red;
47
- console.log();
48
- console.log(color(` Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`));
49
- }
50
- if (comparisonRunPath) {
51
- console.log();
52
- console.log(chalk.dim(` Saved summary: ${comparisonRunPath}`));
53
- }
54
- }
55
- function padCell(value, width) {
56
- return value.padEnd(width, " ");
57
- }
58
- function resultCell(outcome) {
59
- if (!outcome)
60
- return "—";
61
- return `${outcome.result.passedCases}/${outcome.result.totalCases}`;
62
- }
63
- function deltaCell(row) {
64
- if (!row.rawOutcome || !row.compiledOutcome)
65
- return "—";
66
- const delta = row.compiledOutcome.result.passedCases - row.rawOutcome.result.passedCases;
67
- return delta > 0 ? `+${delta}` : `${delta}`;
68
- }
69
- export function printAgentTestMatrix(rows) {
70
- if (rows.length === 0)
71
- return;
72
- const includeRaw = rows.some((row) => Boolean(row.rawOutcome));
73
- const includeCompiled = rows.some((row) => Boolean(row.compiledOutcome));
74
- const includeDelta = includeRaw && includeCompiled;
75
- const headers = [
76
- "Agent",
77
- ...(includeRaw ? ["Source files"] : []),
78
- ...(includeCompiled ? ["Portable Context"] : []),
79
- ...(includeDelta ? ["Delta"] : []),
80
- ];
81
- const body = rows.map((row) => [
82
- row.agentLabel,
83
- ...(includeRaw ? [resultCell(row.rawOutcome)] : []),
84
- ...(includeCompiled ? [resultCell(row.compiledOutcome)] : []),
85
- ...(includeDelta ? [deltaCell(row)] : []),
86
- ]);
87
- const widths = headers.map((header, index) => Math.max(header.length, ...body.map((row) => (row[index] ?? "").length)));
88
- const heading = includeDelta ? " Comparison" : " Results";
89
- console.log();
90
- console.log(chalk.bold(heading));
91
- console.log();
92
- console.log(` | ${headers.map((header, index) => padCell(header, widths[index] ?? header.length)).join(" | ")} |`);
93
- console.log(` | ${widths.map((width) => "-".repeat(width)).join(" | ")} |`);
94
- for (const row of body) {
95
- console.log(` | ${row.map((cell, index) => padCell(cell ?? "", widths[index] ?? cell.length)).join(" | ")} |`);
96
- }
97
- }
98
- export function printAgentTestFailures(rows) {
99
- for (const row of rows) {
100
- const failures = [];
101
- for (const [label, outcome] of [
102
- ["Source files", row.rawOutcome ?? null],
103
- ["Portable Context", row.compiledOutcome ?? null],
104
- ]) {
105
- if (!outcome || outcome.result.ok)
106
- continue;
107
- for (const [index, caseResult] of outcome.result.caseResults.entries()) {
108
- if (caseResult.ok)
109
- continue;
110
- const reason = caseResult.checks.find((entry) => !entry.ok)?.detail ?? "failed";
111
- failures.push(`${label} · Check ${index + 1}: ${reason}`);
112
- }
113
- }
114
- if (failures.length === 0)
115
- continue;
116
- console.log();
117
- console.log(chalk.bold(` ${row.agentLabel} failures`));
118
- console.log();
119
- for (const failure of failures) {
120
- console.log(` - ${failure}`);
121
- }
122
- }
123
- }
124
- export function printSavedTestOutcome(prefix, outcome) {
125
- const color = outcome.result.ok ? chalk.green : chalk.red;
126
- const status = outcome.result.ok ? chalk.green("PASS") : chalk.red("FAIL");
127
- console.log(chalk.bold(` ${prefix}`));
128
- console.log();
129
- console.log(color(` ${status} ${outcome.result.passedCases}/${outcome.result.totalCases} readiness checks`));
130
- console.log();
131
- for (const [index, caseResult] of outcome.result.caseResults.entries()) {
132
- const caseStatus = caseResult.ok ? chalk.green("PASS") : chalk.red("FAIL");
133
- console.log(` ${caseStatus} Check ${index + 1}`);
134
- console.log(chalk.dim(` ${caseResult.question}`));
135
- const failedChecks = caseResult.checks.filter((entry) => !entry.ok).slice(0, 3);
136
- for (const failedCheck of failedChecks) {
137
- console.log(chalk.dim(` Failed criterion: ${failedCheck.label}: ${failedCheck.detail}`));
138
- }
139
- }
140
- console.log();
141
- if (outcome.result.sandbox_path) {
142
- console.log(chalk.dim(` Preserved sandbox: ${outcome.result.sandbox_path}`));
143
- console.log();
144
- }
145
- console.log(chalk.dim(` Saved run: ${visibleRunPath(outcome)}`));
146
- }
147
- export function printSavedTestComparison(rawOutcome, compiledOutcome, comparisonRunPath) {
148
- if (!rawOutcome && !compiledOutcome)
149
- return;
150
- console.log();
151
- if (rawOutcome) {
152
- printSavedTestOutcome("Source files", rawOutcome);
153
- }
154
- if (compiledOutcome) {
155
- if (rawOutcome)
156
- console.log();
157
- printSavedTestOutcome("Portable Context", compiledOutcome);
158
- }
159
- if (rawOutcome && compiledOutcome) {
160
- const rawReadiness = readinessPassRate(rawOutcome);
161
- const compiledReadiness = readinessPassRate(compiledOutcome);
162
- const delta = compiledReadiness - rawReadiness;
163
- const color = delta >= 0 ? chalk.green : chalk.red;
164
- const direction = delta >= 0 ? "improved" : "decreased";
165
- console.log();
166
- console.log(color(` Readiness-check pass rate ${direction} from ${rawReadiness}% to ${compiledReadiness}%.`));
167
- }
168
- if (comparisonRunPath) {
169
- console.log();
170
- console.log(chalk.dim(` Saved summary: ${comparisonRunPath}`));
171
- }
172
- }
173
- export function printSavedTestComparisonSummary(rawOutcome, compiledOutcome, comparisonRunPath) {
174
- if (!rawOutcome && !compiledOutcome)
175
- return;
176
- console.log();
177
- console.log(chalk.bold(" Comparison"));
178
- console.log();
179
- console.log(" | Target | Readiness checks |");
180
- console.log(" | --- | --- |");
181
- if (rawOutcome) {
182
- console.log(` | Source files | \`${rawOutcome.result.passedCases}/${rawOutcome.result.totalCases}\` |`);
183
- }
184
- if (compiledOutcome) {
185
- console.log(` | Portable Context | \`${compiledOutcome.result.passedCases}/${compiledOutcome.result.totalCases}\` |`);
186
- }
187
- if (rawOutcome && compiledOutcome) {
188
- const rawReadiness = readinessPassRate(rawOutcome);
189
- const compiledReadiness = readinessPassRate(compiledOutcome);
190
- const delta = compiledReadiness - rawReadiness;
191
- const color = delta >= 0 ? chalk.green : chalk.red;
192
- const direction = delta >= 0 ? "improved" : "decreased";
193
- console.log();
194
- console.log(color(` Readiness-check pass rate ${direction} from ${rawReadiness}% to ${compiledReadiness}%.`));
195
- }
196
- if (comparisonRunPath) {
197
- console.log();
198
- console.log(chalk.dim(` Saved summary: ${comparisonRunPath}`));
199
- }
200
- }
201
- export function saveTestComparisonRun(options) {
202
- return saveReadinessCheckRun({
203
- sourcePath: options.sourcePath,
204
- portableContextPath: options.compiledPath,
205
- preparationName: options.compiledName,
206
- checksFingerprint: options.checksFingerprint,
207
- mode: options.mode,
208
- rawOutcome: options.rawOutcome,
209
- compiledOutcome: options.compiledOutcome,
210
- });
211
- }
212
- export async function runSavedRawTest(options) {
213
- return runSavedSourceFilesCheck({
214
- sourcePath: options.sourcePath,
215
- preparationConfig: options.preparationConfig,
216
- executor: options.executor,
217
- preserveSandboxes: options.preserveSandboxes ?? "on-failure",
218
- runSuffix: options.runSuffix,
219
- });
220
- }
221
- export async function runSavedCompiledTest(options) {
222
- const compiledPath = options.compiledPath ?? findBuiltCompiledPath(options.sourcePath, options.preparationConfig.name);
223
- return runSavedPortableContextCheck({
224
- sourcePath: options.sourcePath,
225
- preparationConfig: options.preparationConfig,
226
- executor: options.executor,
227
- portableContextPath: compiledPath,
228
- preserveSandboxes: options.preserveSandboxes ?? "on-failure",
229
- runSuffix: options.runSuffix,
230
- });
231
- }
@@ -1,2 +0,0 @@
1
- import type { CommandModule } from "yargs";
2
- export declare const verifyCommand: CommandModule;
@@ -1,94 +0,0 @@
1
- import chalk from "chalk";
2
- import { detectInterf } from "../../packages/project-model/interf.js";
3
- import { validateCompiledCompile, validateCompiledStage, } from "../../packages/compiler/validate.js";
4
- import { validateMethodPackage } from "../../packages/method-package/local-methods.js";
5
- function normalizeVerifyCheck(value) {
6
- if (!value)
7
- return null;
8
- if (value === "stage")
9
- return "stage";
10
- if (value === "portable-context")
11
- return "portable-context";
12
- if (value === "method")
13
- return "method";
14
- return null;
15
- }
16
- export const verifyCommand = {
17
- command: "verify <check> [stageId]",
18
- describe: "Run deterministic verification checks",
19
- builder: (yargs) => yargs
20
- .positional("check", {
21
- type: "string",
22
- describe: "Check to run (`stage`, `portable-context`, or `method`)",
23
- })
24
- .positional("stageId", {
25
- type: "string",
26
- describe: "Stage id when using `verify stage <stage-id>`",
27
- })
28
- .option("path", {
29
- type: "string",
30
- describe: "Path to a Method package when using `verify method`",
31
- })
32
- .option("json", {
33
- type: "boolean",
34
- default: false,
35
- describe: "Print JSON output",
36
- }),
37
- handler: async (argv) => {
38
- const check = normalizeVerifyCheck(argv.check);
39
- if (!check) {
40
- process.exitCode = 1;
41
- console.log(chalk.red(`Unknown verify check: ${String(argv.check)}`));
42
- return;
43
- }
44
- let result;
45
- if (check === "method") {
46
- const path = argv.path;
47
- if (!path) {
48
- process.exitCode = 1;
49
- console.log(chalk.red("`interf verify method` needs --path <method-dir>."));
50
- return;
51
- }
52
- result = validateMethodPackage(path);
53
- }
54
- else {
55
- const detected = detectInterf(process.cwd());
56
- if (!detected) {
57
- process.exitCode = 1;
58
- console.log(chalk.red("Run this from inside Portable Context."));
59
- return;
60
- }
61
- if (check === "portable-context") {
62
- result = validateCompiledCompile(detected.path);
63
- }
64
- else {
65
- const stageId = argv.stageId;
66
- if (!stageId) {
67
- process.exitCode = 1;
68
- console.log(chalk.red("`interf verify stage` needs <stage-id>."));
69
- return;
70
- }
71
- result = validateCompiledStage(detected.path, stageId);
72
- }
73
- }
74
- if (argv.json) {
75
- console.log(JSON.stringify(result, null, 2));
76
- if (typeof result === "object" && result && "ok" in result && !result.ok) {
77
- process.exitCode = 1;
78
- }
79
- return;
80
- }
81
- const typed = result;
82
- console.log();
83
- if (typed.ok) {
84
- console.log(chalk.green(` ${typed.summary ?? "Verification passed."}`));
85
- }
86
- else {
87
- process.exitCode = 1;
88
- console.log(chalk.red(` ${typed.summary ?? "Verification failed."}`));
89
- for (const error of typed.errors ?? []) {
90
- console.log(chalk.dim(` - ${error}`));
91
- }
92
- }
93
- },
94
- };