Skip to content
CAI
Software that uses CAICheck a score

pact-foundation/pact-ruby

70.9

Strong · 6 November 2026

3.8k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added Alligator model to ZooApp

The ZooApp example now includes an Alligator model class within the ZooApp::Animals namespace. This new model stores an animal's name and implements equality comparison based on that name, allowing instances to be compared directly.

_example/zoo-app/lib/zoo\app/models · high confidence

Added ZooApp example application with AnimalServiceClient

The example application now includes a ZooApp module containing an AnimalServiceClient that interacts with an external animal-service.com API to retrieve alligator data, along with a version definition file.

_example/zoo-app/lib/zoo\app · high confidence

Added animal-service example application

The example/animal-service directory now contains a complete, runnable example application. This includes a Sinatra-based API that exposes an endpoint to retrieve alligator data by name, backed by a SQLite database via Sequel, along with the necessary configuration files (config.ru, Rakefile) and source code to run and test the service.

example/animal-service · high confidence

Added native Ruby bindings for Pact verifier execution and logging

The library now includes native Ruby wrappers for the Pact FFI verifier and logger. Users can execute verifications via the new \Pact::Native::BlockingVerifier\ module, which exposes the \pactffi\_verifier\_execute\ function, and control logging output through \Pact::Native::Logger.log\_to\_stdout\, supporting standard log levels from trace to off.

lib/pact/native · high confidence

Added release and specification automation tasks

New Rake tasks have been introduced to streamline the development and release workflow. The \tasks/release.rake\ file adds \generate\_changelog\ to produce changelogs using conventional changelog and \tag\_for\_release\ to create and push Git tags automatically. The \tasks/spec.rake\ file defines specific RSpec tasks for running general specs (\spec\), Pact provider specs (\pact:spec\), and Pact consumer verification specs (\pact:verify\), along with a \spec:all\ task to execute the full test suite.

tasks · high confidence

New FFI-based provider verification architecture with HTTP, gRPC, and async support

The provider verification logic has been rewritten to use the Pact FFI (Foreign Function Interface) for core verification, replacing the previous implementation. This introduces a new modular architecture with dedicated verifiers for HTTP, gRPC, and async message transports, coordinated by a MixedVerifier. The change includes a new \HttpServer\ that patches WEBrick to handle bodyless PUT/PATCH/POST requests and supports both Rack 2 and Rack 3 handlers. It also adds a \PactBrokerProxy\ to fetch pacts from a broker, a \GrufServer\ wrapper for gRPC services, and a \ProviderServerRunner\ to manage provider state setup/teardown servlets. Configuration is now handled via a new \PactConfig\ hierarchy supporting HTTP, gRPC, async, and mixed transport types.

lib/pact/provider · high confidence

New RSpec DSL helpers for Pact consumer, provider, and message testing

The library introduces a new set of RSpec support files that provide a modern DSL for defining Pact interactions. Consumers can now use \has\_http\_pact\_between\, \has\_grpc\_pact\_between\, and \has\_message\_pact\_between\ to configure mock servers and execute verifications, while providers can use \http\_pact\_provider\, \grpc\_pact\_provider\, and \message\_pact\_provider\ to define verification targets and provider states. Additionally, new helpers for message-based testing (\PactMessageHelpers\) and WebMock management (\WebmockHelpers\) are included to streamline Kafka/outbox testing and network mock isolation.

lib/pact/rspec · high confidence

New release automation scripts for gem publishing

Added \script/release.sh\ and \script/trigger-release.sh\ to streamline the gem release process. The local release script handles version bumping, changelog generation, and git tagging, while the trigger script invokes the GitHub Actions workflow via the API to automate the actual publishing step.

script · high confidence

Project scaffolding and RSpec configuration for Pact Ruby v2

The repository has been initialized with the structure for the v2 release, including a new \.rspec\ file that configures RSpec to use the progress formatter and automatically require \spec\_helper\ and \rails\_helper\. An \Appraisals\ file has been added to manage testing against different dependency versions, specifically Rack 2 and ActiveSupport 5.1 (with additional gems for Ruby 3.4). The \Rakefile\ now loads custom rake tasks from \lib/tasks\ and \tasks\, and sets the default task to run specs and pact verification. Documentation files such as \README.md\, \CONTRIBUTING.md\, \RELEASING.md\, and \ROADMAP.md\ have been added or updated to reflect the new architecture and usage instructions for the FFI-based implementation.

(repo-wide) · high confidence

Behavioural changes

5 commits (0 fixes) modifying example/animal-service/db

A change to existing behaviour in example/animal-service/db — 5 commits, 1 file: “Updated example app with latest good practise pact code”; “chore(deps): bundle update example/animal-service”; “Updated zoo-app example”; and 2 more.

example/animal-service/db · medium confidence · unverified

Adopts Zeitwerk for library autoloading and introduces FFI error handling

The library now uses Zeitwerk for class autoloading, replacing the previous manual require structure, which improves how classes are loaded and organized. Additionally, a new FFI error class has been added to provide detailed context (reason, status, and message) when underlying FFI operations fail, and core extension polyfills are explicitly loaded before eager loading to ensure compatibility with host applications.

lib · high confidence

Corrected polyfill implementations for blank?, present?, and presence methods

The core\_ext polyfill module has been updated to more closely align with Active Support's behavior for applications not loading the full library. Specifically, the implementations of Object\#blank?, Object\#present?, and the newly added Object\#presence method have been fixed to ensure correct logical evaluation across various object types. This change ensures that methods like presence correctly return the object itself when present, and blank?/present? behave consistently with standard Active Support expectations, improving reliability for users relying on these utilities without the full framework.

lib/pact/support · high confidence

New FFI-based consumer API for HTTP, gRPC, and message interactions

The consumer library has been rewritten to use the Pact FFI directly, introducing new builder classes for HTTP, gRPC, and message interactions. This change enables support for plugin-based content types (such as Protobuf) and allows users to define interaction references. The new API also ensures that the FFI log level is correctly initialized when creating a pact, and provides a unified configuration interface for different transport types.

lib/pact/consumer · high confidence

Pact library updated to version 2.1.0 with new DSL and configuration files

The pact library has been upgraded to version 2.1.0. This release introduces new configuration and DSL files, including \lib/pact/configuration.rb\ for provider state setup/teardown, \lib/pact/generators.rb\ for data generation helpers, \lib/pact/matchers.rb\ for various matching strategies, and \lib/pact/rspec.rb\ for RSpec integration. It also adds \lib/pact/railtie.rb\ for Rails support. The version number in \lib/pact/version.rb\ is explicitly set to 2.1.0.

lib/pact · high confidence

Pact v2 library reorganized under the Pact namespace

The Pact v2 library has been reorganized to move generators, matchers, and tasks into the main Pact namespace. This change introduces new generator classes for random integers, decimals, hexadecimal strings, UUIDs, and dates, alongside a comprehensive set of matcher classes for v1 through v4 of the Pact specification. Users can now utilize these updated components for more precise contract testing, including support for complex types like semver, content types, and nested structures via each-key and each-value matchers.

lib/pact/generators, lib/pact/matchers, lib/pact/tasks · high confidence

Test coverage

4 commits adding/updating tests in spec/lib/provider; 6 commits adding/updating tests in spec/pact/consumers; Added Pact contract tests for Zoo App and Animal Service integration; Added Pact v2 integration tests for HTTP, gRPC, Kafka, and MATT plugins; Added RSpec test configuration files for Rails and general specs; Added internal test application scaffolding for Pact verification; Added test coverage for Pact library components.

Dependencies

Updated gem dependencies and metadata for pact-ruby

The pact gem's dependency manifest has been updated to include pact-ffi (\~\> 0.5.8) for Rust Core support, rack-proxy, and webrick (\~\> 1.8) as runtime dependencies, while adding zeitwerk (\~\> 2.3) for code loading. Development dependencies now include appraisal (\~\> 2.5), faraday (\~\>2.0), and various testing and linting tools. The gemspec metadata has been enriched with author details, license (MIT), and documentation links, and example applications (animal-service, zoo-app) have been updated to use pact-ffi.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 71 → 71 (-0.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 65 → 65 (+0.0)
  • Architecture 99 → 99 (+0.0)
  • Maturity 73 → 76 (+3.0)
  • Readiness 73 → 73 (+0.1)
  • Security 83 → 75 (-8.3)

Resolved (9)

  • Duplicate intent between ProviderServerRunner and ProviderStateServlet. Both classes expose methods to add setup/teardown states with identical signatures. It is unclear why both exist and when to use one over the other, suggesting a potential architectural duplication.
  • Duplicated block (5 lines × 2) (lib/pact/consumer/grpc_interaction_builder.rb)
  • Inconsistent constructor signatures for Consumer vs Provider PactConfig. The Consumer config requires consumer_name and provider_name as positional arguments, while the Provider config only requires provider_name (and omits consumer_name). This forces different initialization patterns for symmetric concepts.
  • Inconsistent method names for generating the interaction JSON representation. Most builders use interaction_json(), but MessageInteractionBuilder uses build_interaction_json(). This is a minor naming inconsistency that breaks the pattern.
  • Inconsistent naming and argument structure for defining responses. HTTP builders use will_respond_with with explicit HTTP components, while gRPC and Sync Message builders use will_respond_with with a generic hash. This mirrors the request inconsistency and breaks the symmetry between request and response definition patterns in the same builder types.
  • Inconsistent naming and argument structure for setting request/response payloads across interaction builders. HTTP builders use with_request with explicit HTTP components, while gRPC and Sync Message builders use with_request with a generic hash. Message builders use with_json_contents or with_proto_contents. This creates a fragmented API where the same logical step (defining the request) has different names and argument shapes depending on the transport.
  • Off-boarding risk: anonymized user #1
  • Outdated: rubocop
  • Outdated: rubocop-performance

New (3)

  • MessageInteractionBuilder.validate! (cognitive 16) (lib/pact/consumer/message_interaction_builder.rb)
  • Off-boarding risk: anonymized user #1
  • Repeated repair: lib/pact/consumer/message_interaction_builder.rb (lib/pact/consumer/message_interaction_builder.rb)

Changes since last survey

  • 9 commits — 7 feature/other, 2 fixes

By area

  • .github/workflows — 6 commits
  • (root) — 2 commits
  • lib/pact — 1 commit

Notable commits

  • fix: fix: remove pact bin for cli no longer packaged in v2
  • fix: fix: support plugin message contents without a transport
  • change: chore(ci): install avro plugin
  • change: chore(deps): update dependency ruby to v4.0.8 (#433)
  • change: chore(deps): update dependency ruby to v4.0.9 (#434)
  • change: chore(deps): update pact-foundation/pact-cli digest to 27100e9 (#429)
  • change: chore(deps): update pact-foundation/pact-cli digest to 575a793 (#432)
  • change: chore(deps): update pact-foundation/pact-cli digest to d3f8b44 (#428)
  • change: chore(release): version 2.1.2

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pact-foundation/pact-ruby was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit b68abd9a09596f8015480d76f253100d4b72b142 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.