pi-harness-runtime 1.1.383 → 1.1.384
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/harness/job-state-machine.ts +97 -10
- package/harness/langchain/surge.test.ts +57 -25
- package/package.json +8 -4
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/dist/minimax-browser-auth.d.ts +1 -0
- package/packages/auth/dist/minimax-browser-auth.d.ts.map +1 -1
- package/packages/auth/dist/minimax-browser-auth.js +2 -2
- package/packages/auth/dist/minimax-browser-auth.js.map +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/auth/src/minimax-browser-auth.ts +15 -3
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/dist/checkpoint-manager.d.ts.map +1 -1
- package/packages/checkpoint/dist/checkpoint-manager.js +3 -0
- package/packages/checkpoint/dist/checkpoint-manager.js.map +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/checkpoint/src/checkpoint-manager.ts +8 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/connection-runtime/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/durable-review/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-sink/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/permission-mode/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/telegram/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/voice-api/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
- package/scripts/run-e2e-scripts.mjs +74 -0
- package/scripts/run-langchain-tests.mjs +169 -0
- package/scripts/typecheck-packages.mjs +167 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Run the standalone e2e scripts in e2e/*.e2e.ts.
|
|
4
|
+
*
|
|
5
|
+
* These are scripts, not test files: they were named `*.test.ts`, which made
|
|
6
|
+
* `bun test e2e/` pick them up - and because they call `process.exit(0)`
|
|
7
|
+
* when the opt-in is missing, the first one aborted the whole test runner.
|
|
8
|
+
* They are therefore named `*.e2e.ts` and are run by this script instead.
|
|
9
|
+
*
|
|
10
|
+
* They talk to the real world (Telegram, Qdrant, R2), so they only run when
|
|
11
|
+
* PI_HARNESS_E2E=1 is set. CI never sets it.
|
|
12
|
+
*/
|
|
13
|
+
import { execFileSync } from "node:child_process";
|
|
14
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
|
|
17
|
+
const PER_SCRIPT_TIMEOUT_MS = 300_000;
|
|
18
|
+
|
|
19
|
+
const root = join(import.meta.dirname, "..");
|
|
20
|
+
const e2eDir = join(root, "e2e");
|
|
21
|
+
const bun = process.env.BUN_BIN ?? "bun";
|
|
22
|
+
|
|
23
|
+
if (!existsSync(e2eDir)) {
|
|
24
|
+
console.error(`e2e scripts: ${e2eDir} not found`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const scripts = readdirSync(e2eDir)
|
|
29
|
+
.filter((name) => name.endsWith(".e2e.ts"))
|
|
30
|
+
.sort();
|
|
31
|
+
|
|
32
|
+
if (scripts.length === 0) {
|
|
33
|
+
console.log("e2e scripts: no *.e2e.ts files found");
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (process.env.PI_HARNESS_E2E !== "1") {
|
|
38
|
+
console.log(
|
|
39
|
+
`e2e scripts: SKIP (${scripts.length} scripts) - set PI_HARNESS_E2E=1 to run them against the real services`,
|
|
40
|
+
);
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const failed = [];
|
|
45
|
+
|
|
46
|
+
for (const script of scripts) {
|
|
47
|
+
const started = Date.now();
|
|
48
|
+
let code = 0;
|
|
49
|
+
try {
|
|
50
|
+
execFileSync(bun, ["run", join(e2eDir, script)], {
|
|
51
|
+
cwd: root,
|
|
52
|
+
encoding: "utf8",
|
|
53
|
+
stdio: "inherit",
|
|
54
|
+
timeout: PER_SCRIPT_TIMEOUT_MS,
|
|
55
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
56
|
+
});
|
|
57
|
+
} catch (error) {
|
|
58
|
+
code = error.status ?? -1;
|
|
59
|
+
}
|
|
60
|
+
const seconds = ((Date.now() - started) / 1000).toFixed(1);
|
|
61
|
+
if (code === 0) {
|
|
62
|
+
console.log(`ok ${script} (${seconds}s)`);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
failed.push(script);
|
|
66
|
+
console.error(`FAIL ${script} (${seconds}s, exit ${code})`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (failed.length > 0) {
|
|
70
|
+
console.error(`e2e scripts: failing scripts: ${failed.join(", ")}`);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log(`e2e scripts: ${scripts.length - failed.length}/${scripts.length} passed`);
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Run the harness/langchain test suite one file per process.
|
|
4
|
+
*
|
|
5
|
+
* Two reasons this exists instead of a plain `bun test harness/langchain/`:
|
|
6
|
+
*
|
|
7
|
+
* 1. `harness/langchain/` contains BOTH the compiled `*.test.js` and the
|
|
8
|
+
* `*.test.ts` sources, so a directory run executes every test twice and
|
|
9
|
+
* tests stale compiled code.
|
|
10
|
+
* 2. One broken file must not take the whole run down with it (a file that
|
|
11
|
+
* leaks memory is OOM killed by the runner, which kills the run).
|
|
12
|
+
*
|
|
13
|
+
* The files in KNOWN_FAILING are reported but do not fail the run - they
|
|
14
|
+
* are pre-existing breakage that is tracked separately:
|
|
15
|
+
*
|
|
16
|
+
* - daemon.test.ts : needs `node:sqlite`, which bun 1.3.14 does not have
|
|
17
|
+
* (under node it times out waiting for the daemon event)
|
|
18
|
+
*
|
|
19
|
+
* A known-failing file is only excused when it fails WITHOUT a test
|
|
20
|
+
* assertion failing (it crashed, timed out or was killed). If one of them
|
|
21
|
+
* starts failing an assertion, that is a real regression and the run fails.
|
|
22
|
+
*/
|
|
23
|
+
import { execFileSync } from "node:child_process";
|
|
24
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Files with pre-existing failures (see the module comment).
|
|
29
|
+
*
|
|
30
|
+
* `expect` is the failure signature: the file is only excused while it
|
|
31
|
+
* fails in exactly this way. A different failure is a real regression.
|
|
32
|
+
*/
|
|
33
|
+
const KNOWN_FAILING = new Map([
|
|
34
|
+
[
|
|
35
|
+
"daemon.test.ts",
|
|
36
|
+
{
|
|
37
|
+
reason: "needs node:sqlite (missing in bun 1.3.14)",
|
|
38
|
+
expect: /node:sqlite|waitFor timed out/i,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
const PER_FILE_TIMEOUT_MS = 180_000;
|
|
44
|
+
/**
|
|
45
|
+
* The known-failing files get a short budget: surge.test.ts needs ~70 s to
|
|
46
|
+
* be OOM killed, and there is no point burning that time in CI.
|
|
47
|
+
*/
|
|
48
|
+
const KNOWN_FAILING_TIMEOUT_MS = 25_000;
|
|
49
|
+
|
|
50
|
+
const root = join(import.meta.dirname, "..");
|
|
51
|
+
const suiteDir = join(root, "harness", "langchain");
|
|
52
|
+
|
|
53
|
+
if (!existsSync(suiteDir)) {
|
|
54
|
+
console.error(`langchain tests: ${suiteDir} not found`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// bun is installed globally (not into node_modules/.bin), so use PATH.
|
|
59
|
+
const bun = process.env.BUN_BIN ?? "bun";
|
|
60
|
+
try {
|
|
61
|
+
execFileSync(bun, ["--version"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
62
|
+
} catch {
|
|
63
|
+
console.error(
|
|
64
|
+
`langchain tests: "${bun}" is not executable - install bun or set BUN_BIN`,
|
|
65
|
+
);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const files = readdirSync(suiteDir)
|
|
70
|
+
.filter((name) => name.endsWith(".test.ts"))
|
|
71
|
+
.sort();
|
|
72
|
+
|
|
73
|
+
if (files.length === 0) {
|
|
74
|
+
console.error("langchain tests: no *.test.ts files found");
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** A failing assertion inside the file output (as opposed to a crash). */
|
|
79
|
+
function hasAssertionFailure(output) {
|
|
80
|
+
return /(^|\n)\s*\(fail\)|AssertionError/.test(output);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const known = [];
|
|
84
|
+
const failed = [];
|
|
85
|
+
const stale = [];
|
|
86
|
+
let passedFiles = 0;
|
|
87
|
+
|
|
88
|
+
for (const file of files) {
|
|
89
|
+
const started = Date.now();
|
|
90
|
+
const knownReason = KNOWN_FAILING.get(file)?.reason;
|
|
91
|
+
const knownExpect = KNOWN_FAILING.get(file)?.expect;
|
|
92
|
+
const timeout = knownReason
|
|
93
|
+
? KNOWN_FAILING_TIMEOUT_MS
|
|
94
|
+
: PER_FILE_TIMEOUT_MS;
|
|
95
|
+
let output = "";
|
|
96
|
+
let code = 0;
|
|
97
|
+
let killed = false;
|
|
98
|
+
try {
|
|
99
|
+
output = execFileSync(bun, ["test", join(suiteDir, file)], {
|
|
100
|
+
cwd: root,
|
|
101
|
+
encoding: "utf8",
|
|
102
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
103
|
+
timeout,
|
|
104
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
105
|
+
});
|
|
106
|
+
} catch (error) {
|
|
107
|
+
output = `${error.stdout ?? ""}${error.stderr ?? ""}`;
|
|
108
|
+
code = error.status ?? -1;
|
|
109
|
+
killed = Boolean(error.killed) || error.signal !== undefined;
|
|
110
|
+
}
|
|
111
|
+
const seconds = ((Date.now() - started) / 1000).toFixed(1);
|
|
112
|
+
const summary = output
|
|
113
|
+
.split("\n")
|
|
114
|
+
.filter((line) => /pass|fail|Ran /.test(line))
|
|
115
|
+
.slice(-3)
|
|
116
|
+
.join(" | ");
|
|
117
|
+
const how = killed
|
|
118
|
+
? code === 0 || code === -1
|
|
119
|
+
? "killed"
|
|
120
|
+
: `exit ${code}`
|
|
121
|
+
: `exit ${code}`;
|
|
122
|
+
|
|
123
|
+
if (code === 0) {
|
|
124
|
+
passedFiles++;
|
|
125
|
+
console.log(`ok ${file} (${seconds}s) ${summary.slice(0, 120)}`);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// A known-failing file is only excused while it fails in exactly the
|
|
130
|
+
// recorded way and without an assertion failing - anything else is a
|
|
131
|
+
// real regression.
|
|
132
|
+
if (knownReason && !hasAssertionFailure(output) && knownExpect?.test(output)) {
|
|
133
|
+
known.push(`${file} (${knownReason})`);
|
|
134
|
+
console.log(
|
|
135
|
+
`known-failing ${file} (${seconds}s, ${how}) ${knownReason} | ${summary
|
|
136
|
+
.slice(0, 120)
|
|
137
|
+
.trim()}`,
|
|
138
|
+
);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
failed.push(file);
|
|
143
|
+
console.error(
|
|
144
|
+
`FAIL ${file} (${seconds}s, ${how}) ${summary.slice(0, 200)}`,
|
|
145
|
+
);
|
|
146
|
+
if (!knownReason) {
|
|
147
|
+
const tail = output.split("\n").slice(-40).join("\n");
|
|
148
|
+
console.error(tail.trim());
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// A known-failing entry that no longer matches a file is stale.
|
|
153
|
+
for (const entry of KNOWN_FAILING.keys()) {
|
|
154
|
+
if (!files.includes(entry)) stale.push(entry);
|
|
155
|
+
}
|
|
156
|
+
if (stale.length > 0) {
|
|
157
|
+
console.warn(
|
|
158
|
+
`langchain tests: stale known-failing entries (no such file): ${stale.join(", ")}`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
console.log(
|
|
163
|
+
`langchain tests: ${passedFiles}/${files.length} files passed, ${known.length} known-failing, ${failed.length} failed`,
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
if (failed.length > 0) {
|
|
167
|
+
console.error(`langchain tests: failing files: ${failed.join(", ")}`);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|