Repository navigation
build(schemas): fail CI when a minor release makes a non-additive schema change - #8502
Conversation
…ema change Add scripts/lint-additive-minor.cjs. It compares two schema trees and reports every change that a validator pinned to the base release rejects: a property added to a closed object, a property removed, a newly required property, a narrowed type, a removed enum value, a changed const, a new enum, a tightened bound, an added pattern or format, additionalProperties closed, and a removed schema file. Changes it cannot classify reliably are reported for review and never fail. CI compares static/schemas/source with the latest stable release of the same major line. It fails on any violation that scripts/lint-additive-minor-baseline.json does not record. The baseline holds the 64 current violations against 3.2.7, each with the reason "pending WG decision". On pull requests the baseline may only shrink relative to the target branch. --history runs the comparison across the 3.x releases.
The required-added rule compared only a node's own `required` list. A name that the base already required through an `allOf` entry, or on the schema enclosing a composition branch, was reported as newly required. History showed 12 such false violations in `core/format.json` from 3.0.0 to 3.1.0. Add tests for both cases, and a test that reads closure from the base, so opening an object while adding a property still fails. Correct the header, which claimed the check reports every change a pinned validator rejects.
…or check Skip any base schema marked x-status experimental, or in a file whose root is, because the versioning policy classes experimental-only changes as patch-level. The baseline drops six entries, from 64 to 58. Keep only the violations that break an implementation pinned to the older release. Remove the review findings, union expansion, the patternProperties exemption, the moved-out-of-composition branch, --update-baseline, and the enum-introduced, pattern-added, and format-added kinds. Bound checks cover numeric bounds only. Keep one single-fault test per kind, and split the baseline entry test into a reason test and a kind test.
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated path requires human/CODEOWNERS approval.
This PR modifies .github/workflows/build-check.yml, which matches the gated path glob .github/workflows/**. gated_paths is true and review_decision is REVIEW_REQUIRED (not APPROVED), so decision-table row 2 fires: the hard approval gate is not satisfied and the outcome cannot be approve or plain comment.
No blocking (critical/high) findings exist. The reviewer confirms this is additive-minor CI tooling only — no schema/wire/dist change — and correctly carries no changeset. The one follow-up (matchBranches rest-pairing leaving a removed oneOf/anyOf branch unreported at L1014) is deliberately scoped out and noted as a non-blocking future pass; not a blocking finding.
Escalation reasons
.github/workflows/build-check.yml(modified) is under a hard approval gate (.github/workflows/**); requires human/CODEOWNERS review (review_decisionisREVIEW_REQUIRED, notAPPROVED).
Once a real reviewer/CODEOWNERS approval lands (review_decision: APPROVED), this clean diff with no blocking findings can fall through to approve.
Why human review
- Modifies .github/workflows/build-check.yml — gated path (.github/workflows/**) under a hard approval gate; review_decision is REVIEW_REQUIRED, so human/CODEOWNERS approval is required before merge.
- This PR touches a path under a hard, non-overridable approval gate (.github/workflows/build-check.yml (modified) matches
.github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.
Summary
AdCP promises that a minor release only adds to the protocol. Some published schemas break that promise. This pull request adds a continuous integration (CI) check that fails when a schema change breaks it.
If you know protobuf tooling, this is the JSON Schema counterpart of
buf breaking, closest to itsWIRE_JSONcategory. It compares the schemas against the last stable release and fails on changes that break existing payloads, such as a removed field, a narrowed type or a removed enum value. Experimental schemas are exempt, much asignore_unstable_packagesskips alpha and beta packages.It adds one rule protobuf doesn't need. In protobuf, adding a field never breaks a receiver, because unknown fields are kept. In JSON Schema, a closed object rejects unknown fields, so adding one breaks older validators. It also checks constraints that
buf breakingleaves to other tools, such as newly required fields and tighter bounds.Why
Many AdCP schemas are closed. A closed schema tells a validator to reject any field it doesn't recognize. In JSON Schema,
additionalProperties: falsecloses an object.Some buyers validate each response against the schemas of the release they built for. Suppose that a minor release adds an optional field to a closed schema. A seller on the later release sends that field. The buyer's validator doesn't recognize the field, so it rejects the whole response. The buyer changed nothing, yet its integration stops working.
Two published schemas show the pattern:
brand-ref) has been closed since 3.0. Release 3.1 addedbrand_kit_overrideto it, and 3.2 addedcountries. A buyer that validates against 3.0 rejects a brand reference that carries either field.account-ref) has a closed form that names an account by brand and operator. Release 3.2 addedcurrency,timezone, andoperator_unitto that form.The following table counts the non-additive changes between consecutive releases. It leaves out experimental surfaces. Most of the changes are fields added to closed objects.
Release 3.2.0 was withdrawn, so the 3.2 line starts at 3.2.1. The patch lines add a few more: 8 changes from 3.0.0 to 3.0.28, and 2 from 3.1.0 to 3.1.29.
What changes
The check,
lint-additive-minor.cjs, runs in the build check job. It works as follows:main, that release is 3.2.7.main. The baseline can only shrink, so a pull request that adds an entry fails.x-status: "experimental". The versioning policy classes experimental-only changes as patch-level.The check fails on these kinds of change:
maxLengthadditionalProperties: false$idremoved without an aliasThe check has these known limits:
oneOfandanyOfbranches by heuristic. It skips a branch that it can't pair safely.pattern,format, oruniqueItems, and anenumadded where any value was allowed.Compatibility impact
mainthat are planned for 3.3.0. Each entry carries the reason "pending WG decision". The WG can resolve each entry before release.Test plan
mainwith 58 recorded changes and 0 unrecorded ones.brand-refandaccount-refadditions.