RFC: Pact MkII — a ground-up redesign of the Pact framework - #146
RFC: Pact MkII — a ground-up redesign of the Pact framework#146rholshausen wants to merge 2 commits into
Conversation
Proposes a single-engine architecture with thin generated SDKs, declarative interactions compiled to inspectable matching plans, components/plugins as the core design, a shape language with variant testing for optional and polymorphic values, provider shapes with a subsumption check, and scriptable lifecycle hooks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
good read, will take some time to mull over. sounds really promising |
|
One thing to note, I have been getting Claude to run a number of spikes to test some design ideas, and one of the things that was flagged is this RFC is still very HTTP centric, and will need to be rewritten. TLDR is that HTTP becomes a more specific interaction, interaction responses become optional and polled, and a message fire and forget is just an interaction that no response defined.
|

This RFC is a thought experiment made concrete: if we designed Pact from scratch today, what would we keep, change, and throw away? It proposes Pact MkII (working title), built on five pillars:
pact explain), building on the v2 matching engine prototyped in pact-reference.optional,oneOf,anyOfand cardinality, made safe by variant testing (every declared variation is actually exercised and replayed), plus provider-published shapes with a subsumption check to catch response variance the consumer never declared.The consumer-driven workflow, the pact file as artifact, and the broker/
can-i-deployworkflow are all retained. v1–v4 pact files remain verifiable and apact upgradetool is proposed. Deterministic verification remains the foundation; AI assistance (SDK maintenance, mismatch diagnosis, agentic orchestration) is strictly optional.Backwards compatibility is explicitly not a constraint for this exercise, though a migration path is sketched. Feedback is welcome on any part, but the unresolved questions section lists the areas where community input would help most: naming/versioning, the day-one scope of the component model, variant sampling defaults, and subsumption policy.
🤖 Generated with Claude Code