Skip to main content
OpenAPI compatibility

ContractSutra AI

Offline OpenAPI diff. A green gate is not runtime proof.

Offline detector for breaking changes between two JSON OpenAPI documents. npm [email protected] published 2026-11-22. The command alias is contractsutra. The npm README says there is no telemetry, no network call, no API key, and 0 runtime dependencies. It reads OpenAPI 3.0, 3.1, and 3.2 JSON only. It does not read YAML, GraphQL, AsyncAPI, or protobuf. A green gate is not proof the running service is compatible. Declared consumers stay labelled USER_DECLARED_UNVERIFIED. Generated cases stay labelled NOT_RUN. On 2026-11-23 the npm downloads API returned no row, so both counts are 0. GitHub showed 0 stars and 0 open issues, and its detected language was HTML because the handbook is in the repository. The handbook home and the npm README both said 123 automated tests passing, 20 of 20 gold-corpus scenarios, and 2,000 fuzz cases with 0 failures. The npm README says the gold corpus is synthetic and written by the author, not a measure of real-world APIs. The test-report page says the run was recorded 2026-11-22 on Node v24.15.0. This page did not re-run any of it. The name ContractSutra has not been trademark-searched. The npm README says the output is engineering evidence, not legal advice and not a compliance certification.

  • Offline
  • JSON only
  • Node 22+
GitHub version
0.2.1
Licence
Apache-2.0
Language
JavaScript
Weekly downloads
439
Overall downloads
439
GitHub stars
0

Use it when

  • 1

    You want a CI gate on two JSON OpenAPI files before a release.

  • 2

    You want each finding to name a JSON pointer, a direction, and a severity.

  • 3

    You want Markdown, HTML, JSON, and SARIF evidence without an API key.

What it does, and what it does not

Read this before the guide. A limit here is a limit of the tool.

Does

  • compare classifies each difference with direction-aware rules. The npm README says a provider must keep accepting old requests and keep honoring old responses.
  • Each finding has a stable ID, a JSON pointer, a severity, and the declared consumers it touches. Where the tool cannot decide, the finding is UNKNOWN.
  • Request tightenings such as a new required field, a removed field, or a narrower enum are breaking. Response removals and type changes are breaking. Added optional fields are additive.
  • oneOf, anyOf, allOf, an external ref, a cycle, or nesting deeper than 6 becomes UNRESOLVED_SEMANTICS with severity needs review. The npm README says those cases never silently pass.
  • audit runs 12 checks and replays the reports. verify checks the seal. A hash-chained log records the run. --fail-on breaking exits 2 when that gate trips.
  • serve binds loopback and needs CONTRACTSUTRA_TOKEN of 32 or more characters. mcp is experimental and speaks protocol 2025-11-25 only. Node.js 22 or newer. 0 runtime dependencies.

Does not

  • It compares specifications, not running services. The npm README says a green gate is not proof of runtime compatibility.
  • JSON only. The npm README says YAML, GraphQL SDL, AsyncAPI, and protobuf are not read.
  • Consumer mapping uses a file you supply. The npm README says that mapping is USER_DECLARED_UNVERIFIED and is not Pact verification.
  • cases writes templates marked NOT_RUN. The npm README says nothing is executed.
  • The hash chain and the seal detect edits. The npm README says they are not digital signatures, and the audit is automated self-verification, not a human audit and not a certification.
  • install-ide copies instruction files for nine IDE hosts. The npm README says native loading is authored, not verified. 22 agent roles and 29 skills are instruction files, not running services. The handbook home and the npm README both said 123 tests passing. This page did not re-run them. The name ContractSutra has not been trademark-searched.

Claims above are from the project pages and are attributed as stated there. They are not independently verified here.

How a run moves

From the ContractSutra AI npm README, version 0.2.1, published 2026-11-22. It reads two OpenAPI JSON files. It does not call the API.

  1. 1. Compare

    Request and response

    A new required request field is breaking. A removed response field is breaking. An optional addition is additive.

  2. 2. Unknown

    Needs review

    Composition keywords, external refs, cycles, and deep nesting stay unresolved. The npm README says they never silently pass.

  3. 3. Consumers

    Declared only

    The mapping file is labelled USER_DECLARED_UNVERIFIED. That is not Pact.

  4. 4. Gate

    Exit 2

    fail-on breaking stops CI. Exit 0 is not proof the running service still matches the spec.

How to read the result

Result It means It does not mean
Breaking The bundled fixture report, as described in the npm README, includes a new required request field and a removed response field. Not a test of the live API. This page did not re-run that fixture.
UNKNOWN The npm README says the tool could not decide from the spec text. Not a pass.
NOT_RUN Generated cases are templates. Not an executed test and not a certification.

Wording is from the project page or README and is attributed as stated there. It is not independently verified here.

Commands and notes

  • npx [email protected] doctor local check. No network.
  • npx [email protected] compare --before v1.json --after v2.json --out reports Markdown, HTML, JSON, and SARIF.
  • npx [email protected] compare --fail-on breaking exit 2 when that gate trips.
  • npx [email protected] audit --dir reports --out reports/audit 12-check replay. verify checks the seal.
  • validate, cases, install-ide, serve, and mcp listed in the npm README. serve is loopback only. mcp is experimental.

Documentation

Titles and descriptions below are the HTML title and meta description from each page on 2026-11-23. The security page and the test-report page cut the meta description at 200 characters in the HTML, so those sentences stay unfinished here. llms.txt is not HTML, so that card uses the file name. This website did not re-run the tests or the sample audit.

Open the documentation site

Questions

Does a green ContractSutra gate mean the API is compatible in production?

No. The npm README says the tool compares specifications, not running services, and a green gate does not prove the running API is compatible. The output is not legal advice and not a compliance certification. This page is not legal advice either.

Where is the handbook, and did this page re-run the tests?

https://shahvatsalofficial.github.io/contractsutra-ai/ returned HTTP 200 on 2026-11-23. Twelve handbook pages each have their own meta description, so each card shows that sentence. The security page and the test-report page cut their meta descriptions at 200 characters in the HTML, and this page does not finish those sentences. samples/index.html, samples/audit-report.html, and samples/compatibility.html also returned HTTP 200 and have their own descriptions. llms.txt returned HTTP 200 and is not HTML, so that card uses the file name. The handbook home and the npm README both said 123 tests passing, 20 of 20 gold-corpus scenarios, and 2,000 fuzz cases with 0 failures. This page did not re-run them and did not re-run the sample audit.

WhatsApp