Skip to content

fix(harness): declare pi-mcp-adapter peer deps so the pi harness runs - #41

Merged
itelo merged 2 commits into
mainfrom
itelo/pi-typebox-fix
Aug 21, 2026
Merged

fix(harness): declare pi-mcp-adapter peer deps so the pi harness runs#41
itelo merged 2 commits into
mainfrom
itelo/pi-typebox-fix

Conversation

@itelo

@itelo itelo commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Real runtime bug in the pi harness (from #38). pi-coding-agent pins typebox exactly, so npm nested it under node_modules/@earendil-works/pi-coding-agent/node_modules/typebox and left no top-level typebox. pi-mcp-adapter also imports typebox and resolves it from its own dir → walks up to a top-level copy that isn't there → throws Cannot find module 'typebox' the instant the pi harness loads the MCP adapter. So SEAM_WIZARD_HARNESS=pi npm run eval failed in ~1s with an empty diff on every case.

Why CI missed it: the eval is the only thing that exercises pi's runtime, and it doesn't run in CI — typecheck/build/tests don't execute pi-mcp-adapter.

Fix

  • Declare typebox (pinned 1.1.38) as a direct wizard dependency, so it hoists to top-level where pi-mcp-adapter can resolve it. Verified: require.resolve('typebox', { paths: ['node_modules/pi-mcp-adapter'] }) now succeeds, and the lockfile has a top-level node_modules/typebox.
  • Eval no longer hides failures: runIntegration reports step failures as events (not throws), so the real runner now captures the reason, threads it onto the case result, and run.ts prints a Failures: section. A no row is never a dead end again.

Testing

  • typecheck / eslint / prettier / build clean
  • 144/144 tests pass (+1: runner-reported error surfaces on the case result)
  • typebox resolves from pi-mcp-adapter's dir; top-level entry in lockfile
  • Full runtime pi validation still needs a real SEAM_WIZARD_HARNESS=pi npm run eval (can't run in CI/sandbox).

Security & Compliance

  • No security impact

@itelo
itelo requested a review from razor-x as a code owner August 21, 2026 14:34
@itelo
itelo force-pushed the itelo/pi-typebox-fix branch from b9bbdb9 to 8032bc8 Compare August 21, 2026 14:40
pi-coding-agent pins typebox exactly, so npm nested it under the coding-agent and
left no top-level copy. pi-mcp-adapter also imports typebox and resolves it from
its own dir, so on any clean install it threw `Cannot find module 'typebox'` the
moment the pi harness loaded the MCP adapter — the pi run failed instantly with
an empty diff. CI missed it because the eval (the only runtime exercise of pi)
doesn't run in CI. Declare typebox (pinned 1.1.38) as a direct dep so it hoists
to top-level where pi-mcp-adapter can find it.

Also make the eval surface failures instead of hiding them: the real runner
captures the step-failure reason (runIntegration reports it as an event, not a
throw), threads it onto the case result, and run.ts prints a Failures section.
@itelo
itelo force-pushed the itelo/pi-typebox-fix branch from c04023b to 3430be5 Compare August 21, 2026 14:45
@itelo
itelo merged commit f7c4d6d into main Aug 21, 2026
11 checks passed
@itelo
itelo deleted the itelo/pi-typebox-fix branch August 21, 2026 14:52
@itelo itelo changed the title fix(harness): declare typebox so pi-mcp-adapter resolves it fix(harness): declare pi-mcp-adapter peer deps so the pi harness runs Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants