Skip to content

fix(utils): parse robots groups per RFC 9309 - #1079

Merged
nc9 merged 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/robots-txt-parser-1078
Oct 24, 2026
Merged

nc9 merged 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/robots-txt-parser-1078

Conversation

@WilliamK112

@WilliamK112 WilliamK112 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • parse consecutive User-agent records as one group and copy the following rules to every named agent
  • preserve explicit groups whose only rule is an empty Disallow:, while stripping inline comments before parsing
  • add parser, matcher, and AI-crawler integration regressions, plus an Unreleased changelog entry

Closes #1078

Verification

  • bun test packages/utils/tests/robots-txt-756.test.ts packages/utils/tests/robots-match-556.test.ts packages/rules/tests/ai-crawlers.test.ts (34 pass)
  • bun test packages/utils/tests (484 pass)
  • bun run typecheck
  • bun run lint
  • bun run format:check
  • git diff --check

Checklist

  • The change is scoped to the linked issue
  • Tests cover all three reported robots.txt shapes and the AI-crawler outcome
  • Commit includes a DCO sign-off

@WilliamK112
WilliamK112 force-pushed the codex/robots-txt-parser-1078 branch 3 times, most recently from 1858ae5 to 6f45852 Compare October 24, 2026 01:42
@nc9
nc9 force-pushed the codex/robots-txt-parser-1078 branch from 6f45852 to 193e969 Compare October 24, 2026 03:47
@nc9
nc9 merged commit 9b30d8e into squirrelscan:main Oct 24, 2026
15 checks passed
@nc9

nc9 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Merged. Thank you @WilliamK112, clean fix and good tests. (Nik)

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.

utils/robots-txt: stacked user-agent lines, empty Disallow groups and inline comments are misparsed

2 participants