Skip to content

Gold Schema Compatibility CI Gate (ADR-036 MVP) #2516

@SatoryKono

Description

@SatoryKono

Summary

The repository already has a real schema-governance baseline in CI. The remaining gap is an explicit Gold compatibility classifier and gate aligned with ADR-036, so PRs can distinguish compatible Gold contract evolution from breaking Gold contract changes.

Current baseline (2026-04-12)

The repo already contains:

  • accepted versioning policy in docs/02-architecture/decisions/ADR-036-gold-contract-versioning-policy.md
  • schema-governance workflow in .github/workflows/schema-governance.yml
  • blocking checks for:
    • generated schema artifacts freshness
    • contract import validation
    • schema parity / PK coverage
    • representative Silver schema drift
  • supporting tooling such as:
    • scripts/schema/generate_schema_artifacts.py
    • scripts/schema/generate_contracts.py
    • src/tools/verify_schema_parity.py
    • src/tools/generate_json_field_typing_inventory.py

What is still missing

What is still not present is a Gold-focused compatibility diff/classification layer that:

  • detects Gold contract changes in a PR
  • classifies them according to ADR-036 semantics
  • produces readable diagnostics
  • fails CI only for breaking Gold changes

In other words, schema governance exists, but the ADR-036 Gold compatibility policy is not yet enforced as a first-class CI gate.

Goal

Add an explicit Gold schema compatibility classifier on top of the existing schema-governance workflow without replacing the current gates.

Proposed scope

  1. Implement a Gold compatibility rule set derived from ADR-036.
  • adding a nullable column = compatible
  • removing a column = breaking
  • renaming a column = breaking
  • narrowing a type = breaking
  • changing nullable to non-nullable = breaking
  • semantic reinterpretation of an existing field = breaking when detectable through contract metadata or explicit rename/migration markers
  1. Add Gold-focused diffing.
  • detect Gold contract changes for affected schemas in a PR or compare target/base snapshots
  • classify each change using the explicit rule set
  • emit human-readable diagnostics explaining why the change is compatible or breaking
  1. Integrate the classifier into CI.
  • extend .github/workflows/schema-governance.yml or an adjacent workflow step
  • keep the existing generated-artifacts / contracts-export / schema-parity / silver-schema-drift checks intact
  • fail only when the Gold compatibility classifier identifies breaking changes
  1. Document operator/developer workflow.
  • explain the rule set
  • explain how intentional breaking changes should be introduced under ADR-036
  • explain how to update or regenerate any baselines used by the classifier

Concrete evidence anchors

  • .github/workflows/schema-governance.yml
  • docs/02-architecture/decisions/ADR-036-gold-contract-versioning-policy.md
  • docs/D-03 Data Contracts & Schema Specification.md
  • docs/reports/great-expectations-spike-2026-04-01.md
  • src/tools/verify_schema_parity.py

Out of scope

  • downstream consumer registry / notification automation
  • replacing Silver schema drift checks with a new framework
  • full multi-layer schema governance redesign in this issue
  • broad deprecation workflow automation outside Gold contract compatibility

Definition of done

  • Gold schema changes are classified explicitly as compatible or breaking
  • CI exposes a dedicated Gold compatibility result in addition to the current governance gates
  • diagnostics explain the exact Gold diff and classification outcome
  • docs explain the rule set, extension path, and intentional-breaking-change workflow

Acceptance tests

  • adding a nullable Gold column is classified as compatible
  • removing a Gold column is classified as breaking
  • renaming a Gold column is classified as breaking
  • narrowing a Gold column type is classified as breaking
  • changing nullable to non-nullable is classified as breaking
  • CI output shows the concrete Gold contract diff in human-readable form
  • the existing schema-governance gates remain green/independent when no Gold breaking change is introduced

Related

  • ADR-036 Gold contract versioning policy
  • existing schema-governance workflow
  • complements, and does not replace, parity and Silver drift checks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions