Skip to content

ado: agent discovery optimization improvements - #229

Merged
catalinred merged 6 commits into
mainfrom
feat/ado-improvements
Nov 25, 2026
Merged

catalinred merged 6 commits into
mainfrom
feat/ado-improvements

Conversation

@catalinred

@catalinred catalinred commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

TODO:

  • Link headers - add global Link in vercel build output
  • API catalog - add well-known/api-catalog + linkset Content-Type
  • Markdown negotiation - Accept-based rewrite + text/markdown Content-Type
  • DNS for AI Discovery - mirror doublezero.xyz TXT record on docs subdomain

Link headers - add global Link in vercel build output

Mirrors the main-site header set in doublezero.xyz's next.config.ts so HTTP-only crawlers find the agent-orientation files without parsing HTML. Scored by isitagentready.com's "Link headers" check.

Verification once deployed:
curl -sI https://docs.doublezero.xyz/ | grep -i ^link


API catalog - add well-known/api-catalog + linkset Content-Type

  • hooks/emit_well_known.py — generates site/.well-known/api-catalog (RFC 9727 linkset+json, two anchors: docs + lake); docstring updated; refactored the agent-skills early-return into a nested if so the catalog always writes even when agent-skills/ is absent.
  • scripts/build-vercel-output.sh — prepends two header-only continue: true routes:
    1. Content-Type: application/linkset+json; profile="..." for /.well-known/api-catalog (extensionless file, otherwise application/octet-stream).
    2. Global Link header: llms.txt + llms-full.txt as rel="alternate", plus /.well-known/api-catalog as rel="api-catalog".

Verification once deployed:

curl -sI https://docs.doublezero.xyz/ | grep -i ^link
curl -s https://docs.doublezero.xyz/.well-known/api-catalog | jq .linkset[0].anchor
curl -sI https://docs.doublezero.xyz/.well-known/api-catalog | grep -i content-type


Markdown negotiation - Accept-based rewrite + text/markdown Content-Type

Agents sending Accept: text/markdown on any trailing-slash path are internally rewritten to the sidecar page>/index.md that hooks/emit_markdown.py already emits for every locale. Browsers never advertise text/markdown, so no risk of swapping HTML out from under a human.

Positioned after the per-file redirects in redirects.json so an old URL still 308s first; the agent re-requests the new URL with Accept intact and lands on the right .md.

Verification once deployed:

curl -sI -H 'Accept: text/markdown' https://docs.doublezero.xyz/setup/ | grep -iE 'HTTP|content-type'
# expect: HTTP/2 200 + content-type: text/markdown; charset=utf-8

curl -sI https://docs.doublezero.xyz/setup/ | grep -iE 'HTTP|content-type'
# expect: HTTP/2 200 + content-type: text/html; charset=utf-8 (browsers still get HTML)


DNS for AI Discovery - added.

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
doublezero-docs Ignored Ignored Preview Nov 25, 2026 4:24pm UTC

Request Review

@catalinred catalinred changed the title Add global Link in vercel build output ADO: agent discovery optimization Nov 25, 2026
@catalinred catalinred changed the title ADO: agent discovery optimization ado: agent discovery optimization improvements Nov 25, 2026
@catalinred
catalinred requested a review from nikw9944 November 25, 2026 12:01

@nikw9944 nikw9944 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catalog looks right. It cross-links the lake's own /.well-known/api-catalog instead of copying its service list, so the two can't drift. One check before merge and two small fixes, inline.

Note, not a change request: the main site serves markdown only when text/markdown is listed before text/html in Accept. This rule fires whenever text/markdown appears at all. Browsers don't send text/markdown, so it's harmless, but using the same rule here would make the two sites behave the same way.

Comment thread scripts/build-vercel-output.sh Resolved
Comment thread scripts/build-vercel-output.sh Resolved
Comment thread hooks/emit_well_known.py Resolved

@nikw9944 nikw9944 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all three are addressed. Once it's deployed, please confirm a multi-value header gets markdown: curl -sI -H 'Accept: text/markdown, text/html;q=0.9' https://docs.doublezero.xyz/setup/ | grep -iE 'HTTP|content-type' should return 200 and text/markdown.

@catalinred
catalinred merged commit c9730bb into main Nov 25, 2026
5 checks passed
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.

2 participants