SEO + AEO on AutopilotFrom the team at Stackmatix
The Growth Library

Regression-Test Compiled Robots Rules Against a URL Allowlist

Regression-test a compiled robots policy with12source-scoped verdicts and five negative mutations that detect lost groups or changed matching behavior.

Approve a generated robots policy by running expected verdicts against its exact compiled bytes. Reading a source template is insufficient when the build merges groups, normalizes paths or appends environment rules. The release question is whether the output implements the approved access intentions for the selected crawler and URL set.

This exercise uses a fictional public documentation site and a Google-scoped matching oracle. It is not a new recommendation about which crawler purposes to permit. Make that choice in the crawler policy matrix,then translate the approved choice into testable paths.

The artifact consists of one file, a table of expected verdicts and negative mutations that must fail the regression check. Run it locally against the parser used in your review. A green result for this bounded fixture does not prove every crawler implements identical semantics.

Pin the parser contract and compiled policy

Use the current Google robots specification for Google-specific behavior and RFC 9309 for the protocol baseline. Google selects the most specific applicable user-agent group; repeated groups for that same selected token are combined. Do not merge the wildcard group into a more specific group just to obtain a convenient answer.

For matching paths, Google documents case sensitivity, most-specific matching and the least restrictive rule when equivalent allow and disallow rules tie. Its documented wildcard syntax supports an asterisk and a terminal dollar sign. These expectations belong to the named parser contract, not an undocumented homemade universal parser.

User-agent: *
Disallow: /private/
Disallow: /exports/

User-agent: Googlebot
Disallow: /drafts/
Allow: /drafts/public/
Disallow: /report$
Disallow: /equal
Allow: /equal
Disallow: /guides/%E3%83%84

User-agent: Googlebot
Disallow: /search?

The approved fictional intention is deliberately unusual: generic crawlers avoid private and export paths; the selected Googlebot groups contain their own rules. If the owner intended those generic restrictions to apply to Googlebot too, this file would be a policy-design failure. A parser test must not conceal that distinction.

Use the complete expected-verdict table

Treat the rows below as mandatory assertions for the exact file above. The caller token identifies the matching product; it is not evidence that an observed network request really came from that provider. Keep host and scheme fixed for these path tests.

Product tokenPath and queryExpectedReason
OtherBot/private/aDenyWildcard group prefix
OtherBot/guides/startAllowNo matching restriction
Googlebot/private/aAllowSpecific groups selected;wildcard group not inherited
Googlebot/drafts/aDenySpecific disallow
Googlebot/drafts/public/aAllowLonger allow wins
Googlebot/Drafts/aAllowCase-sensitive path
Googlebot/reportDenyEnd-anchored match
Googlebot/reportingAllowEnd anchor does not match
Googlebot/equalAllowEquivalent allow/disallow tie
Googlebot/search?q=setupDenySecond selected group participates
Googlebot/guides/%E3%83%84DenyEncoded UTF-8 path
Googlebot/guides/startAllowNo matching restriction

There are 12 assertions: two for the generic product and ten for Googlebot. Preserve exact path case and percent-encoded octets in the fixture file. A test harness that lowercases every path has changed the input before evaluating the policy.

Add negative mutations that must be detected

First, remove the second Googlebot group. The search-query assertion must now fail: the compiler has lost a selected-group rule. Second, remove the longer /drafts/public/ allow. The public-draft assertion must fail. Third, change the allow on /equal to /equal/public. The tie assertion must fail because the remaining disallow now governs /equal.

Fourth, remove the dollar sign from /report$. The /reporting assertion must fail because a prefix restriction now catches that longer path. Fifth, force the harness to lowercase paths before evaluation. The /Drafts/a assertion must detect that incorrect transformation. Apply mutations one at a time and restore the approved input between runs.

A harness that reports success for both the approved file and every deliberately broken mutation is not testing the intended contract. Record parser name, version, configuration, compiled-file digest and row-level actual verdicts so another reviewer can reproduce the failure.

Keep encoding and policy changes reviewable

For additional Unicode fixtures, follow the named parser’s documented percent-encoding rules. Google documents matching against percent-encoded forms and canonicalizing raw UTF-8 rule paths into that form. Add a paired raw/encoded test only when your chosen parser supports the same documented behavior;do not silently reinterpret reserved separators as ordinary letters.

Inspect the served file after deployment and compare its digest with the tested output. A successful local compiler test cannot establish that the edge delivered those bytes. The delivery-layer comparison provides that separate observation.

Retain the robots directive matrix for indexing directives. A robots path verdict is a crawl-permission result, not authentication and not proof that an allowed page will be indexed. Keep those acceptance questions separate in the release record.

Compare actual verdicts without rebuilding the parser

Keep the policy evaluator separate from the fixture runner. The runner should load the compiled bytes once, pass each product token and exact URL to the chosen evaluator, and compare its returned verdict with the stored expectation. It should report the row identifier, expected verdict and actual verdict on failure, then exit unsuccessfully if any assertion differs.

Do not implement a few string-prefix checks in the runner and call that a complete robots parser. Group selection, matching normalization and wildcard interpretation belong to the evaluator under test. Record its version and supporting documentation. If it implements only the RFC baseline rather than the selected Google behavior, label that limitation and choose expectations accordingly.

Save baseline and mutation results as separate runs. One failed mutation is useful evidence only if the unmodified baseline passes under the same evaluator and configuration.

Approve the bounded oracle

The acceptance record should include owner-approved intentions, compiled bytes, source-scoped parser contract, all 12 baseline verdicts and the five detected mutations. Any parser discrepancy needs an explanation against the pinned documentation before approval. Do not resolve it by changing expected results merely to match the tool.

When the policy changes, review both new expectations and preserved cases. Adding a specific group can change which existing wildcard rules apply even when their text is untouched. That is exactly the kind of regression a compiled-file oracle should expose.

Release only after the actual output matches the approved decisions and public delivery is verified separately. The result is a repeatable policy test, not a claim that a few green URLs establish universal bot compliance or future search visibility.

Sources

Matt Pru

Co-founder and CEO of Stackmatix. Writing about growth, customer acquisition, and the decisions behind useful marketing. Connect on LinkedIn.

Developed with AI assistance under Matt's editorial direction. Our Editorial Approach