Skip to content

fix(lab-ops-hub): align crawl validators on IPv4 ranges (#476) - #477

Merged
dezren39 merged 1 commit into
mainfrom
creator/476-ipv4-ranges
Oct 21, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator/476-ipv4-ranges

Conversation

@dezren39

@dezren39 dezren39 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Fixes #476

  • Python container validator: refuse IPv4 multicast (224.0.0.0/4) and 192.88.99.0/24 on both the plain and embedded-IPv4 paths — ipaddress.is_global passes both.
  • TS Worker validator: narrow ipv4IsGlobal's /24 checks to the third octet (192.0.0.0/24 with the .9/.10 global exceptions, 192.0.2.0/24, 192.88.99.0/24, 198.51.100.0/24, 203.0.113.0/24) instead of widening them to /16s on the second octet.
  • Shared test vectors in both suites (test/lib.test.ts, test/test_container_validate.py).

Verification: npm test in pkgs/lab-ops-hub — TS 14/14, Python 7/7. A 2,542-URL divergence scan calling both validators went from 169 divergent verdicts pre-fix to 0 post-fix.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Improved crawl URL validation for IPv4 targets.
    • Blocks multicast, reserved, documentation, special-purpose, and 6to4 relay addresses, including IPv4-mapped variants.
    • Correctly handles exact special-use ranges while preserving explicitly permitted exceptions.
    • Continues to allow ordinary public IPv4 addresses and valid neighboring ranges.
  • Tests
    • Added coverage to verify consistent validation results across supported IPv4 range types.

- Python: refuse IPv4 multicast (224.0.0.0/4) and 192.88.99.0/24 on plain and embedded paths — ipaddress is_global passes both

- TS: narrow ipv4IsGlobal /24 checks to the third octet (192.0.0.0/24 with .9/.10 exceptions, 192.0.2.0/24, 192.88.99.0/24, 198.51.100.0/24, 203.0.113.0/24) instead of widening them to /16s

- Shared test vectors in both suites; 2,542-URL divergence scan 169 -> 0
@dezren39
dezren39 requested a review from a team as a code owner October 21, 2026 12:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T12:19:59.256552Z c9db2d4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af7f03a1-e654-4082-b9fd-0f0f9a900a56
📥 Commits

Reviewing files that changed from the base of the PR and between 668dd32 and c9db2d4.

📒 Files selected for processing: 4
  • pkgs/lab-ops-hub/container/app.py
  • pkgs/lab-ops-hub/src/lib.ts
  • pkgs/lab-ops-hub/test/lib.test.ts
  • pkgs/lab-ops-hub/test/test_container_validate.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The Python and TypeScript crawl validators now reject matching IPv4 multicast and special-use ranges. Both test suites cover these ranges, documented exceptions, and public neighboring addresses.

Changes: IPv4 Validator Alignment

Layer / File(s) Summary
IPv4 range validation
pkgs/lab-ops-hub/src/lib.ts, pkgs/lab-ops-hub/container/app.py
The validators reject multicast and specified special-use IPv4 ranges. The TypeScript checks use exact /24 ranges and allow 192.0.0.9 and 192.0.0.10. The Python validator also checks embedded IPv4 targets and the 6to4 relay anycast range.
Cross-validator regression coverage
pkgs/lab-ops-hub/test/lib.test.ts, pkgs/lab-ops-hub/test/test_container_validate.py
Both suites test rejected ranges, accepted exceptions, and public neighboring addresses.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • #472: The Python validator adds multicast and 6to4 relay anycast checks for embedded IPv4 targets.
  • #470: Both validator test suites gain regression vectors, but this change does not add CI wiring to run them together.
Merge Risk: ⚪ Minimal · up to c9db2

The reported validator alignment has no identified merge-blocking issue; proceed with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: aligning the Python and TypeScript crawl validators on IPv4 range handling.
Linked Issues check Passed The changes satisfy active issue #476. Python rejects IPv4 multicast and 192.88.99.0/24 on plain and embedded-IPv4 paths. TypeScript checks the third octet and preserves the 192.0.0.9 and .10 exceptio…
Out of Scope Changes check Passed The changes stay within issue #476. They modify the two crawl validators and add focused tests for the required IPv4 ranges and embedded paths. No unrelated behavior or files are identified in the sup…
Full details: Linked Issues check

Explanation

The changes satisfy active issue #476. Python rejects IPv4 multicast and 192.88.99.0/24 on plain and embedded-IPv4 paths. TypeScript checks the third octet and preserves the 192.0.0.9 and .10 exceptions. The shared test vectors cover blocked ranges, embedded multicast, exceptions, neighboring public addresses, and 8.8.8.8 in both test suites. The supplied verification reports all listed tests passed and zero validator divergences.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #476. They modify the two crawl validators and add focused tests for the required IPv4 ranges and embedded paths. No unrelated behavior or files are identified in the supplied change summary.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dezren39
dezren39 merged commit 9218147 into main Oct 21, 2026
5 checks passed
@dezren39
dezren39 deleted the creator/476-ipv4-ranges branch October 21, 2026 12:23
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.

lab-ops-hub crawl validators disagree on IPv4 ranges — Python allows multicast, TS over-blocks public /24 neighbours as /16s

1 participant