Repository navigation
Implement Poke Interconnect Protocol (PIP v1) and MCP server - #1
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ore, outbox, node) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…add error_for_raw, mark_dead, receipt lookup by ref Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Implements PIP v1 as the Python package
pip_protocol(distpoke-interconnect,pip-nodeCLI). The spec isdocs/PROTOCOL.md; everything below follows it.Core design — one transport-agnostic
Nodedoes all verification and policy; HTTP (FastAPI) and MCP (FastMCP) are thin adapters, so there is no unauthenticated path on either transport.config/policy.example.yaml): pinned peers, scopes withprefix:*wildcards, per-resource consents (CONSENT_REQUIREDdistinct fromFORBIDDEN), token-bucket rate limits, size caps, redaction fields/regexes. Redaction runs before signing so signatures cover redacted content.MemoryStore/SqliteStorebehind oneStoreprotocol (nonces, idempotency receipts by key+ref, outbox).Outboxgives at-least-once sending with exponential backoff; receiver idempotency gives effectively-once.GET /.well-known/pip,POST /pip/v1/inbox(HTTP status mapped fromPipError.http_status, body always a signed envelope),/healthz,/metrics(Prometheus, private registry), optional constant-time bearer gate,X-PIP-Request-Id/X-PIP-Trace-Id, JSON logs without payload contents.HttpPeerClientverifies the response signature andin_reply_to.pip_handshake,pip_send_message,pip_exchange_data,pip_get_receipt,pip_list_capabilities; resourcespip://identity|capabilities|policy/scopes; promptspip_compose_message,pip_request_data. Tools never raise — failures return the signederrorenvelope. stdio and streamable-http (with bearer middleware).PIP_*env via pydantic-settings, key only via file path, refuses group/world-readable key files, loopback bind by default, TLS delegated to a proxy (docs/SECURITY.md).Verification:
ruff check,ruff format --check,mypy --strict src,pytest(116 tests) all pass locally; CI workflow runs the same on Python 3.10 and 3.12. Smoke-testedpip-node keygen/identity/serve-http+curl /healthz,/.well-known/pip.Notable decisions / deviations from spec text: duplicate receipts are re-signed (a mutated stored receipt would fail signature);
Consent.expiresoptional; any1.xversion accepted; inboundreceipt/errorenvelopes requiremessages:send,dataresponsesdata:respond;pip_get_receipttakes a signedreceipt-type lookup envelope and requiresmessages:read.Follow-ups: async handlers / background outbox worker, peer directory beyond the static policy file, mTLS option, persistent inbox, key-rotation CLI.
Link to Devin session: https://app.devin.ai/sessions/4104d923252c419994b9ebddc2f28bec
Open in Devin Desktop: https://app.devin.ai/desktop/session/4104d923252c419994b9ebddc2f28bec?variant=devin
Requested by: @CommunityPoke