Skip to content

feat(mcp-m5): add pmcp v2.3 optional dep behind pmcp-dispatcher feature#908

Merged
noahgift merged 2 commits into
mainfrom
feat/mcp-m5-pmcp-dep
Apr 19, 2026
Merged

feat(mcp-m5): add pmcp v2.3 optional dep behind pmcp-dispatcher feature#908
noahgift merged 2 commits into
mainfrom
feat/mcp-m5-pmcp-dep

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

First slice of the M5 dispatcher migration. Zero behaviour change — the hand-rolled JSON-RPC stdio loop in server.rs still owns every request today. This PR only wires the dep so subsequent PRs can land the pmcp code paths incrementally behind a feature flag.

What changes

  • crates/aprender-mcp/Cargo.toml: add pmcp = { version = "2.3", optional = true } + new pmcp-dispatcher feature that selects it. Off by default.
  • Cargo.lock: aprender-mcp entry now lists pmcp 2.3.0. No new transitive deps — pmcp 2.3.0 was already resolved in the workspace via aprender-orchestrate (MCP client side), so this is a single-line lock update, not a new tree branch. Workspace versions stay aligned per the spec's "M5+ will migrate the dispatcher to pmcp v2.x; workspace version must stay aligned" risk mitigation (§Risks).
  • Spec §M5 first checkbox flipped; header moves PLANNED → IN PROGRESS.

PR plan (per the M5 research brief, 2026-04-19)

  1. this PR — pmcp optional dep, feature flag off. FALSIFY-MCP-009 deferred until PR 2 lands the actual parity test.
  2. PR 2 (next)src/transports/{mod,stdio}.rs: stdio wrapper that delegates to either the hand-rolled loop or pmcp::Server based on the feature; tests/falsify_mcp_009.rs asserts byte-identical tools/list + tools/call wire output across both paths.
  3. PR 3 — per-tool pmcp::Handler registration (FALSIFY-MCP-010, preserving FALSIFY-MCP-008 codegen).
  4. PR 4 — cancellation port + apr.serve daemon tracking (FALSIFY-MCP-011).
  5. PR 5 — --transport sse --port N (FALSIFY-MCP-012).
  6. PR 6 — --transport websocket (FALSIFY-MCP-013) + re-run the full falsification suite.

Test plan

  • cargo check -p aprender-mcp green with default features
  • cargo check -p aprender-mcp --features pmcp-dispatcher green (pmcp 2.3.0 resolves from the existing workspace lockfile entry)
  • cargo test -p aprender-mcp all lib + integration + falsification tests PASS (51 lib, 78-across-suites, 1 doc)
  • cargo tree -d -p aprender-mcp --features pmcp-dispatcher no duplicate deps
  • CI ci/gate + workspace-test green

🤖 Generated with Claude Code

First slice of the M5 dispatcher migration. Zero behaviour change — the
hand-rolled JSON-RPC stdio loop in `server.rs` still owns every request
today. This PR only wires the dep so subsequent PRs can land the pmcp
code paths incrementally behind a feature flag.

## What changes

- `crates/aprender-mcp/Cargo.toml`: add `pmcp = { version = "2.3", optional
  = true }` + new `pmcp-dispatcher` feature that selects it. Off by default.
- `Cargo.lock`: aprender-mcp entry now lists pmcp 2.3.0. No new transitive
  deps — pmcp 2.3.0 was already resolved in the workspace via
  `aprender-orchestrate` (MCP client side), so this is a single-line lock
  update, not a new tree branch. Workspace versions stay aligned per the
  spec's "M5+ will migrate the dispatcher to `pmcp` v2.x; workspace
  version must stay aligned" risk mitigation (§Risks).
- Spec §M5 first checkbox flipped; header moves PLANNED → IN PROGRESS.

## PR plan (per the M5 research brief, 2026-04-19)

1. **this PR** — pmcp optional dep, feature flag off. FALSIFY-MCP-009
   deferred until PR 2 lands the actual parity test.
2. **PR 2 (next)** — `src/transports/{mod,stdio}.rs`: stdio wrapper that
   delegates to either the hand-rolled loop or `pmcp::Server` based on
   the feature; `tests/falsify_mcp_009.rs` asserts byte-identical
   `tools/list` + `tools/call` wire output across both paths.
3. PR 3 — per-tool `pmcp::Handler` registration (FALSIFY-MCP-010,
   preserving FALSIFY-MCP-008 codegen).
4. PR 4 — cancellation port + `apr.serve` daemon tracking
   (FALSIFY-MCP-011).
5. PR 5 — `--transport sse --port N` (FALSIFY-MCP-012).
6. PR 6 — `--transport websocket` (FALSIFY-MCP-013) + re-run the full
   falsification suite.

## Verification
- `cargo check -p aprender-mcp` — green with default features
- `cargo check -p aprender-mcp --features pmcp-dispatcher` — green; pmcp
  2.3.0 resolves from the existing workspace lockfile entry
- `cargo test -p aprender-mcp` — all 51 lib + 8 falsify_m1 + 4 falsify_006
  + 8 falsify_008 + 4 falsify_progress_001 + 5 falsify_003 + 5 falsify_004
  + 2 falsify_schema + 1 doctest still PASS
- `cargo tree -d -p aprender-mcp --features pmcp-dispatcher` — no
  duplicate deps
@noahgift noahgift enabled auto-merge (squash) April 19, 2026 10:48
@noahgift noahgift merged commit 25bfdd6 into main Apr 19, 2026
10 checks passed
@noahgift noahgift deleted the feat/mcp-m5-pmcp-dep branch April 19, 2026 11:35
noahgift added a commit that referenced this pull request Apr 19, 2026
…ffold

Cuts a patch release combining the two PRs that landed post-v0.31.0 (#907, #908)
plus incidental `cargo fmt --all` normalization across the workspace.

Wire-level changes:
- Workspace + root `aprender` package bumped 0.31.0 → 0.31.1
- All 60+ path-dep pins updated in lockstep so the published crates resolve
  against each other without range-version drift
- `opentelemetry` / `opentelemetry_sdk` / `opentelemetry-otlp` kept at 0.31.0
  (external deps — global sed caught them as false-positives during bump)

CHANGELOG.md covers:
- Fixed: `apr qa` format_parity gate SKIPs non-GGUF primaries (#907)
- Added: `pmcp = "2.3"` optional dep behind `pmcp-dispatcher` feature (#908)

Pre-push gates:
- cargo fmt --all (applied — 45 lines across 17 non-Cargo files)
- cargo test -p aprender-contracts --lib: 1371 passed / 0 failed
- cargo deny check advisories: advisories ok

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
noahgift added a commit that referenced this pull request Apr 19, 2026
…ffold (#909)

* chore(release): v0.31.1 — QA format_parity SKIP fix + MCP M5 pmcp scaffold

Cuts a patch release combining the two PRs that landed post-v0.31.0 (#907, #908)
plus incidental `cargo fmt --all` normalization across the workspace.

Wire-level changes:
- Workspace + root `aprender` package bumped 0.31.0 → 0.31.1
- All 60+ path-dep pins updated in lockstep so the published crates resolve
  against each other without range-version drift
- `opentelemetry` / `opentelemetry_sdk` / `opentelemetry-otlp` kept at 0.31.0
  (external deps — global sed caught them as false-positives during bump)

CHANGELOG.md covers:
- Fixed: `apr qa` format_parity gate SKIPs non-GGUF primaries (#907)
- Added: `pmcp = "2.3"` optional dep behind `pmcp-dispatcher` feature (#908)

Pre-push gates:
- cargo fmt --all (applied — 45 lines across 17 non-Cargo files)
- cargo test -p aprender-contracts --lib: 1371 passed / 0 failed
- cargo deny check advisories: advisories ok

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci(release): disable sccache — sovereign-ci runner image missing rustc-sccache wrapper

The `sovereign-ci:stable` container image is currently missing the
`rustc-sccache` wrapper script, causing every sccache-gated CI job
(ci/test, ci/lint, ci/coverage, ci/gate) to fail at the rustc probe:

    error: could not execute process `rustc-sccache /.../rustc -vV`
      (never executed)
    Caused by: No such file or directory (os error 2)

Reruns fail identically — not transient.

Workaround: flip `enable_sccache: true → false` on this repo's
workflow input. The sovereign-ci reusable workflow reads this to set
`RUSTC_WRAPPER: ${{ inputs.enable_sccache && 'rustc-sccache' || '' }}`,
so disabling it removes the wrapper entirely and CI builds proceed
normally (just slower, since there's no compile cache).

Revert once paiml/.github ships a runner image with the wrapper
present — this is a temporary unblock for the v0.31.1 release PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant