Generated: 2026-02-15
This playbook gives downstream teams a practical, low-risk path to migrate from TypeScript Pi (pi-mono) to pi_agent_rust and verify compatibility without needing internal project context.
Use this when you need to:
- replace an existing
piintegration with Rust Pi, - validate that automation/scripts still behave correctly,
- document a go/no-go decision with reproducible evidence.
Before migration, pin these artifacts as your source of truth:
- Baseline snapshot:
docs/dropin-upstream-baseline.json - Surface inventory:
docs/dropin-feature-inventory-matrix.json - Gap ledger:
docs/dropin-parity-gap-ledger.json - Certification gates:
docs/dropin-certification-contract.json - Certification verdict artifact (strict claim gate):
docs/dropin-certification-verdict.json - Current parity status snapshot (informational):
docs/parity-certification.json
If your required workflow maps to an open critical/high gap in docs/dropin-parity-gap-ledger.json, treat migration as blocked until that gap is closed or explicitly waived for your environment.
If docs/dropin-certification-verdict.json is missing or not overall_verdict = CERTIFIED, treat strict drop-in replacement messaging as blocked.
A migration is complete only when all are true:
- Rust Pi is installed and callable through the intended command (
piorpi-rust). - Required execution surfaces pass validation (interactive, print, JSON mode, RPC, SDK where used).
- Provider/auth/config behavior matches your production expectations.
- Evidence artifacts are stored so another engineer can reproduce the same result.
Record your current TypeScript Pi usage footprint:
- Invocation surfaces used:
- interactive
- print text/json
- RPC
- SDK embedding
- CLI flags/subcommands your automation depends on
- Providers/models used in production
- Session persistence expectations (resume behavior, session directory usage)
- Extension usage (tools, commands, capability prompts)
Minimum capture template:
Current pi version:
Execution surfaces in use:
Required flags/subcommands:
Provider + model matrix:
Env vars used:
Extension dependencies:
Session storage expectations:
Use one of these rollout options:
- Canonical replacement (preferred): Rust Pi becomes
pi, legacy preserved aslegacy-pi. - Side-by-side canary: keep TypeScript
pi, install Rust aspi-rust.
Verification commands:
command -v pi
pi --version
pi --help >/dev/null
# If side-by-side migration is used
command -v legacy-pi || true
command -v pi-rust || trueMove settings and secrets deliberately; do not rely on implicit defaults.
Review and reconcile:
~/.pi/agent/settings.json- project-level
.pi/settings.json
Key parity-sensitive areas:
- default provider/model/thinking level
- queue modes (
steeringMode,followUpMode) - compaction/retry knobs
- extension policy and repair policy
- terminal/image behavior
Validate all provider credentials required by your workflows (for example ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, AZURE_OPENAI_API_KEY, COHERE_API_KEY, plus any OpenAI-compatible provider keys).
Reference:
docs/provider-auth-crosswalk.jsondocs/provider-auth-troubleshooting.md
Run only the checks relevant to your integration footprint.
pi --list-models >/dev/null
pi config >/dev/null
pi --model claude-sonnet-4-20250514 -p "ping"Validate:
- expected flags parse successfully,
- expected subcommands exist (
install,remove,update,list,config), - interactive slash commands used by your team are present/working.
printf 'Hello\n' | pi -p
printf 'Hello\n' | pi --mode jsonValidate:
- stdout framing and exit codes match expectations,
- JSON event envelopes parse in existing tooling,
- no downstream parser breaks on event ordering or field names.
Smoke-check line-delimited JSON protocol:
pi --mode rpcThen send at least:
promptget_statefollow_upabortcompact(if used by clients)
Validate:
- command handling semantics,
- event order consistency,
- tool and extension UI events if your client depends on them.
Reference:
docs/rpc.md
If embedding Pi as a library surface, run the SDK migration checks in:
docs/sdk.mddocs/dropin-sdk-contract.json
Do not claim SDK drop-in compatibility unless your usage scenario passes those checks.
Validate behavior for your actual session workflows:
pi --continue
pi --session <path-to-known-session>Checks:
- resume selects expected project session,
- message history and branching semantics are preserved,
- session index behavior is acceptable for your usage.
Reference:
docs/session.mddocs/tree.md
If you rely on extensions, validate:
- extension load/discovery,
- capability prompt behavior,
- required hostcalls (
tool/http/session/ui), - policy behavior (
safe/balanced/permissive) for your deployment mode.
References:
EXTENSIONS.mddocs/extension-architecture.mddocs/capability-prompts.md
Before promoting to production, capture and store:
- command transcript of migration checks,
- machine-readable test/log artifacts from your CI run,
- explicit pass/fail against each required surface,
- unresolved parity risks (if any) with owner and mitigation.
Recommended gate policy:
- Block rollout if any required surface fails.
- Block rollout if an unresolved
criticalparity gap affects your workflow. - Block strict drop-in replacement messaging unless
docs/dropin-certification-verdict.jsonexists and reportsoverall_verdict = CERTIFIED. - Require sign-off that references the artifact set used for the decision.
If compatibility fails in canary or production:
- Switch command aliasing back to legacy (
legacy-pior TypeScriptpi). - Restore prior config snapshot.
- Record failing command/event transcript.
- Map failure to a parity gap entry (or create one) before retrying migration.
[ ] Baseline/gap/certification artifacts reviewed (including drop-in verdict)
[ ] Required surfaces identified
[ ] Install strategy selected (canonical vs canary)
[ ] Config + credential migration completed
[ ] CLI/print/JSON/RPC/SDK checks run as applicable
[ ] Session behavior validated
[ ] Extension behavior validated (if used)
[ ] Evidence captured and archived
[ ] Go/No-Go decision documented with rollback path
docs/dropin-upstream-baseline.jsondocs/dropin-feature-inventory-matrix.jsondocs/dropin-parity-gap-ledger.jsondocs/dropin-certification-contract.jsondocs/dropin-certification-verdict.jsondocs/parity-certification.jsondocs/rpc.mddocs/session.mddocs/sdk.mddocs/providers.md