Skip to content

fix(docs): keep mirrored ClawHub routes resolvable in anchor audits - #143002

Merged
vincentkoc merged 2 commits into
mainfrom
fix-clawhub-links
Sep 9, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix-clawhub-links

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Summary

node scripts/docs-link-audit.mjs --anchors reports 42 broken links on a clean main when the checkout has no ClawHub source beside it, while plain mode reports 0. All 39 /clawhub/** findings are false positives. No docs content is changed by this PR — the links are correct as authored.

Diagnosis

/clawhub/** pages are authored in openclaw/clawhub, not here. scripts/docs-sync-publish.mjs replaces the whole publish docs/clawhub/ tree from that source, and docs/AGENTS.md (added in #138157, which removed the last local copies) says explicitly not to keep authored copies in this repo. docs/docs.json declares the twelve /clawhub/** navigation entries and three redirects into /clawhub; those are real published routes on docs.openclaw.ai.

buildAuditIndex already handles this: when no ClawHub checkout is resolvable it sets allowExternalClawHubRoutes and adds the navigation-declared routes to routes, so resolveRoute succeeds. But the link check discarded that allowance in anchors mode:

if (!page && (options.anchors || !resolved.ok) && !index.relAllFiles.has(...))

options.anchors short-circuits ahead of resolved.ok, so anchors mode demanded a parsed Markdown page and ignored the allowance that plain mode honours. Same for redirect resolution, which built its pages list from parsed pages only — hence the three Redirect has no terminal Markdown page: /clawdhub -> /clawhub errors.

The intent behind the short-circuit is sound: a route declaration cannot prove a fragment. But it can prove the route, and 39 of the 39 findings are fragment-less links.

Fix

  • Accept a declared mirrored route when the link carries no fragment.
  • Count declared mirrored routes as terminal pages for redirect resolution.
  • In anchors mode only, report a fragment into a mirrored route as fragment unverified without the ClawHub source checkout; set OPENCLAW_DOCS_SYNC_CLAWHUB_REPO, instead of the misleading route/file not found. Plain mode has never inspected fragments, so it keeps resolving the declared route and stays silent.
  • Report the same for a redirect destination that lands on a mirrored route with a fragment, so an unreferenced redirect is not silently unchecked.
  • Print mirrored_clawhub_docs=yes|no in anchors mode and warn on stderr when the source is absent, so reduced coverage is visible rather than silent.

When the ClawHub source is present, mirroredRoutes is empty and behaviour is byte-identical to before.

Results

Run against the repo as authored (no /clawhub/** link here carries a fragment today):

run before after
--anchors, no ClawHub source 42 3
--anchors, with ClawHub source 4 4 (unchanged)
plain, no ClawHub source (what CI runs) 0 0 (unchanged)
plain, with ClawHub source 0 0 (unchanged)

Each of the three unchanged rows is byte-identical to main, diagnostics included.

The remaining 3 are the pre-existing maturity/#windows-app-node failures. The 4th in the with-source run is clawhub/publishing.md:216 :: /clawhub/cli#package-publish-source — a real broken anchor in openclaw/clawhub, not fixable from this repo. I have not filed it upstream; it is reported to the docs-audit orchestrator for routing to openclaw/clawhub.

Fragment-bearing link (the plain-mode edge case)

Temporarily adding a page containing [publishing](/clawhub/publishing#package-publish-source):

run main first revision of this PR current
plain, no ClawHub source 0 (exit 0) 1 (exit 1) 0 (exit 0), identical to main
plain, with ClawHub source 0 0 0
--anchors, no source 43 4 4
--anchors, with source 5 5 5

Fragment-bearing redirect destination

Temporarily rewriting the /tools/clawhub redirect to /clawhub/publishing#package-publish-source, --anchors with no ClawHub source:

main    docs.json:unknown :: /tools/clawhub :: Redirect has no terminal Markdown page: /tools/clawhub -> /clawhub/publishing
first   (no line mentioning /tools/clawhub — silently unchecked)
current docs.json:unknown :: /tools/clawhub :: fragment unverified without the ClawHub source checkout (terminal: /clawhub/publishing#package-publish-source); set OPENCLAW_DOCS_SYNC_CLAWHUB_REPO

Plain mode reports 0 in all three.

Why CI did not catch this

It is not a CI regression — there was nothing to catch. check:docs runs plain docs:check-links, which correctly reports 0, and both lanes (.github/workflows/ci.yml, .github/workflows/docs.yml) check out openclaw/clawhub into clawhub-source and set OPENCLAW_DOCS_SYNC_CLAWHUB_REPO, so even anchors mode would be clean there.

Two related gaps worth recording, neither introduced here:

  1. docs:check-links:anchors is not run by any workflow. It appears only in package.json, CHANGELOG.md, and three docs pages describing it as a manual step. Anchor regressions are ungated, which is why the three #windows-app-node failures have survived. Turning it on would need those fixed first, so I have not done it here.
  2. The audit silently auto-discovers <repo>/../clawhub via DEFAULT_CLAWHUB_REPO_CANDIDATES. Coverage therefore depends on the directory beside the checkout, with no output saying which mode ran. That is what made this look like a regression: the same command reports 4 from a clone with a sibling clawhub/ and 42 from a git worktree without one. The new mirrored_clawhub_docs= line makes that visible.

Validation

pnpm check:docs — the aggregate the CI docs job runs — passes (exit 0), with and without OPENCLAW_DOCS_SYNC_CLAWHUB_REPO set.

Tests: src/scripts/docs-link-audit.test.ts under test/vitest/vitest.tooling.config.ts, 32 passed / 1 pre-existing failure (preserves Mint component targets…, as-s-guide; reproduced unchanged at origin/main, where the file is 24 passed / 1 failed).

Eight hermetic tests cover: mirrored route accepted; fragment reported unverified in anchors mode; fragment left alone in plain mode, both through auditDocsLinks and through the real CLI; redirect destination fragment reported unverified in anchors mode and silent in plain mode; undeclared /clawhub/* route still reported missing; allowance-off still reporting missing. Three of the four added in the current revision fail against the previous revision of this PR.

pnpm check:test-types reports the same 8 pre-existing src/infra/* errors with and without this change (identical error set); none are in the audited files.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 6:44 AM ET / 10:44 UTC (Revision 2).

ClawSweeper review

What this changes

The documentation link auditor accepts declared ClawHub routes without a local source checkout while reporting unverifiable fragments only in anchor mode.

Merge readiness

✅ Ready for maintainer review

Both prior findings are resolved, and the supplied CLI evidence covers their triggering cases. The repair remains necessary on current main; no blocking introduced defect remains.

Priority: P2
Reviewed head: 9999bf149fdedd674b493b00a0b3b66a2d96b7da

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing CLI comparisons, relevant regression coverage, and both prior blockers resolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied real CLI runs exercise the changed auditor with ClawHub source present and absent, plus injected fragment-link and redirect cases, showing reduced false positives and recovery of both previously reported edge cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied real CLI runs exercise the changed auditor with ClawHub source present and absent, plus injected fragment-link and redirect cases, showing reduced false positives and recovery of both previously reported edge cases.
Evidence reviewed 7 items Current main still needs the repair: At the fetched main revision, redirect resolution includes only parsed pages, and anchor mode still rejects absent pages even when route resolution succeeds.
Latest release retains the same mechanism: The supplied latest-release revision for v2026.9.3 contains the parsed-page-only redirect list and the same anchor-mode short circuit; this repair is not present there.
Prior findings resolved: The link diagnostic now requires anchors mode, while the redirect loop independently reports fragment-bearing mirrored destinations. Both prior rank-up requests have corresponding regression coverage, including a plain-mode CLI case.
Findings None None.
Security None None.

How this fits together

The documentation auditor reads Markdown links, navigation, and redirects to identify broken published links. ClawHub pages come from a separate source tree, so local audits must distinguish declared routes from fragments that require that source.

flowchart TD
  A[Markdown links and navigation] --> C[Documentation auditor]
  B[Optional ClawHub source] --> C
  C --> D{Source page available?}
  D -->|Yes| E[Validate page and fragment]
  D -->|No| F[Check declared mirrored route]
  F --> G[Report unverified fragments in anchor mode]
  E --> H[Audit results]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +186, Other +74. Total +260 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 187 1 +186
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 81 7 +74
Total 3 268 8 +260

Review metrics

Metric Value Why it matters
Observed audit improvement 42 → 3 findings without ClawHub source The supplied real CLI comparison removes 39 false positives while preserving unrelated findings.

Technical review

Best possible solution:

Keep route existence and fragment verification distinct, preserving plain-mode behavior and requiring actual mirrored source to verify ClawHub anchors.

Do we have a high-confidence way to reproduce the issue?

Yes: current main rejects navigation-declared ClawHub routes in anchor mode when their source checkout is absent. Source inspection establishes the path, and the supplied CLI comparisons corroborate it; this review did not execute tests.

Is this the best way to solve the issue?

Yes: the patch extends the existing mirrored-route allowance, preserves ordinary fragment handling, and retains explicit diagnostics where source absence prevents verification.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 056d14028ff1.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied real CLI runs exercise the changed auditor with ClawHub source present and absent, plus injected fragment-link and redirect cases, showing reduced false positives and recovery of both previously reported edge cases.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This fixes false positives in an existing documentation audit with a limited tooling impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied real CLI runs exercise the changed auditor with ClawHub source present and absent, plus injected fragment-link and redirect cases, showing reduced false positives and recovery of both previously reported edge cases.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied real CLI runs exercise the changed auditor with ClawHub source present and absent, plus injected fragment-link and redirect cases, showing reduced false positives and recovery of both previously reported edge cases.

Evidence

What I checked:

  • Current main still needs the repair: At the fetched main revision, redirect resolution includes only parsed pages, and anchor mode still rejects absent pages even when route resolution succeeds. (scripts/docs-link-audit.mts:565, 056d14028ff1)
  • Latest release retains the same mechanism: The supplied latest-release revision for v2026.9.3 contains the parsed-page-only redirect list and the same anchor-mode short circuit; this repair is not present there. (scripts/docs-link-audit.mts:565, 1391f7cd2d40)
  • Prior findings resolved: The link diagnostic now requires anchors mode, while the redirect loop independently reports fragment-bearing mirrored destinations. Both prior rank-up requests have corresponding regression coverage, including a plain-mode CLI case. (scripts/docs-link-audit.mts:616, 9999bf149fde)
  • Real CLI proof: The captured body and fix(docs): keep mirrored ClawHub routes resolvable in anchor audits #143002 (comment) report runs on this head through scripts/docs-link-audit.mjs: source-absent anchor findings fall from 42 to 3, plain fragment links return exit 0, and an unreferenced redirect fragment produces the unverified diagnostic. Source-present and plain-mode comparisons preserve their finding counts. Captured context identity: 5846f1d6a53c9aa560f9020c5de0f72c4e7a67a7d88937d42ffbcbbe81d0230c. These are contributor-provided observations; no target code was executed during this review. (scripts/docs-link-audit.mts:681, 9999bf149fde)
  • Existing publishing boundary preserved: The publisher already owns ClawHub source discovery and replacement of the mirrored docs tree. The patch only exports its existing environment-variable name; route collection remains restricted to ClawHub navigation entries. No Codex runtime or protocol contract is involved. (scripts/docs-sync-publish.mjs:727, 9999bf149fde)
  • Relevant merged history: Main history records Peter Steinberger's shared publishing-anchor refactor and mirrored-route maintenance. GitHub confirms fix(docs): preserve mirrored ClawHub maturity links #138241 was merged with author steipete. This supports reviewer routing, without establishing introduction of the reported defect. (scripts/lib/docs-published-routes.mts:51, 05d9c8bd6b9c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-09T09:33:18.327Z sha 195f5983f2e30c7b7ab9b9784248c50fac608494 :: needs changes before merge. :: [P2] Keep unverified fragment errors behind anchor mode | [P2] Report unverified fragments in mirrored redirect destinations

`/clawhub/**` pages are authored in openclaw/clawhub and injected into the
publish tree by `scripts/docs-sync-publish.mjs`, so a checkout without the
ClawHub source has the docs.json navigation entries but no Markdown pages.

`buildAuditIndex` already accepts those declared routes when the source is
absent (`allowExternalClawHubRoutes`), but `--anchors` mode discarded the
allowance: its route check required a parsed page and ignored `resolved.ok`.
Every link into `/clawhub/**` was therefore reported as
"route/file not found", and the three redirects targeting `/clawhub` as
"Redirect has no terminal Markdown page" — 42 false positives on a clean
tree, while plain mode reported 0.

Accept a declared mirrored route in anchors mode when the link carries no
fragment, count mirrored routes as terminal pages for redirect resolution,
and report fragment-bearing links into them as unverified rather than
missing. Anchors mode now also prints `mirrored_clawhub_docs=` and warns on
stderr when the source is absent, so the reduced coverage is visible instead
of silent.

No docs content changes: the 39 links were correct as authored.
The unverified-fragment branch for ClawHub-mirrored routes ran in plain
mode too, so a link like /clawhub/publishing#section turned into a broken
link and failed docs:check-links -- a mode that has never inspected
fragments. Gate the diagnostic on anchor mode and let plain mode resolve
the declared route as it did before.

Redirect destinations that land on a mirrored route now resolve off the
navigation declaration, which proves the route but not the fragment.
Report those fragments as unverified instead of skipping them silently.
@vincentkoc

Copy link
Copy Markdown
Member Author

Both findings fixed in 9999bf149fd (rebased onto current main). The PR body now carries the full before/after tables; below is each finding with the evidence that settles it.

Two notes on how the evidence was produced. This worktree has no sibling clawhub/, so it is the source-absent shape; OPENCLAW_DOCS_SYNC_CLAWHUB_REPO pointed at a real openclaw/clawhub checkout gives the source-present shape. And neither edge case is reachable from the repo as authored — no /clawhub/** link carries a fragment today, and no redirect destination does either — so each was reproduced by temporarily introducing the triggering content, then reverted.


1. Keep unverified fragment errors behind anchor mode — scripts/docs-link-audit.mts:588-594

Confirmed, and the diagnosis was exactly right. The branch is now gated:

const mirroredOnly = !page && index.mirroredRoutes.has(terminal);
if (mirroredOnly) {
  // Plain mode does not inspect fragments at all, so a declared mirrored
  // route resolves there whether or not the link carries one. Only anchor
  // mode reports the fragment it cannot verify without the source.
  if (options.anchors && destination.hash) {
    unverifiedMirroredFragments++;
    broken.push({ ... });
  }
  continue;
}

Reproduced from the CLI. With a page containing [publishing](/clawhub/publishing#package-publish-source) added to docs/, running node scripts/docs-link-audit.mjs (plain, no ClawHub source):

broken_links exit
origin/main 0 0
previous revision of this PR 1 1
current 0 0

The previous revision's failure line was:

zz-clawhub-fragment-repro.md:10 :: /clawhub/publishing#package-publish-source :: fragment unverified without the ClawHub source checkout (terminal: /clawhub/publishing#package-publish-source); set OPENCLAW_DOCS_SYNC_CLAWHUB_REPO

The current revision's plain-mode output is byte-identical to main's for that same tree. Anchors mode is unaffected by the gate — it still reports the link as unverified (4 findings with the repro page present, vs 43 on main).

Covered through the CLI test boundary. Two tests added, in the same describe block:

  • leaves fragments into mirrored routes alone in plain mode — direct auditDocsLinks({ allowExternalClawHubRoutes: true }), expects broken empty and unverifiedMirroredFragments === 0.
  • exits clean from the CLI in plain mode for a fragment into a mirrored route — spawnSync on scripts/docs-link-audit.mjs with no --anchors, expects broken_links=0, exit 0, and no fragment unverified in stdout. The fixture root is nested one directory deeper than the existing CLI harness's so that <root>/../clawhub cannot accidentally resolve and flip the allowance off — this run has to be the source-absent shape to mean anything.

Both fail against the previous revision.


2. Report unverified fragments in mirrored redirect destinations — scripts/docs-link-audit.mts:514-517

Confirmed, including the subtlety that the link loop does not compensate when nothing references the redirect. The redirect loop now diagnoses it while processing the record, using the same reason string as the link path:

// A redirect into a ClawHub-mirrored route now resolves off the navigation
// declaration, which proves the route but not the fragment. Say so instead
// of letting the destination fragment go silently unchecked.
if (!page && destination.hash) {
  const terminal = normalizeRoute(destination.pathname);
  if (index.mirroredRoutes.has(terminal)) {
    unverifiedMirroredFragments++;
    broken.push({ file: "docs.json", line: 0, link: record.source, reason: ... });
  }
}

Reproduced from the CLI. Rewriting the existing /tools/clawhub redirect destination to /clawhub/publishing#package-publish-source and running --anchors with no ClawHub source — nothing in docs/ links to /tools/clawhub, so this is exactly the unreferenced case:

main     docs.json:unknown :: /tools/clawhub :: Redirect has no terminal Markdown page: /tools/clawhub -> /clawhub/publishing
previous (no line mentioning /tools/clawhub — resolved silently, and unverifiedMirroredFragments stayed 0)
current  docs.json:unknown :: /tools/clawhub :: fragment unverified without the ClawHub source checkout (terminal: /clawhub/publishing#package-publish-source); set OPENCLAW_DOCS_SYNC_CLAWHUB_REPO

Totals for those runs: 42 / 3 / 4. Plain mode reports 0 in all three.

Two tests added: reports unverified fragments in redirect destinations into mirrored routes (anchors; asserts the count, file, link, and reason) and keeps mirrored redirect destinations silent in plain mode (the mode guard, so the fix for finding 2 cannot reintroduce finding 1).


3. Complete next step

Both cases are fixed and validated through the CLI test boundary, per the above.


Verification on 9999bf149fd

pnpm check:docs — the aggregate the CI docs job runs, not a hand-picked subset — exit 0, both with and without OPENCLAW_DOCS_SYNC_CLAWHUB_REPO set.

Plain mode is unchanged from main in every configuration, diagnostics included:

run main this PR
plain, no ClawHub source 0 0 — byte-identical
plain, with ClawHub source 0 0 — byte-identical
--anchors, with ClawHub source 4 4 — byte-identical
--anchors, no ClawHub source 42 3 — the intended change

Tests: src/scripts/docs-link-audit.test.ts under test/vitest/vitest.tooling.config.ts is 32 passed / 1 failed. The failure is preserves Mint component targets for raw component apostrophes normalized after separators (as-s-guide), which reproduces unchanged at origin/main, where the same file is 24 passed / 1 failed. It is untouched by this PR.

pnpm check:test-types reports an identical set of 8 pre-existing src/infra/* errors with and without this change; none are in the audited files. (Run from a full clone — tsgo refuses to start in a git worktree whose node_modules is a symlink.)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 9, 2026
@vincentkoc
vincentkoc merged commit 48e4ae9 into main Sep 9, 2026
152 of 153 checks passed
@vincentkoc
vincentkoc deleted the fix-clawhub-links branch September 9, 2026 10:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…penclaw#143002)

* fix(docs): keep mirrored ClawHub routes resolvable in anchor audits

`/clawhub/**` pages are authored in openclaw/clawhub and injected into the
publish tree by `scripts/docs-sync-publish.mjs`, so a checkout without the
ClawHub source has the docs.json navigation entries but no Markdown pages.

`buildAuditIndex` already accepts those declared routes when the source is
absent (`allowExternalClawHubRoutes`), but `--anchors` mode discarded the
allowance: its route check required a parsed page and ignored `resolved.ok`.
Every link into `/clawhub/**` was therefore reported as
"route/file not found", and the three redirects targeting `/clawhub` as
"Redirect has no terminal Markdown page" — 42 false positives on a clean
tree, while plain mode reported 0.

Accept a declared mirrored route in anchors mode when the link carries no
fragment, count mirrored routes as terminal pages for redirect resolution,
and report fragment-bearing links into them as unverified rather than
missing. Anchors mode now also prints `mirrored_clawhub_docs=` and warns on
stderr when the source is absent, so the reduced coverage is visible instead
of silent.

No docs content changes: the 39 links were correct as authored.

* fix(docs): keep the mirrored-fragment diagnostic in anchor mode

The unverified-fragment branch for ClawHub-mirrored routes ran in plain
mode too, so a link like /clawhub/publishing#section turned into a broken
link and failed docs:check-links -- a mode that has never inspected
fragments. Gate the diagnostic on anchor mode and let plain mode resolve
the declared route as it did before.

Redirect destinations that land on a mirrored route now resolve off the
navigation declaration, which proves the route but not the fragment.
Report those fragments as unverified instead of skipping them silently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant