@interf/compiler 0.6.1 → 0.6.4
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 +106 -80
- package/builtin-workflows/interf/README.md +5 -5
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +4 -4
- package/builtin-workflows/interf/improve/SKILL.md +2 -2
- package/builtin-workflows/interf/use/query/SKILL.md +1 -1
- package/builtin-workflows/interf/workflow.json +6 -6
- package/builtin-workflows/interf/workflow.schema.json +1 -1
- package/dist/bin.js +2 -28
- package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
- package/dist/{commands → cli/commands}/check-draft.js +16 -16
- package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
- package/dist/{commands → cli/commands}/compile-controller.js +37 -35
- package/dist/{commands → cli/commands}/compile.d.ts +2 -2
- package/dist/{commands → cli/commands}/compile.js +15 -11
- package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
- package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
- package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +3 -3
- package/dist/{commands → cli/commands}/create-workflow-wizard.js +64 -37
- package/dist/{commands → cli/commands}/create.d.ts +1 -1
- package/dist/{commands → cli/commands}/create.js +15 -18
- package/dist/{commands → cli/commands}/dataset-selection.d.ts +1 -1
- package/dist/{commands → cli/commands}/default.js +3 -3
- package/dist/{commands → cli/commands}/doctor.js +5 -6
- package/dist/{commands → cli/commands}/executor-flow.d.ts +1 -1
- package/dist/{commands → cli/commands}/executor-flow.js +13 -16
- package/dist/{commands → cli/commands}/init.d.ts +4 -1
- package/dist/{commands → cli/commands}/init.js +162 -77
- package/dist/{commands → cli/commands}/list.js +6 -6
- package/dist/{commands → cli/commands}/reset.js +4 -4
- package/dist/{commands → cli/commands}/source-config-wizard.d.ts +9 -4
- package/dist/{commands → cli/commands}/source-config-wizard.js +168 -94
- package/dist/{commands → cli/commands}/status.js +20 -11
- package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
- package/dist/{commands → cli/commands}/test-flow.js +52 -48
- package/dist/cli/commands/test.d.ts +14 -0
- package/dist/{commands → cli/commands}/test.js +40 -24
- package/dist/{commands → cli/commands}/verify.js +4 -4
- package/dist/cli/index.d.ts +21 -0
- package/dist/cli/index.js +33 -0
- package/dist/index.d.ts +22 -11
- package/dist/index.js +15 -6
- package/dist/lib/agent-args.d.ts +1 -4
- package/dist/lib/agent-args.js +1 -52
- package/dist/lib/agent-constants.d.ts +1 -5
- package/dist/lib/agent-constants.js +1 -28
- package/dist/lib/agent-detection.d.ts +1 -7
- package/dist/lib/agent-detection.js +1 -65
- package/dist/lib/agent-execution.d.ts +1 -2
- package/dist/lib/agent-execution.js +1 -243
- package/dist/lib/agent-logs.d.ts +1 -2
- package/dist/lib/agent-logs.js +1 -17
- package/dist/lib/agent-preflight.d.ts +1 -7
- package/dist/lib/agent-preflight.js +1 -77
- package/dist/lib/agent-render.d.ts +1 -8
- package/dist/lib/agent-render.js +1 -218
- package/dist/lib/agent-shells.d.ts +1 -69
- package/dist/lib/agent-shells.js +1 -1021
- package/dist/lib/agent-status.d.ts +1 -3
- package/dist/lib/agent-status.js +1 -58
- package/dist/lib/agent-types.d.ts +1 -30
- package/dist/lib/agent-types.js +1 -1
- package/dist/lib/agents.d.ts +1 -6
- package/dist/lib/agents.js +1 -5
- package/dist/lib/builtin-compiled-workflow.d.ts +1 -38
- package/dist/lib/builtin-compiled-workflow.js +1 -94
- package/dist/lib/chart-guidance.d.ts +1 -1
- package/dist/lib/chart-guidance.js +1 -8
- package/dist/lib/compiled-compile.d.ts +1 -48
- package/dist/lib/compiled-compile.js +1 -255
- package/dist/lib/compiled-paths.d.ts +1 -40
- package/dist/lib/compiled-paths.js +3 -106
- package/dist/lib/compiled-raw.d.ts +1 -49
- package/dist/lib/compiled-raw.js +3 -102
- package/dist/lib/compiled-reset.d.ts +1 -2
- package/dist/lib/compiled-reset.js +3 -72
- package/dist/lib/compiled-schema.d.ts +1 -31
- package/dist/lib/compiled-schema.js +1 -141
- package/dist/lib/discovery.d.ts +1 -7
- package/dist/lib/discovery.js +1 -84
- package/dist/lib/execution-profile.d.ts +1 -17
- package/dist/lib/execution-profile.js +1 -84
- package/dist/lib/executors.d.ts +1 -32
- package/dist/lib/executors.js +1 -43
- package/dist/lib/filesystem.d.ts +1 -2
- package/dist/lib/filesystem.js +1 -55
- package/dist/lib/interf-bootstrap.d.ts +1 -3
- package/dist/lib/interf-bootstrap.js +3 -18
- package/dist/lib/interf-detect.d.ts +1 -33
- package/dist/lib/interf-detect.js +3 -176
- package/dist/lib/interf-scaffold.d.ts +1 -2
- package/dist/lib/interf-scaffold.js +3 -114
- package/dist/lib/interf-workflow-package.d.ts +1 -25
- package/dist/lib/interf-workflow-package.js +1 -342
- package/dist/lib/interf.d.ts +1 -5
- package/dist/lib/interf.js +3 -4
- package/dist/lib/local-workflows.d.ts +1 -54
- package/dist/lib/local-workflows.js +1 -422
- package/dist/lib/logger.d.ts +1 -3
- package/dist/lib/logger.js +1 -10
- package/dist/lib/package-root.d.ts +1 -0
- package/dist/lib/package-root.js +1 -0
- package/dist/lib/parse.d.ts +1 -8
- package/dist/lib/parse.js +1 -145
- package/dist/lib/project-paths.d.ts +1 -11
- package/dist/lib/project-paths.js +3 -32
- package/dist/lib/runtime-acceptance.d.ts +1 -9
- package/dist/lib/runtime-acceptance.js +1 -269
- package/dist/lib/runtime-contracts.d.ts +1 -2
- package/dist/lib/runtime-contracts.js +1 -48
- package/dist/lib/runtime-inventory.d.ts +1 -7
- package/dist/lib/runtime-inventory.js +1 -29
- package/dist/lib/runtime-paths.d.ts +1 -8
- package/dist/lib/runtime-paths.js +1 -26
- package/dist/lib/runtime-prompt.d.ts +1 -2
- package/dist/lib/runtime-prompt.js +1 -48
- package/dist/lib/runtime-reconcile.d.ts +1 -2
- package/dist/lib/runtime-reconcile.js +1 -193
- package/dist/lib/runtime-runs.d.ts +1 -11
- package/dist/lib/runtime-runs.js +1 -262
- package/dist/lib/runtime-types.d.ts +1 -43
- package/dist/lib/runtime-types.js +1 -1
- package/dist/lib/runtime.d.ts +1 -6
- package/dist/lib/runtime.js +1 -5
- package/dist/lib/schema.d.ts +4 -1073
- package/dist/lib/schema.js +6 -542
- package/dist/lib/source-config.d.ts +1 -39
- package/dist/lib/source-config.js +3 -293
- package/dist/lib/state-artifacts.d.ts +1 -8
- package/dist/lib/state-artifacts.js +1 -13
- package/dist/lib/state-health.d.ts +1 -4
- package/dist/lib/state-health.js +1 -132
- package/dist/lib/state-io.d.ts +1 -10
- package/dist/lib/state-io.js +1 -76
- package/dist/lib/state-paths.d.ts +1 -4
- package/dist/lib/state-paths.js +1 -13
- package/dist/lib/state-view.d.ts +1 -4
- package/dist/lib/state-view.js +1 -103
- package/dist/lib/state.d.ts +1 -7
- package/dist/lib/state.js +1 -12
- package/dist/lib/test-execution.d.ts +1 -14
- package/dist/lib/test-execution.js +3 -525
- package/dist/lib/test-matrices.d.ts +1 -90
- package/dist/lib/test-matrices.js +3 -96
- package/dist/lib/test-paths.d.ts +1 -12
- package/dist/lib/test-paths.js +3 -59
- package/dist/lib/test-profile-presets.d.ts +1 -57
- package/dist/lib/test-profile-presets.js +3 -50
- package/dist/lib/test-sandbox.d.ts +1 -11
- package/dist/lib/test-sandbox.js +3 -105
- package/dist/lib/test-specs.d.ts +1 -7
- package/dist/lib/test-specs.js +3 -114
- package/dist/lib/test-targets.d.ts +1 -5
- package/dist/lib/test-targets.js +3 -38
- package/dist/lib/test-types.d.ts +1 -17
- package/dist/lib/test-types.js +3 -1
- package/dist/lib/test.d.ts +1 -4
- package/dist/lib/test.js +3 -3
- package/dist/lib/util.d.ts +1 -4
- package/dist/lib/util.js +1 -25
- package/dist/lib/validate-compiled.d.ts +1 -27
- package/dist/lib/validate-compiled.js +1 -241
- package/dist/lib/validate-helpers.d.ts +1 -12
- package/dist/lib/validate-helpers.js +1 -41
- package/dist/lib/validate.d.ts +1 -21
- package/dist/lib/validate.js +1 -249
- package/dist/lib/workflow-authoring.d.ts +1 -26
- package/dist/lib/workflow-authoring.js +1 -119
- package/dist/lib/workflow-definitions.d.ts +1 -78
- package/dist/lib/workflow-definitions.js +1 -203
- package/dist/lib/workflow-edit-session.d.ts +1 -16
- package/dist/lib/workflow-edit-session.js +1 -57
- package/dist/lib/workflow-edit-utils.d.ts +1 -10
- package/dist/lib/workflow-edit-utils.js +1 -39
- package/dist/lib/workflow-helpers.d.ts +1 -38
- package/dist/lib/workflow-helpers.js +1 -167
- package/dist/lib/workflow-improvement.d.ts +1 -22
- package/dist/lib/workflow-improvement.js +1 -209
- package/dist/lib/workflow-primitives.d.ts +1 -2
- package/dist/lib/workflow-primitives.js +1 -5
- package/dist/lib/workflow-review-paths.d.ts +1 -10
- package/dist/lib/workflow-review-paths.js +1 -27
- package/dist/lib/workflow-stage-policy.d.ts +1 -5
- package/dist/lib/workflow-stage-policy.js +1 -31
- package/dist/lib/workflow-stage-runner.d.ts +1 -41
- package/dist/lib/workflow-stage-runner.js +1 -109
- package/dist/lib/workflows.d.ts +1 -15
- package/dist/lib/workflows.js +1 -31
- package/dist/packages/agents/index.d.ts +18 -0
- package/dist/packages/agents/index.js +16 -0
- package/dist/packages/agents/lib/agents.d.ts +6 -0
- package/dist/packages/agents/lib/agents.js +5 -0
- package/dist/packages/agents/lib/args.d.ts +4 -0
- package/dist/packages/agents/lib/args.js +52 -0
- package/dist/packages/agents/lib/chart-guidance.d.ts +1 -0
- package/dist/packages/agents/lib/chart-guidance.js +8 -0
- package/dist/packages/agents/lib/compiled-bootstrap.d.ts +3 -0
- package/dist/packages/agents/lib/compiled-bootstrap.js +18 -0
- package/dist/packages/agents/lib/constants.d.ts +5 -0
- package/dist/packages/agents/lib/constants.js +28 -0
- package/dist/packages/agents/lib/detection.d.ts +7 -0
- package/dist/packages/agents/lib/detection.js +65 -0
- package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
- package/dist/packages/agents/lib/execution-profile.js +84 -0
- package/dist/packages/agents/lib/execution.d.ts +2 -0
- package/dist/packages/agents/lib/execution.js +243 -0
- package/dist/packages/agents/lib/executors.d.ts +32 -0
- package/dist/packages/agents/lib/executors.js +45 -0
- package/dist/packages/agents/lib/logs.d.ts +2 -0
- package/dist/packages/agents/lib/logs.js +17 -0
- package/dist/packages/agents/lib/preflight.d.ts +7 -0
- package/dist/packages/agents/lib/preflight.js +77 -0
- package/dist/packages/agents/lib/render.d.ts +8 -0
- package/dist/packages/agents/lib/render.js +218 -0
- package/dist/packages/agents/lib/schema.d.ts +8 -0
- package/dist/packages/agents/lib/schema.js +7 -0
- package/dist/packages/agents/lib/shells.d.ts +71 -0
- package/dist/packages/agents/lib/shells.js +1023 -0
- package/dist/packages/agents/lib/status.d.ts +3 -0
- package/dist/packages/agents/lib/status.js +58 -0
- package/dist/packages/agents/lib/types.d.ts +30 -0
- package/dist/packages/agents/lib/types.js +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
- package/dist/packages/compiler/compiled-compile.d.ts +4 -0
- package/dist/packages/compiler/compiled-compile.js +4 -0
- package/dist/packages/compiler/compiled-paths.d.ts +40 -0
- package/dist/packages/compiler/compiled-paths.js +106 -0
- package/dist/packages/compiler/compiled-pipeline.d.ts +39 -0
- package/dist/packages/compiler/compiled-pipeline.js +134 -0
- package/dist/packages/compiler/compiled-schema.d.ts +31 -0
- package/dist/packages/compiler/compiled-schema.js +141 -0
- package/dist/packages/compiler/compiled-stage-plan.d.ts +15 -0
- package/dist/packages/compiler/compiled-stage-plan.js +79 -0
- package/dist/packages/compiler/compiled-stage-runner.d.ts +10 -0
- package/dist/packages/compiler/compiled-stage-runner.js +46 -0
- package/dist/packages/compiler/compiled-target.d.ts +11 -0
- package/dist/packages/compiler/compiled-target.js +16 -0
- package/dist/packages/compiler/discovery.d.ts +7 -0
- package/dist/packages/compiler/discovery.js +80 -0
- package/dist/packages/compiler/index.d.ts +24 -0
- package/dist/packages/compiler/index.js +23 -0
- package/dist/packages/compiler/lib/schema.d.ts +684 -0
- package/dist/packages/compiler/lib/schema.js +363 -0
- package/dist/packages/compiler/raw-snapshot.d.ts +49 -0
- package/dist/packages/compiler/raw-snapshot.js +102 -0
- package/dist/packages/compiler/reset.d.ts +2 -0
- package/dist/packages/compiler/reset.js +72 -0
- package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
- package/dist/packages/compiler/runtime-acceptance.js +269 -0
- package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
- package/dist/packages/compiler/runtime-contracts.js +48 -0
- package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
- package/dist/packages/compiler/runtime-inventory.js +29 -0
- package/dist/packages/compiler/runtime-paths.d.ts +8 -0
- package/dist/packages/compiler/runtime-paths.js +26 -0
- package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
- package/dist/packages/compiler/runtime-prompt.js +48 -0
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
- package/dist/packages/compiler/runtime-reconcile.js +193 -0
- package/dist/packages/compiler/runtime-runs.d.ts +11 -0
- package/dist/packages/compiler/runtime-runs.js +262 -0
- package/dist/packages/compiler/runtime-types.d.ts +43 -0
- package/dist/packages/compiler/runtime-types.js +1 -0
- package/dist/packages/compiler/runtime.d.ts +6 -0
- package/dist/packages/compiler/runtime.js +5 -0
- package/dist/packages/compiler/state-artifacts.d.ts +8 -0
- package/dist/packages/compiler/state-artifacts.js +13 -0
- package/dist/packages/compiler/state-health.d.ts +4 -0
- package/dist/packages/compiler/state-health.js +132 -0
- package/dist/packages/compiler/state-io.d.ts +10 -0
- package/dist/packages/compiler/state-io.js +76 -0
- package/dist/packages/compiler/state-paths.d.ts +4 -0
- package/dist/packages/compiler/state-paths.js +13 -0
- package/dist/packages/compiler/state-view.d.ts +4 -0
- package/dist/packages/compiler/state-view.js +103 -0
- package/dist/packages/compiler/state.d.ts +7 -0
- package/dist/packages/compiler/state.js +12 -0
- package/dist/packages/compiler/validate-compiled.d.ts +27 -0
- package/dist/packages/compiler/validate-compiled.js +241 -0
- package/dist/packages/compiler/validate-helpers.d.ts +12 -0
- package/dist/packages/compiler/validate-helpers.js +41 -0
- package/dist/packages/compiler/validate.d.ts +21 -0
- package/dist/packages/compiler/validate.js +249 -0
- package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
- package/dist/packages/compiler/workflow-primitives.js +5 -0
- package/dist/packages/compiler/workflows.d.ts +15 -0
- package/dist/packages/compiler/workflows.js +31 -0
- package/dist/packages/project-model/compiled-paths.d.ts +1 -0
- package/dist/packages/project-model/compiled-paths.js +1 -0
- package/dist/packages/project-model/compiled-raw.d.ts +1 -0
- package/dist/packages/project-model/compiled-raw.js +1 -0
- package/dist/packages/project-model/compiled-reset.d.ts +1 -0
- package/dist/packages/project-model/compiled-reset.js +1 -0
- package/dist/packages/project-model/index.d.ts +11 -0
- package/dist/packages/project-model/index.js +10 -0
- package/dist/packages/project-model/interf-bootstrap.d.ts +1 -0
- package/dist/packages/project-model/interf-bootstrap.js +1 -0
- package/dist/packages/project-model/interf-detect.d.ts +33 -0
- package/dist/packages/project-model/interf-detect.js +176 -0
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
- package/dist/packages/project-model/interf-scaffold.js +124 -0
- package/dist/packages/project-model/interf.d.ts +5 -0
- package/dist/packages/project-model/interf.js +4 -0
- package/dist/packages/project-model/lib/schema.d.ts +125 -0
- package/dist/packages/project-model/lib/schema.js +62 -0
- package/dist/packages/project-model/project-paths.d.ts +11 -0
- package/dist/packages/project-model/project-paths.js +32 -0
- package/dist/packages/project-model/source-config.d.ts +38 -0
- package/dist/packages/project-model/source-config.js +298 -0
- package/dist/packages/shared/file-types.d.ts +1 -0
- package/dist/packages/shared/file-types.js +4 -0
- package/dist/packages/shared/filesystem.d.ts +2 -0
- package/dist/packages/shared/filesystem.js +55 -0
- package/dist/packages/shared/index.d.ts +7 -0
- package/dist/packages/shared/index.js +7 -0
- package/dist/packages/shared/logger.d.ts +3 -0
- package/dist/packages/shared/logger.js +10 -0
- package/dist/packages/shared/naming.d.ts +1 -0
- package/dist/packages/shared/naming.js +8 -0
- package/dist/packages/shared/parse.d.ts +8 -0
- package/dist/packages/shared/parse.js +145 -0
- package/dist/packages/shared/path-guards.d.ts +2 -0
- package/dist/packages/shared/path-guards.js +14 -0
- package/dist/packages/shared/util.d.ts +3 -0
- package/dist/packages/shared/util.js +3 -0
- package/dist/packages/testing/index.d.ts +13 -0
- package/dist/packages/testing/index.js +10 -0
- package/dist/packages/testing/lib/schema.d.ts +261 -0
- package/dist/packages/testing/lib/schema.js +119 -0
- package/dist/packages/testing/test-execution.d.ts +14 -0
- package/dist/packages/testing/test-execution.js +525 -0
- package/dist/packages/testing/test-matrices.d.ts +90 -0
- package/dist/packages/testing/test-matrices.js +96 -0
- package/dist/packages/testing/test-paths.d.ts +12 -0
- package/dist/packages/testing/test-paths.js +59 -0
- package/dist/packages/testing/test-profile-presets.d.ts +57 -0
- package/dist/packages/testing/test-profile-presets.js +50 -0
- package/dist/packages/testing/test-sandbox.d.ts +11 -0
- package/dist/packages/testing/test-sandbox.js +105 -0
- package/dist/packages/testing/test-specs.d.ts +7 -0
- package/dist/packages/testing/test-specs.js +114 -0
- package/dist/packages/testing/test-targets.d.ts +5 -0
- package/dist/packages/testing/test-targets.js +38 -0
- package/dist/packages/testing/test-types.d.ts +16 -0
- package/dist/packages/testing/test-types.js +1 -0
- package/dist/packages/testing/test.d.ts +4 -0
- package/dist/packages/testing/test.js +3 -0
- package/dist/packages/workflow-authoring/index.d.ts +4 -0
- package/dist/packages/workflow-authoring/index.js +4 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
- package/dist/packages/workflow-authoring/workflow-authoring.js +121 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
- package/dist/packages/workflow-authoring/workflow-improvement.js +210 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
- package/dist/packages/workflow-package/context-interface.d.ts +96 -0
- package/dist/packages/workflow-package/context-interface.js +146 -0
- package/dist/packages/workflow-package/index.d.ts +11 -0
- package/dist/packages/workflow-package/index.js +11 -0
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +389 -0
- package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
- package/dist/packages/workflow-package/lib/package-root.js +6 -0
- package/dist/packages/workflow-package/local-workflows.d.ts +57 -0
- package/dist/packages/workflow-package/local-workflows.js +424 -0
- package/dist/packages/workflow-package/workflow-definitions.d.ts +82 -0
- package/dist/packages/workflow-package/workflow-definitions.js +210 -0
- package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
- package/dist/packages/workflow-package/workflow-helpers.js +167 -0
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
- package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
- package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
- package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
- package/package.json +43 -19
- package/dist/commands/test.d.ts +0 -3
- package/dist/lib/compiled-home.d.ts +0 -5
- package/dist/lib/compiled-home.js +0 -32
- package/dist/lib/config.js +0 -9
- /package/dist/{commands → cli/commands}/dataset-selection.js +0 -0
- /package/dist/{commands → cli/commands}/default.d.ts +0 -0
- /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
- /package/dist/{commands → cli/commands}/list.d.ts +0 -0
- /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
- /package/dist/{commands → cli/commands}/status.d.ts +0 -0
- /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { WorkflowIdPattern } from "../compiler/lib/schema.js";
|
|
3
|
+
import { TestProfilePresetIdSchema, resolveTestProfilePreset, } from "./test-profile-presets.js";
|
|
4
|
+
export const TestMatrixAgentSchema = z.enum(["claude-code", "codex"]);
|
|
5
|
+
const TestMatrixProfileInputSchema = z.object({
|
|
6
|
+
id: z.string().regex(WorkflowIdPattern),
|
|
7
|
+
preset: TestProfilePresetIdSchema.optional(),
|
|
8
|
+
agent: TestMatrixAgentSchema.optional(),
|
|
9
|
+
model: z.string().min(1).optional(),
|
|
10
|
+
profile: z.string().min(1).optional(),
|
|
11
|
+
effort: z.string().min(1).optional(),
|
|
12
|
+
timeout_ms: z.number().int().positive().optional(),
|
|
13
|
+
}).superRefine((value, ctx) => {
|
|
14
|
+
if (!value.preset && !value.agent) {
|
|
15
|
+
ctx.addIssue({
|
|
16
|
+
code: z.ZodIssueCode.custom,
|
|
17
|
+
path: ["agent"],
|
|
18
|
+
message: "Test-matrix profiles need either `agent` or `preset`.",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (value.preset) {
|
|
22
|
+
for (const field of ["agent", "model", "profile", "effort", "timeout_ms"]) {
|
|
23
|
+
if (value[field] !== undefined) {
|
|
24
|
+
ctx.addIssue({
|
|
25
|
+
code: z.ZodIssueCode.custom,
|
|
26
|
+
path: [field],
|
|
27
|
+
message: `Test profile presets own \`${field}\`; remove the inline override or stop using \`preset\`.`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export const TestMatrixProfileSchema = TestMatrixProfileInputSchema.transform((value) => {
|
|
34
|
+
if (!value.preset) {
|
|
35
|
+
return {
|
|
36
|
+
...value,
|
|
37
|
+
agent: value.agent,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const preset = resolveTestProfilePreset(value.preset);
|
|
41
|
+
return {
|
|
42
|
+
...value,
|
|
43
|
+
agent: preset.agent,
|
|
44
|
+
model: preset.model,
|
|
45
|
+
profile: preset.profile,
|
|
46
|
+
effort: preset.effort,
|
|
47
|
+
timeout_ms: preset.timeout_ms,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
export const TestMatrixRetryPolicySchema = z.object({
|
|
51
|
+
max_attempts_per_profile: z.number().int().min(1).max(5).optional(),
|
|
52
|
+
});
|
|
53
|
+
export const TestMatrixDatasetSchema = z.string().regex(WorkflowIdPattern);
|
|
54
|
+
export const TestMatrixSchema = z.object({
|
|
55
|
+
id: z.string().regex(WorkflowIdPattern),
|
|
56
|
+
name: z.string().min(1),
|
|
57
|
+
source_path: z.string().min(1),
|
|
58
|
+
compile_profiles: z.array(TestMatrixProfileSchema).min(1),
|
|
59
|
+
retry_policy: TestMatrixRetryPolicySchema.optional(),
|
|
60
|
+
datasets: z.array(TestMatrixDatasetSchema).min(1),
|
|
61
|
+
}).superRefine((value, ctx) => {
|
|
62
|
+
const duplicateProfileIds = findDuplicates(value.compile_profiles.map((profile) => profile.id));
|
|
63
|
+
for (const id of duplicateProfileIds) {
|
|
64
|
+
ctx.addIssue({
|
|
65
|
+
code: z.ZodIssueCode.custom,
|
|
66
|
+
path: ["compile_profiles"],
|
|
67
|
+
message: `Duplicate compile profile id in test matrix: ${id}`,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const duplicateCompiledIds = findDuplicates(value.datasets);
|
|
71
|
+
for (const id of duplicateCompiledIds) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
code: z.ZodIssueCode.custom,
|
|
74
|
+
path: ["datasets"],
|
|
75
|
+
message: `Duplicate dataset id in test matrix: ${id}`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
function findDuplicates(values) {
|
|
80
|
+
const seen = new Set();
|
|
81
|
+
const duplicates = new Set();
|
|
82
|
+
for (const value of values) {
|
|
83
|
+
if (seen.has(value))
|
|
84
|
+
duplicates.add(value);
|
|
85
|
+
seen.add(value);
|
|
86
|
+
}
|
|
87
|
+
return Array.from(duplicates.values()).sort();
|
|
88
|
+
}
|
|
89
|
+
export function testMatrixProfileToExecutionProfile(profile) {
|
|
90
|
+
return {
|
|
91
|
+
model: profile.model ?? null,
|
|
92
|
+
profile: profile.profile ?? null,
|
|
93
|
+
effort: profile.effort ?? null,
|
|
94
|
+
timeoutMs: profile.timeout_ms ?? null,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TestTargetType } from "./test-types.js";
|
|
2
|
+
export declare const TEST_SPEC_EXTENSIONS: Set<string>;
|
|
3
|
+
export declare function testSpecRootPath(sourcePath: string): string;
|
|
4
|
+
export declare function testSpecTypePath(sourcePath: string, type: TestTargetType): string;
|
|
5
|
+
export declare function targetTestRunsPath(compiledPath: string, type: TestTargetType): string;
|
|
6
|
+
export declare function targetTestRunGitignorePath(compiledPath: string, type: TestTargetType): string;
|
|
7
|
+
export declare function targetTestSandboxesPath(compiledPath: string, type: TestTargetType): string;
|
|
8
|
+
export declare function targetTestSandboxGitignorePath(compiledPath: string, type: TestTargetType): string;
|
|
9
|
+
export declare function testSpecFilePath(sourcePath: string, type: TestTargetType, id: string): string;
|
|
10
|
+
export declare function normalizeTestId(input: string): string;
|
|
11
|
+
export declare function assertTestId(id: string): void;
|
|
12
|
+
export declare function assertWritableTestSpecPath(filePath: string): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { basename, dirname, join } from "node:path";
|
|
3
|
+
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compiler/compiled-paths.js";
|
|
4
|
+
const TEST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,79}$/;
|
|
5
|
+
export const TEST_SPEC_EXTENSIONS = new Set([".json"]);
|
|
6
|
+
export function testSpecRootPath(sourcePath) {
|
|
7
|
+
return join(sourcePath, "interf", "tests", "matrix", "specs");
|
|
8
|
+
}
|
|
9
|
+
export function testSpecTypePath(sourcePath, type) {
|
|
10
|
+
return join(testSpecRootPath(sourcePath), type);
|
|
11
|
+
}
|
|
12
|
+
function isDatasetTestsRootPath(artifactRootPath) {
|
|
13
|
+
return basename(dirname(artifactRootPath)) === "tests";
|
|
14
|
+
}
|
|
15
|
+
export function targetTestRunsPath(compiledPath, type) {
|
|
16
|
+
if (existsSync(compiledInterfConfigPath(compiledPath))) {
|
|
17
|
+
return join(targetTestRunsRootForCompiled(compiledPath), type);
|
|
18
|
+
}
|
|
19
|
+
if (isDatasetTestsRootPath(compiledPath)) {
|
|
20
|
+
return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "runs");
|
|
21
|
+
}
|
|
22
|
+
throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected a compiled context or interf/tests/<dataset> root.`);
|
|
23
|
+
}
|
|
24
|
+
export function targetTestRunGitignorePath(compiledPath, type) {
|
|
25
|
+
return join(targetTestRunsPath(compiledPath, type), ".gitignore");
|
|
26
|
+
}
|
|
27
|
+
export function targetTestSandboxesPath(compiledPath, type) {
|
|
28
|
+
if (existsSync(compiledInterfConfigPath(compiledPath))) {
|
|
29
|
+
return join(targetTestSandboxesRootForCompiled(compiledPath), type);
|
|
30
|
+
}
|
|
31
|
+
if (isDatasetTestsRootPath(compiledPath)) {
|
|
32
|
+
return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "sandboxes");
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected a compiled context or interf/tests/<dataset> root.`);
|
|
35
|
+
}
|
|
36
|
+
export function targetTestSandboxGitignorePath(compiledPath, type) {
|
|
37
|
+
return join(targetTestSandboxesPath(compiledPath, type), ".gitignore");
|
|
38
|
+
}
|
|
39
|
+
export function testSpecFilePath(sourcePath, type, id) {
|
|
40
|
+
return join(testSpecTypePath(sourcePath, type), `${id}.json`);
|
|
41
|
+
}
|
|
42
|
+
export function normalizeTestId(input) {
|
|
43
|
+
return input
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.trim()
|
|
46
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
47
|
+
.replace(/^-+|-+$/g, "")
|
|
48
|
+
.slice(0, 80);
|
|
49
|
+
}
|
|
50
|
+
export function assertTestId(id) {
|
|
51
|
+
if (!TEST_ID_PATTERN.test(id)) {
|
|
52
|
+
throw new Error(`Invalid test id: ${id}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function assertWritableTestSpecPath(filePath) {
|
|
56
|
+
if (existsSync(filePath)) {
|
|
57
|
+
throw new Error(`Test spec already exists: ${filePath}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const TestProfilePresetValueSchema: z.ZodObject<{
|
|
3
|
+
agent: z.ZodEnum<{
|
|
4
|
+
"claude-code": "claude-code";
|
|
5
|
+
codex: "codex";
|
|
6
|
+
}>;
|
|
7
|
+
model: z.ZodOptional<z.ZodString>;
|
|
8
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
9
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
10
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const TestProfilePresetIds: readonly ["release-claude-high", "release-codex-high", "tier1-max-claude", "tier1-max-codex"];
|
|
14
|
+
export declare const TestProfilePresetIdSchema: z.ZodEnum<{
|
|
15
|
+
"release-claude-high": "release-claude-high";
|
|
16
|
+
"release-codex-high": "release-codex-high";
|
|
17
|
+
"tier1-max-claude": "tier1-max-claude";
|
|
18
|
+
"tier1-max-codex": "tier1-max-codex";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const TestProfilePresets: {
|
|
21
|
+
readonly "release-claude-high": {
|
|
22
|
+
agent: "claude-code" | "codex";
|
|
23
|
+
label: string;
|
|
24
|
+
model?: string | undefined;
|
|
25
|
+
profile?: string | undefined;
|
|
26
|
+
effort?: string | undefined;
|
|
27
|
+
timeout_ms?: number | undefined;
|
|
28
|
+
};
|
|
29
|
+
readonly "release-codex-high": {
|
|
30
|
+
agent: "claude-code" | "codex";
|
|
31
|
+
label: string;
|
|
32
|
+
model?: string | undefined;
|
|
33
|
+
profile?: string | undefined;
|
|
34
|
+
effort?: string | undefined;
|
|
35
|
+
timeout_ms?: number | undefined;
|
|
36
|
+
};
|
|
37
|
+
readonly "tier1-max-claude": {
|
|
38
|
+
agent: "claude-code" | "codex";
|
|
39
|
+
label: string;
|
|
40
|
+
model?: string | undefined;
|
|
41
|
+
profile?: string | undefined;
|
|
42
|
+
effort?: string | undefined;
|
|
43
|
+
timeout_ms?: number | undefined;
|
|
44
|
+
};
|
|
45
|
+
readonly "tier1-max-codex": {
|
|
46
|
+
agent: "claude-code" | "codex";
|
|
47
|
+
label: string;
|
|
48
|
+
model?: string | undefined;
|
|
49
|
+
profile?: string | undefined;
|
|
50
|
+
effort?: string | undefined;
|
|
51
|
+
timeout_ms?: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type TestProfilePresetId = z.infer<typeof TestProfilePresetIdSchema>;
|
|
55
|
+
export type TestProfilePresetValue = z.infer<typeof TestProfilePresetValueSchema>;
|
|
56
|
+
export declare function resolveTestProfilePreset(id: TestProfilePresetId): TestProfilePresetValue;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const TestProfilePresetAgentSchema = z.enum(["claude-code", "codex"]);
|
|
3
|
+
const TestProfilePresetValueSchema = z.object({
|
|
4
|
+
agent: TestProfilePresetAgentSchema,
|
|
5
|
+
model: z.string().min(1).optional(),
|
|
6
|
+
profile: z.string().min(1).optional(),
|
|
7
|
+
effort: z.string().min(1).optional(),
|
|
8
|
+
timeout_ms: z.number().int().positive().optional(),
|
|
9
|
+
label: z.string().min(1),
|
|
10
|
+
});
|
|
11
|
+
export const TestProfilePresetIds = [
|
|
12
|
+
"release-claude-high",
|
|
13
|
+
"release-codex-high",
|
|
14
|
+
"tier1-max-claude",
|
|
15
|
+
"tier1-max-codex",
|
|
16
|
+
];
|
|
17
|
+
export const TestProfilePresetIdSchema = z.enum(TestProfilePresetIds);
|
|
18
|
+
export const TestProfilePresets = {
|
|
19
|
+
"release-claude-high": TestProfilePresetValueSchema.parse({
|
|
20
|
+
agent: "claude-code",
|
|
21
|
+
model: "claude-sonnet-4-6",
|
|
22
|
+
effort: "high",
|
|
23
|
+
timeout_ms: 480000,
|
|
24
|
+
label: "Claude Code (Claude Sonnet 4.6, high)",
|
|
25
|
+
}),
|
|
26
|
+
"release-codex-high": TestProfilePresetValueSchema.parse({
|
|
27
|
+
agent: "codex",
|
|
28
|
+
model: "gpt-5.4-mini",
|
|
29
|
+
effort: "high",
|
|
30
|
+
timeout_ms: 480000,
|
|
31
|
+
label: "Codex (GPT-5.4 Mini, high)",
|
|
32
|
+
}),
|
|
33
|
+
"tier1-max-claude": TestProfilePresetValueSchema.parse({
|
|
34
|
+
agent: "claude-code",
|
|
35
|
+
model: "claude-opus-4-6[1m]",
|
|
36
|
+
effort: "max",
|
|
37
|
+
timeout_ms: 480000,
|
|
38
|
+
label: "Claude Code (Claude Opus 4.6 1M, max)",
|
|
39
|
+
}),
|
|
40
|
+
"tier1-max-codex": TestProfilePresetValueSchema.parse({
|
|
41
|
+
agent: "codex",
|
|
42
|
+
model: "gpt-5.4",
|
|
43
|
+
effort: "xhigh",
|
|
44
|
+
timeout_ms: 480000,
|
|
45
|
+
label: "Codex (GPT-5.4, xhigh)",
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
export function resolveTestProfilePreset(id) {
|
|
49
|
+
return TestProfilePresets[id];
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TestTargetCandidate } from "./test-types.js";
|
|
2
|
+
export type TestSandboxRetentionMode = "on-failure" | "always";
|
|
3
|
+
export interface TestSandbox {
|
|
4
|
+
rootPath: string;
|
|
5
|
+
rawPath: string;
|
|
6
|
+
targetPath: string;
|
|
7
|
+
compiledPath: string | null;
|
|
8
|
+
preserve(destinationPath: string): string;
|
|
9
|
+
cleanup(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createTestSandbox(target: TestTargetCandidate): TestSandbox;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
4
|
+
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
5
|
+
import { readInterfConfig, resolveCompiledRawPath } from "../project-model/interf.js";
|
|
6
|
+
import { projectRawTestQueryShell } from "../agents/lib/shells.js";
|
|
7
|
+
import { compiledCompiledPathForDataset } from "../project-model/project-paths.js";
|
|
8
|
+
import { saveCompiledInterfConfig } from "../project-model/source-config.js";
|
|
9
|
+
import { projectRawSnapshot } from "../compiler/raw-snapshot.js";
|
|
10
|
+
import { refreshCompiledArtifacts } from "../compiler/state.js";
|
|
11
|
+
import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, workflowImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../compiler/compiled-paths.js";
|
|
12
|
+
function toPortableRelativePath(fromPath, toPath) {
|
|
13
|
+
return relative(fromPath, toPath).split(sep).join("/");
|
|
14
|
+
}
|
|
15
|
+
function sanitizeCompiledArtifacts(compiledPath) {
|
|
16
|
+
for (const absolutePath of [
|
|
17
|
+
testRootForCompiled(compiledPath),
|
|
18
|
+
targetTestSandboxesRootForCompiled(compiledPath),
|
|
19
|
+
stageExecutionShellsRoot(compiledPath),
|
|
20
|
+
workflowImprovementLoopsRoot(compiledPath),
|
|
21
|
+
compiledRuntimeLogsRoot(compiledPath),
|
|
22
|
+
compiledQueryAcceptanceRoot(compiledPath),
|
|
23
|
+
]) {
|
|
24
|
+
rmSync(absolutePath, { recursive: true, force: true });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function createTestSandbox(target) {
|
|
28
|
+
let sandboxRoot = mkdtempSync(join(tmpdir(), "interf-test-sandbox-"));
|
|
29
|
+
let preserved = false;
|
|
30
|
+
const sandboxCompiledPath = () => (target.type === "compiled"
|
|
31
|
+
? compiledCompiledPathForDataset(sandboxRoot, target.name)
|
|
32
|
+
: null);
|
|
33
|
+
const sandboxRawPath = () => (target.type === "compiled"
|
|
34
|
+
? join(compiledCompiledPathForDataset(sandboxRoot, target.name), "raw")
|
|
35
|
+
: join(sandboxRoot, "raw"));
|
|
36
|
+
const sandboxTargetPath = () => (target.type === "compiled"
|
|
37
|
+
? compiledCompiledPathForDataset(sandboxRoot, target.name)
|
|
38
|
+
: sandboxRoot);
|
|
39
|
+
try {
|
|
40
|
+
if (target.type === "compiled") {
|
|
41
|
+
mkdirSync(dirname(sandboxTargetPath()), { recursive: true });
|
|
42
|
+
cpSync(target.path, sandboxTargetPath(), { recursive: true });
|
|
43
|
+
sanitizeCompiledArtifacts(sandboxTargetPath());
|
|
44
|
+
const sandboxConfig = readInterfConfig(sandboxTargetPath());
|
|
45
|
+
if (!sandboxConfig) {
|
|
46
|
+
throw new Error(`Sandbox compiled context is missing interf.json: ${sandboxTargetPath()}`);
|
|
47
|
+
}
|
|
48
|
+
if (!existsSync(resolveCompiledRawPath(sandboxTargetPath(), sandboxConfig))) {
|
|
49
|
+
throw new Error(`Sandbox compiled context is missing its local raw snapshot: ${sandboxTargetPath()}. Rebuild the compiled context before testing it.`);
|
|
50
|
+
}
|
|
51
|
+
saveCompiledInterfConfig(sandboxTargetPath(), {
|
|
52
|
+
...sandboxConfig,
|
|
53
|
+
checks: [],
|
|
54
|
+
source: {
|
|
55
|
+
path: toPortableRelativePath(sandboxTargetPath(), sandboxRawPath()),
|
|
56
|
+
dataset_path: toPortableRelativePath(sandboxTargetPath(), sandboxRawPath()),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
refreshCompiledBootstrapGuidance(sandboxTargetPath());
|
|
60
|
+
refreshCompiledArtifacts(sandboxTargetPath(), { ensureViewSpec: true });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
projectRawSnapshot({
|
|
64
|
+
sourcePath: target.path,
|
|
65
|
+
destinationPath: sandboxRawPath(),
|
|
66
|
+
compiledPath: target.path,
|
|
67
|
+
mode: "link-or-copy",
|
|
68
|
+
prune: false,
|
|
69
|
+
preserveTimestamps: false,
|
|
70
|
+
});
|
|
71
|
+
projectRawTestQueryShell(sandboxTargetPath());
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
rmSync(sandboxRoot, { recursive: true, force: true });
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
get rootPath() {
|
|
80
|
+
return sandboxRoot;
|
|
81
|
+
},
|
|
82
|
+
get rawPath() {
|
|
83
|
+
return sandboxRawPath();
|
|
84
|
+
},
|
|
85
|
+
get targetPath() {
|
|
86
|
+
return sandboxTargetPath();
|
|
87
|
+
},
|
|
88
|
+
get compiledPath() {
|
|
89
|
+
return sandboxCompiledPath();
|
|
90
|
+
},
|
|
91
|
+
preserve(destinationPath) {
|
|
92
|
+
mkdirSync(dirname(destinationPath), { recursive: true });
|
|
93
|
+
rmSync(destinationPath, { recursive: true, force: true });
|
|
94
|
+
renameSync(sandboxRoot, destinationPath);
|
|
95
|
+
sandboxRoot = destinationPath;
|
|
96
|
+
preserved = true;
|
|
97
|
+
return sandboxRoot;
|
|
98
|
+
},
|
|
99
|
+
cleanup() {
|
|
100
|
+
if (preserved)
|
|
101
|
+
return;
|
|
102
|
+
rmSync(sandboxRoot, { recursive: true, force: true });
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TestSpec, TestTargetType, LoadedTestSpec } from "./test-types.js";
|
|
2
|
+
export declare function listTestSpecs(sourcePath: string, type: TestTargetType): LoadedTestSpec[];
|
|
3
|
+
export declare function loadTestSpec(sourcePath: string, type: TestTargetType, id: string): LoadedTestSpec | null;
|
|
4
|
+
export declare function loadTestSpecFromFile(filePath: string): LoadedTestSpec | null;
|
|
5
|
+
export declare function writeTestSpec(sourcePath: string, spec: TestSpec & {
|
|
6
|
+
id?: string;
|
|
7
|
+
}): string;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { basename, extname, join } from "node:path";
|
|
3
|
+
import { readJsonFileWithSchema } from "../shared/parse.js";
|
|
4
|
+
import { TestSpecSchema } from "./lib/schema.js";
|
|
5
|
+
import { TEST_SPEC_EXTENSIONS, assertTestId, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./test-paths.js";
|
|
6
|
+
function readTestSpecFile(filePath) {
|
|
7
|
+
const extension = extname(filePath).toLowerCase();
|
|
8
|
+
if (!TEST_SPEC_EXTENSIONS.has(extension))
|
|
9
|
+
return null;
|
|
10
|
+
const parsed = readJsonFileWithSchema(filePath, "test spec", TestSpecSchema);
|
|
11
|
+
if (!parsed)
|
|
12
|
+
return null;
|
|
13
|
+
return {
|
|
14
|
+
...parsed,
|
|
15
|
+
id: basename(filePath, extension),
|
|
16
|
+
filePath,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function serializeTestSpec(spec) {
|
|
20
|
+
return {
|
|
21
|
+
type: spec.type,
|
|
22
|
+
name: spec.name,
|
|
23
|
+
...(spec.description ? { description: spec.description } : {}),
|
|
24
|
+
cases: spec.cases.map((testCase) => ({
|
|
25
|
+
id: testCase.id,
|
|
26
|
+
question: testCase.question,
|
|
27
|
+
...(testCase.file ? { file: testCase.file } : {}),
|
|
28
|
+
...(testCase.answer ? { answer: testCase.answer } : {}),
|
|
29
|
+
...(testCase.strictness ? { strictness: testCase.strictness } : {}),
|
|
30
|
+
...(testCase.expect ? { expect: testCase.expect } : {}),
|
|
31
|
+
})),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function listTestSpecs(sourcePath, type) {
|
|
35
|
+
const dirPath = testSpecTypePath(sourcePath, type);
|
|
36
|
+
if (!existsSync(dirPath))
|
|
37
|
+
return [];
|
|
38
|
+
return readdirSync(dirPath)
|
|
39
|
+
.map((entry) => join(dirPath, entry))
|
|
40
|
+
.filter((filePath) => TEST_SPEC_EXTENSIONS.has(extname(filePath).toLowerCase()))
|
|
41
|
+
.map((filePath) => readTestSpecFile(filePath))
|
|
42
|
+
.filter((value) => value !== null)
|
|
43
|
+
.sort((left, right) => left.name.localeCompare(right.name) || left.id.localeCompare(right.id));
|
|
44
|
+
}
|
|
45
|
+
export function loadTestSpec(sourcePath, type, id) {
|
|
46
|
+
const normalizedId = normalizeTestId(id);
|
|
47
|
+
const filePath = join(testSpecTypePath(sourcePath, type), `${normalizedId}.json`);
|
|
48
|
+
if (!existsSync(filePath))
|
|
49
|
+
return null;
|
|
50
|
+
return readTestSpecFile(filePath);
|
|
51
|
+
}
|
|
52
|
+
export function loadTestSpecFromFile(filePath) {
|
|
53
|
+
return readTestSpecFile(filePath);
|
|
54
|
+
}
|
|
55
|
+
export function writeTestSpec(sourcePath, spec) {
|
|
56
|
+
const id = normalizeTestId(spec.id ?? spec.name);
|
|
57
|
+
assertTestId(id);
|
|
58
|
+
const dirPath = testSpecTypePath(sourcePath, spec.type);
|
|
59
|
+
mkdirSync(dirPath, { recursive: true });
|
|
60
|
+
const existingPath = join(dirPath, `${id}.json`);
|
|
61
|
+
if (existsSync(existingPath)) {
|
|
62
|
+
throw new Error(`Test spec already exists: ${existingPath}`);
|
|
63
|
+
}
|
|
64
|
+
const filePath = testSpecFilePath(sourcePath, spec.type, id);
|
|
65
|
+
assertWritableTestSpecPath(filePath);
|
|
66
|
+
const normalizedSpec = {
|
|
67
|
+
type: spec.type,
|
|
68
|
+
name: spec.name.trim(),
|
|
69
|
+
...(spec.description && spec.description.trim().length > 0
|
|
70
|
+
? { description: spec.description.trim() }
|
|
71
|
+
: {}),
|
|
72
|
+
cases: spec.cases.map((testCase) => ({
|
|
73
|
+
id: normalizeTestId(testCase.id),
|
|
74
|
+
question: testCase.question.trim(),
|
|
75
|
+
...(testCase.file && testCase.file.trim().length > 0
|
|
76
|
+
? { file: testCase.file.trim() }
|
|
77
|
+
: {}),
|
|
78
|
+
...(testCase.answer && testCase.answer.trim().length > 0
|
|
79
|
+
? { answer: testCase.answer.trim() }
|
|
80
|
+
: {}),
|
|
81
|
+
...(testCase.strictness && testCase.strictness.trim().length > 0
|
|
82
|
+
? { strictness: testCase.strictness.trim() }
|
|
83
|
+
: {}),
|
|
84
|
+
...(testCase.expect
|
|
85
|
+
? {
|
|
86
|
+
expect: {
|
|
87
|
+
...(testCase.expect.must_include && testCase.expect.must_include.length > 0
|
|
88
|
+
? { must_include: testCase.expect.must_include.map((value) => value.trim()).filter(Boolean) }
|
|
89
|
+
: {}),
|
|
90
|
+
...(testCase.expect.must_include_one_of && testCase.expect.must_include_one_of.length > 0
|
|
91
|
+
? {
|
|
92
|
+
must_include_one_of: testCase.expect.must_include_one_of
|
|
93
|
+
.map((group) => group.map((value) => value.trim()).filter(Boolean))
|
|
94
|
+
.filter((group) => group.length > 0),
|
|
95
|
+
}
|
|
96
|
+
: {}),
|
|
97
|
+
...(testCase.expect.must_not_include && testCase.expect.must_not_include.length > 0
|
|
98
|
+
? { must_not_include: testCase.expect.must_not_include.map((value) => value.trim()).filter(Boolean) }
|
|
99
|
+
: {}),
|
|
100
|
+
...(typeof testCase.expect.min_words === "number"
|
|
101
|
+
? { min_words: testCase.expect.min_words }
|
|
102
|
+
: {}),
|
|
103
|
+
...(typeof testCase.expect.max_words === "number"
|
|
104
|
+
? { max_words: testCase.expect.max_words }
|
|
105
|
+
: {}),
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
: {}),
|
|
109
|
+
})),
|
|
110
|
+
};
|
|
111
|
+
const parsed = TestSpecSchema.parse(normalizedSpec);
|
|
112
|
+
writeFileSync(filePath, `${JSON.stringify(serializeTestSpec(parsed), null, 2)}\n`);
|
|
113
|
+
return filePath;
|
|
114
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TestTargetCandidate } from "./test-types.js";
|
|
2
|
+
export declare function listCompiledTestTargets(sourcePath: string): TestTargetCandidate[];
|
|
3
|
+
export declare function createCompiledTestTarget(compiledPath: string, compiledName: string, workflowId?: string): TestTargetCandidate;
|
|
4
|
+
export declare function createRawTestTarget(sourcePath: string): TestTargetCandidate;
|
|
5
|
+
export declare function listTestTargets(sourcePath: string): TestTargetCandidate[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { listCompiledDatasetsForSourceFolder } from "../project-model/interf-detect.js";
|
|
2
|
+
import { computeCompiledHealth } from "../compiler/state.js";
|
|
3
|
+
function summarizeTargetSortKey(target) {
|
|
4
|
+
return `${target.name}\u0000${target.workflow}`;
|
|
5
|
+
}
|
|
6
|
+
export function listCompiledTestTargets(sourcePath) {
|
|
7
|
+
return listCompiledDatasetsForSourceFolder(sourcePath)
|
|
8
|
+
.map(({ path, config }) => createCompiledTestTarget(path, config.name, config.workflow ?? "interf"))
|
|
9
|
+
.sort((left, right) => summarizeTargetSortKey(left).localeCompare(summarizeTargetSortKey(right)));
|
|
10
|
+
}
|
|
11
|
+
export function createCompiledTestTarget(compiledPath, compiledName, workflowId = "interf") {
|
|
12
|
+
const health = computeCompiledHealth(compiledPath);
|
|
13
|
+
return {
|
|
14
|
+
type: "compiled",
|
|
15
|
+
name: compiledName,
|
|
16
|
+
path: compiledPath,
|
|
17
|
+
workflow: workflowId,
|
|
18
|
+
status: health.status,
|
|
19
|
+
stage: health.stage,
|
|
20
|
+
summary: health.summary,
|
|
21
|
+
eligible: health.status === "compiled",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function createRawTestTarget(sourcePath) {
|
|
25
|
+
return {
|
|
26
|
+
type: "raw",
|
|
27
|
+
name: "raw",
|
|
28
|
+
path: sourcePath,
|
|
29
|
+
workflow: "raw",
|
|
30
|
+
status: "compiled",
|
|
31
|
+
stage: "raw",
|
|
32
|
+
summary: "Run the checks against an isolated sandbox of the raw files.",
|
|
33
|
+
eligible: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function listTestTargets(sourcePath) {
|
|
37
|
+
return listCompiledTestTargets(sourcePath);
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TestSpec, TestTargetType } from "./lib/schema.js";
|
|
2
|
+
export type { TestCaseExpect, TestCase, TestSpec, TestCheckResult, TestCaseResult, TestTargetResult, TestTargetRun, TestTargetType, } from "./lib/schema.js";
|
|
3
|
+
export interface LoadedTestSpec extends TestSpec {
|
|
4
|
+
id: string;
|
|
5
|
+
filePath: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TestTargetCandidate {
|
|
8
|
+
type: TestTargetType;
|
|
9
|
+
name: string;
|
|
10
|
+
path: string;
|
|
11
|
+
workflow: string;
|
|
12
|
+
status: "idle" | "running" | "compiled" | "stale" | "failed";
|
|
13
|
+
stage: string;
|
|
14
|
+
summary: string;
|
|
15
|
+
eligible: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { TestCaseExpect, TestCase, TestSpec, TestCheckResult, TestCaseResult, TestTargetResult, TestTargetRun, TestTargetType, LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
|
|
2
|
+
export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
|
|
3
|
+
export { createRawTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
|
|
4
|
+
export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
|
|
2
|
+
export { createRawTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
|
|
3
|
+
export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function copyDirectory(sourcePath: string, targetPath: string): void;
|
|
2
|
+
export declare function directoriesMatch(leftPath: string, rightPath: string): boolean;
|
|
3
|
+
export interface WorkflowEditShellArtifacts {
|
|
4
|
+
rootPath: string;
|
|
5
|
+
workflowBeforePath: string;
|
|
6
|
+
workflowAfterPath: string;
|
|
7
|
+
promptLogPath: string;
|
|
8
|
+
eventLogPath: string;
|
|
9
|
+
statusLogPath: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, } from "node:fs";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
export function copyDirectory(sourcePath, targetPath) {
|
|
4
|
+
rmSync(targetPath, { recursive: true, force: true });
|
|
5
|
+
mkdirSync(targetPath, { recursive: true });
|
|
6
|
+
cpSync(sourcePath, targetPath, { recursive: true });
|
|
7
|
+
}
|
|
8
|
+
function listFileSnapshot(dirPath) {
|
|
9
|
+
const snapshot = new Map();
|
|
10
|
+
if (!existsSync(dirPath))
|
|
11
|
+
return snapshot;
|
|
12
|
+
const collect = (currentPath) => {
|
|
13
|
+
for (const entry of readdirSync(currentPath)) {
|
|
14
|
+
const fullPath = join(currentPath, entry);
|
|
15
|
+
const stat = statSync(fullPath);
|
|
16
|
+
if (stat.isDirectory()) {
|
|
17
|
+
collect(fullPath);
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (!stat.isFile())
|
|
21
|
+
continue;
|
|
22
|
+
snapshot.set(relative(dirPath, fullPath), readFileSync(fullPath, "utf8"));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
collect(dirPath);
|
|
26
|
+
return snapshot;
|
|
27
|
+
}
|
|
28
|
+
export function directoriesMatch(leftPath, rightPath) {
|
|
29
|
+
const left = listFileSnapshot(leftPath);
|
|
30
|
+
const right = listFileSnapshot(rightPath);
|
|
31
|
+
if (left.size !== right.size)
|
|
32
|
+
return false;
|
|
33
|
+
for (const [relativePath, content] of left.entries()) {
|
|
34
|
+
if (right.get(relativePath) !== content) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|