Repository navigation
chore: Require ClientX 0.7.0 - #51
Merged
Merged
Conversation
- Raise the ClientX floor to `clientx>=0.7.0` in the dependencies, the `mcp` extra and the dev group, and lock 0.7.0. - ClientX 0.7.0 checks every call's arguments against their types before sending, so gravitywell's own constraints, such as `timer`'s `Json(gt=0)` and the rule types' `Literal`, hold for Python callers too: an argument that doesn't fit raises `ArgumentError`, and nothing reaches the Pi-hole. With 0.6, such a call went to the Pi-hole. - Test that such an argument is refused before sending: a bound, a `Literal` and a type. The test fails on ClientX 0.6.0. - Say so in `docs/errors.md`, `llms.txt` and the changelog, as a breaking change. - No changes to `src/`: gravitywell already runs on 0.7.0 as it is. Co-Authored-By: Claude Opus 5.5 <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.
Raises gravitywell's ClientX floor from 0.6.0 to 0.7.0, released yesterday with slatecipher/ClientX#196.
What changed and why
ClientX 0.7.0 checks every call's arguments against their types, in pydantic's lax mode, before it sends a request. gravitywell never set
validate_arguments=True, so on ClientX 0.6 its Python calls weren't checked at all. gravitywell's own constraints, such astimer'sJson(gt=0), the rule types'Literaland the counts' types, held only for AI tools. A bad argument went to the Pi-hole:dns.set_blocking(blocking=False, timer=-5){"timer":-5}ArgumentError(timer), nothing sentdomains.get("blok", "exact", ...)GET /api/domains/blok/...ArgumentError(rule_type), nothing sentstats.top_domains(count="ten")count=tenArgumentError(count), nothing sentRequiring 0.7.0 gives one behaviour for every install, which
docs/errors.mddescribes:ArgumentErrormeans gravitywell refused a call before sending anything.pyproject.toml:clientx>=0.7.0in the dependencies, themcpextra and the dev group, still with no upper bound.uv.lockmoves to 0.7.0, and only ClientX changes in it.test_pi_hole.py: one test, checking that an argument that doesn't fit is refused before sending, for a bound, aLiteraland a type. It fails on ClientX 0.6.0, so it guards the floor.docs/errors.md,llms.txtandCHANGELOG.mddescribe the new behaviour.src/: gravitywell runs on 0.7.0 as it is. ClientX#196 was adjusted while in review so that gravitywell's Teleporter upload, atuple[str, bytes, str]file, needs noSkipValidation.Breaking change
Code that passed an argument that doesn't fit its type now gets
clientx.ArgumentError, where before it got the Pi-hole'shttpx2.HTTPStatusError, or a request that went through. Projects that also use ClientX 0.6 for clients of their own have to move to 0.7.0. The changelog entry says both.make release-prwill make the next release 0.3.0.Testing
make check: lint, strict pyright and 364 tests, at 100% coverage.make typecheck-testsis clean too.clientx0.7.0 wheel:Tool.call().set_blockingwith a timer passes, and the Pi-hole was left as it was.🤖 Generated with Claude Code