Repository navigation
refactor(utils): move CID validation into agirails.utils.cid - #12
Merged
Merged
Conversation
validation.py had grown past 800 lines. The CID patterns, MAX_CID_LENGTH, validate_cid and ensure_valid_cid now live in agirails.utils.cid; the dispute clients import from there. validation.py re-exports validate_cid and both CID patterns, so existing imports keep working. The CID validation test drops its explanatory comments and section banners, types __await__ instead of ignoring it, and checks that the validation module still exports validate_cid. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…validation Both names were public in agirails.utils.validation on main and in 4.10.0b0. Re-export them from agirails.utils.cid and cover all five CID names in the compatibility test. 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.
Follow-up to #9. It brings the CID validation change in line with the repository's code checks and does not change behaviour.
validation.pyhad grown to 814 lines, over the 800-line limit. The CID patterns,MAX_CID_LENGTH,validate_cidandensure_valid_cidmove to a new module,agirails/utils/cid.py, and the dispute clients import from there.validation.pyre-exportsvalidate_cidand both CID patterns, the names that were public in 4.8.0, so existing imports keep working. A test checks the re-export.__await__gets a return type instead oftype: ignore.Checks:
code-check difffrom the base of fix(dispute): validate evidence and reasoning CIDs before sending #9: 11 violations before (K13 ×1, K2 ×9, K5 ×1), 0 after.pytest: 4275 passed, 46 skipped.ruff check src/agirailsandruff format --check src/agirailsare clean, andmypyon the two utils modules is clean.🤖 Generated with Claude Code