Skip to content

AR-20261104-1: one URL per docs page (trailing slash) + slash-agnostic legacy redirects - #990

Open
warp-agent-staging[bot] wants to merge 8 commits into
mainfrom
factory/ar-20261104-1-docs-trailing-slash
Open

warp-agent-staging[bot] wants to merge 8 commits into
mainfrom
factory/ar-20261104-1-docs-trailing-slash

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

AR-20261104-1 normalizes slash/no-slash HTML page addresses to the slash form and makes legacy redirects work for HTML and Markdown requests. Direct .md representations and index.html aliases remain available.

Premise reconfirmed 2026-11-18 on production with curl, following redirects separately: /factories and /factories/ both return 200, while /agent-platform returns 404. /agent-platform/ redirects to /agents/. The duplicate-URL and legacy-source premises still hold.

Change

  • Set vercel.json trailingSlash: true: extensionless pages redirect with 308; files and /.well-known/* remain unredirected.
  • Normalize legacy redirect rules to handle both slash forms, collapse chains, and remove duplicate/self-redirect rules that would loop or shadow live pages (including /platform and /agents). Headers and rewrites remain unchanged from main.
  • Use slash-form internal links in content and the API sidebar link. Content changes relative to main are URL-only, not copy changes.
  • Extend redirect tests to 11 cases, including concrete wildcard migrations and all 17 known underscore error aliases. Add direct error mappings before wildcard fallback.
  • Restrict production Markdown negotiation to canonical paths with built HTML and Markdown twins. Legacy aliases reach redirects first; HTML-only pages fall through to HTML.
  • Add 32 modeled HTML/Markdown journeys and a repeatable live verifier with optional sitemap coverage.
  • Merged main on 2026-11-18 at head 7230cace5d1c383b3c5e25ca79226851d911b8e7; retain main's content and retired-page deletion. Astro's trailingSlash remains unset: Vercel owns this redirect behavior.

Hypothesis

Consolidating duplicate URLs makes crawlers and answer engines retrieve and cite one URL per page. Google treats redirects as the strongest canonicalization signal (Consolidate duplicate URLs). Bing's webmaster guidelines name trailing-slash duplicates as reducing confidence for grounding and citations (Bing Webmaster Guidelines).

Metric and prediction:

  • The share of docs.warp.dev retrievals on no-slash variants (Peec, ChatGPT and Perplexity) falls to ≤2% within 21 days of deploy.
  • The docs citation rate stays flat or rises by up to 10% relative.
  • Falsified if the docs citation rate falls by ≥5% relative over 21 days.

Verification — refreshed 2026-11-27

Commit: 8b74cc463953fbeddcda379b281b9a7f47f1630d. Exact-head Vercel preview, deployment 8118993755, succeeded on 2026-11-27. This section supersedes the older-head checks and preview previously recorded here.

Live HTTP verification

Reproduce under Node 22: node scripts/verify-live-routing.mjs https://docs-9ubw3l01n-warpdotdev.vercel.app --sitemap. The verifier uses sequential GET requests with a 150 ms pause, records redirect statuses, destinations, and final content types, and stops as incomplete on HTTP 429.
Run from 20:45:43Z to 20:54:52Z on 2026-11-27: 890 checks passed, 0 failures, no rate limiting.

  • All 429 sitemap URLs returned HTML 200 directly. All 428 non-root slashless counterparts returned one 308 to the exact slash URL, then HTML 200.
  • All 32 representative HTML/Markdown checks passed: normal and legacy URLs, query preservation, tracking cleanup, underscore errors, CLI wildcard migration, API-reference HTML fallback, direct Markdown, text/discovery files, an index.html alias, and a genuine 404.
  • /errors/authentication_required now takes two 308s to the final hyphenated error page for HTML and Markdown. The slash form takes one. The old preview took three hops for HTML and returned a Markdown-request 404.
  • /agent-platform now takes two 308s to /agents/ for HTML and Markdown. The slash form takes one. The old preview returned 404 for Markdown.
  • /api/ returns HTML 200 for both Accept headers instead of rewriting Markdown requests to nonexistent /api.md.
  • /factories.md, /llms.txt, and /.well-known/ard.json retain their content types without redirects. utm_source is preserved; trk cleanup remains a 301.
  • /retrieve takes one 308 to /retrieve/, then returns JSON 400 when the required q parameter is intentionally omitted. This verifies routing and deterministic input validation without querying the retrieval backend.
    The same representative verifier recorded 21 passes and 12 failures on the previous preview, versus 33 passes after the fix. Local JSONL logs are /tmp/pr990-routing-before.jsonl, /tmp/pr990-routing-after.jsonl, and /tmp/pr990-routing-sitemap.jsonl; these local files are not shared artifacts. The checked-in verifier makes the checks reproducible.

Repository checks and CI

Local Node 22.23.5 checks passed: typecheck (0 errors), heading-vars (5/5), build (430 HTML files, 428 Markdown twins), heading TOCs (3,736 entries), homepage JSON-LD, redirect-slashes (11/11), Markdown negotiation (8/8), generated routing (32 modeled journeys), tracking middleware (6/6), tracking routes, retrieval proxy (11/11), Markdown serialization (12/12), redirect-checker unit tests (7/7), platform migration, and article-retirement validators. Internal links: 5,313 checked, 0 broken. git diff --check passed.
Trunk is not installed locally; no Trunk pass is claimed. Existing build warnings about chunk size, i18n, the 404 route, and Fontconfig did not fail the build.
Exact-head CI passed: build/link/audit, editorial quality, and technical references. CodeQL analyses, Vercel, and CLA passed. Engineering-review automation was skipped. Existing reviewers were not changed.

Scope and remaining limits

  • The two-hop guarantee covers literal page redirects, all 17 known underscore error aliases, and the concrete wildcard examples tested. Arbitrary wildcard values can still resolve to missing pages. No exhaustive live legacy sweep is claimed.
  • Direct .md representations and index.html aliases remain available. /retrieve retains the extra 308 from the global slash setting.
  • The generated-middleware validator models the relevant stages, not the full Vercel CDN. The HTTP checks provide deployment evidence for selected journeys.
  • No AI-citation improvement has been measured. The prediction remains an experiment. Preview-versus-production aggregate audit scores are not equivalent-host comparisons and are not routing evidence.
  • Page wording is unchanged apart from the original URL-only link edits. Unrelated failures and page-retirement decisions are outside this change.

Unverified claims

These VERIFY markers already exist in pages whose links this PR changes. This routing work does not verify their product claims or change their prose:

  • Extra-directory parsing and harness publication are verified against public source, but stable-release coverage has not been confirmed.
  • Complete the production factory artifact-entry procedure and observe work-item aggregation, plan or media opening, and file retrieval with a non-sensitive fixture; authenticated navigation is not available in this environment.
  • Confirm plan-link ACLs and their relationship to artifact API access using an authorized viewer, a signed-out viewer, and a signed-in viewer without fixture access before publishing plan-sharing instructions.
  • Use a controlled plan edit to confirm current-content retrieval before documenting whether the API result reflects later notebook changes or a snapshot.

Documentation risk

Risk: engineering-review-required
Rationale: Changes site-wide redirects and production Markdown middleware. Existing product VERIFY markers are preserved and disclosed above.
Source files consulted: vercel.json, scripts/build-tracking-middleware.mjs, src/lib/markdown-negotiation.js, src/lib/docs-markdown.js, scripts/redirect-slashes.test.mjs at 8b74cc4
Requested engineering reviewers: unchanged; no additional request made
Engineering review status: pending
Docs override: none

Conversation · Implementation plan

Co-Authored-By: Warp agent@warp.dev

…c legacy redirects

- vercel.json: trailingSlash: true so /page 308s to /page/ (files and
  /.well-known are untouched by Vercel's rule).
- Legacy literal redirect sources now match both slash forms ('(/?)');
  :param* sources get '/' twins. Removes 22 duplicates and 3 no-slash
  sources that would shadow live pages, resolves the building-a-slackbot
  conflict, collapses 2 chains, adds fragment-free twins for 2
  fragment-only sources, and canonicalizes /api destinations to /api/.
- scripts/redirect-slashes.test.mjs replays vercel.json through
  @vercel/routing-utils (npm run test:redirect-slashes, wired into CI).
@cla-bot cla-bot Bot added the cla-signed label Nov 4, 2026
@vercel

vercel Bot commented Nov 4, 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 Nov 27, 2026 8:43pm UTC

Request Review

@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.

@warp-agent-staging warp-agent-staging Bot added the factory:aeo-factory Label associated to the "aeo-factory" factory label Nov 4, 2026
- 59 internal links in 13 MDX pages (incl. 12 to /api) now use the slash
  form, so in-site navigation never costs a 308. Anchors kept; code
  blocks and external links untouched.
- New test: internal links in docs content use the canonical slash URL.
- Replace the Accept: text/markdown test, which asserted nothing when the
  rewrite never matched, with the property this PR guarantees: no redirect
  or rewrite turns a page URL (slash or no-slash) into a /.md path.
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

Autoresearch gates: all passed (AR-20261104-1).

  • Metric (G1): Peec ChatGPT+Perplexity share of docs.warp.dev retrievals landing on no-slash URL variants should fall to ≤2% within 21 days of deploy. Docs citation rate should be flat to +10% relative. The experiment is falsified if the docs citation rate falls ≥5% relative. The baseline is read retroactively from the 14 days before merge, because Peec isn't connected to the factory right now.
  • Fast verifier (G2) on the preview at head 8dcc5f6:
    • 409/409 sitemap URLs without the slash: exactly one 308, then 200.
    • All 1,354 redirect sources in both slash forms (2,701 requests): 0 404s, ≤2 hops.
    • .md, .txt, .json, .xml and /.well-known paths are not redirected.
    • verify_site --compare against a main-based control preview: 0 regressions.
    • ora agent-experience score on the preview vs the control preview: 59 → 59, required-tier unchanged.
  • CI and review (G3): CI green. The adversarial review accepted with no blocking findings: every old redirect source keeps its final destination except the intended fixes. Both non-blocking items are done (honest Markdown test; 59 internal no-slash links → slash form).
  • Second confirmation (G4): checked on production with an OAI-SearchBot UA. /factories and /factories/ both return 200. /agent-platform returns 404 while /agent-platform/ returns 308. /platform returns 308 to /agents/ although /platform/ is a live page; this PR fixes that.
  • Merges cleanly together with docs#989; tested with a local merge of both onto main.

Preview links: /agent-platform (lands on /agents/) · /factories (308 → /factories/) · /platform (now /platform/, was /agents/)

Posted by a Warp agent

@warp-agent-staging
warp-agent-staging Bot marked this pull request as ready for review November 4, 2026 16:57
… re-apply one-URL-per-page redirects and slash links)

Co-Authored-By: Warp <agent@warp.dev>
With "trailingSlash": true in vercel.json, Vercel answers /platform with a 308 to
/platform/ itself, so the explicit rule this check expected is redundant (and a
self-redirect would loop). The check still rejects any /platform rule that points
elsewhere, a redirect chain at /platform/, and a missing /platform/ page.

Co-Authored-By: Warp <agent@warp.dev>
@warp-agent-staging

warp-agent-staging Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

2026-11-18 / 975839d: CI green (10 pass, 2 skipped). Final preview: all 421 sitemap no-slash URLs take one redirect to slash + 200; required probes pass. /platform validator mismatch fixed. Bulk legacy HTTP sweep remains inconclusive (429). Evidence and unchanged 21-day metric in body.

View in factory

Posted by a Warp agent

warp-agent-staging Bot added a commit that referenced this pull request Nov 18, 2026
…oken

Matches the bearerAuth scheme in developers/agent-api-openapi.yaml. The test now
also accepts the slash-agnostic /developers/cli(/?) source that #990 introduces.

Co-Authored-By: Warp <agent@warp.dev>
Resolution: take main's vercel.json routing (markdown negotiation moved to
routing middleware in #1053) and keep trailingSlash: true; take main's
link-list copy and re-apply canonical slash URLs; normalise three new
/api links added on main. scripts/redirect-slashes.test.mjs: 9/9 pass.
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

Merged current main (5e6063b). vercel.json now drops this branch's old rewrites, since main negotiates Markdown in routing middleware (#1053), and keeps trailingSlash: true. redirect-slashes.test passes 9/9 after three new /api links were normalised.

Preview check: /retrieve?q=… now takes one 308 to /retrieve/?q=… and then returns 200 JSON. Owner call: keep the extra hop, or point the advertised URL in llms.txt at /retrieve/?

View in factory

@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

Status 2026-11-25: up to date with main (d3768f8). The merge keeps main's 6 new redirect sources and its content edits, and the only dropped entries are /agents and /platform, which trailingSlash covers. Build, link-check, editorial and Vercel checks pass. CodeQL failed only at its results upload with a GitHub Server Error, so an empty commit re-runs it.

Premise on production today, from slash_check.py with main's vercel.json:

  • 426/428 sitemap URLs answer 200 at both slash forms.
  • 443 of 1,426 redirect sources resolve in only one slash form, and 1 source 404s in both forms.
  • /platform is already fixed on main.

Preview (slash_check.py, exit 0):

  • 428/428 sitemap URLs return one 308 to the slash form, then 200.
  • 1,412 redirect sources (2,788 requests) give 0 failures in ≤2 hops.
  • .md twins, llms files and /.well-known return 200 with no redirect.

Posted by a Warp agent

Scope negotiation to built canonical pages, flatten known error aliases, and verify middleware/redirect journeys with repeatable live checks.

Co-Authored-By: Warp <agent@warp.dev>

This branch was successfully deployed

1 active deployment
Preview — 8b74cc46 Deployed Nov 27, 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 warpy-factory Opened by the Warp factory agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant