Skip to content

Add JSON-Schema compatibility classification#304

Merged
JE-Chen merged 1 commit into
devfrom
feat/schema-compat-batch
Jun 21, 2026
Merged

Add JSON-Schema compatibility classification#304
JE-Chen merged 1 commit into
devfrom
feat/schema-compat-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

We could validate against (json_schema) and generate (action_lint/schema) JSON Schemas but couldn't classify whether a change is backward/forward/full compatible.

  • diff_schemas(old, new)[SchemaChange(path, kind, breaks)] over the object subset (properties/required/type/enum).
  • check_compatibility(old, new, mode){compatible, mode, changes, breaking}.
  • is_backward_compatible / is_forward_compatible / is_full_compatible.

Rules (Confluent/Avro): added-required field, narrowed type, removed enum value → break backward; removed-required field, widened type, added enum value → break forward. (Numeric bounds out of scope.)

Layers

  • Headless core: utils/schema_compat/ (pure stdlib, zero PySide6).
  • Facade: 6 symbols + __all__.
  • Executor: AC_check_compatibility.
  • MCP: ac_check_compatibility (read-only).
  • Script Builder: under Data.
  • Tests: test/unit_test/headless/test_schema_compat_batch.py (10 tests).
  • Docs: v96_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest test/unit_test/headless/test_schema_compat_batch.py → 10 passed.
  • ruff check je_auto_control/ clean; pylint 10.00/10; bandit clean; radon CC clean.
  • Package stays Qt-free.

We could validate against and generate JSON Schemas but couldn't classify
whether a change is backward / forward / full compatible. Add diff_schemas
and check_compatibility over the object subset (properties / required /
type / enum): added-required field and narrowed type / removed enum value
break backward; removed-required field and widened type / added enum value
break forward. Wired through facade, executor (AC_check_compatibility),
MCP, and the Script Builder with a headless test batch and EN/Zh docs.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 66 complexity · 0 duplication

Metric Results
Complexity 66
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 426d1cb into dev Jun 21, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/schema-compat-batch branch June 21, 2026 20:18
@sonarqubecloud

Copy link
Copy Markdown

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