Repository navigation
Port Pi v1.0.4 runtime modules to Rust - #1102
Closed
AnthonyRonning wants to merge 6 commits into
Closed
AnthonyRonning wants to merge 6 commits into
AnthonyRonning wants to merge 6 commits into
Conversation
AnthonyRonning
added this pull request to stack #1092
October 8, 2026 02:33
Checkpoint pending work at owner request; implementation and cleanup remain unfinished. Formatting and strict workspace Clippy passed. The workspace test hook failed in pi-conformance::every_upstream_test_is_accounted_for on conditional symlink-test coverage; hook bypassed to preserve this WIP state.
AnthonyRonning
removed this pull request from stack #1092
October 8, 2026 17:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of the Pi Rust port, stacked above #1099.
Status
Draft — the reference spike, harness skeleton and Steps 1–2 are complete. Steps 3–8 are in progress; Phase 1 is not complete.
d95727f0, skeletonf413acc6, Step 1d39c0a68, Step 27ac5718c.apps/maple-agent/pi-conformance/selection/.just ciand full selected commit hooks.Scope
Ports selected Pi v1.0.4 modules into independent
pi-ai,pi-agent-core,pi-coding-agent, andpi-mcpcrates, with dev-onlypi-testkitandpi-conformance. The upstream pin is7c10bd4337495ee613f2224843ecdf349b80d1df. Runtime integration, host tools, transport/auth integration, and the existing embedded runtime remain phase 2.The reference flake is isolated from the product toolchain. Its recorder uses Pi's faux provider, deterministic time and randomness, and source aliases. Test inventory and selection tooling live under
apps/maple-agent/pi-conformance/selection/.Spike evidence
v22.23.2and the pinned 866,386-byte model catalog; no native-module fallback was needed. This machine does not enforce the Linux Nix sandbox, so Linux sandbox execution is still unverified.agent-loop,agent,session-context-edit, andextensions-runner: 151 tests passed.05a34a03254d6e13bc761d1f3d087f15303c2b88ab47350db692ed744eda9aee.just ci, rootnix flake check --no-update-lock-file, and reference-flake evaluation passed. The spike's hosted Agent CI passed on macOS, Linux and Windows (run).Harness validation
Pinned macOS
just ciand every selected repository pre-commit component passed at the skeleton commit. Root flake checks passed.Two independent upstream reference executions produced identical normalized inventory/results; both corpus recordings were byte-identical.
pi-corpus-checkpassed. The catalog and toolchain pins remain unchanged.The skeleton validates complete test inventory, source correspondence, coverage accounting, corpus schema and content hashes, crate dependency boundaries, and explicitly pending work. It includes deterministic time/random/ID injection and an owned task driver tested against the TypeScript fake timers.
The skeleton passed hosted Agent CI on macOS, Linux and Windows, and the Pi reference job (run). This validates the skeleton, not the uncommitted later port.
Step 1 passed pinned macOS
just ci, full selected pre-commit checks,pi-upstream-testsandpi-corpus-check. Its 68 library and 201 integration tests pass; the latter include the 144 translated cases plus supplementary regressions. Fresh TypeScript output was recorded through the pinned Nix recorder. The corpus includes lossless UTF-16, binary64, field-presence, JSON ordering, validation-error and shared-state observations.Step 2 passed pinned macOS
just ci, full selected pre-commit checks, upstream reference tests and corpus freshness. Its 78 library and 357 integration tests pass; the latter include all 300 selected Step 1–2 cases plus regressions. Six gated wire fixtures compare bodies, deltas, shared partials, final values and retained events; 103 new direct-function cases use 44 frozen source model records. Cache retention uses an optional host-supplied environment key.Decisions applied
The crates may depend on the planned third-party Rust libraries, but must have no direct or transitive dependency on Maple crates or local packages outside the six-crate boundary. MCP uses
rmcp =3.4.1protocol types without transport features. Validation usesjsonschema =0.55.1with remote and filesystem retrieval disabled explicitly. Existing ACP and process-wrapper versions remain unchanged.Auth-only upstream cases exercise a replaced seam: the missing-auth synchronous throw and Cloudflare auth base-URL resolution are excluded as
replace-module. Mixed request-shaping tests retain their assertions using resolved auth fixtures. The port does not recreate the upstream auth registry.The owner also approved documenting the low-level cleared-model boundary: after callers clear Agent.model, Rust cannot invoke the typed provider with JavaScript undefined. It retains the source events, user history, final error and cleanup; the ordinary session no-model guard remains exact. Its two-case executable comparison is being integrated in Step 3.
The package-manager selection is corrected to follow the explicit source cuts: the manifest-glob-only case at upstream line 1740 will be excluded, and line 1767 retains its applicable exact local-path and symlink assertions. Restoring a cut discovery API solely for these tests would expand the selected runtime. The owner authorized this judgment on 2026-10-08; the exact correction and rationale will accompany Step 5.
Review ownership and final gate
Code-owned surfaces touched by this PR include workspace/crate
Cargo.tomlfiles andCargo.lock, the Agent justfile, the isolated reference flake and lock,.github/workflows/, andscripts/ci/.The PR stays draft until translated tests and all recorded scenarios pass with zero pending entries, the manifest is complete, any behavioral deviations have owner approval, dependency/branding checks pass, and Agent CI passes on Linux, macOS, and Windows with
pi-referencegreen. Nothing merges as part of this work.