Skip to content

refactor(utils): move CID validation into agirails.utils.cid - #12

Merged
DamirAGI merged 2 commits into
mainfrom
fix/code-check-cid-validation
Nov 30, 2026
Merged

DamirAGI merged 2 commits into
mainfrom
fix/code-check-cid-validation

Conversation

@DamirAGI

Copy link
Copy Markdown
Contributor

Follow-up to #9. It brings the CID validation change in line with the repository's code checks and does not change behaviour.

  • validation.py had grown to 814 lines, over the 800-line limit. The CID patterns, MAX_CID_LENGTH, validate_cid and ensure_valid_cid move to a new module, agirails/utils/cid.py, and the dispute clients import from there.
  • validation.py re-exports validate_cid and both CID patterns, the names that were public in 4.8.0, so existing imports keep working. A test checks the re-export.
  • The CID validation test loses its explanatory comments and section banners, and __await__ gets a return type instead of type: ignore.

Checks:

🤖 Generated with Claude Code

agirails-factory Bot and others added 2 commits November 30, 2026 12:43
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>
@DamirAGI
DamirAGI merged commit eabc845 into main Nov 30, 2026
18 checks passed
@DamirAGI
DamirAGI deleted the fix/code-check-cid-validation branch November 30, 2026 14:32
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