Skip to content

fix(dox): one permanent hop to each page, and search crawlers skip the .md twins and query URLs (DOX-G17, #559) - #587

Merged
craig-o-curtis merged 1 commit into
mainfrom
chore/559-choreseo-fix-gsc-unindexed-pages
Nov 27, 2026
Merged

craig-o-curtis merged 1 commit into
mainfrom
chore/559-choreseo-fix-gsc-unindexed-pages

Conversation

@craig-o-curtis

@craig-o-curtis craig-o-curtis commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #559.

Merge order: northguild/northguild.dev#29 (the robots.txt) is merged and deployed. This PR's deploy smoke checks that live file.

Why

Search Console lists 887 URLs as not indexed. Most are URLs we never want indexed, and Google keeps fetching them while 331 real pages wait in "Discovered – currently not indexed".

What changes

  • One permanent hop to a page. A slashless page URL got a 307 from the assets binding. A 307 is temporary (RFC 9110 §15.4.8), so Google may keep the slashless URL as canonical. The Worker now turns that 307 into a 308 (RFC 9110 §15.4.9). A missing page still gets a direct 404. The old-host 301 now lands on the slash URL in one hop.
  • The workers.dev copy is noindex. gmt-dox.northguild.workers.dev/gmt/* answers X-Robots-Tag: noindex. URL Inspection showed Google treating that host as a duplicate.
  • Links a page renders end in a slash. A new rendered-links gate (tier pr, Chromium) fails a slashless page link that a mount renders at run time. test:dist reads only the built HTML, so it cannot catch those. The slash predicate moves to scripts/lib/page-links.mjs, and test:dist and the gate share it.
  • The robots.txt policy check. scripts/robots-policy.mjs checks the landing robots.txt against a policy table, using robots-parser 3.0.1 (pinned exactly, devDependency). Googlebot and Bingbot skip the .md twins and page URLs with a query. Every other agent still reads them. deploy-smoke checks the live file, and its slash rows expect 308.
  • Runbook. cloudflare-runbook.md §4 has the Search Console steps after deploy, the timeline and the nine pages to inspect again.

No packages/ change, so no changeset.

Validation

  • Unit tests per slice pass: worker, dist-base, page-links, widget-pages, gate registry and robots-policy (8/8).
  • oxfmt --check and oxlint pass on the changed files.
  • checkRobots on the live https://northguild.dev/robots.txt after northguild.dev#29 deployed: 0 failures.
  • Still running: the local full gates, astro check, pnpm run validate and the live rendered-links run against a built site, plus this PR's CI. A closing commit follows that sets the tracker to Done and removes the story's spec folder.

…e `.md` twins and query URLs (DOX-G17, #559)

- The Worker turns the assets binding's trailing-slash 307 into a 308, and the old-host 301
  lands on the slash URL. The workers.dev copy answers X-Robots-Tag: noindex.
- A new `rendered-links` gate, tier pr, fails a slashless page link that a mount renders at run
  time. The slash predicate moves to scripts/lib/page-links.mjs, shared with test:dist.
- robots-policy.mjs checks the landing robots.txt against a policy table with robots-parser
  3.0.1. deploy-smoke checks the live file, and its slash rows expect 308.
- The Cloudflare runbook gains the Search Console steps and the pages to inspect again.
@craig-o-curtis craig-o-curtis added bug Something isn't working documentation Improvements or additions to documentation labels Nov 27, 2026
@craig-o-curtis
craig-o-curtis marked this pull request as ready for review November 27, 2026 13:55

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

Looks good at 803dcad. permanentSlash turns a 307 into a 308 only when it is the same origin, the same path plus / and the same query; other responses pass through. The old-host 301 adds the slash through withPageSlash and leaves dotted paths alone. _redirects lists both the slash and the slashless form, so the moved-page rules still match after the hop. I checked the robots rules against robots-parser 3.0.1: the .md twins are blocked, query URLs get the treatment the policy table expects, and the OG images stay crawlable. The X-Robots-Tag: noindex stays on the twins, which covers the case where something is blocked but still indexed. The five dox-g17 specs match the code. worker/index.test.ts wouldn't load locally because the generated corpus-counts module was missing, so CI's run is the one that counts there. When I approved, 51 checks had passed and the Dox browser tests were still pending.

@craig-o-curtis
craig-o-curtis merged commit a0506a1 into main Nov 27, 2026
53 checks passed
@craig-o-curtis
craig-o-curtis deleted the chore/559-choreseo-fix-gsc-unindexed-pages branch November 27, 2026 14:09
craig-o-curtis added a commit that referenced this pull request Nov 27, 2026
…ks, close DOX-G17 (#559) (#588)

Follow-up to #587, which merged the DOX-G17 work for #559. The final
gate run found three small defects after that merge. This PR fixes them
and closes the story.

## Fixes

- **deploy-smoke:** the slash rows 6a and 6b now run in the local smoke
(`DOX_SMOKE_LOCAL`) as well as live. `wrangler dev` answers a slashless
page with the same 307 as production, so the Worker's 308 can be checked
before a deploy. Both rows read the function page from the local
sitemap.
- **rendered-links:** the gate now waits for `settle` before it reads
the links, as `tier-2-gates.md` describes.
- **robots-policy.test.ts:** drops its `vitest` import. The Vitest
globals are on, and the test rules forbid importing them.

## Close-out

- Tracker: DOX-G17 is Done. Its spec folder is removed, along with its
line in `specs/index.md`.
- Two docs went over their size budget, so each is split:
- The Search Console steps and the pages to inspect again move to
`context/dox/search-console-runbook.md`.
- The gate runner and CI jobs move to
`context/dox/built/tier-2-runner-and-ci.md`.
  
  The index entries and the one inbound link are updated.

## Validation

- `deploy-smoke` passes live against production. It also passes locally
under `wrangler dev`, where `/gmt/reference` returns 308.
- The `robots-policy`, `page-links` and gate-registry tests pass (96).
- `node scripts/verdict.mjs validate` passes all 27 checks. It ran
before the two doc splits, so CI is the check for those.
- `oxfmt --check` and oxlint are clean, and `/optimize` reports no
finding from this story.

No `packages/` file changes, so there is no changeset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation gmt monorepo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(seo): Fix GSC unindexed pages

2 participants