@interf/compiler 0.7.2 → 0.9.1
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 +141 -99
- package/TRADEMARKS.md +1 -1
- package/agent-skills/interf-actions/SKILL.md +71 -0
- package/agent-skills/interf-actions/references/cli.md +190 -0
- package/apps/compiler-ui/.next/server/app/index.html +1 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_buildManifest.js +11 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_clientMiddlewareManifest.js +1 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_ssgManifest.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/03~yq9q893hmn.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/06z~l3kwb891e.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/08g7lvje.te.u.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/08m7vf5asqlsm.js +91 -0
- package/apps/compiler-ui/.next/static/chunks/0_i-3_5l9t2qe.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0b-ywny_j0g~0.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0b52v41o1gixx.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js +124 -0
- package/apps/compiler-ui/.next/static/chunks/0gpzgsv0w.q~m.js +31 -0
- package/apps/compiler-ui/.next/static/chunks/0ilwfezfvu6~-.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0n51hrfoufc7g.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +5 -0
- package/apps/compiler-ui/.next/static/chunks/0xxmf45eskdt~.css +1 -0
- package/apps/compiler-ui/.next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
- package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +3 -0
- package/apps/compiler-ui/.next/static/chunks/14wtz~vq25~qq.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
- package/apps/compiler-ui/.next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- package/apps/compiler-ui/.next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- package/apps/compiler-ui/.next/static/media/worker.102zas1s52_pf.js +109 -0
- package/builtin-workflows/interf/README.md +8 -8
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +6 -6
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +1 -1
- package/builtin-workflows/interf/improve/SKILL.md +2 -2
- package/builtin-workflows/interf/use/query/SKILL.md +2 -2
- package/builtin-workflows/interf/workflow.json +9 -9
- package/builtin-workflows/interf/workflow.schema.json +2 -2
- package/dist/cli/commands/check-draft.d.ts +5 -4
- package/dist/cli/commands/check-draft.js +18 -17
- package/dist/cli/commands/compile-controller.d.ts +3 -0
- package/dist/cli/commands/compile-controller.js +53 -45
- package/dist/cli/commands/compile.js +83 -27
- package/dist/cli/commands/compiled-flow.d.ts +3 -0
- package/dist/cli/commands/compiled-flow.js +9 -7
- package/dist/cli/commands/control-path.d.ts +11 -0
- package/dist/cli/commands/control-path.js +72 -0
- package/dist/cli/commands/create-workflow-wizard.d.ts +12 -0
- package/dist/cli/commands/create-workflow-wizard.js +232 -66
- package/dist/cli/commands/create.js +70 -46
- package/dist/cli/commands/default.js +5 -3
- package/dist/cli/commands/doctor.js +5 -5
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.js +362 -101
- package/dist/cli/commands/list.js +8 -7
- package/dist/cli/commands/preparation-selection.d.ts +6 -0
- package/dist/cli/commands/preparation-selection.js +11 -0
- package/dist/cli/commands/reset.js +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +4 -4
- package/dist/cli/commands/source-config-wizard.js +175 -200
- package/dist/cli/commands/status.js +116 -8
- package/dist/cli/commands/test-flow.d.ts +1 -1
- package/dist/cli/commands/test-flow.js +35 -33
- package/dist/cli/commands/test.d.ts +4 -0
- package/dist/cli/commands/test.js +95 -58
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/web.d.ts +11 -0
- package/dist/cli/commands/web.js +373 -0
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.js +3 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/packages/agents/lib/execution.js +4 -2
- package/dist/packages/agents/lib/executors.d.ts +1 -0
- package/dist/packages/agents/lib/executors.js +1 -0
- package/dist/packages/agents/lib/render.d.ts +2 -2
- package/dist/packages/agents/lib/render.js +10 -9
- package/dist/packages/agents/lib/shells.d.ts +3 -11
- package/dist/packages/agents/lib/shells.js +58 -106
- package/dist/packages/agents/lib/types.d.ts +1 -0
- package/dist/packages/compiler/compiled-paths.d.ts +4 -1
- package/dist/packages/compiler/compiled-paths.js +8 -2
- package/dist/packages/compiler/compiled-pipeline.d.ts +7 -0
- package/dist/packages/compiler/compiled-pipeline.js +15 -4
- package/dist/packages/compiler/compiled-schema.js +1 -1
- package/dist/packages/compiler/compiled-stage-plan.d.ts +2 -2
- package/dist/packages/compiler/compiled-stage-plan.js +4 -4
- package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -0
- package/dist/packages/compiler/compiled-stage-runner.js +50 -2
- package/dist/packages/compiler/compiled-target.d.ts +1 -1
- package/dist/packages/compiler/compiled-target.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +161 -1
- package/dist/packages/compiler/lib/schema.js +87 -1
- package/dist/packages/compiler/raw-snapshot.d.ts +9 -2
- package/dist/packages/compiler/runtime-acceptance.js +1 -1
- package/dist/packages/compiler/runtime-contracts.js +2 -2
- package/dist/packages/compiler/runtime-prompt.js +7 -7
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +3 -0
- package/dist/packages/compiler/runtime-types.d.ts +1 -0
- package/dist/packages/compiler/state-health.js +1 -1
- package/dist/packages/compiler/state-view.js +2 -2
- package/dist/packages/compiler/validate-compiled.js +11 -9
- package/dist/packages/execution/adapters.d.ts +15 -0
- package/dist/packages/execution/adapters.js +1 -0
- package/dist/packages/execution/events.d.ts +8 -0
- package/dist/packages/execution/events.js +16 -0
- package/dist/packages/execution/index.d.ts +9 -0
- package/dist/packages/execution/index.js +6 -0
- package/dist/packages/execution/lib/schema.d.ts +1554 -0
- package/dist/packages/execution/lib/schema.js +319 -0
- package/dist/packages/local-service/action-values.d.ts +23 -0
- package/dist/packages/local-service/action-values.js +31 -0
- package/dist/packages/local-service/client.d.ts +119 -0
- package/dist/packages/local-service/client.js +356 -0
- package/dist/packages/local-service/index.d.ts +15 -0
- package/dist/packages/local-service/index.js +11 -0
- package/dist/packages/local-service/lib/schema.d.ts +7355 -0
- package/dist/packages/local-service/lib/schema.js +636 -0
- package/dist/packages/local-service/routes.d.ts +27 -0
- package/dist/packages/local-service/routes.js +32 -0
- package/dist/packages/local-service/runtime.d.ts +134 -0
- package/dist/packages/local-service/runtime.js +2841 -0
- package/dist/packages/local-service/server.d.ts +17 -0
- package/dist/packages/local-service/server.js +572 -0
- package/dist/packages/project-model/index.d.ts +2 -1
- package/dist/packages/project-model/index.js +1 -0
- package/dist/packages/project-model/interf-detect.d.ts +6 -2
- package/dist/packages/project-model/interf-detect.js +48 -19
- package/dist/packages/project-model/interf-scaffold.d.ts +1 -0
- package/dist/packages/project-model/interf-scaffold.js +39 -17
- package/dist/packages/project-model/interf.d.ts +2 -2
- package/dist/packages/project-model/interf.js +2 -2
- package/dist/packages/project-model/lib/schema.d.ts +80 -6
- package/dist/packages/project-model/lib/schema.js +29 -19
- package/dist/packages/project-model/project-paths.d.ts +3 -1
- package/dist/packages/project-model/project-paths.js +6 -2
- package/dist/packages/project-model/source-config.d.ts +25 -11
- package/dist/packages/project-model/source-config.js +152 -82
- package/dist/packages/project-model/source-folders.d.ts +11 -0
- package/dist/packages/project-model/source-folders.js +110 -0
- package/dist/packages/testing/test-execution.js +5 -5
- package/dist/packages/testing/test-paths.js +4 -3
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +4 -6
- package/dist/packages/workflow-authoring/workflow-authoring.js +46 -85
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +2 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +83 -49
- package/dist/packages/workflow-authoring/workflow-improvement.js +2 -1
- package/dist/packages/workflow-package/context-interface.js +2 -2
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +6 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +115 -8
- package/dist/packages/workflow-package/local-workflows.js +33 -17
- package/dist/packages/workflow-package/workflow-definitions.d.ts +5 -5
- package/dist/packages/workflow-package/workflow-definitions.js +23 -22
- package/dist/packages/workflow-package/workflow-helpers.js +10 -6
- package/dist/packages/workflow-package/workflow-review-paths.js +5 -1
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +1 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +2 -0
- package/package.json +18 -4
- package/dist/cli/commands/dataset-selection.d.ts +0 -6
- package/dist/cli/commands/dataset-selection.js +0 -11
- package/dist/lib/agent-args.d.ts +0 -1
- package/dist/lib/agent-args.js +0 -1
- package/dist/lib/agent-constants.d.ts +0 -1
- package/dist/lib/agent-constants.js +0 -1
- package/dist/lib/agent-detection.d.ts +0 -1
- package/dist/lib/agent-detection.js +0 -1
- package/dist/lib/agent-execution.d.ts +0 -1
- package/dist/lib/agent-execution.js +0 -1
- package/dist/lib/agent-logs.d.ts +0 -1
- package/dist/lib/agent-logs.js +0 -1
- package/dist/lib/agent-preflight.d.ts +0 -1
- package/dist/lib/agent-preflight.js +0 -1
- package/dist/lib/agent-render.d.ts +0 -1
- package/dist/lib/agent-render.js +0 -1
- package/dist/lib/agent-shells.d.ts +0 -1
- package/dist/lib/agent-shells.js +0 -1
- package/dist/lib/agent-status.d.ts +0 -1
- package/dist/lib/agent-status.js +0 -1
- package/dist/lib/agent-types.d.ts +0 -1
- package/dist/lib/agent-types.js +0 -1
- package/dist/lib/agents.d.ts +0 -1
- package/dist/lib/agents.js +0 -1
- package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
- package/dist/lib/builtin-compiled-workflow.js +0 -1
- package/dist/lib/chart-guidance.d.ts +0 -1
- package/dist/lib/chart-guidance.js +0 -1
- package/dist/lib/compiled-compile.d.ts +0 -1
- package/dist/lib/compiled-compile.js +0 -1
- package/dist/lib/compiled-paths.d.ts +0 -1
- package/dist/lib/compiled-paths.js +0 -3
- package/dist/lib/compiled-raw.d.ts +0 -1
- package/dist/lib/compiled-raw.js +0 -3
- package/dist/lib/compiled-reset.d.ts +0 -1
- package/dist/lib/compiled-reset.js +0 -3
- package/dist/lib/compiled-schema.d.ts +0 -1
- package/dist/lib/compiled-schema.js +0 -1
- package/dist/lib/discovery.d.ts +0 -1
- package/dist/lib/discovery.js +0 -1
- package/dist/lib/execution-profile.d.ts +0 -1
- package/dist/lib/execution-profile.js +0 -1
- package/dist/lib/executors.d.ts +0 -1
- package/dist/lib/executors.js +0 -1
- package/dist/lib/filesystem.d.ts +0 -1
- package/dist/lib/filesystem.js +0 -1
- package/dist/lib/interf-bootstrap.d.ts +0 -1
- package/dist/lib/interf-bootstrap.js +0 -3
- package/dist/lib/interf-detect.d.ts +0 -1
- package/dist/lib/interf-detect.js +0 -3
- package/dist/lib/interf-scaffold.d.ts +0 -1
- package/dist/lib/interf-scaffold.js +0 -3
- package/dist/lib/interf-workflow-package.d.ts +0 -1
- package/dist/lib/interf-workflow-package.js +0 -1
- package/dist/lib/interf.d.ts +0 -1
- package/dist/lib/interf.js +0 -3
- package/dist/lib/local-workflows.d.ts +0 -1
- package/dist/lib/local-workflows.js +0 -1
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/package-root.d.ts +0 -1
- package/dist/lib/package-root.js +0 -1
- package/dist/lib/parse.d.ts +0 -1
- package/dist/lib/parse.js +0 -1
- package/dist/lib/project-paths.d.ts +0 -1
- package/dist/lib/project-paths.js +0 -3
- package/dist/lib/runtime-acceptance.d.ts +0 -1
- package/dist/lib/runtime-acceptance.js +0 -1
- package/dist/lib/runtime-contracts.d.ts +0 -1
- package/dist/lib/runtime-contracts.js +0 -1
- package/dist/lib/runtime-inventory.d.ts +0 -1
- package/dist/lib/runtime-inventory.js +0 -1
- package/dist/lib/runtime-paths.d.ts +0 -1
- package/dist/lib/runtime-paths.js +0 -1
- package/dist/lib/runtime-prompt.d.ts +0 -1
- package/dist/lib/runtime-prompt.js +0 -1
- package/dist/lib/runtime-reconcile.d.ts +0 -1
- package/dist/lib/runtime-reconcile.js +0 -1
- package/dist/lib/runtime-runs.d.ts +0 -1
- package/dist/lib/runtime-runs.js +0 -1
- package/dist/lib/runtime-types.d.ts +0 -1
- package/dist/lib/runtime-types.js +0 -1
- package/dist/lib/runtime.d.ts +0 -1
- package/dist/lib/runtime.js +0 -1
- package/dist/lib/schema.d.ts +0 -4
- package/dist/lib/schema.js +0 -6
- package/dist/lib/source-config.d.ts +0 -1
- package/dist/lib/source-config.js +0 -3
- package/dist/lib/state-artifacts.d.ts +0 -1
- package/dist/lib/state-artifacts.js +0 -1
- package/dist/lib/state-health.d.ts +0 -1
- package/dist/lib/state-health.js +0 -1
- package/dist/lib/state-io.d.ts +0 -1
- package/dist/lib/state-io.js +0 -1
- package/dist/lib/state-paths.d.ts +0 -1
- package/dist/lib/state-paths.js +0 -1
- package/dist/lib/state-view.d.ts +0 -1
- package/dist/lib/state-view.js +0 -1
- package/dist/lib/state.d.ts +0 -1
- package/dist/lib/state.js +0 -1
- package/dist/lib/test-execution.d.ts +0 -1
- package/dist/lib/test-execution.js +0 -3
- package/dist/lib/test-matrices.d.ts +0 -1
- package/dist/lib/test-matrices.js +0 -3
- package/dist/lib/test-paths.d.ts +0 -1
- package/dist/lib/test-paths.js +0 -3
- package/dist/lib/test-profile-presets.d.ts +0 -1
- package/dist/lib/test-profile-presets.js +0 -3
- package/dist/lib/test-sandbox.d.ts +0 -1
- package/dist/lib/test-sandbox.js +0 -3
- package/dist/lib/test-specs.d.ts +0 -1
- package/dist/lib/test-specs.js +0 -3
- package/dist/lib/test-targets.d.ts +0 -1
- package/dist/lib/test-targets.js +0 -3
- package/dist/lib/test-types.d.ts +0 -1
- package/dist/lib/test-types.js +0 -3
- package/dist/lib/test.d.ts +0 -1
- package/dist/lib/test.js +0 -3
- package/dist/lib/util.d.ts +0 -1
- package/dist/lib/util.js +0 -1
- package/dist/lib/validate-compiled.d.ts +0 -1
- package/dist/lib/validate-compiled.js +0 -1
- package/dist/lib/validate-helpers.d.ts +0 -1
- package/dist/lib/validate-helpers.js +0 -1
- package/dist/lib/validate.d.ts +0 -1
- package/dist/lib/validate.js +0 -1
- package/dist/lib/workflow-authoring.d.ts +0 -1
- package/dist/lib/workflow-authoring.js +0 -1
- package/dist/lib/workflow-definitions.d.ts +0 -1
- package/dist/lib/workflow-definitions.js +0 -1
- package/dist/lib/workflow-edit-session.d.ts +0 -1
- package/dist/lib/workflow-edit-session.js +0 -1
- package/dist/lib/workflow-edit-utils.d.ts +0 -1
- package/dist/lib/workflow-edit-utils.js +0 -1
- package/dist/lib/workflow-helpers.d.ts +0 -1
- package/dist/lib/workflow-helpers.js +0 -1
- package/dist/lib/workflow-improvement.d.ts +0 -1
- package/dist/lib/workflow-improvement.js +0 -1
- package/dist/lib/workflow-primitives.d.ts +0 -1
- package/dist/lib/workflow-primitives.js +0 -1
- package/dist/lib/workflow-review-paths.d.ts +0 -1
- package/dist/lib/workflow-review-paths.js +0 -1
- package/dist/lib/workflow-stage-policy.d.ts +0 -1
- package/dist/lib/workflow-stage-policy.js +0 -1
- package/dist/lib/workflow-stage-runner.d.ts +0 -1
- package/dist/lib/workflow-stage-runner.js +0 -1
- package/dist/lib/workflows.d.ts +0 -1
- package/dist/lib/workflows.js +0 -1
|
@@ -4,6 +4,8 @@ import { detectInterf, listCompiledDatasetsForSourceFolder, readInterfConfig, re
|
|
|
4
4
|
import { computeCompiledHealth } from "../../packages/compiler/state.js";
|
|
5
5
|
import { sourceDatasetConfigFromInterfConfig, loadCompiledDatasetConfig, } from "../../packages/project-model/source-config.js";
|
|
6
6
|
import { printSavedTestComparisonState, readCurrentSavedTestComparison } from "./test-flow.js";
|
|
7
|
+
import { findLocalService, readLocalServiceRunSnapshot, } from "../../packages/local-service/index.js";
|
|
8
|
+
import { resolveCommandControlPath } from "./control-path.js";
|
|
7
9
|
function statusColor(status) {
|
|
8
10
|
switch (status) {
|
|
9
11
|
case "compiled":
|
|
@@ -18,23 +20,40 @@ function statusColor(status) {
|
|
|
18
20
|
}
|
|
19
21
|
export const statusCommand = {
|
|
20
22
|
command: "status",
|
|
21
|
-
describe: "Show deterministic health for the
|
|
22
|
-
|
|
23
|
+
describe: "Show deterministic health for the Portable Context agents use",
|
|
24
|
+
builder: (yargs) => yargs.option("watch", {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
default: false,
|
|
27
|
+
describe: "Poll the local Interf service for live run status",
|
|
28
|
+
}),
|
|
29
|
+
handler: async (argv) => {
|
|
23
30
|
let compiledPath = null;
|
|
24
31
|
const detected = detectInterf(process.cwd());
|
|
32
|
+
const serviceProjectPath = detected ? resolveSourceControlPath(detected.path) : resolveCommandControlPath();
|
|
33
|
+
const service = await findLocalService({
|
|
34
|
+
projectPath: serviceProjectPath,
|
|
35
|
+
timeoutMs: 200,
|
|
36
|
+
});
|
|
37
|
+
if (service) {
|
|
38
|
+
await printLocalServiceStatus(service.serviceUrl);
|
|
39
|
+
if (argv.watch === true) {
|
|
40
|
+
await watchLocalServiceStatus(service.serviceUrl);
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
25
44
|
if (detected) {
|
|
26
45
|
compiledPath = detected.path;
|
|
27
46
|
}
|
|
28
47
|
else {
|
|
29
|
-
const sourcePath =
|
|
48
|
+
const sourcePath = resolveCommandControlPath();
|
|
30
49
|
const local = listCompiledDatasetsForSourceFolder(sourcePath).map(({ path, config }) => ({
|
|
31
50
|
path,
|
|
32
51
|
name: config.name,
|
|
33
52
|
}));
|
|
34
53
|
if (local.length === 0) {
|
|
35
54
|
process.exitCode = 1;
|
|
36
|
-
console.log(chalk.red(" No
|
|
37
|
-
console.log(chalk.dim(" Run `interf`, save
|
|
55
|
+
console.log(chalk.red(" No Portable Context found."));
|
|
56
|
+
console.log(chalk.dim(" Run `interf`, save readiness checks, and compile Portable Context agents can use first."));
|
|
38
57
|
return;
|
|
39
58
|
}
|
|
40
59
|
if (local.length === 1) {
|
|
@@ -42,7 +61,7 @@ export const statusCommand = {
|
|
|
42
61
|
}
|
|
43
62
|
else {
|
|
44
63
|
const selected = await p.select({
|
|
45
|
-
message: "Which
|
|
64
|
+
message: "Which Portable Context?",
|
|
46
65
|
options: local.map((entry) => ({ value: entry.path, label: entry.name })),
|
|
47
66
|
});
|
|
48
67
|
if (p.isCancel(selected))
|
|
@@ -74,8 +93,8 @@ export const statusCommand = {
|
|
|
74
93
|
else {
|
|
75
94
|
console.log();
|
|
76
95
|
console.log(chalk.dim(latestComparisonState.stale
|
|
77
|
-
? " Saved
|
|
78
|
-
: " No saved
|
|
96
|
+
? " Saved readiness results are stale for the current checks. Run `interf test` again."
|
|
97
|
+
: " No saved readiness check run yet. Run `interf test` to check source files and Portable Context."));
|
|
79
98
|
}
|
|
80
99
|
console.log();
|
|
81
100
|
const metricOrder = [
|
|
@@ -100,3 +119,92 @@ export const statusCommand = {
|
|
|
100
119
|
}
|
|
101
120
|
},
|
|
102
121
|
};
|
|
122
|
+
function formatEventTime(value) {
|
|
123
|
+
const date = new Date(value);
|
|
124
|
+
if (Number.isNaN(date.valueOf()))
|
|
125
|
+
return value;
|
|
126
|
+
return date.toLocaleTimeString([], {
|
|
127
|
+
hour: "2-digit",
|
|
128
|
+
minute: "2-digit",
|
|
129
|
+
second: "2-digit",
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function testScore(run) {
|
|
133
|
+
const compiled = run.comparison?.compiled;
|
|
134
|
+
const raw = run.comparison?.raw;
|
|
135
|
+
if (compiled)
|
|
136
|
+
return `${compiled.passed_cases}/${compiled.total_cases}`;
|
|
137
|
+
if (raw)
|
|
138
|
+
return `${raw.passed_cases}/${raw.total_cases}`;
|
|
139
|
+
return "pending";
|
|
140
|
+
}
|
|
141
|
+
function compileRunEventDetail(event) {
|
|
142
|
+
if ("message" in event && typeof event.message === "string")
|
|
143
|
+
return event.message;
|
|
144
|
+
if ("summary" in event && typeof event.summary === "string")
|
|
145
|
+
return event.summary;
|
|
146
|
+
if ("error" in event && typeof event.error === "string")
|
|
147
|
+
return event.error;
|
|
148
|
+
if ("stage_id" in event && typeof event.stage_id === "string")
|
|
149
|
+
return event.stage_id;
|
|
150
|
+
return "recorded";
|
|
151
|
+
}
|
|
152
|
+
async function printLocalServiceStatus(serviceUrl) {
|
|
153
|
+
const { jobs, compileRuns, testRuns } = await readLocalServiceRunSnapshot({ serviceUrl });
|
|
154
|
+
const latestJob = jobs[0] ?? null;
|
|
155
|
+
const latestCompile = compileRuns[0]?.run ?? null;
|
|
156
|
+
const latestTest = testRuns[0] ?? null;
|
|
157
|
+
console.log();
|
|
158
|
+
console.log(chalk.green(" Interf local service is running"));
|
|
159
|
+
console.log(chalk.dim(` Interf: ${serviceUrl}/`));
|
|
160
|
+
if (latestJob) {
|
|
161
|
+
console.log();
|
|
162
|
+
console.log(chalk.bold(` Latest local job: ${latestJob.title}`));
|
|
163
|
+
console.log(chalk.dim(` run: ${latestJob.run_id}`));
|
|
164
|
+
console.log(chalk.dim(` type: ${latestJob.job_type}`));
|
|
165
|
+
console.log(chalk.dim(` status: ${latestJob.status}`));
|
|
166
|
+
const stepSummary = latestJob.steps
|
|
167
|
+
.map((step) => `${step.id}:${step.status}`)
|
|
168
|
+
.join(", ");
|
|
169
|
+
if (stepSummary)
|
|
170
|
+
console.log(chalk.dim(` steps: ${stepSummary}`));
|
|
171
|
+
for (const event of latestJob.events.slice(-4)) {
|
|
172
|
+
const detail = event.message ?? event.step_id ?? "recorded";
|
|
173
|
+
console.log(chalk.dim(` ${formatEventTime(event.timestamp)} ${event.type} ${detail}`));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (latestCompile) {
|
|
177
|
+
console.log();
|
|
178
|
+
console.log(chalk.bold(` Latest prepare run: ${latestCompile.preparation}`));
|
|
179
|
+
console.log(chalk.dim(` run: ${latestCompile.run_id}`));
|
|
180
|
+
console.log(chalk.dim(` status: ${latestCompile.status}`));
|
|
181
|
+
console.log(chalk.dim(` Method: ${latestCompile.method}`));
|
|
182
|
+
const stageSummary = latestCompile.stages
|
|
183
|
+
.map((stage) => `${stage.stage_id}:${stage.status}`)
|
|
184
|
+
.join(", ");
|
|
185
|
+
if (stageSummary)
|
|
186
|
+
console.log(chalk.dim(` stages: ${stageSummary}`));
|
|
187
|
+
const events = latestCompile.events.slice(-6);
|
|
188
|
+
for (const event of events) {
|
|
189
|
+
const detail = compileRunEventDetail(event);
|
|
190
|
+
console.log(chalk.dim(` ${formatEventTime(event.timestamp)} ${event.type} ${detail}`));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
console.log(chalk.dim(" No prepare runs recorded by the local service yet."));
|
|
195
|
+
}
|
|
196
|
+
if (latestTest) {
|
|
197
|
+
console.log();
|
|
198
|
+
console.log(chalk.bold(` Latest readiness check run: ${latestTest.preparation}`));
|
|
199
|
+
console.log(chalk.dim(` status: ${latestTest.status}`));
|
|
200
|
+
console.log(chalk.dim(` mode: ${latestTest.mode}`));
|
|
201
|
+
console.log(chalk.dim(` readiness checks: ${testScore(latestTest)}`));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async function watchLocalServiceStatus(serviceUrl) {
|
|
205
|
+
while (true) {
|
|
206
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
207
|
+
console.clear();
|
|
208
|
+
await printLocalServiceStatus(serviceUrl);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -14,7 +14,7 @@ export interface AgentTestMatrixRow {
|
|
|
14
14
|
rawOutcome?: SavedTestOutcome | null;
|
|
15
15
|
compiledOutcome?: SavedTestOutcome | null;
|
|
16
16
|
}
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function readinessPassRate(outcome: SavedTestOutcome): number;
|
|
18
18
|
export declare function readSavedTestComparison(projectPath: string, datasetName: string): TestRunComparison | null;
|
|
19
19
|
export declare function readCurrentSavedTestComparison(options: {
|
|
20
20
|
projectPath: string;
|
|
@@ -2,14 +2,15 @@ import chalk from "chalk";
|
|
|
2
2
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { createRawTestTarget, createCompiledTestTarget, runTargetTestsAuto, saveTargetTestRun, } from "../../packages/testing/test.js";
|
|
5
|
-
import { buildTestSpecFromSourceFolderConfig, buildTestSpecFromCompiledDatasetConfig,
|
|
6
|
-
import {
|
|
5
|
+
import { buildTestSpecFromSourceFolderConfig, buildTestSpecFromCompiledDatasetConfig, fingerprintReadinessChecks, resolveSourceDatasetPath, } from "../../packages/project-model/source-config.js";
|
|
6
|
+
import { ensurePortableContextScaffold, } from "../../packages/project-model/interf.js";
|
|
7
|
+
import { datasetLatestTestStatePath, datasetLatestTestSummaryPath, normalizeDatasetTestRunId, datasetTestRunPath, datasetTestRunsRoot, } from "../../packages/project-model/project-paths.js";
|
|
7
8
|
import { testRootForCompiled } from "../../packages/project-model/compiled-paths.js";
|
|
8
9
|
import { readJsonFileWithSchema } from "../../packages/shared/parse.js";
|
|
9
10
|
import { TestRunComparisonSchema } from "../../packages/testing/lib/schema.js";
|
|
10
11
|
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
11
12
|
import { findBuiltCompiledPath } from "./compiled-flow.js";
|
|
12
|
-
export function
|
|
13
|
+
export function readinessPassRate(outcome) {
|
|
13
14
|
return outcome.result.totalCases > 0
|
|
14
15
|
? Math.round((outcome.result.passedCases / outcome.result.totalCases) * 100)
|
|
15
16
|
: 0;
|
|
@@ -50,7 +51,7 @@ export function readCurrentSavedTestComparison(options) {
|
|
|
50
51
|
if (!latestComparison) {
|
|
51
52
|
return { comparison: null, stale: false };
|
|
52
53
|
}
|
|
53
|
-
const currentFingerprint =
|
|
54
|
+
const currentFingerprint = fingerprintReadinessChecks(options.checks);
|
|
54
55
|
if (!latestComparison.checks_fingerprint || latestComparison.checks_fingerprint !== currentFingerprint) {
|
|
55
56
|
return { comparison: null, stale: true };
|
|
56
57
|
}
|
|
@@ -58,21 +59,21 @@ export function readCurrentSavedTestComparison(options) {
|
|
|
58
59
|
}
|
|
59
60
|
function renderLatestSummaryMarkdown(payload) {
|
|
60
61
|
const lines = [
|
|
61
|
-
"# Latest
|
|
62
|
+
"# Latest Readiness Results",
|
|
62
63
|
"",
|
|
63
|
-
"| Target |
|
|
64
|
+
"| Target | Readiness checks |",
|
|
64
65
|
"| --- | --- |",
|
|
65
66
|
];
|
|
66
67
|
if (payload.raw) {
|
|
67
68
|
lines.push(`| Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
|
|
68
69
|
}
|
|
69
70
|
if (payload.compiled) {
|
|
70
|
-
lines.push(`| Portable
|
|
71
|
+
lines.push(`| Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
|
|
71
72
|
}
|
|
72
73
|
lines.push("");
|
|
73
74
|
if (payload.summary.raw_pass_rate != null && payload.summary.compiled_pass_rate != null) {
|
|
74
75
|
const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
|
|
75
|
-
lines.push(`
|
|
76
|
+
lines.push(`Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`, "");
|
|
76
77
|
}
|
|
77
78
|
if (payload.raw) {
|
|
78
79
|
lines.push(`- Latest source-files run: ${payload.raw.run_path}`);
|
|
@@ -84,15 +85,15 @@ function renderLatestSummaryMarkdown(payload) {
|
|
|
84
85
|
}
|
|
85
86
|
export function printSavedTestComparisonState(payload, comparisonRunPath) {
|
|
86
87
|
console.log();
|
|
87
|
-
console.log(chalk.bold(" Latest
|
|
88
|
+
console.log(chalk.bold(" Latest readiness results"));
|
|
88
89
|
console.log();
|
|
89
|
-
console.log(" | Target |
|
|
90
|
+
console.log(" | Target | Readiness checks |");
|
|
90
91
|
console.log(" | --- | --- |");
|
|
91
92
|
if (payload.raw) {
|
|
92
93
|
console.log(` | Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
|
|
93
94
|
}
|
|
94
95
|
if (payload.compiled) {
|
|
95
|
-
console.log(` | Portable
|
|
96
|
+
console.log(` | Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
|
|
96
97
|
}
|
|
97
98
|
if (!payload.raw || !payload.compiled) {
|
|
98
99
|
console.log();
|
|
@@ -107,7 +108,7 @@ export function printSavedTestComparisonState(payload, comparisonRunPath) {
|
|
|
107
108
|
const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
|
|
108
109
|
const color = (payload.summary.pass_rate_delta ?? 0) >= 0 ? chalk.green : chalk.red;
|
|
109
110
|
console.log();
|
|
110
|
-
console.log(color(`
|
|
111
|
+
console.log(color(` Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`));
|
|
111
112
|
}
|
|
112
113
|
if (comparisonRunPath) {
|
|
113
114
|
console.log();
|
|
@@ -117,7 +118,7 @@ export function printSavedTestComparisonState(payload, comparisonRunPath) {
|
|
|
117
118
|
function padCell(value, width) {
|
|
118
119
|
return value.padEnd(width, " ");
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function resultCell(outcome) {
|
|
121
122
|
if (!outcome)
|
|
122
123
|
return "—";
|
|
123
124
|
return `${outcome.result.passedCases}/${outcome.result.totalCases}`;
|
|
@@ -137,13 +138,13 @@ export function printAgentTestMatrix(rows) {
|
|
|
137
138
|
const headers = [
|
|
138
139
|
"Agent",
|
|
139
140
|
...(includeRaw ? ["Source files"] : []),
|
|
140
|
-
...(includeCompiled ? ["Context
|
|
141
|
+
...(includeCompiled ? ["Portable Context"] : []),
|
|
141
142
|
...(includeDelta ? ["Delta"] : []),
|
|
142
143
|
];
|
|
143
144
|
const body = rows.map((row) => [
|
|
144
145
|
row.agentLabel,
|
|
145
|
-
...(includeRaw ? [
|
|
146
|
-
...(includeCompiled ? [
|
|
146
|
+
...(includeRaw ? [resultCell(row.rawOutcome)] : []),
|
|
147
|
+
...(includeCompiled ? [resultCell(row.compiledOutcome)] : []),
|
|
147
148
|
...(includeDelta ? [deltaCell(row)] : []),
|
|
148
149
|
]);
|
|
149
150
|
const widths = headers.map((header, index) => Math.max(header.length, ...body.map((row) => (row[index] ?? "").length)));
|
|
@@ -162,7 +163,7 @@ export function printAgentTestFailures(rows) {
|
|
|
162
163
|
const failures = [];
|
|
163
164
|
for (const [label, outcome] of [
|
|
164
165
|
["Source files", row.rawOutcome ?? null],
|
|
165
|
-
["Context
|
|
166
|
+
["Portable Context", row.compiledOutcome ?? null],
|
|
166
167
|
]) {
|
|
167
168
|
if (!outcome || outcome.result.ok)
|
|
168
169
|
continue;
|
|
@@ -170,7 +171,7 @@ export function printAgentTestFailures(rows) {
|
|
|
170
171
|
if (caseResult.ok)
|
|
171
172
|
continue;
|
|
172
173
|
const reason = caseResult.checks.find((entry) => !entry.ok)?.detail ?? "failed";
|
|
173
|
-
failures.push(`${label} ·
|
|
174
|
+
failures.push(`${label} · Check ${index + 1}: ${reason}`);
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
177
|
if (failures.length === 0)
|
|
@@ -204,11 +205,11 @@ export function printSavedTestOutcome(prefix, outcome) {
|
|
|
204
205
|
const status = outcome.result.ok ? chalk.green("PASS") : chalk.red("FAIL");
|
|
205
206
|
console.log(chalk.bold(` ${prefix}`));
|
|
206
207
|
console.log();
|
|
207
|
-
console.log(color(` ${status} ${outcome.result.passedCases}/${outcome.result.totalCases}
|
|
208
|
+
console.log(color(` ${status} ${outcome.result.passedCases}/${outcome.result.totalCases} readiness checks`));
|
|
208
209
|
console.log();
|
|
209
210
|
for (const [index, caseResult] of outcome.result.caseResults.entries()) {
|
|
210
211
|
const caseStatus = caseResult.ok ? chalk.green("PASS") : chalk.red("FAIL");
|
|
211
|
-
console.log(` ${caseStatus}
|
|
212
|
+
console.log(` ${caseStatus} Check ${index + 1}`);
|
|
212
213
|
console.log(chalk.dim(` ${caseResult.question}`));
|
|
213
214
|
const failedChecks = caseResult.checks.filter((entry) => !entry.ok).slice(0, 3);
|
|
214
215
|
for (const failedCheck of failedChecks) {
|
|
@@ -232,16 +233,16 @@ export function printSavedTestComparison(rawOutcome, compiledOutcome, comparison
|
|
|
232
233
|
if (compiledOutcome) {
|
|
233
234
|
if (rawOutcome)
|
|
234
235
|
console.log();
|
|
235
|
-
printSavedTestOutcome("Context
|
|
236
|
+
printSavedTestOutcome("Portable Context", compiledOutcome);
|
|
236
237
|
}
|
|
237
238
|
if (rawOutcome && compiledOutcome) {
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const delta =
|
|
239
|
+
const rawReadiness = readinessPassRate(rawOutcome);
|
|
240
|
+
const compiledReadiness = readinessPassRate(compiledOutcome);
|
|
241
|
+
const delta = compiledReadiness - rawReadiness;
|
|
241
242
|
const color = delta >= 0 ? chalk.green : chalk.red;
|
|
242
243
|
const direction = delta >= 0 ? "improved" : "decreased";
|
|
243
244
|
console.log();
|
|
244
|
-
console.log(color(`
|
|
245
|
+
console.log(color(` Readiness-check pass rate ${direction} from ${rawReadiness}% to ${compiledReadiness}%.`));
|
|
245
246
|
}
|
|
246
247
|
if (comparisonRunPath) {
|
|
247
248
|
console.log();
|
|
@@ -254,22 +255,22 @@ export function printSavedTestComparisonSummary(rawOutcome, compiledOutcome, com
|
|
|
254
255
|
console.log();
|
|
255
256
|
console.log(chalk.bold(" Comparison"));
|
|
256
257
|
console.log();
|
|
257
|
-
console.log(" | Target |
|
|
258
|
+
console.log(" | Target | Readiness checks |");
|
|
258
259
|
console.log(" | --- | --- |");
|
|
259
260
|
if (rawOutcome) {
|
|
260
261
|
console.log(` | Source files | \`${rawOutcome.result.passedCases}/${rawOutcome.result.totalCases}\` |`);
|
|
261
262
|
}
|
|
262
263
|
if (compiledOutcome) {
|
|
263
|
-
console.log(` | Context
|
|
264
|
+
console.log(` | Portable Context | \`${compiledOutcome.result.passedCases}/${compiledOutcome.result.totalCases}\` |`);
|
|
264
265
|
}
|
|
265
266
|
if (rawOutcome && compiledOutcome) {
|
|
266
|
-
const
|
|
267
|
-
const
|
|
268
|
-
const delta =
|
|
267
|
+
const rawReadiness = readinessPassRate(rawOutcome);
|
|
268
|
+
const compiledReadiness = readinessPassRate(compiledOutcome);
|
|
269
|
+
const delta = compiledReadiness - rawReadiness;
|
|
269
270
|
const color = delta >= 0 ? chalk.green : chalk.red;
|
|
270
271
|
const direction = delta >= 0 ? "improved" : "decreased";
|
|
271
272
|
console.log();
|
|
272
|
-
console.log(color(`
|
|
273
|
+
console.log(color(` Readiness-check pass rate ${direction} from ${rawReadiness}% to ${compiledReadiness}%.`));
|
|
273
274
|
}
|
|
274
275
|
if (comparisonRunPath) {
|
|
275
276
|
console.log();
|
|
@@ -282,7 +283,7 @@ export function saveTestComparisonRun(options) {
|
|
|
282
283
|
? summarizeSavedTestOutcome("Source files", options.rawOutcome)
|
|
283
284
|
: null;
|
|
284
285
|
const compiledSummary = options.compiledOutcome
|
|
285
|
-
? summarizeSavedTestOutcome("Context
|
|
286
|
+
? summarizeSavedTestOutcome("Portable Context", options.compiledOutcome)
|
|
286
287
|
: null;
|
|
287
288
|
const effectiveMode = rawSummary && compiledSummary
|
|
288
289
|
? "both"
|
|
@@ -343,11 +344,12 @@ export async function runSavedRawTest(options) {
|
|
|
343
344
|
return null;
|
|
344
345
|
}
|
|
345
346
|
const datasetSourcePath = resolveSourceDatasetPath(options.sourcePath, options.datasetConfig);
|
|
347
|
+
const portableContextPath = ensurePortableContextScaffold(options.sourcePath, options.datasetConfig.name, options.datasetConfig.workflow ?? "interf");
|
|
346
348
|
const target = createRawTestTarget(datasetSourcePath);
|
|
347
349
|
const run = await runTargetTestsAuto(datasetSourcePath, spec, [target], {
|
|
348
350
|
executor,
|
|
349
351
|
preserveSandboxes: options.preserveSandboxes ?? "on-failure",
|
|
350
|
-
artifactRootPath:
|
|
352
|
+
artifactRootPath: testRootForCompiled(portableContextPath),
|
|
351
353
|
});
|
|
352
354
|
const result = run.results[0];
|
|
353
355
|
if (!result)
|
|
@@ -9,6 +9,10 @@ export interface TestCommandResult {
|
|
|
9
9
|
mode: TestMode;
|
|
10
10
|
rows: AgentTestMatrixRow[];
|
|
11
11
|
}
|
|
12
|
+
export interface TestCommandFailure {
|
|
13
|
+
message: string;
|
|
14
|
+
hints: string[];
|
|
15
|
+
}
|
|
12
16
|
export declare const testCommand: CommandModule;
|
|
13
17
|
export declare function runTestCommand(argv?: Record<string, unknown>): Promise<boolean>;
|
|
14
18
|
export {};
|