@interf/compiler 0.9.1 → 0.9.3
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.
- package/README.md +9 -9
- package/agent-skills/interf-actions/SKILL.md +3 -0
- package/agent-skills/interf-actions/references/cli.md +13 -13
- package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +2 -2
- package/builtin-methods/interf-default/improve/SKILL.md +18 -0
- package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +4 -4
- package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +2 -2
- package/dist/cli/commands/check-draft.d.ts +6 -6
- package/dist/cli/commands/check-draft.js +5 -5
- package/dist/cli/commands/compile-controller.d.ts +7 -7
- package/dist/cli/commands/compile-controller.js +35 -38
- package/dist/cli/commands/compile.d.ts +3 -3
- package/dist/cli/commands/compile.js +23 -21
- package/dist/cli/commands/compiled-flow.d.ts +11 -11
- package/dist/cli/commands/compiled-flow.js +33 -30
- package/dist/cli/commands/create-method-wizard.d.ts +76 -0
- package/dist/cli/commands/{create-workflow-wizard.js → create-method-wizard.js} +153 -163
- package/dist/cli/commands/create.d.ts +3 -3
- package/dist/cli/commands/create.js +44 -45
- package/dist/cli/commands/default.js +1 -1
- package/dist/cli/commands/executor-flow.d.ts +6 -6
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.d.ts +2 -2
- package/dist/cli/commands/init.js +139 -118
- package/dist/cli/commands/list.js +11 -10
- package/dist/cli/commands/preparation-selection.d.ts +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +9 -9
- package/dist/cli/commands/source-config-wizard.js +43 -43
- package/dist/cli/commands/status.js +36 -9
- package/dist/cli/commands/test-flow.d.ts +15 -15
- package/dist/cli/commands/test-flow.js +29 -219
- package/dist/cli/commands/test.d.ts +2 -2
- package/dist/cli/commands/test.js +50 -51
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/web.js +41 -28
- package/dist/compiler-ui/404.html +1 -0
- package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
- package/dist/compiler-ui/__next._full.txt +20 -0
- package/dist/compiler-ui/__next._head.txt +5 -0
- package/dist/compiler-ui/__next._index.txt +5 -0
- package/dist/compiler-ui/__next._tree.txt +5 -0
- package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
- package/{apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css → dist/compiler-ui/_next/static/chunks/0c9mu7yldxyyg.css} +1 -1
- package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/15mks7ry_cupt.js} +15 -21
- package/{apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js → dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js} +1 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
- package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
- package/dist/compiler-ui/_not-found.html +1 -0
- package/dist/compiler-ui/_not-found.txt +15 -0
- package/{apps/compiler-ui/.next/server/app → dist/compiler-ui}/index.html +1 -1
- package/dist/compiler-ui/index.txt +20 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +5 -3
- package/dist/packages/agents/index.d.ts +1 -1
- package/dist/packages/agents/lib/args.d.ts +2 -2
- package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
- package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
- package/dist/packages/agents/lib/execution-profile.js +7 -6
- package/dist/packages/agents/lib/executors.d.ts +13 -13
- package/dist/packages/agents/lib/preflight.d.ts +1 -0
- package/dist/packages/agents/lib/preflight.js +32 -9
- package/dist/packages/agents/lib/shells.d.ts +25 -24
- package/dist/packages/agents/lib/shells.js +161 -154
- package/dist/packages/agents/lib/types.d.ts +2 -2
- package/dist/packages/compiler/artifact-counts.d.ts +1 -0
- package/dist/packages/compiler/artifact-counts.js +30 -0
- package/dist/packages/compiler/compiled-paths.d.ts +4 -7
- package/dist/packages/compiler/compiled-paths.js +9 -15
- package/dist/packages/compiler/compiled-pipeline.d.ts +11 -12
- package/dist/packages/compiler/compiled-pipeline.js +22 -22
- package/dist/packages/compiler/compiled-schema.d.ts +20 -20
- package/dist/packages/compiler/compiled-schema.js +29 -29
- package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
- package/dist/packages/compiler/compiled-stage-plan.js +8 -8
- package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -5
- package/dist/packages/compiler/compiled-stage-runner.js +7 -7
- package/dist/packages/compiler/compiled-target.d.ts +5 -5
- package/dist/packages/compiler/compiled-target.js +5 -5
- package/dist/packages/compiler/index.d.ts +3 -3
- package/dist/packages/compiler/index.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +62 -247
- package/dist/packages/compiler/lib/schema.js +56 -174
- package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
- package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -7
- package/dist/packages/compiler/raw-snapshot.js +0 -1
- package/dist/packages/compiler/reset.js +3 -3
- package/dist/packages/compiler/runtime-acceptance.js +9 -16
- package/dist/packages/compiler/runtime-contracts.js +9 -9
- package/dist/packages/compiler/runtime-prompt.js +4 -4
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +9 -9
- package/dist/packages/compiler/runtime-types.d.ts +8 -7
- package/dist/packages/compiler/state-health.js +26 -35
- package/dist/packages/compiler/state-view.js +6 -6
- package/dist/packages/compiler/validate-compiled.d.ts +5 -5
- package/dist/packages/compiler/validate-compiled.js +56 -64
- package/dist/packages/compiler/validate.d.ts +2 -2
- package/dist/packages/compiler/validate.js +22 -14
- package/dist/packages/contracts/index.d.ts +2 -0
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/schema.d.ts +205 -0
- package/dist/packages/contracts/lib/schema.js +101 -0
- package/dist/packages/execution/index.d.ts +2 -2
- package/dist/packages/execution/index.js +1 -1
- package/dist/packages/execution/lib/schema.d.ts +80 -83
- package/dist/packages/execution/lib/schema.js +25 -48
- package/dist/packages/local-service/action-values.d.ts +0 -1
- package/dist/packages/local-service/action-values.js +0 -1
- package/dist/packages/local-service/client.d.ts +4 -4
- package/dist/packages/local-service/client.js +4 -4
- package/dist/packages/local-service/index.d.ts +3 -3
- package/dist/packages/local-service/index.js +2 -2
- package/dist/packages/local-service/lib/schema.d.ts +536 -974
- package/dist/packages/local-service/lib/schema.js +43 -160
- package/dist/packages/local-service/run-observability.d.ts +6 -0
- package/dist/packages/local-service/run-observability.js +592 -0
- package/dist/packages/local-service/runtime.d.ts +19 -23
- package/dist/packages/local-service/runtime.js +302 -880
- package/dist/packages/local-service/server.d.ts +1 -0
- package/dist/packages/local-service/server.js +25 -20
- package/dist/packages/method-authoring/index.d.ts +4 -0
- package/dist/packages/method-authoring/index.js +4 -0
- package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
- package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
- package/dist/packages/method-authoring/method-authoring.js +116 -0
- package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
- package/dist/packages/method-authoring/method-edit-session.js +125 -0
- package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
- package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +63 -63
- package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
- package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
- package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
- package/dist/packages/{workflow-package → method-package}/context-interface.js +19 -19
- package/dist/packages/method-package/index.d.ts +11 -0
- package/dist/packages/method-package/index.js +11 -0
- package/dist/packages/method-package/interf-method-package.d.ts +31 -0
- package/dist/packages/{workflow-package/interf-workflow-package.js → method-package/interf-method-package.js} +145 -145
- package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
- package/dist/packages/method-package/local-methods.d.ts +64 -0
- package/dist/packages/method-package/local-methods.js +466 -0
- package/dist/packages/method-package/method-definitions.d.ts +83 -0
- package/dist/packages/method-package/method-definitions.js +205 -0
- package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
- package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +22 -26
- package/dist/packages/method-package/method-review-paths.d.ts +10 -0
- package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
- package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +12 -11
- package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +6 -6
- package/dist/packages/methods/index.d.ts +2 -0
- package/dist/packages/methods/index.js +2 -0
- package/dist/packages/methods/method-resolution.d.ts +6 -0
- package/dist/packages/methods/method-resolution.js +7 -0
- package/dist/packages/project-model/index.d.ts +1 -4
- package/dist/packages/project-model/index.js +0 -3
- package/dist/packages/project-model/interf-detect.d.ts +1 -5
- package/dist/packages/project-model/interf-detect.js +7 -18
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
- package/dist/packages/project-model/interf-scaffold.js +38 -39
- package/dist/packages/project-model/interf.d.ts +1 -2
- package/dist/packages/project-model/interf.js +1 -2
- package/dist/packages/project-model/lib/schema.d.ts +2 -66
- package/dist/packages/project-model/lib/schema.js +5 -23
- package/dist/packages/project-model/project-paths.d.ts +9 -10
- package/dist/packages/project-model/project-paths.js +14 -17
- package/dist/packages/project-model/source-config.d.ts +11 -18
- package/dist/packages/project-model/source-config.js +42 -60
- package/dist/packages/project-model/source-folders.d.ts +4 -4
- package/dist/packages/project-model/source-folders.js +10 -10
- package/dist/packages/testing/index.d.ts +2 -2
- package/dist/packages/testing/index.js +1 -1
- package/dist/packages/testing/lib/schema.d.ts +11 -11
- package/dist/packages/testing/lib/schema.js +8 -9
- package/dist/packages/testing/readiness-check-run.d.ts +67 -0
- package/dist/packages/testing/readiness-check-run.js +258 -0
- package/dist/packages/testing/test-execution.d.ts +3 -3
- package/dist/packages/testing/test-execution.js +5 -5
- package/dist/packages/testing/test-paths.js +6 -6
- package/dist/packages/testing/test-profile-presets.js +2 -2
- package/dist/packages/testing/test-sandbox.js +10 -11
- package/dist/packages/testing/test-targets.d.ts +1 -1
- package/dist/packages/testing/test-targets.js +8 -7
- package/dist/packages/testing/test-types.d.ts +1 -1
- package/package.json +16 -33
- package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +0 -5
- package/builtin-workflows/interf/improve/SKILL.md +0 -18
- package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
- package/dist/packages/project-model/compiled-paths.d.ts +0 -1
- package/dist/packages/project-model/compiled-paths.js +0 -1
- package/dist/packages/project-model/compiled-raw.d.ts +0 -1
- package/dist/packages/project-model/compiled-raw.js +0 -1
- package/dist/packages/project-model/compiled-reset.d.ts +0 -1
- package/dist/packages/project-model/compiled-reset.js +0 -1
- package/dist/packages/shared/index.d.ts +0 -7
- package/dist/packages/shared/index.js +0 -7
- package/dist/packages/shared/util.d.ts +0 -3
- package/dist/packages/shared/util.js +0 -3
- package/dist/packages/testing/test-matrices.d.ts +0 -90
- package/dist/packages/testing/test-matrices.js +0 -96
- package/dist/packages/workflow-authoring/index.d.ts +0 -4
- package/dist/packages/workflow-authoring/index.js +0 -4
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
- package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
- package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
- package/dist/packages/workflow-package/index.d.ts +0 -11
- package/dist/packages/workflow-package/index.js +0 -11
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
- package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
- package/dist/packages/workflow-package/local-workflows.js +0 -457
- package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
- package/dist/packages/workflow-package/workflow-definitions.js +0 -211
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_buildManifest.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_clientMiddlewareManifest.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_ssgManifest.js +0 -0
- /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
- /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
- /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
- /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
|
@@ -3,9 +3,10 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
|
3
3
|
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
5
5
|
import { readInterfConfig, } from "./interf.js";
|
|
6
|
-
import {
|
|
6
|
+
import { seedCompiledMethodPackage } from "../method-package/interf-method-package.js";
|
|
7
7
|
import { readJsonFileWithSchema } from "../shared/parse.js";
|
|
8
|
-
import {
|
|
8
|
+
import { getCompiledMethod } from "../method-package/method-definitions.js";
|
|
9
|
+
import { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, } from "../methods/method-resolution.js";
|
|
9
10
|
import { SourceFolderConfigSchema, } from "./lib/schema.js";
|
|
10
11
|
import { slugify } from "../shared/naming.js";
|
|
11
12
|
import { assertPathWithinRoot, isPathWithinRoot } from "../shared/path-guards.js";
|
|
@@ -60,9 +61,7 @@ export function loadSourceFolderConfig(sourcePath) {
|
|
|
60
61
|
return null;
|
|
61
62
|
return readSourceFolderConfigFile(filePath);
|
|
62
63
|
}
|
|
63
|
-
export
|
|
64
|
-
return preparationConfig?.method ?? preparationConfig?.workflow ?? null;
|
|
65
|
-
}
|
|
64
|
+
export { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig } from "../methods/method-resolution.js";
|
|
66
65
|
function normalizeSourcePreparationConfig(preparationConfig) {
|
|
67
66
|
const method = methodIdForSourcePreparationConfig(preparationConfig);
|
|
68
67
|
return {
|
|
@@ -71,15 +70,10 @@ function normalizeSourcePreparationConfig(preparationConfig) {
|
|
|
71
70
|
};
|
|
72
71
|
}
|
|
73
72
|
export function listSourcePreparationConfigs(config) {
|
|
74
|
-
|
|
75
|
-
const preparations = explicitPreparations.length > 0
|
|
76
|
-
? explicitPreparations
|
|
77
|
-
: config?.datasets ?? [];
|
|
78
|
-
return preparations.map((preparation) => normalizeSourcePreparationConfig(preparation));
|
|
73
|
+
return (config?.preparations ?? []).map((preparation) => normalizeSourcePreparationConfig(preparation));
|
|
79
74
|
}
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
const configured = override ?? datasetConfig.max_attempts ?? null;
|
|
75
|
+
export function resolvePreparationCompileMaxAttempts(preparationConfig, override = null) {
|
|
76
|
+
const configured = override ?? preparationConfig.max_attempts ?? null;
|
|
83
77
|
if (configured == null)
|
|
84
78
|
return null;
|
|
85
79
|
const normalized = Math.trunc(configured);
|
|
@@ -87,8 +81,8 @@ export function resolveDatasetCompileMaxAttempts(datasetConfig, override = null)
|
|
|
87
81
|
return 1;
|
|
88
82
|
return Math.min(5, normalized);
|
|
89
83
|
}
|
|
90
|
-
export function
|
|
91
|
-
const configured = override ??
|
|
84
|
+
export function resolvePreparationCompileMaxLoops(preparationConfig, override = null) {
|
|
85
|
+
const configured = override ?? preparationConfig.max_loops ?? null;
|
|
92
86
|
if (configured == null)
|
|
93
87
|
return null;
|
|
94
88
|
const normalized = Math.trunc(configured);
|
|
@@ -100,11 +94,9 @@ export function getDefaultSourcePreparationConfig(config) {
|
|
|
100
94
|
const preparations = listSourcePreparationConfigs(config);
|
|
101
95
|
return preparations[0] ?? null;
|
|
102
96
|
}
|
|
103
|
-
export const getDefaultSourceDatasetConfig = getDefaultSourcePreparationConfig;
|
|
104
97
|
export function findSourcePreparationConfig(config, preparationName) {
|
|
105
98
|
return listSourcePreparationConfigs(config).find((preparation) => preparation.name === preparationName) ?? null;
|
|
106
99
|
}
|
|
107
|
-
export const findSourceDatasetConfig = findSourcePreparationConfig;
|
|
108
100
|
export function configuredSourceFolderPath(config) {
|
|
109
101
|
return config?.source_folder?.path ?? null;
|
|
110
102
|
}
|
|
@@ -113,10 +105,7 @@ export function resolveConfiguredSourceFolderPath(sourcePath, config = loadSourc
|
|
|
113
105
|
return configuredPath ? resolve(sourcePath, configuredPath) : null;
|
|
114
106
|
}
|
|
115
107
|
function toWritableSourceProjectConfig(config) {
|
|
116
|
-
const
|
|
117
|
-
const preparations = explicitPreparations.length > 0
|
|
118
|
-
? explicitPreparations
|
|
119
|
-
: config?.datasets ?? [];
|
|
108
|
+
const preparations = config?.preparations ?? [];
|
|
120
109
|
const sourceFolder = config?.source_folder;
|
|
121
110
|
if (preparations.length > 0) {
|
|
122
111
|
return {
|
|
@@ -135,13 +124,12 @@ function toWritableSourcePreparationConfig(preparation) {
|
|
|
135
124
|
name: preparation.name,
|
|
136
125
|
path: preparation.path,
|
|
137
126
|
...(preparation.about ? { about: preparation.about } : {}),
|
|
138
|
-
|
|
127
|
+
method: method ?? DEFAULT_METHOD_ID,
|
|
139
128
|
...(typeof preparation.max_attempts === "number" ? { max_attempts: preparation.max_attempts } : {}),
|
|
140
129
|
...(typeof preparation.max_loops === "number" ? { max_loops: preparation.max_loops } : {}),
|
|
141
130
|
checks: preparation.checks,
|
|
142
131
|
};
|
|
143
132
|
}
|
|
144
|
-
const toWritableSourceDatasetConfig = toWritableSourcePreparationConfig;
|
|
145
133
|
export function saveSourceFolderConfig(sourcePath, config) {
|
|
146
134
|
const existing = loadSourceFolderConfig(sourcePath);
|
|
147
135
|
const mergedConfig = {
|
|
@@ -151,7 +139,7 @@ export function saveSourceFolderConfig(sourcePath, config) {
|
|
|
151
139
|
mkdirSync(projectInterfRoot(sourcePath), { recursive: true });
|
|
152
140
|
writeFileSync(sourceFolderConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(mergedConfig), null, 2) + "\n");
|
|
153
141
|
}
|
|
154
|
-
export function
|
|
142
|
+
export function appendSourcePreparationChecks(sourcePath, preparationName, checks) {
|
|
155
143
|
const existing = loadSourceFolderConfig(sourcePath);
|
|
156
144
|
const currentPreparation = findSourcePreparationConfig(existing, preparationName);
|
|
157
145
|
const otherPreparations = listSourcePreparationConfigs(existing).filter((preparation) => preparation.name !== preparationName);
|
|
@@ -171,8 +159,7 @@ export function appendSourceDatasetChecks(sourcePath, preparationName, checks) {
|
|
|
171
159
|
],
|
|
172
160
|
});
|
|
173
161
|
}
|
|
174
|
-
export
|
|
175
|
-
export function upsertSourceDatasetConfig(sourcePath, preparationConfig, options = {}) {
|
|
162
|
+
export function upsertSourcePreparationConfig(sourcePath, preparationConfig, options = {}) {
|
|
176
163
|
const existing = loadSourceFolderConfig(sourcePath);
|
|
177
164
|
const preparations = listSourcePreparationConfigs(existing);
|
|
178
165
|
const candidateNames = Array.from(new Set([preparationConfig.name, options.matchName].filter((value) => Boolean(value))));
|
|
@@ -187,24 +174,22 @@ export function upsertSourceDatasetConfig(sourcePath, preparationConfig, options
|
|
|
187
174
|
preparations,
|
|
188
175
|
});
|
|
189
176
|
}
|
|
190
|
-
export const upsertSourcePreparationConfig = upsertSourceDatasetConfig;
|
|
191
177
|
export function compiledMaxAttempts(maxAttempts) {
|
|
192
178
|
if (maxAttempts == null)
|
|
193
179
|
return undefined;
|
|
194
|
-
return
|
|
180
|
+
return resolvePreparationCompileMaxAttempts({ max_attempts: maxAttempts }, null) ?? 1;
|
|
195
181
|
}
|
|
196
182
|
export function compiledMaxLoops(maxLoops) {
|
|
197
183
|
if (maxLoops == null)
|
|
198
184
|
return undefined;
|
|
199
|
-
return
|
|
185
|
+
return resolvePreparationCompileMaxLoops({ max_loops: maxLoops }, null) ?? 1;
|
|
200
186
|
}
|
|
201
|
-
export function
|
|
202
|
-
const method = config.method ?? config.workflow;
|
|
187
|
+
export function sourcePreparationConfigFromInterfConfig(config, preparationPath = `./${config.name}`) {
|
|
203
188
|
return {
|
|
204
189
|
name: config.name,
|
|
205
190
|
path: preparationPath,
|
|
206
191
|
...(config.about ? { about: config.about } : {}),
|
|
207
|
-
|
|
192
|
+
method: config.method,
|
|
208
193
|
...(typeof config.max_attempts === "number"
|
|
209
194
|
? { max_attempts: config.max_attempts }
|
|
210
195
|
: {}),
|
|
@@ -214,7 +199,7 @@ export function sourceDatasetConfigFromInterfConfig(config, preparationPath = `.
|
|
|
214
199
|
checks: config.checks ?? [],
|
|
215
200
|
};
|
|
216
201
|
}
|
|
217
|
-
export function
|
|
202
|
+
export function loadCompiledPreparationConfig(compiledPath) {
|
|
218
203
|
const config = readInterfConfig(compiledPath);
|
|
219
204
|
if (!config)
|
|
220
205
|
return null;
|
|
@@ -225,11 +210,7 @@ export function loadCompiledDatasetConfig(compiledPath) {
|
|
|
225
210
|
: `./${config.name}`;
|
|
226
211
|
const sourceBinding = typeof config.source?.preparation_path === "string" && config.source.preparation_path.length > 0
|
|
227
212
|
? config.source.preparation_path
|
|
228
|
-
:
|
|
229
|
-
? config.source.source_folder_path
|
|
230
|
-
: typeof config.source?.dataset_path === "string" && config.source.dataset_path.length > 0
|
|
231
|
-
? config.source.dataset_path
|
|
232
|
-
: null;
|
|
213
|
+
: null;
|
|
233
214
|
const preparationPath = sourceBinding
|
|
234
215
|
? (() => {
|
|
235
216
|
const sourceAbsolutePath = resolve(compiledPath, sourceBinding);
|
|
@@ -239,19 +220,21 @@ export function loadCompiledDatasetConfig(compiledPath) {
|
|
|
239
220
|
return relative(projectPath, sourceAbsolutePath).split(sep).join("/") || defaultPreparationPath;
|
|
240
221
|
})()
|
|
241
222
|
: defaultPreparationPath;
|
|
242
|
-
return
|
|
223
|
+
return sourcePreparationConfigFromInterfConfig(config, preparationPath);
|
|
243
224
|
}
|
|
244
225
|
export function saveCompiledInterfConfig(compiledPath, config) {
|
|
245
226
|
mkdirSync(compiledInterfRoot(compiledPath), { recursive: true });
|
|
246
227
|
writeFileSync(compiledInterfConfigPath(compiledPath), JSON.stringify(config, null, 2) + "\n");
|
|
247
228
|
return config;
|
|
248
229
|
}
|
|
249
|
-
export function
|
|
230
|
+
export function syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath, preparationConfig) {
|
|
250
231
|
const current = readInterfConfig(compiledPath);
|
|
251
232
|
const projectPath = resolveSourceControlPathForCompiled(compiledPath);
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
-
const methodId = methodIdForSourcePreparationConfig(
|
|
233
|
+
const preparationAbsolutePath = resolveSourcePreparationPath(projectPath, preparationConfig);
|
|
234
|
+
const preparationRelativePath = relative(compiledPath, preparationAbsolutePath).split(sep).join("/") || ".";
|
|
235
|
+
const methodId = methodIdForSourcePreparationConfig(preparationConfig)
|
|
236
|
+
?? methodIdForSourcePreparationConfig(current)
|
|
237
|
+
?? DEFAULT_METHOD_ID;
|
|
255
238
|
const methodChanged = current?.method !== undefined && current.method !== methodId;
|
|
256
239
|
const methodOrigin = methodChanged || !current?.method_origin
|
|
257
240
|
? {
|
|
@@ -259,7 +242,7 @@ export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, da
|
|
|
259
242
|
local_draft: false,
|
|
260
243
|
}
|
|
261
244
|
: current.method_origin;
|
|
262
|
-
const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, method: _ignoredMethod,
|
|
245
|
+
const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, method: _ignoredMethod, max_attempts: _ignoredMaxAttempts, max_loops: _ignoredMaxLoops, checks: _ignoredChecks, method_origin: _ignoredMethodOrigin, source: _ignoredSource, ...passthrough } = current ?? {};
|
|
263
246
|
const nextConfig = {
|
|
264
247
|
...passthrough,
|
|
265
248
|
...(!current ? {
|
|
@@ -269,31 +252,31 @@ export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, da
|
|
|
269
252
|
},
|
|
270
253
|
} : {}),
|
|
271
254
|
type: "compiled",
|
|
272
|
-
name:
|
|
273
|
-
...(
|
|
255
|
+
name: preparationConfig.name,
|
|
256
|
+
...(preparationConfig.about ? { about: preparationConfig.about } : {}),
|
|
274
257
|
method: methodId,
|
|
275
|
-
...(typeof
|
|
276
|
-
? { max_attempts:
|
|
258
|
+
...(typeof preparationConfig.max_attempts === "number"
|
|
259
|
+
? { max_attempts: preparationConfig.max_attempts }
|
|
277
260
|
: {}),
|
|
278
|
-
...(typeof
|
|
279
|
-
? { max_loops:
|
|
261
|
+
...(typeof preparationConfig.max_loops === "number"
|
|
262
|
+
? { max_loops: preparationConfig.max_loops }
|
|
280
263
|
: {}),
|
|
281
|
-
checks:
|
|
264
|
+
checks: preparationConfig.checks,
|
|
282
265
|
method_origin: methodOrigin,
|
|
283
266
|
source: {
|
|
284
267
|
path: current?.source?.path ?? "./raw",
|
|
285
268
|
control_path: defaultControlPathForCompiled(compiledPath),
|
|
286
|
-
preparation_path:
|
|
269
|
+
preparation_path: preparationRelativePath,
|
|
287
270
|
},
|
|
288
271
|
};
|
|
289
272
|
const saved = saveCompiledInterfConfig(compiledPath, nextConfig);
|
|
290
273
|
if (methodChanged) {
|
|
291
274
|
const sourcePath = projectPath;
|
|
292
|
-
const
|
|
293
|
-
|
|
275
|
+
const selectedMethod = getCompiledMethod(methodId, { sourcePath });
|
|
276
|
+
seedCompiledMethodPackage({
|
|
294
277
|
compiledPath,
|
|
295
278
|
sourcePath,
|
|
296
|
-
|
|
279
|
+
methodId: selectedMethod.id,
|
|
297
280
|
});
|
|
298
281
|
}
|
|
299
282
|
refreshCompiledBootstrapGuidance(compiledPath);
|
|
@@ -340,7 +323,7 @@ export function buildTestSpecFromSourceFolderConfig(options) {
|
|
|
340
323
|
defaultDescription: `Derived from saved Preparation checks in ${SOURCE_FOLDER_CONFIG_PATH}`,
|
|
341
324
|
});
|
|
342
325
|
}
|
|
343
|
-
export function
|
|
326
|
+
export function buildTestSpecFromCompiledPreparationConfig(options) {
|
|
344
327
|
const { compiledPath, targetType = "compiled" } = options;
|
|
345
328
|
const config = readInterfConfig(compiledPath);
|
|
346
329
|
const configPath = compiledInterfConfigPath(compiledPath);
|
|
@@ -354,15 +337,14 @@ export function buildTestSpecFromCompiledDatasetConfig(options) {
|
|
|
354
337
|
filePath: targetType === "raw"
|
|
355
338
|
? `${configPath}#checks:file-as-is`
|
|
356
339
|
: `${configPath}#checks:compiled`,
|
|
357
|
-
defaultDescription: "Derived from checks in the
|
|
340
|
+
defaultDescription: "Derived from checks in the portable context config.",
|
|
358
341
|
});
|
|
359
342
|
}
|
|
360
|
-
export function
|
|
361
|
-
const configuredPath =
|
|
343
|
+
export function resolveSourcePreparationPath(projectPath, preparationConfig) {
|
|
344
|
+
const configuredPath = preparationConfig.path.trim();
|
|
362
345
|
const resolvedPath = resolve(projectPath, configuredPath);
|
|
363
346
|
if (isAbsolute(configuredPath)) {
|
|
364
347
|
return resolvedPath;
|
|
365
348
|
}
|
|
366
349
|
return assertPathWithinRoot(projectPath, resolvedPath, "Source folder path");
|
|
367
350
|
}
|
|
368
|
-
export const resolveSourcePreparationPath = resolveSourceDatasetPath;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare function listVisibleSourceFolders(projectPath: string): string[];
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
2
|
+
export declare function isReservedSourcePreparationPath(relativePath: string): boolean;
|
|
3
|
+
export declare function normalizeSourcePreparationPathForConfig(projectPath: string, value: string): string;
|
|
4
|
+
export declare function defaultPreparationNameForPath(sourceFolderPath: string): string;
|
|
5
5
|
export declare function findSingleSourceFolderCandidate(projectPath: string): string | null;
|
|
6
6
|
export declare function listSourceFolderChoices(projectPath?: string): Array<{
|
|
7
7
|
value: string;
|
|
8
8
|
label: string;
|
|
9
9
|
hint: string;
|
|
10
10
|
}>;
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function defaultSourcePreparationPathForPrompt(name: string, introStyle: "first" | "additional" | "edit", projectPath?: string): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
2
2
|
import { isAbsolute, join, relative, sep } from "node:path";
|
|
3
3
|
import { slugify } from "../shared/naming.js";
|
|
4
|
-
import {
|
|
4
|
+
import { resolveSourcePreparationPath } from "./source-config.js";
|
|
5
5
|
import { isPathWithinRoot } from "../shared/path-guards.js";
|
|
6
|
-
const
|
|
6
|
+
const DEFAULT_PREPARATION_NAME = "default";
|
|
7
7
|
const IGNORED_SOURCE_FOLDER_ENTRIES = new Set([
|
|
8
8
|
".DS_Store",
|
|
9
9
|
".git",
|
|
@@ -35,16 +35,16 @@ export function listVisibleSourceFolders(projectPath) {
|
|
|
35
35
|
}
|
|
36
36
|
return visibleDirectories.sort((left, right) => left.localeCompare(right));
|
|
37
37
|
}
|
|
38
|
-
export function
|
|
38
|
+
export function isReservedSourcePreparationPath(relativePath) {
|
|
39
39
|
const normalized = relativePath.replace(/\\/g, "/").replace(/^\.\/+/, "");
|
|
40
40
|
return normalized === "interf" ||
|
|
41
41
|
normalized.startsWith("interf/") ||
|
|
42
42
|
normalized === ".interf" ||
|
|
43
43
|
normalized.startsWith(".interf/");
|
|
44
44
|
}
|
|
45
|
-
export function
|
|
45
|
+
export function normalizeSourcePreparationPathForConfig(projectPath, value) {
|
|
46
46
|
const trimmedValue = value.trim();
|
|
47
|
-
const resolvedPath =
|
|
47
|
+
const resolvedPath = resolveSourcePreparationPath(projectPath, { path: trimmedValue });
|
|
48
48
|
const relativePath = relative(projectPath, resolvedPath).split(sep).join("/") || ".";
|
|
49
49
|
if (relativePath === ".") {
|
|
50
50
|
throw new Error("Pick a Source Folder, not the Interf Workspace itself.");
|
|
@@ -58,7 +58,7 @@ export function normalizeSourceDatasetPathForConfig(projectPath, value) {
|
|
|
58
58
|
}
|
|
59
59
|
return resolvedPath;
|
|
60
60
|
}
|
|
61
|
-
if (
|
|
61
|
+
if (isReservedSourcePreparationPath(relativePath)) {
|
|
62
62
|
throw new Error("Pick an existing source folder, not `interf/` or `.interf/`.");
|
|
63
63
|
}
|
|
64
64
|
if (!existsSync(resolvedPath)) {
|
|
@@ -69,13 +69,13 @@ export function normalizeSourceDatasetPathForConfig(projectPath, value) {
|
|
|
69
69
|
}
|
|
70
70
|
return relativePath.startsWith("./") ? relativePath : `./${relativePath}`;
|
|
71
71
|
}
|
|
72
|
-
export function
|
|
73
|
-
const segments =
|
|
72
|
+
export function defaultPreparationNameForPath(sourceFolderPath) {
|
|
73
|
+
const segments = sourceFolderPath
|
|
74
74
|
.replace(/\\/g, "/")
|
|
75
75
|
.replace(/\/+$/g, "")
|
|
76
76
|
.split("/")
|
|
77
77
|
.filter((segment) => segment.length > 0 && segment !== ".");
|
|
78
|
-
return slugify(segments[segments.length - 1] ?? "") ||
|
|
78
|
+
return slugify(segments[segments.length - 1] ?? "") || DEFAULT_PREPARATION_NAME;
|
|
79
79
|
}
|
|
80
80
|
export function findSingleSourceFolderCandidate(projectPath) {
|
|
81
81
|
const visibleDirectories = listVisibleSourceFolders(projectPath);
|
|
@@ -91,7 +91,7 @@ export function listSourceFolderChoices(projectPath = process.cwd()) {
|
|
|
91
91
|
hint: `Use ./${entry} as the source folder`,
|
|
92
92
|
}));
|
|
93
93
|
}
|
|
94
|
-
export function
|
|
94
|
+
export function defaultSourcePreparationPathForPrompt(name, introStyle, projectPath = process.cwd()) {
|
|
95
95
|
const namedFolderPath = join(projectPath, name);
|
|
96
96
|
if (existsSync(namedFolderPath)) {
|
|
97
97
|
try {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export * as schema from "./lib/schema.js";
|
|
2
2
|
export * as test from "./test.js";
|
|
3
3
|
export * as execution from "./test-execution.js";
|
|
4
|
-
export * as matrices from "./test-matrices.js";
|
|
5
4
|
export * as paths from "./test-paths.js";
|
|
6
5
|
export * as profilePresets from "./test-profile-presets.js";
|
|
6
|
+
export * as readinessCheckRun from "./readiness-check-run.js";
|
|
7
7
|
export * as sandbox from "./test-sandbox.js";
|
|
8
8
|
export * as specs from "./test-specs.js";
|
|
9
9
|
export * as targets from "./test-targets.js";
|
|
10
10
|
export * as types from "./test-types.js";
|
|
11
|
-
export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun,
|
|
11
|
+
export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun, ReadinessCheckRun, TestTargetType, } from "./lib/schema.js";
|
|
12
12
|
export type { LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
|
|
13
13
|
export type { TestSandboxRetentionMode, } from "./test-sandbox.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * as schema from "./lib/schema.js";
|
|
2
2
|
export * as test from "./test.js";
|
|
3
3
|
export * as execution from "./test-execution.js";
|
|
4
|
-
export * as matrices from "./test-matrices.js";
|
|
5
4
|
export * as paths from "./test-paths.js";
|
|
6
5
|
export * as profilePresets from "./test-profile-presets.js";
|
|
6
|
+
export * as readinessCheckRun from "./readiness-check-run.js";
|
|
7
7
|
export * as sandbox from "./test-sandbox.js";
|
|
8
8
|
export * as specs from "./test-specs.js";
|
|
9
9
|
export * as targets from "./test-targets.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type TestCaseExpect, type TestTargetType } from "../../
|
|
2
|
+
import { type TestCaseExpect, type TestTargetType } from "../../contracts/lib/schema.js";
|
|
3
3
|
export declare const TestCaseSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodString;
|
|
5
5
|
question: z.ZodString;
|
|
@@ -65,7 +65,7 @@ export declare const TestTargetResultSchema: z.ZodObject<{
|
|
|
65
65
|
}>;
|
|
66
66
|
name: z.ZodString;
|
|
67
67
|
path: z.ZodString;
|
|
68
|
-
|
|
68
|
+
method: z.ZodString;
|
|
69
69
|
}, z.core.$strip>;
|
|
70
70
|
sandbox_path: z.ZodOptional<z.ZodString>;
|
|
71
71
|
ok: z.ZodBoolean;
|
|
@@ -143,7 +143,7 @@ export declare const TestTargetRunSchema: z.ZodObject<{
|
|
|
143
143
|
}>;
|
|
144
144
|
name: z.ZodString;
|
|
145
145
|
path: z.ZodString;
|
|
146
|
-
|
|
146
|
+
method: z.ZodString;
|
|
147
147
|
}, z.core.$strip>;
|
|
148
148
|
sandbox_path: z.ZodOptional<z.ZodString>;
|
|
149
149
|
ok: z.ZodBoolean;
|
|
@@ -189,11 +189,11 @@ export declare const TestRunTargetSummarySchema: z.ZodObject<{
|
|
|
189
189
|
}>;
|
|
190
190
|
name: z.ZodString;
|
|
191
191
|
path: z.ZodString;
|
|
192
|
-
|
|
192
|
+
method: z.ZodString;
|
|
193
193
|
}, z.core.$strip>;
|
|
194
194
|
}, z.core.$strip>;
|
|
195
|
-
export declare const
|
|
196
|
-
kind: z.ZodLiteral<"interf-
|
|
195
|
+
export declare const ReadinessCheckRunSchema: z.ZodObject<{
|
|
196
|
+
kind: z.ZodLiteral<"interf-readiness-check-run">;
|
|
197
197
|
version: z.ZodLiteral<1>;
|
|
198
198
|
generated_at: z.ZodString;
|
|
199
199
|
mode: z.ZodEnum<{
|
|
@@ -203,9 +203,9 @@ export declare const TestRunComparisonSchema: z.ZodObject<{
|
|
|
203
203
|
}>;
|
|
204
204
|
source_path: z.ZodString;
|
|
205
205
|
checks_fingerprint: z.ZodOptional<z.ZodString>;
|
|
206
|
-
|
|
206
|
+
preparation: z.ZodObject<{
|
|
207
207
|
name: z.ZodString;
|
|
208
|
-
|
|
208
|
+
portable_context_path: z.ZodNullable<z.ZodString>;
|
|
209
209
|
}, z.core.$strip>;
|
|
210
210
|
raw: z.ZodNullable<z.ZodObject<{
|
|
211
211
|
label: z.ZodString;
|
|
@@ -222,7 +222,7 @@ export declare const TestRunComparisonSchema: z.ZodObject<{
|
|
|
222
222
|
}>;
|
|
223
223
|
name: z.ZodString;
|
|
224
224
|
path: z.ZodString;
|
|
225
|
-
|
|
225
|
+
method: z.ZodString;
|
|
226
226
|
}, z.core.$strip>;
|
|
227
227
|
}, z.core.$strip>>;
|
|
228
228
|
compiled: z.ZodNullable<z.ZodObject<{
|
|
@@ -240,7 +240,7 @@ export declare const TestRunComparisonSchema: z.ZodObject<{
|
|
|
240
240
|
}>;
|
|
241
241
|
name: z.ZodString;
|
|
242
242
|
path: z.ZodString;
|
|
243
|
-
|
|
243
|
+
method: z.ZodString;
|
|
244
244
|
}, z.core.$strip>;
|
|
245
245
|
}, z.core.$strip>>;
|
|
246
246
|
summary: z.ZodObject<{
|
|
@@ -258,4 +258,4 @@ export type TestTargetResult = z.infer<typeof TestTargetResultSchema>;
|
|
|
258
258
|
export type TestTargetRun = z.infer<typeof TestTargetRunSchema>;
|
|
259
259
|
export type TestRunMode = z.infer<typeof TestRunModeSchema>;
|
|
260
260
|
export type TestRunTargetSummary = z.infer<typeof TestRunTargetSummarySchema>;
|
|
261
|
-
export type
|
|
261
|
+
export type ReadinessCheckRun = z.infer<typeof ReadinessCheckRunSchema>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { RuntimeExecutorInfoSchema, TestCaseExpectSchema, TestTargetTypeSchema, } from "../../
|
|
3
|
-
import { DatasetNameSchema } from "../../project-model/lib/schema.js";
|
|
2
|
+
import { RuntimeExecutorInfoSchema, TestCaseExpectSchema, TestTargetTypeSchema, PreparationNameSchema, } from "../../contracts/lib/schema.js";
|
|
4
3
|
const TestCaseCoreSchema = z.object({
|
|
5
4
|
id: z.string().regex(/^[a-z0-9][a-z0-9-]{0,79}$/),
|
|
6
5
|
question: z.string().min(1),
|
|
@@ -47,7 +46,7 @@ export const TestTargetResultSchema = z.object({
|
|
|
47
46
|
type: TestTargetTypeSchema,
|
|
48
47
|
name: z.string(),
|
|
49
48
|
path: z.string(),
|
|
50
|
-
|
|
49
|
+
method: z.string(),
|
|
51
50
|
}),
|
|
52
51
|
sandbox_path: z.string().optional(),
|
|
53
52
|
ok: z.boolean(),
|
|
@@ -95,19 +94,19 @@ export const TestRunTargetSummarySchema = z.object({
|
|
|
95
94
|
type: TestTargetTypeSchema,
|
|
96
95
|
name: z.string(),
|
|
97
96
|
path: z.string(),
|
|
98
|
-
|
|
97
|
+
method: z.string(),
|
|
99
98
|
}),
|
|
100
99
|
});
|
|
101
|
-
export const
|
|
102
|
-
kind: z.literal("interf-
|
|
100
|
+
export const ReadinessCheckRunSchema = z.object({
|
|
101
|
+
kind: z.literal("interf-readiness-check-run"),
|
|
103
102
|
version: z.literal(1),
|
|
104
103
|
generated_at: z.string(),
|
|
105
104
|
mode: TestRunModeSchema,
|
|
106
105
|
source_path: z.string(),
|
|
107
106
|
checks_fingerprint: z.string().min(1).optional(),
|
|
108
|
-
|
|
109
|
-
name:
|
|
110
|
-
|
|
107
|
+
preparation: z.object({
|
|
108
|
+
name: PreparationNameSchema,
|
|
109
|
+
portable_context_path: z.string().nullable(),
|
|
111
110
|
}),
|
|
112
111
|
raw: TestRunTargetSummarySchema.nullable(),
|
|
113
112
|
compiled: TestRunTargetSummarySchema.nullable(),
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { MethodExecutor } from "../agents/lib/executors.js";
|
|
2
|
+
import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
|
|
3
|
+
import { type TestTargetCandidate, type TestTargetResult } from "./test.js";
|
|
4
|
+
import type { TestSandboxRetentionMode } from "./test-sandbox.js";
|
|
5
|
+
import { type ReadinessCheckRun, type TestRunMode } from "./lib/schema.js";
|
|
6
|
+
export interface SavedReadinessCheckOutcome {
|
|
7
|
+
runPath: string;
|
|
8
|
+
displayRunPath?: string;
|
|
9
|
+
target: TestTargetCandidate;
|
|
10
|
+
result: TestTargetResult;
|
|
11
|
+
}
|
|
12
|
+
export interface ReadinessCheckRunResult {
|
|
13
|
+
sourcePath: string;
|
|
14
|
+
preparationConfig: SourcePreparationConfig;
|
|
15
|
+
portableContextPath: string | null;
|
|
16
|
+
mode: TestRunMode;
|
|
17
|
+
rawOutcome: SavedReadinessCheckOutcome | null;
|
|
18
|
+
compiledOutcome: SavedReadinessCheckOutcome | null;
|
|
19
|
+
comparisonRunPath: string | null;
|
|
20
|
+
comparison: ReadinessCheckRun | null;
|
|
21
|
+
}
|
|
22
|
+
export declare function readinessPassRate(outcome: SavedReadinessCheckOutcome): number;
|
|
23
|
+
export declare function readSavedReadinessCheckRun(projectPath: string, preparationName: string): ReadinessCheckRun | null;
|
|
24
|
+
export declare function parseReadinessCheckRun(value: unknown): ReadinessCheckRun | null;
|
|
25
|
+
export declare function readReadinessCheckRunAtPath(filePath: string, label?: string): ReadinessCheckRun | null;
|
|
26
|
+
export declare function readCurrentSavedReadinessCheckRun(options: {
|
|
27
|
+
projectPath: string;
|
|
28
|
+
preparationName: string;
|
|
29
|
+
checks: SourcePreparationConfig["checks"];
|
|
30
|
+
}): {
|
|
31
|
+
comparison: ReadinessCheckRun | null;
|
|
32
|
+
stale: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare function saveReadinessCheckRun(options: {
|
|
35
|
+
sourcePath: string;
|
|
36
|
+
portableContextPath: string | null;
|
|
37
|
+
preparationName: string;
|
|
38
|
+
checksFingerprint: string;
|
|
39
|
+
mode: TestRunMode;
|
|
40
|
+
rawOutcome: SavedReadinessCheckOutcome | null;
|
|
41
|
+
compiledOutcome: SavedReadinessCheckOutcome | null;
|
|
42
|
+
}): string;
|
|
43
|
+
export declare function runSavedSourceFilesCheck(options: {
|
|
44
|
+
sourcePath: string;
|
|
45
|
+
preparationConfig: SourcePreparationConfig;
|
|
46
|
+
executor?: MethodExecutor | null;
|
|
47
|
+
preserveSandboxes?: TestSandboxRetentionMode;
|
|
48
|
+
runSuffix?: string | null;
|
|
49
|
+
}): Promise<SavedReadinessCheckOutcome | null>;
|
|
50
|
+
export declare function runSavedPortableContextCheck(options: {
|
|
51
|
+
sourcePath: string;
|
|
52
|
+
preparationConfig: SourcePreparationConfig;
|
|
53
|
+
executor?: MethodExecutor | null;
|
|
54
|
+
portableContextPath?: string | null;
|
|
55
|
+
preserveSandboxes?: TestSandboxRetentionMode;
|
|
56
|
+
runSuffix?: string | null;
|
|
57
|
+
}): Promise<SavedReadinessCheckOutcome | null>;
|
|
58
|
+
export declare function runReadinessChecksForExecutor(options: {
|
|
59
|
+
sourcePath: string;
|
|
60
|
+
preparationConfig: SourcePreparationConfig;
|
|
61
|
+
portableContextPath: string | null;
|
|
62
|
+
mode: TestRunMode;
|
|
63
|
+
executor?: MethodExecutor | null;
|
|
64
|
+
preserveSandboxes?: TestSandboxRetentionMode;
|
|
65
|
+
runSuffix?: string | null;
|
|
66
|
+
saveLatest?: boolean;
|
|
67
|
+
}): Promise<ReadinessCheckRunResult>;
|