Skip to content

fix(docs): resolve localized anchors in MCP lookups - #17

Merged
matcra587 merged 2 commits into
mc/docs-heading-fidelityfrom
mc/lookup-fidelity
Sep 22, 2026
Merged

matcra587 merged 2 commits into
mc/docs-heading-fidelityfrom
mc/lookup-fidelity

Conversation

@matcra587

@matcra587 matcra587 commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Description

Page fragments were discarded and search breadcrumbs could suggest unusable heading lookups. Select the requested section with precedence heading, query, fragment, then full page. Resolve translated published IDs through bounded upstream HTML when needed, retain the resolved selection in continuations and return an actionable error for missing or ambiguous targets.

Search results with fragments now include executable follow-up calls. Hits absent from the catalogue retain their rank and carry an availability warning. README adds a compact, dated live-results summary and links to CONTRIBUTING for test instructions.

Review Focus

  • anchor_resolution.go: published heading IDs must map unambiguously to Markdown; HTML is never cached as a page body.
  • pagination.go: selection precedence, snapshot validation and continuation state.
  • apisearch.go and MCP tests: executable fragment calls, unavailable-hit notices and independent upstream body comparisons.

Test Procedure

  • mise run ci: formatting, lint, offline race tests, vulnerability checks, release checks and all five compilation targets.
  • CGO_ENABLED=1 GOFLAGS=-race mise run test:integration: actual stdio MCP exchanges with the checkout's binary.
  • Live coverage: English, Spanish, Japanese, Brazilian Portuguese, Simplified Chinese, Russian, French, Korean and German. Two search hits per language matched independent upstream Markdown; workflow pages spanning 206,349–341,219 bytes were traversed completely.
  • Localized published anchors, encoded anchors, selector precedence, missing targets, cursor replay and disk restarts passed. Fixtures cover long anchored CRLF sections and search-fragment round trips.

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore
  • Tests pass and code is formatted/linted
  • Docs updated (if needed)

Additional Notes

Published-anchor verification may require one additional HTML fetch, capped at 8 MiB with the existing timeout and redirect guards. Ambiguous targets fail explicitly. Uncatalogued search hits remain unavailable until the catalogue refreshes. Live samples do not validate every translated article.

@matcra587
matcra587 added this pull request to stack #18 September 21, 2026 23:55
@matcra587 matcra587 added the bug Something isn't working label Sep 21, 2026
@matcra587 matcra587 self-assigned this Sep 21, 2026
@matcra587 matcra587 changed the title mc/lookup fidelity fix(docs): resolve localized anchors in MCP lookups Sep 21, 2026
@matcra587
matcra587 marked this pull request as ready for review September 22, 2026 00:00
@matcra587
matcra587 merged commit 30023f6 into main Sep 22, 2026
13 checks passed
@matcra587
matcra587 deleted the mc/lookup-fidelity branch September 22, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant