Skip to content

fix(docs): resolve section links with shared anchor targets - #157

Merged
steipete merged 1 commit into
mainfrom
steipete/docs-anchor-renderer-rollout
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/docs-anchor-renderer-rollout

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Related: openclaw/openclaw#137032
Support contract: openclaw/openclaw#137038

What Problem This Solves

Fixes an issue where readers following a documentation section link could land at the top of the page even though the source anchor audit accepted that link. Published MarkdownIt headings and Mintlify's independent checker disagree on punctuation, duplicate numbering, and component targets.

Why This Change Was Made

The publisher now consumes the source-owned document/ID and redirect contracts delivered by normal .openclaw-sync generation. Existing published primary IDs and explicit anchors retain their ownership; compatible Mint compiler spellings become real, unambiguous DOM aliases. Conflicting aliases are omitted instead of stealing an existing target. Components receive actual targets, and fragment navigation opens enclosing details and selects the canonical heading.

This removes the old publisher preprocessing/frontmatter/redirect owners rather than maintaining parallel implementations. Relative document links resolve against final published page URLs. Exact literal percent-containing IDs take precedence over a single decode. Existing current-main invite behavior is preserved. Generated mirror docs are not hand-edited.

User Impact

Existing section links continue to work, while dotted settings, slash/parenthesis headings, plus/dev flags, and supported component titles can also resolve through compatible spellings. Copy-link controls still produce canonical published heading URLs. Initial navigation, same-page clicks, PJAX, and history use the same target resolution; external links are not intercepted as local navigation.

This is stage two of the explicitly approved support → renderer → audit rollout. Source audit activation must wait for this renderer to deploy and pass real production fragment verification.

Evidence

  • Publisher's own installed dependency graph matches the five pinned shared parser dependencies. npm test passes 126 tests on the integrated branch, including real DOM, browser boundary, and newly landed locale-ownership coverage; no source-repo dependency leakage is needed.
  • The new regression fails against the old renderer for missing real aliases/components, not merely a missing import.
  • English differential corpus: 765 pages, all 8,780 primary heading IDs and 8,856 preexisting ID occurrences preserved, zero audit/rendered-DOM differences. The github-actions-2 alias collision is intentionally omitted so existing base/-1/-2 ownership remains intact.
  • Fresh integrated make docs-check passed: 14,934 pages built, 14,933 indexed pages in 21 languages, 85,003 R2 objects prepared, full artifact smoke passed. The local checkout lacked the optional source-code-index checkout; that optional index was not claimed as tested.
  • Ten actual rendered-page Chromium flows pass, including canonical TOC selection/copy URLs, encoded fragments and open accordion state. Captures below are inspected candidate proof, not a claim that production is already deployed.
  • Fresh independent Codex review was scoped-clean at the configured P0-only threshold; broader-priority clearance is not claimed.
  • Production/tooling +32/-338 (net −306); tests/test-support +178/-11; manifest +2; workflow +3/-1; docs +43; lockfile +153. The removed duplicate owners pay down the temporary support-stage growth.

Before: the accepted alias does not select its section on the old production renderer.

Before: alias does not select the working-directory heading

After, candidate: alias selects the existing canonical heading and TOC entry.

Candidate: working-directory alias resolves to canonical heading

After, candidate: component target opens its details container and scrolls into view.

Candidate: sandbox details target is open and visible

Preserve published primary IDs while emitting real compatible aliases and component targets. Reuse the source-owned parser and redirect contract, and open collapsed content during fragment navigation. Deploy only after normal source support sync; source audit activation follows live verification. Related: openclaw/openclaw#137032.
@steipete
steipete marked this pull request as ready for review September 3, 2026 07:10
@steipete
steipete requested a review from a team as a code owner September 3, 2026 07:10
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at 01af109d913c4d01da8e050a046d1669ade58014.

Docs Code CI attempt 1 and the exact-head CodeQL checks passed. Normal source sync delivered both shared modules; their generated Git blobs match source support merge 6d763ee148d4ee62c2c1a39fd5726e1a4d0b94a2 byte-for-byte. No generated mirror files were hand-edited.

Local npm ci, npm test (126/126), make docs-check, and git diff --check passed. The full artifact built 14,934 pages, indexed 14,933 in 21 languages, prepared 85,003 R2 objects, and passed smoke. The optional source-code index was skipped locally because this checkout lacks the source-index checkout; normal R2 deployment supplies it. Fresh integrated Codex review is scoped-clean at the configured P0-only threshold.

Ten isolated Chromium flows pass against the actual integrated artifact: published primary IDs, dotted aliases, slash/parenthesis and plus/dev fragments, canonical TOC selection and copied URL, and opening the sandbox details target. All three captures were inspected. The Browser pane independently confirms actual alias ownership and component targets without console errors; its background-host visibility prevents treating its paused scrolling as the browser-flow proof.

The rebase preserves the separately landed locale-owner fix and both changelog entries. Production/tooling net −306; tests/test-support +178/-11. Active rules impose no independent approving-review requirement; no server rule is bypassed. Proceeding with the authorized renderer merge and normal R2 publication. Production parity will be verified before source audit activation.

@steipete
steipete merged commit d309865 into main Sep 3, 2026
6 checks passed
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Published and verified on production. R2 run 33727893894, attempt 1, built and uploaded docs commit 831a0b636e82fef6c95b6bc34c854176d86f3ab6, which contains renderer merge d309865b27755f63268824fbbb364cca71800da9. Source checkout, full build, generated-site smoke, and R2 upload all succeeded. The earlier merge-triggered run yielded as stale and is not being counted as publication proof.

All ten real Chromium flows on https://docs.openclaw.ai passed with HTTP 200 and no page errors: published primary IDs, dotted aliases, encoded slash/parenthesis and plus/dev fragments, canonical TOC selection/copy URL, and opening the sandbox details target. The live shell is /assets/docs-site.js?v=8de80e3eb178. No request interception or DOM implementation injection was used.

The working-directory alias selects agents.defaults.cwd and copies https://docs.openclaw.ai/gateway/config-agents#agents.defaults.cwd. The encoded exec alias selects the original heading. Sandbox details is open and visible. Every capture below was inspected and contains only public documentation/synthetic examples.

Production: alias resolves to the canonical heading and TOC

Production: encoded exec fragment selects the original heading

Production: component target opens sandbox details

The production gate is satisfied; the final source-audit activation can now proceed. No generated mirror docs were manually edited, and no npm/product release was performed.

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