Skip to content

[AR-20261021-1] Redirect ?fallback and ?slug copies to the clean docs URL - #942

Merged
vikvang merged 2 commits into
mainfrom
factory/ar-20261021-1-param-redirects
Oct 22, 2026
Merged

vikvang merged 2 commits into
mainfrom
factory/ar-20261021-1-param-redirects

Conversation

@warp-agent-staging

Copy link
Copy Markdown
Contributor

Summary

Experiment: AR-20261021-1

Extends the existing ?trk= redirect middleware (AR-20261009-7, #885) to two more parameters, fallback and slug. Any docs URL carrying one of them now gets a 301 to the same path without it. Every other query parameter, including utm_*, is kept. Nothing in the repo reads either parameter.

Why: ChatGPT has moved almost all of its docs homepage retrievals onto two parameter copies, which return 200 with only a canonical tag pointing at /. In Peec, Oct 14–20:

  • https://docs.warp.dev?fallback=true: 36 retrievals, 0.28 citations per retrieval
  • https://docs.warp.dev?slug=university: 31 retrievals, 0.29
  • https://docs.warp.dev/ (clean): 1 retrieval

From Sep 30 to Oct 13 the clean URL had 116 retrievals at 0.75. The same fix for ?trk= moved ChatGPT's share of clean retrievals on the Factories docs from 2% to 96% and raised their citation rate from 0.48 to 0.63 within 11 days.

Metric and prediction: Peec ChatGPT clean share of docs homepage retrievals goes from 1.5% (1/68, Oct 14–20) to at least 70% within 14 days of deploy. Falsified below 30%. Secondary: docs homepage ChatGPT citation rate from 0.28 to at least 0.5.

Implementation: STRIPPED_PARAMS in src/lib/tracking-redirect.js is the single list. The postbuild script emits one Vercel routing entry per key, because entries inside one has array are AND-ed. Requests without any listed parameter never invoke the middleware.

Related issues

Follows #885 (AR-20261009-7). No issue.

Validation

  • node --test scripts/tracking-redirect.test.mjs: 6 tests pass. New cases cover each parameter alone, both together, all three plus utm_source in one hop, a non-homepage path, and no redirect when only utm_* is present.
  • Ran scripts/build-tracking-middleware.mjs against a stub .vercel/output/config.json: it emits three routes (trk, fallback, slug) ahead of the filesystem handler and copies the function.
  • Preview curl checks and an ora comparison against production follow in a comment once the Vercel preview is up.

Screenshots

None (no visual change).

Follow-ups

None.

@warp-agent-staging warp-agent-staging Bot added the factory:aeo-factory Label associated to the "aeo-factory" factory label Oct 21, 2026
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-staging-factory on this PR to send it follow-up work.

@cla-bot cla-bot Bot added the cla-signed label Oct 21, 2026
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 21, 2026 4:45pm UTC

Request Review

@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

Verification on the preview (docs-git-factory-ar-20261021-1-param-redirects-warpdotdev.vercel.app):

  • /?fallback=true, /?slug=university, /?fallback=true&slug=university&utm_source=x, /?trk=x&utm_medium=social and /agents?slug=x all return 301 to the clean URL, with utm_* kept. /, /?utm_source=x and /factories return 200 with no redirect.
  • ora (contract 1.35): compared against a control preview built from main (docs: clarify the Factories overview definition #884's branch), not production, because any preview hostname loses about 11 points on hostname-only checks (noindex on previews, brand and skills searches). Canonical 56 → 56 and required-tier subscore 53.9% → 53.9%. The only moved check is a name search for the preview hostname.
  • Crawler-eye comparison (verify_site.py --compare, control vs candidate): 0 regressions.

Review follow-up (latest commit):

  • The middleware tests now run in CI. npm run test:tracking-redirect runs in the build job, and a new npm run test:tracking-routes runs after npm run build and fails if any stripped parameter lacks its own routing entry ahead of the filesystem handler.
  • Not changed: emitting a trailing-slash canonical from the middleware. Slash handling on docs is per path (/agents 308s to /agents/, /factories/ 308s to /factories, /factories/how-factories-work serves both), so the middleware would have to duplicate that routing to choose correctly. The extra hop only happens when the incoming URL already has the wrong slash form, which is the existing ?trk behavior too, and the homepage this experiment targets is a single hop.

Posted by a Warp agent

@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review October 21, 2026 16:37
@warp-agent-staging
warp-agent-staging Bot requested a review from vikvang October 21, 2026 16:37
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

Ready for review. All gates pass: CI is green, including the two new tracking steps; the preview redirects as intended; ora shows no change against a control preview; the crawler-eye comparison shows 0 regressions; and the independent review found nothing blocking (its one fix is in).

What this should move: ChatGPT's share of clean retrievals for the docs homepage, from 1.5% (1 of 68, Oct 14–20) to at least 70% within 14 days of deploy, read in Peec. Below 30% counts as no effect. It's the same mechanism as #885, which took the Factories docs pages from 2% to 96% clean in 11 days.

Posted by a Warp agent

@warp-for-oss

warp-for-oss Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@warp-agent-staging[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss warp-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR extends the existing tracking-redirect middleware from trk to a shared stripped-parameter list covering trk, fallback, and slug, updates the Vercel route generation to emit one query route per stripped key, and adds CI coverage for both middleware behavior and generated route placement.

Concerns

  • No blocking correctness, security, comment-quality, test-quality, or spec-alignment concerns found in the annotated diff.
  • spec_context.md reports that no approved or repository spec context was found for this PR.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@vikvang
vikvang merged commit 9fc9306 into main Oct 22, 2026
17 checks passed
@vikvang
vikvang deleted the factory/ar-20261021-1-param-redirects branch October 22, 2026 22:58
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

@vikvang, automation “Auto-fix flaky tests” in factory “concierge-factory” couldn’t start a run. The Warp account linked to your GitHub account isn’t on team “Growth”.

  • Wrong Warp account? Sign in to the intended account and Connect/Reconnect GitHub. Then mention the bot again.
  • Right Warp account? Ask an admin of team “Growth” to add you.

This branch was successfully deployed

1 active deployment
Preview — 11c4a7e2 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed factory:aeo-factory Label associated to the "aeo-factory" factory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant