Skip to content

Promote staging to main: ODCS compatibility (optional ontology) - #459

Merged
nightmoose merged 3 commits into
mainfrom
staging
Nov 26, 2026
Merged

nightmoose merged 3 commits into
mainfrom
staging

Conversation

@nightmoose

Copy link
Copy Markdown
Owner

Promotes the ODCS compatibility fix from staging to main (prod). Contains only PR #458 (merge ada09f0).

What a user gets: contractgate validate, synth, test, enforce, push, deploy, POST /contracts/synth, the playground and contract create / version / deploy accept a valid ODCS v3.x contract with no ontology. description may be text or the ODCS object form. The Python SDK reads ODCS too. Native contracts behave as before.

Risk: low. No DB migration. Native YAML takes the same parse path as before (ontology and ontology.entities now default to empty). ODCS input is converted once, on the way in, with the existing importer.

Verified on staging (build ada09f0): CLI built from staging passes validate and synth on a minimal ODCS contract and on the official full example; POST /contracts/synth and the public playground return rows and violations for both; contract create stores native YAML; a Data Contract Specification file gets a clear 422. CI green on #458 (902 Rust tests, Python SDK 209, clippy, fmt, CodeQL).

Known gaps (documented in docs/odcs/using-odcs-directly.md): only schema[0] is read, relationships and SQL quality checks are not mapped, TypeScript SDK still requires ontology.

ContractGate Lead and others added 3 commits November 26, 2026 08:14
… API, Python SDK)

Root cause: validate/synth/enforce/test/push/deploy and the API parsed contract YAML
straight into the native Contract struct, where ontology was required and
description had to be a string. ODCS documents never reach the existing ODCS
importer outside POST /contracts/import.

- ontology and ontology.entities now default to empty; description accepts a map
- odcs::parse_contract_yaml / normalize_contract_yaml detect ODCS (no ontology plus
  apiVersion v3.x, kind DataContract, or a schema list) and map it through the
  existing importer; native YAML is untouched
- used by the CLI, POST /contracts/synth, playground, contract create/version/draft/
  deploy (stored as native YAML), impact and diff
- importer: physicalType fallback, map type, primaryKey implies required and unique
  (single column), note for extra schema objects, numeric version, clear errors
  (Data Contract Specification, no schema, no properties, bad apiVersion)
- Python SDK Contract.from_yaml reads ODCS and no longer requires ontology
- fixtures: official full example and a minimal contract; docs/odcs/using-odcs-directly.md
fix: accept ODCS v3.x contracts without an ontology (validate, synth, API)
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
contractgate Ready Ready Preview Nov 26, 2026 1:40pm UTC

Request Review

@nightmoose
nightmoose merged commit 746de3e into main Nov 26, 2026
48 checks passed

This branch was successfully deployed

1 active deployment
Preview — ada09f0b Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant