|
| 1 | +--- |
| 2 | +phase: 02-compatibility-automation-and-distribution |
| 3 | +plan: "01" |
| 4 | +type: execute |
| 5 | +wave: 1 |
| 6 | +depends_on: [] |
| 7 | +files_modified: |
| 8 | + - package.json |
| 9 | + - scripts/compatibility.mjs |
| 10 | + - scripts/lib.mjs |
| 11 | + - tests/compatibility.test.mjs |
| 12 | + - tests/fixtures/compatibility/ |
| 13 | + - .github/workflows/compatibility.yml |
| 14 | + - docs/VERSIONING.md |
| 15 | + - CONTRIBUTING.md |
| 16 | +autonomous: true |
| 17 | +requirements: [COMP-01] |
| 18 | +must_haves: |
| 19 | + truths: |
| 20 | + - Pull requests automatically classify schema changes against their merge base. |
| 21 | + - Breaking and review-required changes cannot be silently reported as compatible. |
| 22 | + - Compatibility results are available as machine-readable JSON and a CI summary. |
| 23 | +--- |
| 24 | + |
| 25 | +<objective> |
| 26 | +Implement conservative automated JSON Schema breaking-change classification and enforce it in pull-request CI. |
| 27 | +</objective> |
| 28 | + |
| 29 | +<tasks> |
| 30 | +<task type="auto"> |
| 31 | + <name>Implement classifier and CLI</name> |
| 32 | + <read_first>scripts/lib.mjs, docs/VERSIONING.md, schemas/v0.1/common.schema.json</read_first> |
| 33 | + <action>Add a dependency-free directional schema-tree comparator. Report unchanged, compatible, breaking, and review_required outcomes with JSON details. Exit nonzero for breaking changes and support explicit base/head directories.</action> |
| 34 | + <acceptance_criteria>`node scripts/compatibility.mjs --help` exits successfully and documents CLI inputs and exit behavior.</acceptance_criteria> |
| 35 | +</task> |
| 36 | +<task type="auto"> |
| 37 | + <name>Add compatibility fixtures and tests</name> |
| 38 | + <read_first>tests/contracts.test.mjs, scripts/compatibility.mjs</read_first> |
| 39 | + <action>Add tests for additions, removals, required properties, type and enum narrowing, extensibility tightening, constraints, schema removal, and unknown changed keywords.</action> |
| 40 | + <acceptance_criteria>`npm.cmd test` passes and exercises all four classifications.</acceptance_criteria> |
| 41 | +</task> |
| 42 | +<task type="auto"> |
| 43 | + <name>Integrate PR compatibility CI and governance docs</name> |
| 44 | + <read_first>.github/workflows/ci.yml, CONTRIBUTING.md, docs/VERSIONING.md</read_first> |
| 45 | + <action>Add a least-privilege pull-request workflow that compares against the merge base, writes a job summary, uploads the JSON report, and fails on breaking changes. Document local classification and review-required semantics.</action> |
| 46 | + <acceptance_criteria>Workflow uses full-history checkout, runs the classifier, uploads its report, and has read-only contents permission.</acceptance_criteria> |
| 47 | +</task> |
| 48 | +</tasks> |
| 49 | + |
| 50 | +<verification> |
| 51 | +- `npm.cmd test` |
| 52 | +- `npm.cmd run validate` |
| 53 | +- Run the CLI against identical schema trees and a known breaking fixture. |
| 54 | +</verification> |
0 commit comments