test: delimit governance dry-run for issue #21#1
Closed
Conversation
Delimit governance — JSON SchemaGenerator drift: 2 change(s), 1 breaking Generator driftArtifact Re-run the generator and commit the result, or revert the source change.
Powered by Delimit — API governance for every PR |
infracore
added a commit
to delimit-ai/delimit-action
that referenced
this pull request
Apr 7, 2026
The previous header rendered "0 change(s), 1 breaking" when the committed schema was unchanged but generator drift was detected. Suppress the schema-classification line entirely when the diff is empty, and surface drift as a separate "Generator drift: N change(s), N breaking" line so the two signals never appear comma-joined. Caught by deliberation on the live infracore/agentspec#1 test run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
Internal test fork — replaced by agents-oss#39 |
infracore
added a commit
to delimit-ai/delimit-action
that referenced
this pull request
Apr 7, 2026
* Update README with Think and Build tagline * Sync diff engine - null-safety fix from gateway Guards against None schemas in _compare_schema_deep, found during Directus (34K stars) showcase run. Also adds null guards at top of diff() method. 128 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: JSON Schema diff support + generator drift detection (LED-713) Adds first-class JSON Schema support to delimit-action so it can run governance checks against schema files like agents-oss/agentspec's agent.schema.json (issue #21). Changes: - core/json_schema_diff.py — new sibling module to diff_engine_v2. Handles Draft 4+ single-file schemas with internal $ref resolution to #/definitions. Covers 12 v1 change types: property add/remove, required add/remove, type widen/narrow, enum add/remove, const, additionalProperties, pattern, minLength/maxLength, minimum/maximum, items type. Composition keywords (anyOf/oneOf/ allOf) and external $ref deferred past v1. - core/generator_drift.py — new module that runs a regen command in a sandbox and diffs the regenerated artifact against the committed version. Catches drift between source-of-truth (e.g. Zod) and committed generated artifacts. Restores the workspace cleanly so the working tree is unmodified after the check. - core/spec_detector.py — added detect_spec_type() classifier and get_diff_engine() factory. Routes JSON Schema files to the new engine; OpenAPI files keep the existing path. Back-compat: ambiguous docs default to OpenAPI. - action.yml — three new inputs: - fail_on_breaking (boolean alias for mode=enforce) - generator_command (opt-in drift check) - generator_artifact (paired with generator_command) Plus dispatch logic in the validate step and a new JSON Schema branch in the Comment-on-PR step that renders drift + classification. - tests/test_json_schema_diff.py — 41 unit tests covering every v1 change type, $ref resolution at root and nested paths, dispatcher routing, and the agentspec rename as a real-world fixture. Test results: - 41/41 new JSON Schema tests pass - 47/47 existing OpenAPI diff_engine tests still pass (no regressions) Verified end-to-end against the agents-oss/agentspec checkout with the real pnpm run schema:export generator. All three scenarios (clean main, simulated rename PR, hypothetical version bump) classify correctly with expected output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: changelog for v1.9.0 (JSON Schema + generator drift) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: split JSON Schema header so drift and diff are distinct signals The previous header rendered "0 change(s), 1 breaking" when the committed schema was unchanged but generator drift was detected. Suppress the schema-classification line entirely when the diff is empty, and surface drift as a separate "Generator drift: N change(s), N breaking" line so the two signals never appear comma-joined. Caught by deliberation on the live infracore/agentspec#1 test run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: infracore <infracore@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internal test fork — verifying delimit-action against agentspec schemas before opening upstream PR.