feat(agents): make the markdown docs surface complete and reachable - #4109
feat(agents): make the markdown docs surface complete and reachable#4109crazyuploader wants to merge 12 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @crazyuploader's task in 3m 50s —— View job PR Review: Agent docs discoveryReviewed with Code findingsLow
Verified clean
Documentation findingsNo P1/P2. Notes:
Personas & JTBD: Serves agent/script/CI consumers and OTel-instrumentation users. The new "Confirm a service is sending spans" flow and the ingestion-key-scope clarification give a clean happy path with a real validation step and correct next-step links. JTBD checks pass; the ingestion-key API claim was verified against the docs' own service-account guidance. Onboarding label: skipped — all Open questions / residual risk
|
Pull Request
📄 Summary
Agents now reach the docs through
llms.txtand.mdURLs. The last audit run recorded 5 of 5 agents navigating that way, without opening a single HTML page. This PR fixes what that traffic pattern exposed.Four docs pages returned 404 in production. Each page had a multi-line
<Figure />block directly after a list item, so the closing line parsed as a lazy continuation and the page failed to compile. The markdown route tolerated it, the HTML route did not. All four sit in the sidebar:azure-monitoring/app-service/logging.mdxazure-monitoring/az-container-apps/logging.mdxlogs-pipelines/guides/json.mdxlogs-pipelines/guides/trace.mdxEvery
/docs/redirect source returned 404 with.mdappended. Next applies redirects before middleware runs, and the proxy rewrites/docs/<slug>.mdstraight to the markdown API, so the redirect table never ran. That covered 365 sources, including/docs/instrumentation/python.md. We created this failure mode by telling agents to append.md, which they now do. A new resolver follows the HTML redirect chain on a miss and returns 308 to the canonical markdown URL. Redirects that leave the docs tree, such as/docs/userguide/apis/to/api-reference/, are preserved.The region table was invisible without a browser.
RegionContextinitialized its region list to an empty array andRegionTablereturned a skeleton while loading, so no region value appeared anywhere in the HTML response. The markdown export said the data was "available in the rendered docs", which was not true. The built-in region list now seeds the state and the export renders a real table.llms.txtlisted no language guide.getLlmStarterLinkstakes one route per matcher, so the instrumentation prefix could only ever return the overview page. Python, Node.js, Go, and Java are now named explicitly.The markdown-versus-HTML split was not measurable.
custom_prefers_markdownreflected only theAcceptheader, so every.mdrequest logged as HTML. The.mdsuffix is the path agents actually use.Smaller docs fixes from the same run: sample apps moved off port 8080, which the self-hosted SigNoz UI uses; the exit-139 note now covers memory pressure on any host; the
/docs/introductionpage states the.mdconvention and links its three Get Started steps.✅ Change Type
Select all that apply
🐛 Bug Context
Root Cause
Fix Strategy
🧪 Testing Strategy
Tests added/updated:
tests/agent-markdown-stubs.test.jsasserts the region table renders real rows instead of a pointer.tests/agent-discovery.test.jsraises the starter cap to 34 for the four language matchers. Full suite: 291 node tests, 83 vitest,yarn lintclean,yarn buildgreen.Manual verification, local dev server:
/docs/instrumentation/python.md/docs/instrumentation/opentelemetry-python.md, then 200text/markdown/docs/userguide/apis.md(leaves the docs tree)/api-reference/docs/overview/whats-new/changelog-0.76.md/changelog.md/docs/nope-not-real.md/docs/ingestion/signoz-cloud/overview//llms.txt<link rel="alternate" type="text/markdown">/docs/introduction/POST /api/v5/query_rangewith the payload intraces-api.mdxstatus: success, 1 row, against a live workspaceEdge cases covered: redirect chains with a trailing-slash hop; redirect cycles; redirect targets outside
/docs; genuine 404s; markdown responses, which get noLinkheader of their own.📝 Changelog
📋 Checklist
👀 Notes for Reviewers
Four files conflict with #4067:
proxy.ts,app/(site)/api/docs-markdown/[[...slug]]/route.ts,utils/docs/agentDiscovery.ts, andtests/agent-discovery.test.js. The content is disjoint, but the regions are the same. Land #4067 first, will rebase this PR then.Two known gaps, both tracked and not in this PR:
check-stale-urlsskips.jsonunderconstants/, which hides 41 redirect-source hrefs; extending it surfaces 508 issues across 29 files. And no ingestion-key-only ingestion check exists, so the headless verification intraces-api.mdxneeds a service-account key.