feat(pi): add native Pi integration#227
Open
felipe3dfx wants to merge 2 commits intoGentleman-Programming:mainfrom
Open
feat(pi): add native Pi integration#227felipe3dfx wants to merge 2 commits intoGentleman-Programming:mainfrom
felipe3dfx wants to merge 2 commits intoGentleman-Programming:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class native Pi (pi-coding-agent) support to Engram via engram setup pi, shipping an embedded/offline Pi package (extension + skill) and validating runtime behavior with a deterministic harness. Also hardens session summary persistence so low-signal shutdown metadata doesn’t overwrite higher-signal session summaries.
Changes:
- Add Pi setup installer that materializes embedded package assets and runs
pi install <package-dir>across OS path variants. - Add Pi native extension + memory skill, including canonical
mem_*tools, notify-only startup, compaction guidance, and<private>redaction. - Add/extend tests (Go + Node harness) for Pi runtime behaviors, privacy redaction, canonical tool naming, and session summary preservation.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/pi/test/runtime-harness.mjs | Deterministic Node harness to validate Pi extension registration, startup, compaction, and error behavior. |
| plugin/pi/skills/engram/SKILL.md | Pi skill documenting mem_* usage, startup policy, compaction recovery flow. |
| plugin/pi/package.json | Pi package manifest declaring extension + skills for pi install. |
| plugin/pi/extensions/engram.ts | Native Pi extension implementing mem_* tools, lifecycle hooks, redaction, backend autostart, compaction handling. |
| internal/store/store_test.go | Adds tests for <private> redaction in passive capture and summary-preservation semantics on shutdown. |
| internal/store/store.go | Preserves existing non-empty summaries when incoming summary is low-signal shutdown metadata. |
| internal/setup/testdata/pi-contract.json | Fixture capturing validated Pi contract assumptions for installer/runtime behavior. |
| internal/setup/setup_test.go | Adds Pi setup tests (paths, idempotency, embedded asset drift checks, docs assertions). |
| internal/setup/setup.go | Implements installPi, embeds Pi assets, adds pi agent support and OS-specific install paths. |
| internal/setup/plugins/pi/skills/engram/SKILL.md | Embedded Pi skill copy synced from plugin/pi. |
| internal/setup/plugins/pi/package.json | Embedded Pi package manifest copy synced from plugin/pi. |
| internal/setup/plugins/pi/extensions/engram.ts | Embedded Pi extension copy synced from plugin/pi. |
| internal/setup/pi_runtime_harness_test.go | Go test runner that executes the Node runtime harness against source + embedded extensions. |
| internal/setup/generate.go | Extends go generate to sync embedded Pi assets alongside OpenCode. |
| internal/server/server_test.go | Validates <private> redaction through HTTP endpoints used by the Pi extension. |
| internal/mcp/mcp_test.go | Ensures canonical mem_* tool surface remains stable and free of engram_* aliases. |
| internal/mcp/mcp.go | Adds stable, sorted accessor for agent tool names (AgentProfileToolNames). |
| docs/PLUGINS.md | Documents Pi contract assumptions, install flow, and runtime behavior. |
| docs/ARCHITECTURE.md | Updates repo structure and CLI reference to include Pi integration. |
| docs/AGENT-SETUP.md | Adds Pi setup instructions, policy defaults, and E2E checklist/troubleshooting. |
| cmd/engram/main_test.go | Updates CLI usage and post-install messaging assertions for pi. |
| cmd/engram/main_extra_test.go | Ensures interactive setup mode lists Pi as an option. |
| cmd/engram/main.go | Adds Pi post-install instructions and updates CLI help text. |
| README.md | Adds Pi to quickstart setup table + note about offline embedded install. |
| PRD-pi-support.md | Product requirements document describing Pi support goals and constraints. |
| DOCS.md | Documents session end semantics (including shutdown-metadata summary preservation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
🔗 Linked Issue
Closes #127
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:docs— Documentation onlytype:refactor— Code refactoring (no behavior change)type:chore— Maintenance, dependencies, toolingtype:breaking-change— Breaking change📝 Summary
engram setup pito install a native, offline Pi package viapi install.mem_*tools with notify-only startup and compaction recovery guidance.📂 Changes
plugin/pi/**internal/setup/**internal/store/store.gointernal/mcp/**docs/AGENT-SETUP.md,docs/PLUGINS.md,docs/ARCHITECTURE.md,DOCS.md,README.mdPRD-pi-support.md🧪 Test Plan
go test ./...go test -tags e2e ./internal/server/...Manual/runtime validation performed:
mem_*tools worked without bash./engram-recoveryworked.🤖 Automated Checks
Closes #N/Fixes #N/Resolves #Nstatus:approvedlabeltype:*labelgo test ./...passesgo test -tags e2e ./internal/server/...passes✅ Contributor Checklist
Closes #N)type:*label to this PRgo test ./...go test -tags e2e ./internal/server/...Co-Authored-Bytrailers in commits💬 Notes for Reviewers
Issue #127 currently showed
status:needs-reviewwhen checked locally; PR validation may require maintainers to move it tostatus:approved.Two non-blocking hardening notes remain:
shutdown reason=... target=....