Skip to content

test: delimit governance dry-run for issue #21#1

Closed
infracore wants to merge 2 commits intomainfrom
delimit-governance-test
Closed

test: delimit governance dry-run for issue #21#1
infracore wants to merge 2 commits intomainfrom
delimit-governance-test

Conversation

@infracore
Copy link
Copy Markdown
Owner

Internal test fork — verifying delimit-action against agentspec schemas before opening upstream PR.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Delimit governance — JSON Schema

Generator drift: 2 change(s), 1 breaking

Generator drift

Artifact schemas/v1/agent.schema.json is stale vs pnpm run schema:export output (2 drift change(s), 0.728s to regen).

Re-run the generator and commit the result, or revert the source change.

  • 🔴 const_changed at /properties/apiVersion — const value changed at /properties/apiVersion: 'agentspec.io/v1' → 'agentspec.io/v1alpha1'
  • 🟢 enum_value_added at /properties/spec/properties/compliance/properties/packs/items — enum value added at /properties/spec/properties/compliance/properties/packs/items: 'metadata-quality'

Advisory mode — CI will not fail. Set fail_on_breaking: true or mode: enforce to block on breaking changes.


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>
@infracore
Copy link
Copy Markdown
Owner Author

Internal test fork — replaced by agents-oss#39

@infracore infracore closed this Apr 7, 2026
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>
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