@interf/compiler 0.7.3 → 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 +123 -89
- 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 +4 -4
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +1 -1
- package/builtin-workflows/interf/improve/SKILL.md +1 -1
- package/builtin-workflows/interf/use/query/SKILL.md +1 -1
- package/builtin-workflows/interf/workflow.json +8 -8
- package/builtin-workflows/interf/workflow.schema.json +1 -1
- 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 +6 -0
- package/dist/cli/commands/create-workflow-wizard.js +191 -77
- package/dist/cli/commands/create.js +54 -40
- package/dist/cli/commands/default.js +4 -3
- package/dist/cli/commands/doctor.js +5 -5
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.js +326 -76
- 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 -3
- package/dist/cli/commands/source-config-wizard.js +175 -197
- 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 +31 -31
- 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 +45 -96
- 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 +7 -1
- 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 +6 -6
- 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 +25 -10
- package/dist/packages/project-model/interf-scaffold.js +9 -6
- package/dist/packages/project-model/interf.d.ts +1 -1
- package/dist/packages/project-model/interf.js +1 -1
- 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/source-config.d.ts +22 -13
- package/dist/packages/project-model/source-config.js +140 -123
- 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 +1 -3
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +4 -6
- package/dist/packages/workflow-authoring/workflow-authoring.js +45 -86
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +2 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +80 -49
- package/dist/packages/workflow-authoring/workflow-improvement.js +2 -1
- package/dist/packages/workflow-package/context-interface.js +1 -1
- 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-stage-runner.d.ts +1 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +2 -0
- package/package.json +17 -1
- 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,7 +2,7 @@ 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,
|
|
5
|
+
import { buildTestSpecFromSourceFolderConfig, buildTestSpecFromCompiledDatasetConfig, fingerprintReadinessChecks, resolveSourceDatasetPath, } from "../../packages/project-model/source-config.js";
|
|
6
6
|
import { ensurePortableContextScaffold, } from "../../packages/project-model/interf.js";
|
|
7
7
|
import { datasetLatestTestStatePath, datasetLatestTestSummaryPath, normalizeDatasetTestRunId, datasetTestRunPath, datasetTestRunsRoot, } from "../../packages/project-model/project-paths.js";
|
|
8
8
|
import { testRootForCompiled } from "../../packages/project-model/compiled-paths.js";
|
|
@@ -10,7 +10,7 @@ import { readJsonFileWithSchema } from "../../packages/shared/parse.js";
|
|
|
10
10
|
import { TestRunComparisonSchema } from "../../packages/testing/lib/schema.js";
|
|
11
11
|
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
12
12
|
import { findBuiltCompiledPath } from "./compiled-flow.js";
|
|
13
|
-
export function
|
|
13
|
+
export function readinessPassRate(outcome) {
|
|
14
14
|
return outcome.result.totalCases > 0
|
|
15
15
|
? Math.round((outcome.result.passedCases / outcome.result.totalCases) * 100)
|
|
16
16
|
: 0;
|
|
@@ -51,7 +51,7 @@ export function readCurrentSavedTestComparison(options) {
|
|
|
51
51
|
if (!latestComparison) {
|
|
52
52
|
return { comparison: null, stale: false };
|
|
53
53
|
}
|
|
54
|
-
const currentFingerprint =
|
|
54
|
+
const currentFingerprint = fingerprintReadinessChecks(options.checks);
|
|
55
55
|
if (!latestComparison.checks_fingerprint || latestComparison.checks_fingerprint !== currentFingerprint) {
|
|
56
56
|
return { comparison: null, stale: true };
|
|
57
57
|
}
|
|
@@ -59,21 +59,21 @@ export function readCurrentSavedTestComparison(options) {
|
|
|
59
59
|
}
|
|
60
60
|
function renderLatestSummaryMarkdown(payload) {
|
|
61
61
|
const lines = [
|
|
62
|
-
"# Latest
|
|
62
|
+
"# Latest Readiness Results",
|
|
63
63
|
"",
|
|
64
|
-
"| Target |
|
|
64
|
+
"| Target | Readiness checks |",
|
|
65
65
|
"| --- | --- |",
|
|
66
66
|
];
|
|
67
67
|
if (payload.raw) {
|
|
68
68
|
lines.push(`| Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
|
|
69
69
|
}
|
|
70
70
|
if (payload.compiled) {
|
|
71
|
-
lines.push(`| Portable
|
|
71
|
+
lines.push(`| Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
|
|
72
72
|
}
|
|
73
73
|
lines.push("");
|
|
74
74
|
if (payload.summary.raw_pass_rate != null && payload.summary.compiled_pass_rate != null) {
|
|
75
75
|
const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
|
|
76
|
-
lines.push(`
|
|
76
|
+
lines.push(`Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`, "");
|
|
77
77
|
}
|
|
78
78
|
if (payload.raw) {
|
|
79
79
|
lines.push(`- Latest source-files run: ${payload.raw.run_path}`);
|
|
@@ -85,15 +85,15 @@ function renderLatestSummaryMarkdown(payload) {
|
|
|
85
85
|
}
|
|
86
86
|
export function printSavedTestComparisonState(payload, comparisonRunPath) {
|
|
87
87
|
console.log();
|
|
88
|
-
console.log(chalk.bold(" Latest
|
|
88
|
+
console.log(chalk.bold(" Latest readiness results"));
|
|
89
89
|
console.log();
|
|
90
|
-
console.log(" | Target |
|
|
90
|
+
console.log(" | Target | Readiness checks |");
|
|
91
91
|
console.log(" | --- | --- |");
|
|
92
92
|
if (payload.raw) {
|
|
93
93
|
console.log(` | Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
|
|
94
94
|
}
|
|
95
95
|
if (payload.compiled) {
|
|
96
|
-
console.log(` | Portable
|
|
96
|
+
console.log(` | Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
|
|
97
97
|
}
|
|
98
98
|
if (!payload.raw || !payload.compiled) {
|
|
99
99
|
console.log();
|
|
@@ -108,7 +108,7 @@ export function printSavedTestComparisonState(payload, comparisonRunPath) {
|
|
|
108
108
|
const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
|
|
109
109
|
const color = (payload.summary.pass_rate_delta ?? 0) >= 0 ? chalk.green : chalk.red;
|
|
110
110
|
console.log();
|
|
111
|
-
console.log(color(`
|
|
111
|
+
console.log(color(` Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`));
|
|
112
112
|
}
|
|
113
113
|
if (comparisonRunPath) {
|
|
114
114
|
console.log();
|
|
@@ -118,7 +118,7 @@ export function printSavedTestComparisonState(payload, comparisonRunPath) {
|
|
|
118
118
|
function padCell(value, width) {
|
|
119
119
|
return value.padEnd(width, " ");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function resultCell(outcome) {
|
|
122
122
|
if (!outcome)
|
|
123
123
|
return "—";
|
|
124
124
|
return `${outcome.result.passedCases}/${outcome.result.totalCases}`;
|
|
@@ -138,13 +138,13 @@ export function printAgentTestMatrix(rows) {
|
|
|
138
138
|
const headers = [
|
|
139
139
|
"Agent",
|
|
140
140
|
...(includeRaw ? ["Source files"] : []),
|
|
141
|
-
...(includeCompiled ? ["Portable
|
|
141
|
+
...(includeCompiled ? ["Portable Context"] : []),
|
|
142
142
|
...(includeDelta ? ["Delta"] : []),
|
|
143
143
|
];
|
|
144
144
|
const body = rows.map((row) => [
|
|
145
145
|
row.agentLabel,
|
|
146
|
-
...(includeRaw ? [
|
|
147
|
-
...(includeCompiled ? [
|
|
146
|
+
...(includeRaw ? [resultCell(row.rawOutcome)] : []),
|
|
147
|
+
...(includeCompiled ? [resultCell(row.compiledOutcome)] : []),
|
|
148
148
|
...(includeDelta ? [deltaCell(row)] : []),
|
|
149
149
|
]);
|
|
150
150
|
const widths = headers.map((header, index) => Math.max(header.length, ...body.map((row) => (row[index] ?? "").length)));
|
|
@@ -163,7 +163,7 @@ export function printAgentTestFailures(rows) {
|
|
|
163
163
|
const failures = [];
|
|
164
164
|
for (const [label, outcome] of [
|
|
165
165
|
["Source files", row.rawOutcome ?? null],
|
|
166
|
-
["Portable
|
|
166
|
+
["Portable Context", row.compiledOutcome ?? null],
|
|
167
167
|
]) {
|
|
168
168
|
if (!outcome || outcome.result.ok)
|
|
169
169
|
continue;
|
|
@@ -171,7 +171,7 @@ export function printAgentTestFailures(rows) {
|
|
|
171
171
|
if (caseResult.ok)
|
|
172
172
|
continue;
|
|
173
173
|
const reason = caseResult.checks.find((entry) => !entry.ok)?.detail ?? "failed";
|
|
174
|
-
failures.push(`${label} ·
|
|
174
|
+
failures.push(`${label} · Check ${index + 1}: ${reason}`);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
if (failures.length === 0)
|
|
@@ -205,11 +205,11 @@ export function printSavedTestOutcome(prefix, outcome) {
|
|
|
205
205
|
const status = outcome.result.ok ? chalk.green("PASS") : chalk.red("FAIL");
|
|
206
206
|
console.log(chalk.bold(` ${prefix}`));
|
|
207
207
|
console.log();
|
|
208
|
-
console.log(color(` ${status} ${outcome.result.passedCases}/${outcome.result.totalCases}
|
|
208
|
+
console.log(color(` ${status} ${outcome.result.passedCases}/${outcome.result.totalCases} readiness checks`));
|
|
209
209
|
console.log();
|
|
210
210
|
for (const [index, caseResult] of outcome.result.caseResults.entries()) {
|
|
211
211
|
const caseStatus = caseResult.ok ? chalk.green("PASS") : chalk.red("FAIL");
|
|
212
|
-
console.log(` ${caseStatus}
|
|
212
|
+
console.log(` ${caseStatus} Check ${index + 1}`);
|
|
213
213
|
console.log(chalk.dim(` ${caseResult.question}`));
|
|
214
214
|
const failedChecks = caseResult.checks.filter((entry) => !entry.ok).slice(0, 3);
|
|
215
215
|
for (const failedCheck of failedChecks) {
|
|
@@ -233,16 +233,16 @@ export function printSavedTestComparison(rawOutcome, compiledOutcome, comparison
|
|
|
233
233
|
if (compiledOutcome) {
|
|
234
234
|
if (rawOutcome)
|
|
235
235
|
console.log();
|
|
236
|
-
printSavedTestOutcome("Portable
|
|
236
|
+
printSavedTestOutcome("Portable Context", compiledOutcome);
|
|
237
237
|
}
|
|
238
238
|
if (rawOutcome && compiledOutcome) {
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
const delta =
|
|
239
|
+
const rawReadiness = readinessPassRate(rawOutcome);
|
|
240
|
+
const compiledReadiness = readinessPassRate(compiledOutcome);
|
|
241
|
+
const delta = compiledReadiness - rawReadiness;
|
|
242
242
|
const color = delta >= 0 ? chalk.green : chalk.red;
|
|
243
243
|
const direction = delta >= 0 ? "improved" : "decreased";
|
|
244
244
|
console.log();
|
|
245
|
-
console.log(color(`
|
|
245
|
+
console.log(color(` Readiness-check pass rate ${direction} from ${rawReadiness}% to ${compiledReadiness}%.`));
|
|
246
246
|
}
|
|
247
247
|
if (comparisonRunPath) {
|
|
248
248
|
console.log();
|
|
@@ -255,22 +255,22 @@ export function printSavedTestComparisonSummary(rawOutcome, compiledOutcome, com
|
|
|
255
255
|
console.log();
|
|
256
256
|
console.log(chalk.bold(" Comparison"));
|
|
257
257
|
console.log();
|
|
258
|
-
console.log(" | Target |
|
|
258
|
+
console.log(" | Target | Readiness checks |");
|
|
259
259
|
console.log(" | --- | --- |");
|
|
260
260
|
if (rawOutcome) {
|
|
261
261
|
console.log(` | Source files | \`${rawOutcome.result.passedCases}/${rawOutcome.result.totalCases}\` |`);
|
|
262
262
|
}
|
|
263
263
|
if (compiledOutcome) {
|
|
264
|
-
console.log(` | Portable
|
|
264
|
+
console.log(` | Portable Context | \`${compiledOutcome.result.passedCases}/${compiledOutcome.result.totalCases}\` |`);
|
|
265
265
|
}
|
|
266
266
|
if (rawOutcome && compiledOutcome) {
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const delta =
|
|
267
|
+
const rawReadiness = readinessPassRate(rawOutcome);
|
|
268
|
+
const compiledReadiness = readinessPassRate(compiledOutcome);
|
|
269
|
+
const delta = compiledReadiness - rawReadiness;
|
|
270
270
|
const color = delta >= 0 ? chalk.green : chalk.red;
|
|
271
271
|
const direction = delta >= 0 ? "improved" : "decreased";
|
|
272
272
|
console.log();
|
|
273
|
-
console.log(color(`
|
|
273
|
+
console.log(color(` Readiness-check pass rate ${direction} from ${rawReadiness}% to ${compiledReadiness}%.`));
|
|
274
274
|
}
|
|
275
275
|
if (comparisonRunPath) {
|
|
276
276
|
console.log();
|
|
@@ -283,7 +283,7 @@ export function saveTestComparisonRun(options) {
|
|
|
283
283
|
? summarizeSavedTestOutcome("Source files", options.rawOutcome)
|
|
284
284
|
: null;
|
|
285
285
|
const compiledSummary = options.compiledOutcome
|
|
286
|
-
? summarizeSavedTestOutcome("Portable
|
|
286
|
+
? summarizeSavedTestOutcome("Portable Context", options.compiledOutcome)
|
|
287
287
|
: null;
|
|
288
288
|
const effectiveMode = rawSummary && compiledSummary
|
|
289
289
|
? "both"
|
|
@@ -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 {};
|