pi-harness-runtime 1.1.319 → 1.1.320

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 (102) hide show
  1. package/package.json +1 -1
  2. package/packages/a2a-adapter/package.json +1 -1
  3. package/packages/agent-policy/package.json +1 -1
  4. package/packages/architecture-generator/package.json +1 -1
  5. package/packages/auth/package.json +1 -1
  6. package/packages/autonomous-refactor/package.json +1 -1
  7. package/packages/autonomous-runtime/package.json +1 -1
  8. package/packages/cache-strategy/package.json +1 -1
  9. package/packages/capability-registry/package.json +1 -1
  10. package/packages/checkpoint/package.json +1 -1
  11. package/packages/cli-plugin-sdk/package.json +1 -1
  12. package/packages/clipboard/package.json +1 -1
  13. package/packages/clipboard-plugin/package.json +1 -1
  14. package/packages/code-generation/package.json +1 -1
  15. package/packages/code-review/package.json +1 -1
  16. package/packages/codex-adapter/package.json +1 -1
  17. package/packages/codex-watcher/package.json +1 -1
  18. package/packages/config-capture/package.json +1 -1
  19. package/packages/context-compiler/package.json +1 -1
  20. package/packages/context-discovery/package.json +1 -1
  21. package/packages/context-manager/package.json +1 -1
  22. package/packages/cookie-sanitizer/package.json +1 -1
  23. package/packages/cost-optimizer/package.json +1 -1
  24. package/packages/dependency-analyzer/package.json +1 -1
  25. package/packages/django-plugin/package.json +1 -1
  26. package/packages/doc-generator/package.json +1 -1
  27. package/packages/durable-review/package.json +1 -1
  28. package/packages/durable-review/test/acceptance.test.ts +335 -0
  29. package/packages/e2e-tester/package.json +1 -1
  30. package/packages/evaluation-engine/package.json +1 -1
  31. package/packages/evaluation-runner/package.json +1 -1
  32. package/packages/event-bus/package.json +1 -1
  33. package/packages/event-store/package.json +1 -1
  34. package/packages/experience-replay/package.json +1 -1
  35. package/packages/feedback-collector/package.json +1 -1
  36. package/packages/file-copy-helper/package.json +1 -1
  37. package/packages/framework-detector/package.json +1 -1
  38. package/packages/framework-plugin-sdk/package.json +1 -1
  39. package/packages/frappe-plugin/package.json +1 -1
  40. package/packages/generic-web-plugin/package.json +1 -1
  41. package/packages/health-monitor/package.json +1 -1
  42. package/packages/intent-analyzer/package.json +1 -1
  43. package/packages/jev-judge/package.json +1 -1
  44. package/packages/knowledge-graph/package.json +1 -1
  45. package/packages/knowledge-retrieval/package.json +1 -1
  46. package/packages/laravel-plugin/package.json +1 -1
  47. package/packages/learning-engine/package.json +1 -1
  48. package/packages/mcp-adapter/package.json +1 -1
  49. package/packages/memory-engine/package.json +1 -1
  50. package/packages/milestone-manager/package.json +1 -1
  51. package/packages/model-registry/package.json +1 -1
  52. package/packages/nextjs-plugin/package.json +1 -1
  53. package/packages/notification/package.json +1 -1
  54. package/packages/observability/package.json +1 -1
  55. package/packages/okf-indexer/package.json +1 -1
  56. package/packages/paperclip-integration/package.json +1 -1
  57. package/packages/performance-optimizer/package.json +1 -1
  58. package/packages/privilege-broker/package.json +1 -1
  59. package/packages/project-analyzer/package.json +1 -1
  60. package/packages/project-bootstrap/package.json +1 -1
  61. package/packages/projection-engine/package.json +1 -1
  62. package/packages/prompt-compiler/package.json +1 -1
  63. package/packages/prompt-versioning/package.json +1 -1
  64. package/packages/provider-adapter-sdk/package.json +1 -1
  65. package/packages/provider-router/package.json +1 -1
  66. package/packages/provider-selector/package.json +1 -1
  67. package/packages/providers/package.json +1 -1
  68. package/packages/qdrant-skills/package.json +1 -1
  69. package/packages/quota-manager/package.json +1 -1
  70. package/packages/rate-limiter/package.json +1 -1
  71. package/packages/react-vite-plugin/package.json +1 -1
  72. package/packages/release-manager/package.json +1 -1
  73. package/packages/requirement-compiler/package.json +1 -1
  74. package/packages/runtime/package.json +1 -1
  75. package/packages/scheduler/package.json +1 -1
  76. package/packages/scheduler-adapter/package.json +1 -1
  77. package/packages/session/package.json +1 -1
  78. package/packages/session-api/package.json +1 -1
  79. package/packages/session-export/package.json +1 -1
  80. package/packages/shared-context/package.json +1 -1
  81. package/packages/skill-mcp-client/package.json +1 -1
  82. package/packages/skill-registry/package.json +1 -1
  83. package/packages/skills/package.json +1 -1
  84. package/packages/sprint-planner/package.json +1 -1
  85. package/packages/subscription-engine/package.json +1 -1
  86. package/packages/task-compiler/package.json +1 -1
  87. package/packages/telegram/package.json +1 -1
  88. package/packages/tencentdb-memory/package.json +1 -1
  89. package/packages/tencentdb-sync/package.json +1 -1
  90. package/packages/test-data-generator/package.json +1 -1
  91. package/packages/test-generator/package.json +1 -1
  92. package/packages/todo-bd-sync/package.json +1 -1
  93. package/packages/token-estimation/package.json +1 -1
  94. package/packages/token-optimizer/package.json +1 -1
  95. package/packages/trajectory/package.json +1 -1
  96. package/packages/tui/package.json +1 -1
  97. package/packages/types/package.json +1 -1
  98. package/packages/webmcp-tester/package.json +1 -1
  99. package/packages/workflow-events/package.json +1 -1
  100. package/packages/workspace-scanner/package.json +1 -1
  101. package/packages/worktree/package.json +1 -1
  102. package/packages/write-review/package.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/a2a-adapter",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "Google Agent-to-Agent (A2A) protocol adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/agent-policy",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Agent policy runtime for pi-harness - enforces mandatory rule delivery and mutation gating",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/architecture-generator",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Generate ADR and Mermaid diagrams from project analysis",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/auth",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "pi-harness-runtime — auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/autonomous-refactor",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "Autonomous refactoring engine",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/autonomous-runtime",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Autonomous Operations Runtime — task inbox, lease management, and worker lifecycle (RFC-0101)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/cache-strategy",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "Smart caching with TTL and invalidation strategies (RFC-0022)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/capability-registry",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/checkpoint",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Enhanced checkpoint system with incremental snapshots, diff-based storage, and recovery strategies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/cli-plugin-sdk",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "CLI Plugin SDK for pi-harness — install, list, remove, update, invoke plugins",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/clipboard",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/clipboard-plugin",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/code-generation",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Code generation pipeline for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/code-review",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Automated code review engine for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/codex-adapter",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "OpenAI Codex provider adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/codex-watcher",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Watches Codex CLI sessions and emits visible messages for PING-PONG monitoring",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/config-capture",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Auto-capture API-fetched configuration values to AGENTS.md",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/context-compiler",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Bounded context selection engine for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/context-discovery",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/context-manager",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Context Window Manager — prevents model context overflow via compaction and resume prompts (RFC-0010)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cookie-sanitizer",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "pi-harness-runtime — cookie sanitizer (provider-quota cookie file normaliser)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cost-optimizer",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Cost Optimizer for pi-harness-runtime — budget tracking, forecasting, and model selection optimization",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/dependency-analyzer",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/django-plugin",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Django framework analysis — models, management commands, settings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/doc-generator",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Auto-Doc Generator — generate documentation from source code (RFC-0014)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/durable-review",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "SQLite-backed durable reviewer using @earendil-works/pi-durable",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -0,0 +1,335 @@
1
+ /**
2
+ * Durable Review Acceptance Tests
3
+ *
4
+ * Tests per wiki/pi-durable-reviewer-minimax-plan.md acceptance criteria.
5
+ */
6
+
7
+ import { describe, it, before, after, mock } from "node:test";
8
+ import assert from "node:assert";
9
+ import { randomUUID } from "node:crypto";
10
+ import { existsSync, mkdirSync, unlinkSync, rmdirSync, writeFileSync, readFileSync } from "node:fs";
11
+ import { join } from "node:path";
12
+ import { validateAndHashRequest, hashWorkspaceKey, getWorkspaceDir } from "../dist/service.js";
13
+ import { validateReviewRequest } from "../dist/types.js";
14
+ import {
15
+ tryAcquireOwnership,
16
+ releaseOwnership,
17
+ startWorker,
18
+ stopWorker,
19
+ checkWorkerReady,
20
+ } from "../dist/worker.js";
21
+ import { handleReviewRequest, cancelJob, getJobStatus } from "../dist/worker.js";
22
+
23
+ // Test workspace path
24
+ const TEST_WORKSPACE = "/tmp/durable-review-test-" + Date.now();
25
+ const TEST_DB_DIR = join(process.env.HOME || "/tmp", ".pi-harness-runtime", "durable");
26
+
27
+ describe("Acceptance Tests", () => {
28
+ // Setup
29
+ before(() => {
30
+ mkdirSync(TEST_WORKSPACE, { recursive: true });
31
+ });
32
+
33
+ after(() => {
34
+ // Cleanup test workspace
35
+ try {
36
+ const workspaceKey = hashWorkspaceKey(TEST_WORKSPACE);
37
+ const testDir = getWorkspaceDir(workspaceKey);
38
+ const lockPath = join(testDir, ".worker.lock");
39
+ if (existsSync(lockPath)) unlinkSync(lockPath);
40
+ } catch {
41
+ // ignore cleanup errors
42
+ }
43
+ });
44
+
45
+ // --- Feature Disabled ---
46
+ describe("Feature disabled", () => {
47
+ it("validateReviewRequest works without HARNESS_DURABLE_REVIEW flag", () => {
48
+ const request = {
49
+ requestId: "test-1",
50
+ input: { workspacePath: TEST_WORKSPACE },
51
+ };
52
+ const validation = validateReviewRequest(request);
53
+ assert.strictEqual(validation.valid, true);
54
+ });
55
+ });
56
+
57
+ // --- Duplicate Admission ---
58
+ describe("Duplicate admission", () => {
59
+ it("same request returns same input hash", () => {
60
+ const request1 = {
61
+ requestId: "test-dup",
62
+ input: { workspacePath: TEST_WORKSPACE, diff: "test diff" },
63
+ };
64
+ const request2 = {
65
+ requestId: "test-dup",
66
+ input: { workspacePath: TEST_WORKSPACE, diff: "test diff" },
67
+ };
68
+
69
+ const val1 = validateAndHashRequest(request1);
70
+ const val2 = validateAndHashRequest(request2);
71
+
72
+ assert.strictEqual(val1.valid, true);
73
+ assert.strictEqual(val2.valid, true);
74
+ assert.strictEqual(val1.inputHash, val2.inputHash);
75
+ });
76
+
77
+ it("different input returns different hash", () => {
78
+ const request1 = {
79
+ requestId: "test-1",
80
+ input: { workspacePath: TEST_WORKSPACE, diff: "diff 1" },
81
+ };
82
+ const request2 = {
83
+ requestId: "test-2",
84
+ input: { workspacePath: TEST_WORKSPACE, diff: "diff 2" },
85
+ };
86
+
87
+ const val1 = validateAndHashRequest(request1);
88
+ const val2 = validateAndHashRequest(request2);
89
+
90
+ assert.strictEqual(val1.valid, true);
91
+ assert.strictEqual(val2.valid, true);
92
+ assert.notStrictEqual(val1.inputHash, val2.inputHash);
93
+ });
94
+ });
95
+
96
+ // --- Ownership ---
97
+ describe("Ownership race", () => {
98
+ it("first worker acquires ownership", async () => {
99
+ const workspaceKey = hashWorkspaceKey(TEST_WORKSPACE);
100
+ const workerId1 = "worker-1-" + randomUUID().slice(0, 8);
101
+
102
+ const result = await tryAcquireOwnership(workspaceKey, workerId1);
103
+ assert.strictEqual(result.acquired, true);
104
+
105
+ // Cleanup
106
+ await releaseOwnership(workspaceKey, workerId1);
107
+ });
108
+
109
+ it("second worker cannot acquire if first holds lock", async () => {
110
+ const workspaceKey = hashWorkspaceKey(TEST_WORKSPACE);
111
+ const workerId1 = "worker-1-" + randomUUID().slice(0, 8);
112
+ const workerId2 = "worker-2-" + randomUUID().slice(0, 8);
113
+
114
+ // First acquires
115
+ const result1 = await tryAcquireOwnership(workspaceKey, workerId1);
116
+ assert.strictEqual(result1.acquired, true);
117
+
118
+ // Second should fail
119
+ const result2 = await tryAcquireOwnership(workspaceKey, workerId2);
120
+ assert.strictEqual(result2.acquired, false);
121
+ assert.ok(result2.existingOwner);
122
+
123
+ // Cleanup
124
+ await releaseOwnership(workspaceKey, workerId1);
125
+ });
126
+
127
+ it("stale owner is recoverable", async () => {
128
+ const workspaceKey = hashWorkspaceKey(TEST_WORKSPACE);
129
+ const workerId1 = "stale-worker-" + randomUUID().slice(0, 8);
130
+ const workerId2 = "new-worker-" + randomUUID().slice(0, 8);
131
+
132
+ // First acquires
133
+ const result1 = await tryAcquireOwnership(workspaceKey, workerId1);
134
+ assert.strictEqual(result1.acquired, true);
135
+
136
+ // Simulate stale lock by directly writing old timestamp
137
+ const lockPath = join(getWorkspaceDir(workspaceKey), ".worker.lock");
138
+ const staleLock = {
139
+ workerId: workerId1,
140
+ pid: 99999,
141
+ startedAt: Date.now() - 120_000, // 2 minutes ago
142
+ };
143
+ writeFileSync(lockPath, JSON.stringify(staleLock));
144
+
145
+ // New worker should be able to acquire
146
+ const result2 = await tryAcquireOwnership(workspaceKey, workerId2);
147
+ assert.strictEqual(result2.acquired, true);
148
+
149
+ // Cleanup
150
+ await releaseOwnership(workspaceKey, workerId2);
151
+ });
152
+ });
153
+
154
+ // --- Worker Lifecycle ---
155
+ describe("Worker lifecycle", () => {
156
+ it("startWorker succeeds", async () => {
157
+ const result = await startWorker(TEST_WORKSPACE);
158
+ assert.strictEqual(result.success, true);
159
+ assert.ok(result.workerId);
160
+ assert.ok(result.workspaceKey);
161
+ });
162
+
163
+ it("checkWorkerReady returns ready", async () => {
164
+ const ready = await checkWorkerReady();
165
+ assert.strictEqual(ready.ready, true);
166
+ assert.ok(ready.workerId);
167
+ });
168
+
169
+ it("stopWorker succeeds", async () => {
170
+ await stopWorker();
171
+ const ready = await checkWorkerReady();
172
+ assert.strictEqual(ready.ready, false);
173
+ });
174
+ });
175
+
176
+ // --- Request Handling ---
177
+ describe("Request handling", () => {
178
+ before(async () => {
179
+ await startWorker(TEST_WORKSPACE);
180
+ });
181
+
182
+ after(async () => {
183
+ await stopWorker();
184
+ });
185
+
186
+ it("handleReviewRequest creates job", async () => {
187
+ const request = {
188
+ requestId: "test-review-" + randomUUID().slice(0, 8),
189
+ input: { workspacePath: TEST_WORKSPACE },
190
+ };
191
+
192
+ const result = await handleReviewRequest(request);
193
+ assert.ok(result.jobId);
194
+ assert.strictEqual(result.status.status, "queued");
195
+ });
196
+
197
+ it("handleReviewRequest rejects invalid request", async () => {
198
+ const invalidRequest = {
199
+ requestId: "",
200
+ input: { workspacePath: TEST_WORKSPACE },
201
+ };
202
+
203
+ await assert.rejects(
204
+ async () => handleReviewRequest(invalidRequest as any),
205
+ /requestId is required/
206
+ );
207
+ });
208
+
209
+ it("getJobStatus returns null for unknown job", async () => {
210
+ const status = await getJobStatus("unknown-job-id");
211
+ assert.strictEqual(status, null);
212
+ });
213
+
214
+ it("cancelJob returns false for unknown job", async () => {
215
+ const cancelled = await cancelJob("unknown-job-id");
216
+ assert.strictEqual(cancelled, false);
217
+ });
218
+ });
219
+
220
+ // --- Input Stability ---
221
+ describe("Input stability", () => {
222
+ it("validateAndHashRequest produces stable hash", () => {
223
+ const request = {
224
+ requestId: "test-hash",
225
+ input: { workspacePath: TEST_WORKSPACE, diff: "stable diff content" },
226
+ };
227
+
228
+ const result1 = validateAndHashRequest(request);
229
+ const result2 = validateAndHashRequest(request);
230
+
231
+ assert.strictEqual(result1.inputHash, result2.inputHash);
232
+ });
233
+
234
+ it("different content produces different hash", () => {
235
+ const request1 = {
236
+ requestId: "test",
237
+ input: { workspacePath: TEST_WORKSPACE, diff: "content A" },
238
+ };
239
+ const request2 = {
240
+ requestId: "test",
241
+ input: { workspacePath: TEST_WORKSPACE, diff: "content B" },
242
+ };
243
+
244
+ const result1 = validateAndHashRequest(request1);
245
+ const result2 = validateAndHashRequest(request2);
246
+
247
+ assert.notStrictEqual(result1.inputHash, result2.inputHash);
248
+ });
249
+ });
250
+
251
+ // --- Workspace Path ---
252
+ describe("Workspace path handling", () => {
253
+ it("hashWorkspaceKey produces consistent hash", () => {
254
+ const hash1 = hashWorkspaceKey("/some/path");
255
+ const hash2 = hashWorkspaceKey("/some/path");
256
+ assert.strictEqual(hash1, hash2);
257
+ });
258
+
259
+ it("different paths produce different hashes", () => {
260
+ const hash1 = hashWorkspaceKey("/path/a");
261
+ const hash2 = hashWorkspaceKey("/path/b");
262
+ assert.notStrictEqual(hash1, hash2);
263
+ });
264
+
265
+ it("getWorkspaceDir creates directory", () => {
266
+ const workspaceKey = hashWorkspaceKey(TEST_WORKSPACE);
267
+ const dir = getWorkspaceDir(workspaceKey);
268
+ assert.ok(existsSync(dir));
269
+ });
270
+ });
271
+
272
+ // --- Validation ---
273
+ describe("Request validation", () => {
274
+ it("rejects missing requestId", () => {
275
+ const result = validateReviewRequest({
276
+ requestId: "",
277
+ input: { workspacePath: TEST_WORKSPACE },
278
+ });
279
+ assert.strictEqual(result.valid, false);
280
+ assert.ok(result.error?.includes("requestId"));
281
+ });
282
+
283
+ it("rejects missing workspacePath", () => {
284
+ const result = validateReviewRequest({
285
+ requestId: "test",
286
+ input: { workspacePath: "" },
287
+ });
288
+ assert.strictEqual(result.valid, false);
289
+ assert.ok(result.error?.includes("workspacePath"));
290
+ });
291
+
292
+ it("accepts valid request", () => {
293
+ const result = validateReviewRequest({
294
+ requestId: "test",
295
+ input: { workspacePath: TEST_WORKSPACE },
296
+ });
297
+ assert.strictEqual(result.valid, true);
298
+ assert.ok(result.request);
299
+ });
300
+
301
+ it("applies default maxPasses and maxToolCalls", () => {
302
+ const result = validateReviewRequest({
303
+ requestId: "test",
304
+ input: { workspacePath: TEST_WORKSPACE },
305
+ });
306
+ assert.strictEqual(result.valid, true);
307
+ assert.strictEqual(result.request?.maxPasses, 5);
308
+ assert.strictEqual(result.request?.maxToolCalls, 100);
309
+ });
310
+
311
+ it("respects provided maxPasses and maxToolCalls", () => {
312
+ const result = validateReviewRequest({
313
+ requestId: "test",
314
+ input: { workspacePath: TEST_WORKSPACE },
315
+ maxPasses: 10,
316
+ maxToolCalls: 200,
317
+ });
318
+ assert.strictEqual(result.valid, true);
319
+ assert.strictEqual(result.request?.maxPasses, 10);
320
+ assert.strictEqual(result.request?.maxToolCalls, 200);
321
+ });
322
+ });
323
+
324
+ // --- Storage Failure ---
325
+ describe("Storage failure handling", () => {
326
+ it("validateAndHashRequest handles missing workspace path gracefully", () => {
327
+ const result = validateAndHashRequest({
328
+ requestId: "test",
329
+ input: { workspacePath: "/nonexistent/path/that/cannot/exist" },
330
+ });
331
+ assert.strictEqual(result.valid, true); // Validation passes, hash is computed
332
+ assert.ok(result.workspaceKey);
333
+ });
334
+ });
335
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/e2e-tester",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
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/evaluation-engine",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Evaluation engine for pi-harness runtime (RFC-0057)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/evaluation-runner",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic evaluation framework for AI outputs (RFC-0020)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-bus",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-store",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/experience-replay",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Experience replay for debugging and reproducibility (RFC-0059)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/feedback-collector",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "type": "module",
5
5
  "description": "Collect and aggregate human/automated feedback (RFC-0021)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/file-copy-helper",
3
- "version": "1.1.319",
3
+ "version": "1.1.320",
4
4
  "description": "Injects cp/sudo cp rule when user asks to mimic/copy files",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",