Repository navigation
schema: add diff-impact CLI (Phase 2+3 of schema-diff) - #21
Merged
Merged
Conversation
Cross-references what changed between two schemas against what a
specific config actually uses (hyprvalidate/schema/impact.py), rather
than reporting Hyprland's whole API surface diff - the difference
between a usable feature and noise, given how large that surface is.
New `hyprvalidate diff-impact <config> --from A.json --to B.json`
command, informational by default (exit 0 even when it finds
something) since this reports what changed in the schema, not
confirmed breakage; --fail-on-impact opts a CI job into gating on it.
Verified end-to-end against the real hl.permission{} allow -> mode
regression (Hyprland#14400): a config constructing
hl.permission({ allow = ... }) is flagged with the rename guess and
nothing else; a config that never touches hl.permission at all, diffed
against the exact same two schema versions, reports nothing.
Documented gap, not silently overclaimed: this only sees fields
*written* into a spec-table constructor (hl.monitor({ mode = ... })),
not fields *read* off a runtime object handed to a callback (e.g.
win.class inside an hl.on(...) handler) - which is the actual shape of
the real HL.Window over_fullscreen regression this feature was scoped
around. Tracing that needs real type-flow inference (which event name
a handler is registered for, what payload type that event carries)
this doesn't attempt.
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.
Summary
Builds on #20 (the diff engine + real schema corpus). This adds the layer that makes it a usable feature rather than a library: cross-referencing what changed between two schemas against what a specific config actually uses.
hyprvalidate/schema/impact.py—find_used_symbols()collects config keys, dottedhl.*calls, and spec-table constructor fields a config references;compute_impact()cross-references that against aSchemaDiff.hyprvalidate diff-impact <config> --from A.json --to B.json— new CLI command. Informational by default (exit0even when it finds something, since this reports what changed, not confirmed breakage);--fail-on-impactopts a CI job into gating on it.Verified against the real regression
A config constructing
hl.permission({ allow = "yes", ... }), diffed from v0.55.0's schema to v0.55.1's (the exact version transition whereallowbroke), reports:The same diff run against a config that never touches
hl.permissionreports nothing — same two schema versions, different result, because the cross-reference is doing its job.Documented gap, not silently overclaimed
This only sees fields written into a spec-table constructor (
hl.monitor({ mode = ... })) — not fields read off a runtime object handed to a callback (e.g.win.classinside anhl.on(...)handler), which is the actual shape of the realHL.Windowover_fullscreenregression this whole feature was scoped around (see #20's description). Tracing that needs real type-flow inference — which event name a handler is registered for, what payload type that event carries — that this doesn't attempt. Called out explicitly in the module docstring and CHANGELOG rather than left implicit.Test plan
pytest tests/— 214 passed (3 pre-existing/environmental entry-point failures unrelated, deselected)allow → moderegression, both default (exit 0) and--fail-on-impact(exit 1)