Metadata-Version: 2.4
Name: patchr
Version: 0.1.0
Summary: Patchr Protocol infrastructure for agentic orchestration and settlement.
Author: Patchr Core Team
License-Expression: Apache-2.0
Keywords: patchr,sdk,mcp,a2a,workflow,agents
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: api
Requires-Dist: fastapi>=0.111; extra == "api"
Requires-Dist: uvicorn>=0.30; extra == "api"
Provides-Extra: worker
Requires-Dist: redis>=5.0; extra == "worker"
Requires-Dist: rq>=1.16; extra == "worker"
Provides-Extra: db
Requires-Dist: psycopg[binary]>=3.2; extra == "db"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# Patchr

Patchr is the protocol infrastructure layer for agentic orchestration and settlement.
External apps, services, and agents communicate with Patchr through the SDK, API contract, MCP, and A2A protocol surfaces.

Current status: Phase 78 primitives. Patchr now has three flagship workflow templates, citeable proof cards, first-class HUNT, RESOLVE, BRIDGE, PAY, and PROXY domain primitives, portable proof packs, an Auto-Audit Vault contract, Resolve scam and mobility triage, regulated PROXY human routes, misinformation escalation to PROXY review, durable task lifecycle state, durable mandate records, payment mandate preparation, settlement adapter contracts, BRIDGE connector registry, connector preflight, PROXY human-in-the-loop suspend/resume contracts, durable proxy mission records, durable proxy callback reference lookup, proxy mission/outcome/proof schemas, scoped credential references, redacted secret-reference checks, mandate-session and capability-grant policy evaluation and runtime enforcement across BRIDGE, PAY, and PROXY, durable escrow records, durable A2A envelope records, durable community signal provenance, durable integration event outbox, subscriptions, delivery attempts, ready, chain, single and batch claim, complete, cancel, retry, fail, lease, sweep, retry-scheduling, and queue-stat controls, durable agent capability discovery, A2A envelopes, community signal disambiguation, audit proof-of-value verification, listable receipt and evidence export, bearer-token API/MCP/A2A transport auth, public API status, a security whitepaper, a neutral SDK/API/MCP boundary, a public schema catalog, integration manifest with domain capability and policy discovery, domain-aware compatibility handshake with contract references, developer docs, and a versioned agent-readable protocol map with deterministic digest, method-aware API route metadata, SDK, MCP, schema, manifest parity, and policy metadata, external RESOLVE and PROXY SDK helpers, file-to-base64 RESOLVE intake, claim drafting, contact-channel planning, a damaged-TV RESOLVE journey test, a local developer sandbox with API/SDK/MCP trace access, local benchmark evidence with claim labels, source-hygiene guardrails, source brief contract parity, boundary gap wording cleanup, migration inventory closure, brief surface completeness, FastAPI contract parity for PROXY, rollout verification gates, and machine-readable contracts.

## Local Commands

```bash
npm install
npm run dev
npm run api:dev
npm run web:dev
npm run web:build
npm run verify
PYTHONPATH=src:. python -m apps.api.main
PYTHONPATH=src:. python -m apps.worker.main
PYTHONPATH=src:. python -m apps.worker.verify
PYTHONPATH=src:. python -m apps.sandbox.main --pretty
PYTHONPATH=src:. python -m apps.benchmarks.main --iterations 100 --pretty
PYTHONPATH=src:. python -m unittest discover -s tests -p 'test_*.py'
```

## Docs

- [GCP Terraform deployment](infra/gcp/terraform/README.md)
- [Migration plan](docs/picux-migration-plan.md)
- [Phase 0 inventory](docs/picux-migration-inventory.md)
- [Phase 5 community signals](docs/phase5-community-signals.md)
- [Phase 6 external client](docs/phase6-external-client.md)
- [Phase 7 developer sandbox](docs/phase7-developer-sandbox.md)
- [Phase 8 verification](docs/phase8-verification-rollout.md)
- [Phase 9 protocol contracts](docs/phase9-protocol-contracts.md)
- [Phase 10 HUNT domain](docs/phase10-hunt-domain.md)
- [Phase 11 agent registry](docs/phase11-agent-registry.md)
- [Phase 12 audit verification](docs/phase12-audit-verification.md)
- [Phase 13 receipt export](docs/phase13-receipt-export.md)
- [Phase 14 A2A envelope](docs/phase14-a2a-envelope.md)
- [Phase 15 agent registry durability](docs/phase15-agent-registry-durability.md)
- [Phase 16 task lifecycle](docs/phase16-task-lifecycle.md)
- [Phase 17 mandate durability](docs/phase17-mandate-durability.md)
- [Phase 18 escrow durability](docs/phase18-escrow-durability.md)
- [Phase 19 MCP endpoint](docs/phase19-mcp-endpoint.md)
- [Phase 20 transport auth](docs/phase20-transport-auth.md)
- [Phase 21 schema catalog](docs/phase21-schema-catalog.md)
- [Phase 22 A2A envelope durability](docs/phase22-a2a-envelope-durability.md)
- [Phase 23 A2A transport auth](docs/phase23-a2a-transport-auth.md)
- [Phase 24 receipt reconciliation](docs/phase24-receipt-reconciliation.md)
- [Phase 25 evidence catalog](docs/phase25-evidence-catalog.md)
- [Phase 26 community signal durability](docs/phase26-community-signal-durability.md)
- [Phase 27 integration manifest](docs/phase27-integration-manifest.md)
- [Phase 28 integration handshake](docs/phase28-integration-handshake.md)
- [Phase 29 integration events](docs/phase29-integration-events.md)
- [Phase 30 event subscriptions](docs/phase30-event-subscriptions.md)
- [Phase 31 event deliveries](docs/phase31-event-deliveries.md)
- [Phase 32 delivery claim and retry](docs/phase32-delivery-claim-retry.md)
- [Phase 33 delivery leases](docs/phase33-delivery-leases.md)
- [Phase 34 delivery lease sweep](docs/phase34-delivery-lease-sweep.md)
- [Phase 35 delivery retry scheduling](docs/phase35-delivery-retry-scheduling.md)
- [Phase 36 delivery stats](docs/phase36-delivery-stats.md)
- [Phase 37 delivery fail scheduling](docs/phase37-delivery-fail-scheduling.md)
- [Phase 38 delivery completion](docs/phase38-delivery-completion.md)
- [Phase 39 delivery chain](docs/phase39-delivery-chain.md)
- [Phase 40 delivery cancellation](docs/phase40-delivery-cancellation.md)
- [Phase 41 delivery ready preview](docs/phase41-delivery-ready.md)
- [Phase 42 delivery batch claim](docs/phase42-delivery-batch-claim.md)
- [Phase 43 payment adapters](docs/phase43-payment-adapters.md)
- [Phase 44 bridge connectors](docs/phase44-bridge-connectors.md)
- [Phase 45 security policy](docs/phase45-security-policy.md)
- [Phase 46 developer docs](docs/phase46-developer-docs.md)
- [Phase 47 sandbox API](docs/phase47-sandbox-api.md)
- [Phase 48 benchmark evidence](docs/phase48-benchmark-evidence.md)
- [Phase 49 status and security](docs/phase49-status-security.md)
- [Phase 50 source hygiene](docs/phase50-source-hygiene.md)
- [Phase 51 FastAPI contract parity](docs/phase51-fastapi-contract-parity.md)
- [Phase 52 runtime policy enforcement](docs/phase52-runtime-policy-enforcement.md)
- [Phase 53 secret reference checks](docs/phase53-secret-reference-checks.md)
- [Phase 54 BRIDGE preflight](docs/phase54-bridge-preflight.md)
- [Phase 55 PROXY suspend/resume](docs/phase55-proxy-suspend-resume.md)
- [Phase 56 PROXY durability](docs/phase56-proxy-durability.md)
- [Phase 57 PROXY callback refs](docs/phase57-proxy-callback-refs.md)
- [Phase 58 PROXY policy enforcement](docs/phase58-proxy-policy-enforcement.md)
- [Phase 59 PROXY FastAPI parity](docs/phase59-proxy-fastapi-parity.md)
- [Phase 60 PROXY external SDK](docs/phase60-proxy-external-sdk.md)
- [Phase 61 domain manifest](docs/phase61-domain-manifest.md)
- [Phase 62 domain handshake](docs/phase62-domain-handshake.md)
- [Phase 63 domain policy discovery](docs/phase63-domain-policy-discovery.md)
- [Phase 64 agent-readable policy map](docs/phase64-agent-readable-policy-map.md)
- [Phase 65 agent map manifest parity](docs/phase65-agent-map-manifest-parity.md)
- [Phase 66 protocol map surface](docs/phase66-protocol-map-surface.md)
- [Phase 67 handshake contract references](docs/phase67-handshake-contract-refs.md)
- [Phase 68 protocol map route metadata](docs/phase68-protocol-map-route-metadata.md)
- [Phase 69 protocol map version source](docs/phase69-protocol-map-version-source.md)
- [Phase 70 protocol map digest](docs/phase70-protocol-map-digest.md)
- [Phase 71 brief contract parity](docs/phase71-brief-contract-parity.md)
- [Phase 72 boundary gap wording](docs/phase72-boundary-gap-wording.md)
- [Phase 73 migration inventory closure](docs/phase73-migration-inventory-closure.md)
- [Phase 74 brief surface completeness](docs/phase74-brief-surface-completeness.md)
- [Phase 75 resolve TV journey](docs/phase75-resolve-tv-journey.md)
- [Phase 76 resolve attachment contact](docs/phase76-resolve-attachment-contact.md)
- [Phase 77 domain proof packs](docs/phase77-domain-proof-packs.md)
- [Phase 78 workflow templates and proof cards](docs/phase78-workflow-templates-proof-cards.md)
- [Phase 79 developer activation loop](docs/phase79-developer-activation-loop.md)
- [Distribution homepage](docs/distribution-homepage.md)
- [Security whitepaper](docs/security-whitepaper.md)
- [Developer docs](docs/developers/index.md)
- [Docs index](docs/index.md)
