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.
Files changed (122) hide show
  1. package/harness/job-state-machine.ts +97 -10
  2. package/harness/langchain/surge.test.ts +57 -25
  3. package/package.json +8 -4
  4. package/packages/a2a-adapter/package.json +1 -1
  5. package/packages/agent-policy/package.json +1 -1
  6. package/packages/architecture-generator/package.json +1 -1
  7. package/packages/auth/dist/minimax-browser-auth.d.ts +1 -0
  8. package/packages/auth/dist/minimax-browser-auth.d.ts.map +1 -1
  9. package/packages/auth/dist/minimax-browser-auth.js +2 -2
  10. package/packages/auth/dist/minimax-browser-auth.js.map +1 -1
  11. package/packages/auth/package.json +1 -1
  12. package/packages/auth/src/minimax-browser-auth.ts +15 -3
  13. package/packages/autonomous-refactor/package.json +1 -1
  14. package/packages/autonomous-runtime/package.json +1 -1
  15. package/packages/cache-strategy/package.json +1 -1
  16. package/packages/capability-registry/package.json +1 -1
  17. package/packages/checkpoint/dist/checkpoint-manager.d.ts.map +1 -1
  18. package/packages/checkpoint/dist/checkpoint-manager.js +3 -0
  19. package/packages/checkpoint/dist/checkpoint-manager.js.map +1 -1
  20. package/packages/checkpoint/package.json +1 -1
  21. package/packages/checkpoint/src/checkpoint-manager.ts +8 -1
  22. package/packages/cli-plugin-sdk/package.json +1 -1
  23. package/packages/clipboard/package.json +1 -1
  24. package/packages/clipboard-plugin/package.json +1 -1
  25. package/packages/code-generation/package.json +1 -1
  26. package/packages/code-review/package.json +1 -1
  27. package/packages/codex-adapter/package.json +1 -1
  28. package/packages/codex-watcher/package.json +1 -1
  29. package/packages/config-capture/package.json +1 -1
  30. package/packages/connection-runtime/package.json +1 -1
  31. package/packages/context-compiler/package.json +1 -1
  32. package/packages/context-discovery/package.json +1 -1
  33. package/packages/context-manager/package.json +1 -1
  34. package/packages/contracts/package.json +1 -1
  35. package/packages/cookie-sanitizer/package.json +1 -1
  36. package/packages/cost-optimizer/package.json +1 -1
  37. package/packages/dependency-analyzer/package.json +1 -1
  38. package/packages/django-plugin/package.json +1 -1
  39. package/packages/doc-generator/package.json +1 -1
  40. package/packages/durable-review/package.json +1 -1
  41. package/packages/e2e-tester/package.json +1 -1
  42. package/packages/evaluation-engine/package.json +1 -1
  43. package/packages/evaluation-runner/package.json +1 -1
  44. package/packages/event-bus/package.json +1 -1
  45. package/packages/event-sink/package.json +1 -1
  46. package/packages/event-store/package.json +1 -1
  47. package/packages/experience-replay/package.json +1 -1
  48. package/packages/feedback-collector/package.json +1 -1
  49. package/packages/file-copy-helper/package.json +1 -1
  50. package/packages/framework-detector/package.json +1 -1
  51. package/packages/framework-plugin-sdk/package.json +1 -1
  52. package/packages/frappe-plugin/package.json +1 -1
  53. package/packages/generic-web-plugin/package.json +1 -1
  54. package/packages/health-monitor/package.json +1 -1
  55. package/packages/intent-analyzer/package.json +1 -1
  56. package/packages/jev-judge/package.json +1 -1
  57. package/packages/knowledge-graph/package.json +1 -1
  58. package/packages/knowledge-retrieval/package.json +1 -1
  59. package/packages/laravel-plugin/package.json +1 -1
  60. package/packages/learning-engine/package.json +1 -1
  61. package/packages/mcp-adapter/package.json +1 -1
  62. package/packages/memory-engine/package.json +1 -1
  63. package/packages/milestone-manager/package.json +1 -1
  64. package/packages/model-registry/package.json +1 -1
  65. package/packages/nextjs-plugin/package.json +1 -1
  66. package/packages/notification/package.json +1 -1
  67. package/packages/observability/package.json +1 -1
  68. package/packages/okf-indexer/package.json +1 -1
  69. package/packages/paperclip-integration/package.json +1 -1
  70. package/packages/performance-optimizer/package.json +1 -1
  71. package/packages/permission-mode/package.json +1 -1
  72. package/packages/privilege-broker/package.json +1 -1
  73. package/packages/project-analyzer/package.json +1 -1
  74. package/packages/project-bootstrap/package.json +1 -1
  75. package/packages/projection-engine/package.json +1 -1
  76. package/packages/prompt-compiler/package.json +1 -1
  77. package/packages/prompt-versioning/package.json +1 -1
  78. package/packages/provider-adapter-sdk/package.json +1 -1
  79. package/packages/provider-router/package.json +1 -1
  80. package/packages/provider-selector/package.json +1 -1
  81. package/packages/providers/package.json +1 -1
  82. package/packages/qdrant-skills/package.json +1 -1
  83. package/packages/quota-manager/package.json +1 -1
  84. package/packages/rate-limiter/package.json +1 -1
  85. package/packages/react-vite-plugin/package.json +1 -1
  86. package/packages/relay/package.json +1 -1
  87. package/packages/release-manager/package.json +1 -1
  88. package/packages/requirement-compiler/package.json +1 -1
  89. package/packages/runtime/package.json +1 -1
  90. package/packages/scheduler/package.json +1 -1
  91. package/packages/scheduler-adapter/package.json +1 -1
  92. package/packages/session/package.json +1 -1
  93. package/packages/session-api/package.json +1 -1
  94. package/packages/session-export/package.json +1 -1
  95. package/packages/shared-context/package.json +1 -1
  96. package/packages/skill-mcp-client/package.json +1 -1
  97. package/packages/skill-registry/package.json +1 -1
  98. package/packages/skills/package.json +1 -1
  99. package/packages/sprint-planner/package.json +1 -1
  100. package/packages/subscription-engine/package.json +1 -1
  101. package/packages/task-compiler/package.json +1 -1
  102. package/packages/telegram/package.json +1 -1
  103. package/packages/tencentdb-memory/package.json +1 -1
  104. package/packages/tencentdb-sync/package.json +1 -1
  105. package/packages/test-data-generator/package.json +1 -1
  106. package/packages/test-generator/package.json +1 -1
  107. package/packages/todo-bd-sync/package.json +1 -1
  108. package/packages/token-estimation/package.json +1 -1
  109. package/packages/token-optimizer/package.json +1 -1
  110. package/packages/trajectory/package.json +1 -1
  111. package/packages/tui/package.json +1 -1
  112. package/packages/types/package.json +1 -1
  113. package/packages/voice-api/package.json +1 -1
  114. package/packages/webmcp-tester/package.json +1 -1
  115. package/packages/wiki/package.json +1 -1
  116. package/packages/workflow-events/package.json +1 -1
  117. package/packages/workspace-scanner/package.json +1 -1
  118. package/packages/worktree/package.json +1 -1
  119. package/packages/write-review/package.json +1 -1
  120. package/scripts/run-e2e-scripts.mjs +74 -0
  121. package/scripts/run-langchain-tests.mjs +169 -0
  122. package/scripts/typecheck-packages.mjs +167 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/release-manager",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "Release management for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/requirement-compiler",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Compiles raw requirements into validated CompiledRequirement with ambiguity detection and risk tagging",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/runtime",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/scheduler",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — scheduler",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/scheduler-adapter",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Scheduler Adapter — cron, systemd, launchd, internal adapters for autonomous runtime (RFC-0101 §6)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Session management system for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session-api",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session-export",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/shared-context",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — shared-context",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/skill-mcp-client",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "MCP client for Skills SaaS backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skill-registry",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Skill Registry for pi-harness-runtime — dynamic skill discovery and invocation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skills",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "File-based skill system with pi.dev compatibility and Hermes self-improvement",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/sprint-planner",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "Sprint planning engine for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/subscription-engine",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/task-compiler",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Task Compiler for pi-harness-runtime — produces deterministic task DAG from CompiledRequirement",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/telegram",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — Telegram inbound/outbound",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/tencentdb-memory",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "TencentDB Agent Memory client - sync skills to centralized knowledge base",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tencentdb-sync",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Sync SKILL.md skills to TencentDB-Agent-Memory server (RFC-0105/0106)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/test-data-generator",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Test data generation for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/test-generator",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Auto-Test Generator — generate unit and E2E tests from source code (RFC-0013)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/todo-bd-sync",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Two-way sync between rpiv-todo overlay and bd issue tracker",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-estimation",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — token-estimation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-optimizer",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Token Budget Optimizer — maximize prompt value within token limits (RFC-0011)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/trajectory",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Trajectory capture for the write-review loop — persists cycle records for learning",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tui",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — tui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/types",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Shared TypeScript types for pi-harness-runtime packages",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/voice-api",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "Voice-to-text API using Whisper for Telegram and LINE integration",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/webmcp-tester",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/wiki",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "LLM Wiki integration for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/workflow-events",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/workspace-scanner",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/worktree",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — worktree",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/write-review",
3
- "version": "1.1.383",
3
+ "version": "1.1.384",
4
4
  "description": "Two-agent write-review loop with blackboard coordination",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -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
+ }