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+
- npm latest
- [email protected]
- 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. Compare
Request and response
A new required request field is breaking. A removed response field is breaking. An optional addition is additive.
-
2. Unknown
Needs review
Composition keywords, external refs, cycles, and deep nesting stay unresolved. The npm README says they never silently pass.
-
3. Consumers
Declared only
The mapping file is labelled USER_DECLARED_UNVERIFIED. That is not Pact.
-
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
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] doctorlocal check. No network. -
npx [email protected] compare --before v1.json --after v2.json --out reportsMarkdown, HTML, JSON, and SARIF. -
npx [email protected] compare --fail-on breakingexit 2 when that gate trips. -
npx [email protected] audit --dir reports --out reports/audit12-check replay. verify checks the seal. -
validate, cases, install-ide, serve, and mcplisted 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.
- Offline OpenAPI breaking-change detector | ContractSutra AI ContractSutra AI compares OpenAPI specs with direction-aware rules, gates CI, and writes sealed Markdown, HTML, JSON and SARIF audit evidence. Zero dependencies, fully offline.
- Executive summary | ContractSutra AI ContractSutra AI v0.2.1 tells engineering teams whether a change to an OpenAPI document can break the clients that call it, and produces evidence a reviewer can check without trusting the tool.
- Functional specification | ContractSutra AI Offline. Deterministic (same inputs give byte-identical findings). Bounded input size and nesting. Atomic file writes. No network.
- Architecture | ContractSutra AI before.json --+ +--> contract-diff.json / .sarif.json
- Technical reference | ContractSutra AI contractsutra validate --spec <openapi.json>
- User guide | ContractSutra AI node --version # must be 22 or newer
- Compatibility rules | ContractSutra AI Guiding principle: a provider must keep accepting old valid requests and keep satisfying old promised responses.
- Security and privacy | ContractSutra AI It makes after-the-fact edits detectable. It does not prove who produced the files, and an attacker who can rewrite the whole directory consistently can recompute it. For stronger guarantees, sign rel
- Test report and proof | ContractSutra AI Recorded 2026-11-22 on Node v24.15.0, win32 x64. Regenerate with npm run proof. Raw files are in [docs/proof](https://github.com/shahvatsalofficial/contractsutra-ai/tree/main/docs/proof) and the [samp
- Legal and governance | ContractSutra AI This page is a plain-language summary for transparency. It is not legal advice; consult counsel for your situation.
- Operations and release | ContractSutra AI 1. npm test, npm run lint, npm run demo, npm run proof all green locally.
- Roadmap and FAQ | ContractSutra AI Is this an OpenAPI linter? No. It compares two versions and reports compatibility risk.
- Sample reports and results | ContractSutra AI Real generated compatibility, SARIF and audit reports plus test, gold corpus, fuzz and benchmark results.
- ContractSutra independent audit report Independent replay audit of ContractSutra compatibility reports
- ContractSutra compatibility report Static OpenAPI compatibility report
- llms.txt
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.
Other projects
- VigilSutra AI 256 last week · 2,260 overall · 4 stars
- RachnaSutra AI 212 last week · 971 overall · 4 stars
- ArchSutra AI 186 last week · 951 overall · 4 stars
- PramanaSutra AI 200 last week · 786 overall · 4 stars
- EvalSutra AI 205 last week · 597 overall · 4 stars
- DocSutra AI 217 last week · 571 overall · 4 stars
- IncidentSutra AI 237 last week · 549 overall · 4 stars
- ContextSutra AI 213 last week · 566 overall · 4 stars
- MigraSutra AI 219 last week · 562 overall · 4 stars
- WattSutra AI 182 last week · 502 overall · 4 stars
- ProtocolSutra AI 214 last week · 576 overall · 4 stars
- EdgeSutra AI 61 last week · 372 overall · 4 stars
- ContribSutra AI 280 last week · 525 overall · 4 stars
- LocalSutra AI 535 last week · 535 overall · 4 stars
- LineageSutra AI 342 last week · 342 overall · 0 stars
- DeploySutra AI 305 last week · 305 overall · 0 stars
- GovernSutra AI 497 last week · 497 overall · 0 stars
- AccessSutra AI 450 last week · 450 overall · 0 stars
- IntentSutra AI 450 last week · 450 overall · 0 stars