Skip to content

0.1.1: Restrict Crawl Scope and Filter Locale Query Variants - #6

Merged
laiso merged 6 commits into
mainfrom
copilot/restrict-crawl-boundary
Mar 7, 2026
Merged

0.1.1: Restrict Crawl Scope and Filter Locale Query Variants#6
laiso merged 6 commits into
mainfrom
copilot/restrict-crawl-boundary

Conversation

Copilot AI commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Summary

To prevent excessive crawling by site2skill, the crawl scope during fetching has been linked to the starting URL. This ensures that only the starting URL and its sub-paths are targeted, rather than the entire domain, while excluding localization-specific queries such as hl, lang, and locale.

In conjunction with this, the version has been updated to 0.1.1 and a changelog has been added.

Changes

  • Added crawl constraint construction to fetch_site()
  • Applied --include-directories, --accept-regex, and --reject-regex to wget
  • If the starting URL is a page URL, only that URL itself and its sub-paths are allowed.
  • If the starting URL is a directory URL, only its sub-paths are allowed.
  • Localization URLs containing hl, lang, or locale are excluded by default.
  • Added tests to verify the command generation of fetch_site.
  • Updated version to 0.1.1.
  • Added CHANGELOG.md.

Why

The previous implementation was only restricted by --domains=<host>, which made it easy for large documentation sites like developer.android.com to spread from the starting page to related pages on the same host or to localized URLs.

With this change, the crawling boundary logic has been connected to the execution path of fetch_site(), ensuring that only the intended scope is retrieved.

Example

Starting URL:

site2skill https://developer.android.com/training/data-storage/room android-room

Expected behavior:

  • .../training/data-storage/room
  • .../training/data-storage/room/...

are included.

  • Sibling pages under .../training/data-storage/
  • ...?hl=en
  • ...?lang=ja
  • ...?locale=...

are excluded.

On the other hand, general queries that may switch content are not completely rejected.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits March 7, 2026 02:52
Add site2skill/url_filter.py with is_url_allowed() function that:
- Restricts crawl scope to descendants of the starting URL
- Rejects URLs with only localization query params (hl, lang, locale)
- Allows URLs with content-switching query params (version, tab, etc.)
- Supports custom excluded query key sets for future configurability

Add test_url_filter.py with 22 tests covering all specified scenarios.

Co-authored-by: laiso <39830+laiso@users.noreply.github.com>
Co-authored-by: laiso <39830+laiso@users.noreply.github.com>
Copilot AI changed the title [WIP] Update over-crawl prevention plan for document URLs Add URL filter for crawl scope restriction and localization query exclusion Mar 7, 2026
Copilot finished work on behalf of laiso March 7, 2026 02:54
Created demo.md using showboat with executable code blocks demonstrating:
- CLI help output
- Full example converting HTML to a skill with --skip-fetch
- Output skill structure (SKILL.md, references/, scripts/)
- Converted markdown with YAML frontmatter
- URL filter module (localization query rejection, path scoping)
- Test suite execution (26 tests passing)

Co-authored-by: laiso <39830+laiso@users.noreply.github.com>
Copilot AI changed the title Add URL filter for crawl scope restriction and localization query exclusion Add URL crawl-scope filter and showboat demo document Mar 7, 2026
Copilot finished work on behalf of laiso March 7, 2026 03:09
@laiso laiso changed the title Add URL crawl-scope filter and showboat demo document 0.1.1: Add URL crawl-scope filter Mar 7, 2026
@laiso
laiso marked this pull request as ready for review March 7, 2026 03:20
@laiso
laiso merged commit a2a0003 into main Mar 7, 2026
1 check passed
@laiso
laiso deleted the copilot/restrict-crawl-boundary branch March 7, 2026 03:22
@laiso laiso changed the title 0.1.1: Add URL crawl-scope filter 0.1.1: Restrict Crawl Scope and Filter Locale Query Variants Mar 7, 2026
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.

2 participants