Program Context Protocol (PCP)
Your AI coding agent says "done." It isn't.
Long agent sessions drift: the agent forgets what the objective actually was,
marks criteria complete that don't work, drops modularity, and nobody catches
it until it's in production. PCP is a structured .pcp/ directory + CLI that
stops this — deterministic CI gates, auto-generated state (never hand-typed,
never stale), and a validator that checks whether your build actually still
covers your objective.
If you're searching for: LLM hallucinated "done", AI agent context drift, spec drift across dev sessions, keep Claude/Copilot/Cursor aligned with the objective, prevent scope drift in agentic coding — this is that tool.
What makes this different
Spec-as-truth (write a spec, build against it) is now common — Spec Kit, BMAD, OpenSpec all do it. None of them close the loop:
| Tool | Gap PCP closes |
|---|---|
| Spec Kit, OpenSpec, BMAD | Spec-as-truth is mainstream — none block a drifted commit or deploy |
| Kiro (AWS), Tessl | Proprietary |
| Swimm, Fiberplane, Grit | Doc-vs-code only, pairwise — no program-level objective coverage |
| Agent-governance tools (Endor, LaneKeep) | Gate tool calls, not spec alignment |
Pioneer claim: pcp validate-strategy checks whether your module
decomposition still collectively covers the stated objective — deterministic
coupling analysis (circular deps, God modules), not vibes. No other tool in
this space does this.
How it works
objective.md (human-approved, immutable to unattended agents)
↓
strategy/decomposition.md ←── pcp validate-strategy
↓
modules/*/spec.yaml ←── pcp validate-module
↓
[agent codes]
↓
pre-commit: pcp check → Layer 1, deterministic AST/schema, hard block
PR: pcp gate → Layer 2, LLM advisory score, logged
deploy: pcp deploy-check → Layer 3, phase exit criteria, hard block
current_state.md and diff.md are always auto-generated from your actual
code — never hand-written, never allowed to go stale.
Logic-tier ladder — not everything is an LLM's job
Every piece of judgment-requiring logic a PCP-built project writes gets routed to the cheapest tool that can correctly make it, cheapest-first:
| Rung | What it is | When it applies |
|---|---|---|
| 1. Deterministic | if/else, lookup table | Fixed rules, one correct output |
| 2. Solver/optimization | OR-Tools, CBC | Constraints+objective known, answer isn't |
| 3. Statistical/ML | sklearn, HuggingFace | Pattern learned from historical data |
| 4. RAG | retrieval + light synthesis | Answer exists in a bounded corpus |
| 5. Cached reuse | lru_cache, diskcache | Replay a near-duplicate prior answer |
| 6. Deep-think LLM | last resort | Two competent humans would reasonably disagree |
Enforced via schema-validated logic_tier fields per acceptance criterion +
CI drift checks (a criterion that claims rung ≤5 but imports an LLM SDK
fails the gate). Most agentic-coding tools default everything to rung 6 —
this is the difference between "call the LLM" and "decide whether you
should."
Prior-art gate
Before scaffolding a non-trivial module (auth, payments, queues, parsers, state machines, a canvas/diagram editor, PDF processing — anything a mature library probably already solves) PCP runs a prior-art check: search GitHub/npm/PyPI, shortlist candidates, check license compatibility, decide reuse-as-dependency / fork-adapt / reference-pattern-only / build-fresh before code gets written. Rationale is recorded per module, not left to whether the agent happened to think of it that day.
Install
pip install -e .
pcp init
Requires git and the claude CLI on PATH. Run pcp doctor to check
your environment.
Status
Pre-launch — validating across real dogfood projects before a public 1.0. Core loop (schema, validate-strategy, scan, Layer 1/2/3 gates) is built and tested.
License
MIT OR Apache-2.0
Metadata
Release files for program-context-protocol 0.12.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| program_context_protocol-0.12.4.tar.gz | 547.1 kB | Without provenance | Details for program_context_protocol-0.12.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| program_context_protocol-0.12.4-py3-none-any.whl | Python 3 | none | any | Details for program_context_protocol-0.12.4-py3-none-any.whl |
Total release size: 996.7 kB
Release files / program_context_protocol-0.12.4.tar.gz
| Download URL | program_context_protocol-0.12.4.tar.gz |
|---|---|
| Size | 547.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ae4dfb8fbeb3202a687f6e17f33e9c69ed69d7f081372f8e0f39dc8b5fa65bc
|
|
BLAKE2b-256 checksum How to use checksums |
4c542346b6f942184f413bb43d57722229f5536bce52b433410e0f8bba329c0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / program_context_protocol-0.12.4-py3-none-any.whl
| Download URL | program_context_protocol-0.12.4-py3-none-any.whl |
|---|---|
| Size | 449.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee4f85020585b535f150ac8393413bc0368e7ea48243e9328fee7a2c1c432c10
|
|
BLAKE2b-256 checksum How to use checksums |
412a572f2492449a4b9c237284247e3eab6f3400290cc20d4c09d3c2b6746442
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for program-context-protocol 0.12.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.