Skip to content

spec 010 D0 step 2: the redirects block, with the only key that can prove it works - #78

Merged
iancooper merged 1 commit into
masterfrom
docs/spec-010-d0-step2
Aug 7, 2026
Merged

spec 010 D0 step 2: the redirects block, with the only key that can prove it works#78
iancooper merged 1 commit into
masterfrom
docs/spec-010-d0-step2

Conversation

@iancooper

Copy link
Copy Markdown
Member

Step 2 of two. Step 1 (#77) changed what this step had to be.

What step 1 found

Merged with no redirects: block anywhere in the repo. Within 25 seconds, the old path returned HTTP 307 to the new one. A Git-synced SUMMARY.md rename does count as a "move" for GitBook automatic-redirect machinery.

Observation Evidence
Uncached request to old path 307Location: new path, seen twice on cache-miss
location: header is unique to the old path 3 known-good pages: 0 · 404 control: 0 · old path: 1
Old path serves no content 192KB vs the 404 control at 189KB. New path: 584KB with the real <h1>
Sync latency new URL 404 → 200 between 25s and 45s after merge

Recurring 200s on the old path are a CDN artifact — every one carries x-opennext-cache: HIT and the location: header, which no genuine page response has. It is the cached 307 replayed.

Why that killed the planned step 2

GitBook resolves automatic redirects first, and consults .gitbook.yaml only if the URL did not resolve. The path #77 moved now resolves. So a redirect for it would never be read — and would report success either way. That is exactly the vacuous green D0 exists to prevent.

What this block actually does

Two keys, two jobs:

Probe result after publish Meaning
resolves .gitbook.yaml redirects are read on this site, and the plan permits them
still 404 They are not. Spec 010's D2 is dead and automatic redirects are the only mechanism

The probe key is marked for removal and comes out in a follow-up PR once measured.

Verification, the way P0-3 demands rather than by eye

  • Zero bytes outside printable ASCII; no trailing whitespace. GitBook's own published .gitbook.yaml example carries two U+200B zero-width spaces, and this file carried them until 2026-08-05 — which is why GitBook never read the structure: block at all and nothing looked broken. The example is a live contamination source, so this block was typed, not pasted.
  • Parses as YAML; structure: intact; both targets exist on disk; no leading slashes either side.

linkcheck.py clean (112 files); pagelint.py 0 errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_012tcdwxVb8NmKaX2S6fvyFg

… prove it works

Step 1 (#77) answered the question it was built to answer, and the answer changed
this step. GitBook issued an automatic HTTP 307 from the old path to the new one
within 25 seconds of the merge, with no redirects block anywhere in the repo. A
Git-synced SUMMARY.md rename DOES count as a "move" for GitBook's automatic
redirect machinery.

That kills the planned step 2. GitBook resolves automatic redirects FIRST and
consults .gitbook.yaml only if the URL did not resolve — so adding a redirect for
the path #77 moved would never be read, and would report success either way. It
would have been precisely the vacuous green that D0 exists to prevent.

So this block carries two keys doing different jobs:

  - The real redirect for #77's rename. Belt-and-braces, and what spec 010 would
    ship anyway.
  - A probe key for a path that has NEVER existed and returns 404 today. No
    automatic redirect can mask it. If it resolves after publish, .gitbook.yaml
    redirects are read on this site and the plan permits them; if it still 404s,
    they are not, and spec 010's D2 is dead. The key is marked for removal.

Verified before committing, the way P0-3 demands rather than by eye:
  - zero bytes outside printable ASCII, and no trailing whitespace. GitBook's own
    published .gitbook.yaml example carries two U+200B zero-width spaces, and this
    file carried them until 2026-08-05, so the example is a live contamination
    source. This block was typed, not pasted.
  - parses as YAML; structure block intact; both redirect targets exist on disk;
    no leading slashes on either side.

linkcheck clean (112 files); pagelint 0 errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012tcdwxVb8NmKaX2S6fvyFg
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.

1 participant