Skip to content

[doc] Add curated page descriptions for nav pages (SEO + llms.txt) - #64330

Merged
elliot-barn merged 6 commits into
masterfrom
doc-1130-page-descriptions
Jul 13, 2026
Merged

elliot-barn merged 6 commits into
masterfrom
doc-1130-page-descriptions

Conversation

@ronny-anyscale

Copy link
Copy Markdown
Contributor

Summary

Adds a one-line description to the 93 documentation pages that surface in the site navigation — the 19 top-level nav sections and their direct toctree children — so each has a curated <meta name="description">.

  • .md (MyST) pages use html_meta front-matter; .rst pages use the docutils .. meta:: directive. Both compile to the same <meta name="description"> node.
  • Descriptions are tight (~130–150 chars, capped at 160), front-loaded with each page's distinguishing content, and consistent in voice across sections.
  • Purely additive — no page content changes; each edit only prepends a front-matter block / meta directive.

Why

These descriptions pull double duty:

  1. SEO / OpenGraph — real <meta name="description"> snippets for search and social (the repo already runs sphinxext-opengraph).
  2. Agent manifest — they become the per-page descriptions in the forthcoming nav-structured llms.txt generator (DOC-1130). Landing them on their own keeps that extension PR focused.

Before this change only 15 of 642 pages carried a curated description; this brings every nav-visible page up to one.

Testing

  • Additive metadata only — page rendering is unchanged and is covered by the existing docs build (-W) in CI.
  • Confirmed that both .. meta:: and html_meta resolve to <meta name="description"> under the pinned Sphinx 8.2.3 / MyST 5.1.0 stack.

🤖 Generated with Claude Code

@ronny-anyscale
ronny-anyscale requested review from a team and andrewsykim as code owners June 25, 2026 00:49

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds SEO metadata descriptions to various documentation files (.md and .rst) across the Ray documentation suite, covering topics such as clusters, data, core, libraries, observability, RLlib, serve, train, and tune. The review feedback suggests minor formatting and consistency improvements: removing an extra blank line in the RLlib getting started guide and replacing double hyphens with em-dashes in the RLlib algorithms catalog to maintain consistency with other meta descriptions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread doc/source/rllib/getting-started.rst Resolved
Comment thread doc/source/rllib/rllib-algorithms.rst Resolved
@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Jun 25, 2026

@dstrodtman dstrodtman 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.

LGTM for first 93.

We'll want to expand this to all pages in the future.

Add a one-line description to the 93 documentation pages that surface in
the site navigation: the 19 top-level sections and their direct toctree
children. Each is authored as a `<meta name="description">` tag — MyST
`html_meta` front-matter on .md pages, the `.. meta::` directive on .rst
pages — so it serves double duty as the page's SEO/OpenGraph snippet and
as the per-page description for the forthcoming nav-structured llms.txt
generator (DOC-1130).

Descriptions are tight (~130-150 chars, capped at 160), front-loaded with
each page's distinguishing content, and consistent in voice across
sections. Purely additive — no page content is changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Ronny Roland <[email protected]>
@abrarsheikh

Copy link
Copy Markdown
Contributor

please fix merge conflicts

@ronny-anyscale
ronny-anyscale requested a review from a team as a code owner July 7, 2026 19:00
ronny-anyscale and others added 2 commits July 7, 2026 13:01
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Ronny <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Ronny <[email protected]>
#64506 removed the `_includes/rllib/we_are_hiring.rst` file and its
`.. include::` directives from the RLlib pages on master. When master merged
into this branch, our copies of the nine RLlib pages that got `.. meta::`
descriptions kept the include line while the file itself was deleted — so the
`-W` docs build failed on the missing include.

Drop the dangling include from those pages. They now match master apart from
the added description blocks (verified: diff vs master is the `.. meta::`
additions only).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Ronny Roland <[email protected]>
@ronny-anyscale ronny-anyscale added docs An issue or change related to documentation go add ONLY when ready to merge, run all tests labels Jul 7, 2026
@elliot-barn
elliot-barn merged commit d905525 into master Jul 13, 2026
3 checks passed
@elliot-barn
elliot-barn deleted the doc-1130-page-descriptions branch July 13, 2026 17:37
dstrodtman added a commit that referenced this pull request Aug 10, 2026
…65115)

## Summary

Completes the page-description work
[#64330](#64330) started, so that
**every page listed in `llms.txt` carries a curated description**.

#64330 (merged) described the 94 pages that made up the index when it
listed only each section's landing page plus its direct toctree
children. The generator in
[#64458](#64458) makes the index
complete — every in-scope page under its section — so the index now
carries ~630 entries, and the ~400 that #64330 didn't cover fall back to
a truncated first paragraph.

That fallback is often actively bad for an agent routing on it. Of the
397 undescribed pages:

| Fallback problem | Pages | Example |
|---|---:|---|
| No paragraph at all | 22 | `cluster/kubernetes/troubleshooting` |
| Pointer prose | 34 | `cluster/cli` → "This section contains commands
for managing Ray clusters." |
| Restates the title | 117 | every `ray-core/patterns/*` anti-pattern
page |
| Under 70 chars | 170 | `data/inspecting-data` → "Inspect Datasets to
better understand your data." |

## Changes

- **368 pages get a curated description**, following the convention
#64330 established: `myst: html_meta: description:` front matter for
`.md` (164 files), and a `.. meta::` directive for `.rst` (204 files).
The `.rst` block is placed after any leading docinfo field list
(`:orphan:` and friends) but **before** any `.. _label:` target, so the
label still resolves to the section title.
- **31 pages are excluded instead** (`conf.py`). These are thin
API-reference hub pages — a title plus an autosummary table, under 40
words of real prose — whose per-symbol targets are already excluded by
the existing `*/api/doc/*` patterns. Also `data/api/_autogen` (no title
at all) and two `*_regression_example` literalinclude stubs with zero
prose. A description on any of these could only restate its title.

Style follows the same house rule as #64330: 130–150 characters,
front-loading what distinguishes the page, no "Ray X is a…" restatement
of the link title. Mean length 122 chars, none over 160.

Substantial API-reference pages were **kept and described**, not
excluded — `tune/api/schedulers` (965 words of prose), `tune/api/env`,
`tune/api/trainable`, `serve/api/index`, `data/api/expressions` are
exactly what a coding agent wants.

**Result: 479 in-scope pages described, 31 excluded, 0 relying on
first-paragraph fallback.**

## Relationship to other PRs

Independent of **#64458** (the generator). Descriptions are page front
matter and work with the current third-party `sphinx-llms-txt` on master
as well as the in-repo generator. The one file both touch is
`doc/source/conf.py`: this PR appends a `llms_txt_exclude += [...]`
block below the existing list rather than editing the list literal,
which is what #64458 rewrites, so the two shouldn't collide. Either can
merge first.

Not a duplicate: `gh pr list --state open` finds no other PR adding page
descriptions or `html_meta` blocks. #64330, the only prior art, is
merged.

## Rebased on master

Merged master to clear a conflict. Two pages shifted:

- `cluster/kubernetes/user-guides/kuberay-history-server.md` no longer
appears in this diff. #65139 described that page independently while
this branch was open, and its description is the better one: this
branch's scoped the page to GKE and Google Cloud Storage, where master's
covers RayCluster, RayJob, and RayService, which is the page's actual
scope. Resolved in favor of master.
- `ray-observability/user-guides/jax-tpu-profiling.md` is newly
described. It landed on master after this branch was cut and was the one
in-scope page still falling back to a truncated first paragraph.

Net file count is 368 newly described pages plus `conf.py`, plus one
re-key:
`ray-core/scheduling/labels.md` carried a bare top-level `description:`
in its front matter, the only such file in the tree. Sphinx emits no
meta description from that key, so despite looking described the page
fed neither the HTML meta tag nor `llms.txt`. The text is unchanged;
only the key moves under `myst.html_meta`. That page was already counted
as described, so the totals above don't move.

## Testing

Local verification (no Ray build required — these are doc source edits):

```
$ python3 doc/test_no_new_rst.py                       # exit 0 (no new .rst files; all 204 are edits)
$ vale doc/source/data doc/source/ray-overview/examples
  174 alerts, 0 error-level, 0 on the added lines
  identical to the master baseline (174 alerts) — this change adds no Vale alerts
$ python3 -c "import ast; ast.parse(open('doc/source/conf.py').read())"   # conf.py parses
```

Plus scripted checks over all 370 changed files:

- All 164 `.md` front-matter blocks parse as YAML and expose
`myst.html_meta.description`.
- All 204 `.rst` files: `.. meta::` precedes any `.. _label:`, and any
docinfo field list still precedes the `.. meta::` block.
- Re-running the in-scope inventory: 510 pages, 479 described, 31
excluded, **0 gaps**.
- The 31 entries added to `llms_txt_exclude` match the computed exclude
set exactly.

The `-W` docs build is the real end-to-end gate and runs in CI here.

## AI assistance

Drafted with Claude Code: the descriptions were generated from each
page's title, headings, and lead prose, and applied by script. Per
`AGENTS.md`, this needs a human pass over the content before it's ready
for review — **opening as a draft for that reason**. The mechanical
placement is verified by the checks above; what needs human eyes is
whether each description is accurate and useful for its page.

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Artimislyy pushed a commit to Artimislyy/ray that referenced this pull request Aug 11, 2026
…ay-project#65115)

## Summary

Completes the page-description work
[ray-project#64330](ray-project#64330) started, so that
**every page listed in `llms.txt` carries a curated description**.

ray-project#64330 (merged) described the 94 pages that made up the index when it
listed only each section's landing page plus its direct toctree
children. The generator in
[ray-project#64458](ray-project#64458) makes the index
complete — every in-scope page under its section — so the index now
carries ~630 entries, and the ~400 that ray-project#64330 didn't cover fall back to
a truncated first paragraph.

That fallback is often actively bad for an agent routing on it. Of the
397 undescribed pages:

| Fallback problem | Pages | Example |
|---|---:|---|
| No paragraph at all | 22 | `cluster/kubernetes/troubleshooting` |
| Pointer prose | 34 | `cluster/cli` → "This section contains commands
for managing Ray clusters." |
| Restates the title | 117 | every `ray-core/patterns/*` anti-pattern
page |
| Under 70 chars | 170 | `data/inspecting-data` → "Inspect Datasets to
better understand your data." |

## Changes

- **368 pages get a curated description**, following the convention
ray-project#64330 established: `myst: html_meta: description:` front matter for
`.md` (164 files), and a `.. meta::` directive for `.rst` (204 files).
The `.rst` block is placed after any leading docinfo field list
(`:orphan:` and friends) but **before** any `.. _label:` target, so the
label still resolves to the section title.
- **31 pages are excluded instead** (`conf.py`). These are thin
API-reference hub pages — a title plus an autosummary table, under 40
words of real prose — whose per-symbol targets are already excluded by
the existing `*/api/doc/*` patterns. Also `data/api/_autogen` (no title
at all) and two `*_regression_example` literalinclude stubs with zero
prose. A description on any of these could only restate its title.

Style follows the same house rule as ray-project#64330: 130–150 characters,
front-loading what distinguishes the page, no "Ray X is a…" restatement
of the link title. Mean length 122 chars, none over 160.

Substantial API-reference pages were **kept and described**, not
excluded — `tune/api/schedulers` (965 words of prose), `tune/api/env`,
`tune/api/trainable`, `serve/api/index`, `data/api/expressions` are
exactly what a coding agent wants.

**Result: 479 in-scope pages described, 31 excluded, 0 relying on
first-paragraph fallback.**

## Relationship to other PRs

Independent of **ray-project#64458** (the generator). Descriptions are page front
matter and work with the current third-party `sphinx-llms-txt` on master
as well as the in-repo generator. The one file both touch is
`doc/source/conf.py`: this PR appends a `llms_txt_exclude += [...]`
block below the existing list rather than editing the list literal,
which is what ray-project#64458 rewrites, so the two shouldn't collide. Either can
merge first.

Not a duplicate: `gh pr list --state open` finds no other PR adding page
descriptions or `html_meta` blocks. ray-project#64330, the only prior art, is
merged.

## Rebased on master

Merged master to clear a conflict. Two pages shifted:

- `cluster/kubernetes/user-guides/kuberay-history-server.md` no longer
appears in this diff. ray-project#65139 described that page independently while
this branch was open, and its description is the better one: this
branch's scoped the page to GKE and Google Cloud Storage, where master's
covers RayCluster, RayJob, and RayService, which is the page's actual
scope. Resolved in favor of master.
- `ray-observability/user-guides/jax-tpu-profiling.md` is newly
described. It landed on master after this branch was cut and was the one
in-scope page still falling back to a truncated first paragraph.

Net file count is 368 newly described pages plus `conf.py`, plus one
re-key:
`ray-core/scheduling/labels.md` carried a bare top-level `description:`
in its front matter, the only such file in the tree. Sphinx emits no
meta description from that key, so despite looking described the page
fed neither the HTML meta tag nor `llms.txt`. The text is unchanged;
only the key moves under `myst.html_meta`. That page was already counted
as described, so the totals above don't move.

## Testing

Local verification (no Ray build required — these are doc source edits):

```
$ python3 doc/test_no_new_rst.py                       # exit 0 (no new .rst files; all 204 are edits)
$ vale doc/source/data doc/source/ray-overview/examples
  174 alerts, 0 error-level, 0 on the added lines
  identical to the master baseline (174 alerts) — this change adds no Vale alerts
$ python3 -c "import ast; ast.parse(open('doc/source/conf.py').read())"   # conf.py parses
```

Plus scripted checks over all 370 changed files:

- All 164 `.md` front-matter blocks parse as YAML and expose
`myst.html_meta.description`.
- All 204 `.rst` files: `.. meta::` precedes any `.. _label:`, and any
docinfo field list still precedes the `.. meta::` block.
- Re-running the in-scope inventory: 510 pages, 479 described, 31
excluded, **0 gaps**.
- The 31 entries added to `llms_txt_exclude` match the computed exclude
set exactly.

The `-W` docs build is the real end-to-end gate and runs in CI here.

## AI assistance

Drafted with Claude Code: the descriptions were generated from each
page's title, headings, and lead prose, and applied by script. Per
`AGENTS.md`, this needs a human pass over the content before it's ready
for review — **opening as a draft for that reason**. The mechanical
placement is verified by the checks above; what needs human eyes is
whether each description is accurate and useful for its page.

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
dstrodtman added a commit that referenced this pull request Aug 11, 2026
## Summary

Replaces the third-party
[`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt) with a
small in-repo Sphinx extension (`doc/source/_ext/llms_txt.py`, alongside
`callouts.py` / `queryparamrefs.py`) that generates
**navigation-structured** agent manifests instead of one flat list.

Three tiers, emitted into the HTML build output:

- **`/llms.txt`** — index: H1 + summary, one `## Section` per top-level
`toctree` entry of the root doc. Each section lists its landing page and
every in-scope page in the subtree beneath it as `- [title](url):
description`, deduped so a page appears only under the first section
that reaches it, so an agent can locate any page from the index without
drilling into the corpus. A page the nav toctrees never reach (an
example linked only from a gallery grid, say) folds into the section
owning its top-level directory; only pages whose directory maps to no
section land in a trailing `## Other pages`. Sections in
`llms_txt_optional_sections` move to a trailing `## Optional` block.
- **`/<section>/llms-full.txt`** — verbatim page source per section,
behind a `## Contents` TOC (which also surfaces deep pages absent from
the index). A section whose source exceeds
`llms_txt_full_max_shard_tokens` (default **200K**, ~4 chars/token) is
split recursively into per-subdirectory sub-shards, so each loadable
unit fits an agent's context budget.
- **`/llms-full.txt`** — a manifest linking every shard (sub-shards
nested under their parent), each with a description and page count, so
an agent routes without downloading.

Descriptions resolve from front-matter/docinfo `description` → an
`html_meta` / `.. meta::` node → a first-paragraph fallback.

## Why not a single `llms-full.txt`

Ray's full corpus is ~1.14M tokens — too large to load whole on most
models, and truncating it (what `sphinx-llms-txt`'s size knobs do) just
yields an arbitrary lossy prefix. Peer projects all ship a single flat
file and none cap; sharding by section keeps every unit independently
loadable.

### Note for existing `llms-full.txt` consumers

This changes what `/llms-full.txt` serves at a stable URL. Today it's
~5.9 MB of concatenated page text; after this it's a small manifest
linking the per-section shards. Anything pointed at that URL expecting
full text should follow the manifest to the shard it needs instead.

## Changes

- New `doc/source/_ext/llms_txt.py` + hermetic test
`doc/source/_ext/test_llms_txt.py`.
- `conf.py`: swap `sphinx_llms_txt` → `llms_txt`; add `llms_txt_title`,
`llms_txt_optional_sections`, `llms_txt_full_max_shard_tokens` (keeps
the existing `llms_txt_summary` / `llms_txt_exclude`).
- Remove `sphinx-llms-txt==0.7.1` from `requirements-doc.txt` and the
docs lock (`python/deplocks/docs/docbuild_depset_py3.11.lock`; clean
leaf removal — `raydepsets --check` consistent).
- New premerge step `doc: test llms.txt extension` in
`.buildkite/doc.rayci.yml` (runs in the `docbuild-py3.11` env, since the
test needs sphinx + myst).

## Forward-compatibility

Written for the in-flight Sphinx 8→9 upgrade: `findall` (not
`traverse`), `root_doc` (not `master_doc`), defensive `getattr` env
access, `docutils.nodes.meta`, and all work in `build-finished`
(parallel-safe).

## Testing

- `doc/source/_ext/test_llms_txt.py` — hermetic in-process Sphinx build
covering all three description sources, exclusion, the `## Optional`
section, sub-shard splitting, and the nested manifest. Passes on the
pinned stack (Sphinx 8.2.3 / MyST 5.1.0 / docutils 0.21.2).
- The full `-W` docs build validates end-to-end in CI here.

## Relationship to #64330

Independent of [#64330](#64330)
(which adds the per-page `<meta name="description">` descriptions) —
zero file overlap, mergeable in either order. Where a page has no
curated description yet, the generator uses its first paragraph, so
output is sensible regardless.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ay-project#64330)

## Summary

Adds a one-line description to the **93 documentation pages that surface
in the site navigation** — the 19 top-level nav sections and their
direct toctree children — so each has a curated `<meta
name="description">`.

- `.md` (MyST) pages use `html_meta` front-matter; `.rst` pages use the
docutils `.. meta::` directive. Both compile to the same `<meta
name="description">` node.
- Descriptions are tight (~130–150 chars, capped at 160), front-loaded
with each page's distinguishing content, and consistent in voice across
sections.
- **Purely additive** — no page content changes; each edit only prepends
a front-matter block / meta directive.

## Why

These descriptions pull double duty:

1. **SEO / OpenGraph** — real `<meta name="description">` snippets for
search and social (the repo already runs `sphinxext-opengraph`).
2. **Agent manifest** — they become the per-page descriptions in the
forthcoming nav-structured `llms.txt` generator (DOC-1130). Landing them
on their own keeps that extension PR focused.

Before this change only 15 of 642 pages carried a curated description;
this brings every nav-visible page up to one.

## Testing

- Additive metadata only — page rendering is unchanged and is covered by
the existing docs build (`-W`) in CI.
- Confirmed that both `.. meta::` and `html_meta` resolve to `<meta
name="description">` under the pinned Sphinx 8.2.3 / MyST 5.1.0 stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Ronny <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ay-project#65115)

## Summary

Completes the page-description work
[ray-project#64330](ray-project#64330) started, so that
**every page listed in `llms.txt` carries a curated description**.

ray-project#64330 (merged) described the 94 pages that made up the index when it
listed only each section's landing page plus its direct toctree
children. The generator in
[ray-project#64458](ray-project#64458) makes the index
complete — every in-scope page under its section — so the index now
carries ~630 entries, and the ~400 that ray-project#64330 didn't cover fall back to
a truncated first paragraph.

That fallback is often actively bad for an agent routing on it. Of the
397 undescribed pages:

| Fallback problem | Pages | Example |
|---|---:|---|
| No paragraph at all | 22 | `cluster/kubernetes/troubleshooting` |
| Pointer prose | 34 | `cluster/cli` → "This section contains commands
for managing Ray clusters." |
| Restates the title | 117 | every `ray-core/patterns/*` anti-pattern
page |
| Under 70 chars | 170 | `data/inspecting-data` → "Inspect Datasets to
better understand your data." |

## Changes

- **368 pages get a curated description**, following the convention
ray-project#64330 established: `myst: html_meta: description:` front matter for
`.md` (164 files), and a `.. meta::` directive for `.rst` (204 files).
The `.rst` block is placed after any leading docinfo field list
(`:orphan:` and friends) but **before** any `.. _label:` target, so the
label still resolves to the section title.
- **31 pages are excluded instead** (`conf.py`). These are thin
API-reference hub pages — a title plus an autosummary table, under 40
words of real prose — whose per-symbol targets are already excluded by
the existing `*/api/doc/*` patterns. Also `data/api/_autogen` (no title
at all) and two `*_regression_example` literalinclude stubs with zero
prose. A description on any of these could only restate its title.

Style follows the same house rule as ray-project#64330: 130–150 characters,
front-loading what distinguishes the page, no "Ray X is a…" restatement
of the link title. Mean length 122 chars, none over 160.

Substantial API-reference pages were **kept and described**, not
excluded — `tune/api/schedulers` (965 words of prose), `tune/api/env`,
`tune/api/trainable`, `serve/api/index`, `data/api/expressions` are
exactly what a coding agent wants.

**Result: 479 in-scope pages described, 31 excluded, 0 relying on
first-paragraph fallback.**

## Relationship to other PRs

Independent of **ray-project#64458** (the generator). Descriptions are page front
matter and work with the current third-party `sphinx-llms-txt` on master
as well as the in-repo generator. The one file both touch is
`doc/source/conf.py`: this PR appends a `llms_txt_exclude += [...]`
block below the existing list rather than editing the list literal,
which is what ray-project#64458 rewrites, so the two shouldn't collide. Either can
merge first.

Not a duplicate: `gh pr list --state open` finds no other PR adding page
descriptions or `html_meta` blocks. ray-project#64330, the only prior art, is
merged.

## Rebased on master

Merged master to clear a conflict. Two pages shifted:

- `cluster/kubernetes/user-guides/kuberay-history-server.md` no longer
appears in this diff. ray-project#65139 described that page independently while
this branch was open, and its description is the better one: this
branch's scoped the page to GKE and Google Cloud Storage, where master's
covers RayCluster, RayJob, and RayService, which is the page's actual
scope. Resolved in favor of master.
- `ray-observability/user-guides/jax-tpu-profiling.md` is newly
described. It landed on master after this branch was cut and was the one
in-scope page still falling back to a truncated first paragraph.

Net file count is 368 newly described pages plus `conf.py`, plus one
re-key:
`ray-core/scheduling/labels.md` carried a bare top-level `description:`
in its front matter, the only such file in the tree. Sphinx emits no
meta description from that key, so despite looking described the page
fed neither the HTML meta tag nor `llms.txt`. The text is unchanged;
only the key moves under `myst.html_meta`. That page was already counted
as described, so the totals above don't move.

## Testing

Local verification (no Ray build required — these are doc source edits):

```
$ python3 doc/test_no_new_rst.py                       # exit 0 (no new .rst files; all 204 are edits)
$ vale doc/source/data doc/source/ray-overview/examples
  174 alerts, 0 error-level, 0 on the added lines
  identical to the master baseline (174 alerts) — this change adds no Vale alerts
$ python3 -c "import ast; ast.parse(open('doc/source/conf.py').read())"   # conf.py parses
```

Plus scripted checks over all 370 changed files:

- All 164 `.md` front-matter blocks parse as YAML and expose
`myst.html_meta.description`.
- All 204 `.rst` files: `.. meta::` precedes any `.. _label:`, and any
docinfo field list still precedes the `.. meta::` block.
- Re-running the in-scope inventory: 510 pages, 479 described, 31
excluded, **0 gaps**.
- The 31 entries added to `llms_txt_exclude` match the computed exclude
set exactly.

The `-W` docs build is the real end-to-end gate and runs in CI here.

## AI assistance

Drafted with Claude Code: the descriptions were generated from each
page's title, headings, and lead prose, and applied by script. Per
`AGENTS.md`, this needs a human pass over the content before it's ready
for review — **opening as a draft for that reason**. The mechanical
placement is verified by the checks above; what needs human eyes is
whether each description is accurate and useful for its page.

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…project#64458)

## Summary

Replaces the third-party
[`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt) with a
small in-repo Sphinx extension (`doc/source/_ext/llms_txt.py`, alongside
`callouts.py` / `queryparamrefs.py`) that generates
**navigation-structured** agent manifests instead of one flat list.

Three tiers, emitted into the HTML build output:

- **`/llms.txt`** — index: H1 + summary, one `## Section` per top-level
`toctree` entry of the root doc. Each section lists its landing page and
every in-scope page in the subtree beneath it as `- [title](url):
description`, deduped so a page appears only under the first section
that reaches it, so an agent can locate any page from the index without
drilling into the corpus. A page the nav toctrees never reach (an
example linked only from a gallery grid, say) folds into the section
owning its top-level directory; only pages whose directory maps to no
section land in a trailing `## Other pages`. Sections in
`llms_txt_optional_sections` move to a trailing `## Optional` block.
- **`/<section>/llms-full.txt`** — verbatim page source per section,
behind a `## Contents` TOC (which also surfaces deep pages absent from
the index). A section whose source exceeds
`llms_txt_full_max_shard_tokens` (default **200K**, ~4 chars/token) is
split recursively into per-subdirectory sub-shards, so each loadable
unit fits an agent's context budget.
- **`/llms-full.txt`** — a manifest linking every shard (sub-shards
nested under their parent), each with a description and page count, so
an agent routes without downloading.

Descriptions resolve from front-matter/docinfo `description` → an
`html_meta` / `.. meta::` node → a first-paragraph fallback.

## Why not a single `llms-full.txt`

Ray's full corpus is ~1.14M tokens — too large to load whole on most
models, and truncating it (what `sphinx-llms-txt`'s size knobs do) just
yields an arbitrary lossy prefix. Peer projects all ship a single flat
file and none cap; sharding by section keeps every unit independently
loadable.

### Note for existing `llms-full.txt` consumers

This changes what `/llms-full.txt` serves at a stable URL. Today it's
~5.9 MB of concatenated page text; after this it's a small manifest
linking the per-section shards. Anything pointed at that URL expecting
full text should follow the manifest to the shard it needs instead.

## Changes

- New `doc/source/_ext/llms_txt.py` + hermetic test
`doc/source/_ext/test_llms_txt.py`.
- `conf.py`: swap `sphinx_llms_txt` → `llms_txt`; add `llms_txt_title`,
`llms_txt_optional_sections`, `llms_txt_full_max_shard_tokens` (keeps
the existing `llms_txt_summary` / `llms_txt_exclude`).
- Remove `sphinx-llms-txt==0.7.1` from `requirements-doc.txt` and the
docs lock (`python/deplocks/docs/docbuild_depset_py3.11.lock`; clean
leaf removal — `raydepsets --check` consistent).
- New premerge step `doc: test llms.txt extension` in
`.buildkite/doc.rayci.yml` (runs in the `docbuild-py3.11` env, since the
test needs sphinx + myst).

## Forward-compatibility

Written for the in-flight Sphinx 8→9 upgrade: `findall` (not
`traverse`), `root_doc` (not `master_doc`), defensive `getattr` env
access, `docutils.nodes.meta`, and all work in `build-finished`
(parallel-safe).

## Testing

- `doc/source/_ext/test_llms_txt.py` — hermetic in-process Sphinx build
covering all three description sources, exclusion, the `## Optional`
section, sub-shard splitting, and the nested manifest. Passes on the
pinned stack (Sphinx 8.2.3 / MyST 5.1.0 / docutils 0.21.2).
- The full `-W` docs build validates end-to-end in CI here.

## Relationship to ray-project#64330

Independent of [ray-project#64330](ray-project#64330)
(which adds the per-page `<meta name="description">` descriptions) —
zero file overlap, mergeable in either order. Where a page has no
curated description yet, the generator uses its first paragraph, so
output is sensible regardless.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ay-project#65115)

## Summary

Completes the page-description work
[ray-project#64330](ray-project#64330) started, so that
**every page listed in `llms.txt` carries a curated description**.

ray-project#64330 (merged) described the 94 pages that made up the index when it
listed only each section's landing page plus its direct toctree
children. The generator in
[ray-project#64458](ray-project#64458) makes the index
complete — every in-scope page under its section — so the index now
carries ~630 entries, and the ~400 that ray-project#64330 didn't cover fall back to
a truncated first paragraph.

That fallback is often actively bad for an agent routing on it. Of the
397 undescribed pages:

| Fallback problem | Pages | Example |
|---|---:|---|
| No paragraph at all | 22 | `cluster/kubernetes/troubleshooting` |
| Pointer prose | 34 | `cluster/cli` → "This section contains commands
for managing Ray clusters." |
| Restates the title | 117 | every `ray-core/patterns/*` anti-pattern
page |
| Under 70 chars | 170 | `data/inspecting-data` → "Inspect Datasets to
better understand your data." |

## Changes

- **368 pages get a curated description**, following the convention
ray-project#64330 established: `myst: html_meta: description:` front matter for
`.md` (164 files), and a `.. meta::` directive for `.rst` (204 files).
The `.rst` block is placed after any leading docinfo field list
(`:orphan:` and friends) but **before** any `.. _label:` target, so the
label still resolves to the section title.
- **31 pages are excluded instead** (`conf.py`). These are thin
API-reference hub pages — a title plus an autosummary table, under 40
words of real prose — whose per-symbol targets are already excluded by
the existing `*/api/doc/*` patterns. Also `data/api/_autogen` (no title
at all) and two `*_regression_example` literalinclude stubs with zero
prose. A description on any of these could only restate its title.

Style follows the same house rule as ray-project#64330: 130–150 characters,
front-loading what distinguishes the page, no "Ray X is a…" restatement
of the link title. Mean length 122 chars, none over 160.

Substantial API-reference pages were **kept and described**, not
excluded — `tune/api/schedulers` (965 words of prose), `tune/api/env`,
`tune/api/trainable`, `serve/api/index`, `data/api/expressions` are
exactly what a coding agent wants.

**Result: 479 in-scope pages described, 31 excluded, 0 relying on
first-paragraph fallback.**

## Relationship to other PRs

Independent of **ray-project#64458** (the generator). Descriptions are page front
matter and work with the current third-party `sphinx-llms-txt` on master
as well as the in-repo generator. The one file both touch is
`doc/source/conf.py`: this PR appends a `llms_txt_exclude += [...]`
block below the existing list rather than editing the list literal,
which is what ray-project#64458 rewrites, so the two shouldn't collide. Either can
merge first.

Not a duplicate: `gh pr list --state open` finds no other PR adding page
descriptions or `html_meta` blocks. ray-project#64330, the only prior art, is
merged.

## Rebased on master

Merged master to clear a conflict. Two pages shifted:

- `cluster/kubernetes/user-guides/kuberay-history-server.md` no longer
appears in this diff. ray-project#65139 described that page independently while
this branch was open, and its description is the better one: this
branch's scoped the page to GKE and Google Cloud Storage, where master's
covers RayCluster, RayJob, and RayService, which is the page's actual
scope. Resolved in favor of master.
- `ray-observability/user-guides/jax-tpu-profiling.md` is newly
described. It landed on master after this branch was cut and was the one
in-scope page still falling back to a truncated first paragraph.

Net file count is 368 newly described pages plus `conf.py`, plus one
re-key:
`ray-core/scheduling/labels.md` carried a bare top-level `description:`
in its front matter, the only such file in the tree. Sphinx emits no
meta description from that key, so despite looking described the page
fed neither the HTML meta tag nor `llms.txt`. The text is unchanged;
only the key moves under `myst.html_meta`. That page was already counted
as described, so the totals above don't move.

## Testing

Local verification (no Ray build required — these are doc source edits):

```
$ python3 doc/test_no_new_rst.py                       # exit 0 (no new .rst files; all 204 are edits)
$ vale doc/source/data doc/source/ray-overview/examples
  174 alerts, 0 error-level, 0 on the added lines
  identical to the master baseline (174 alerts) — this change adds no Vale alerts
$ python3 -c "import ast; ast.parse(open('doc/source/conf.py').read())"   # conf.py parses
```

Plus scripted checks over all 370 changed files:

- All 164 `.md` front-matter blocks parse as YAML and expose
`myst.html_meta.description`.
- All 204 `.rst` files: `.. meta::` precedes any `.. _label:`, and any
docinfo field list still precedes the `.. meta::` block.
- Re-running the in-scope inventory: 510 pages, 479 described, 31
excluded, **0 gaps**.
- The 31 entries added to `llms_txt_exclude` match the computed exclude
set exactly.

The `-W` docs build is the real end-to-end gate and runs in CI here.

## AI assistance

Drafted with Claude Code: the descriptions were generated from each
page's title, headings, and lead prose, and applied by script. Per
`AGENTS.md`, this needs a human pass over the content before it's ready
for review — **opening as a draft for that reason**. The mechanical
placement is verified by the checks above; what needs human eyes is
whether each description is accurate and useful for its page.

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…project#64458)

## Summary

Replaces the third-party
[`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt) with a
small in-repo Sphinx extension (`doc/source/_ext/llms_txt.py`, alongside
`callouts.py` / `queryparamrefs.py`) that generates
**navigation-structured** agent manifests instead of one flat list.

Three tiers, emitted into the HTML build output:

- **`/llms.txt`** — index: H1 + summary, one `## Section` per top-level
`toctree` entry of the root doc. Each section lists its landing page and
every in-scope page in the subtree beneath it as `- [title](url):
description`, deduped so a page appears only under the first section
that reaches it, so an agent can locate any page from the index without
drilling into the corpus. A page the nav toctrees never reach (an
example linked only from a gallery grid, say) folds into the section
owning its top-level directory; only pages whose directory maps to no
section land in a trailing `## Other pages`. Sections in
`llms_txt_optional_sections` move to a trailing `## Optional` block.
- **`/<section>/llms-full.txt`** — verbatim page source per section,
behind a `## Contents` TOC (which also surfaces deep pages absent from
the index). A section whose source exceeds
`llms_txt_full_max_shard_tokens` (default **200K**, ~4 chars/token) is
split recursively into per-subdirectory sub-shards, so each loadable
unit fits an agent's context budget.
- **`/llms-full.txt`** — a manifest linking every shard (sub-shards
nested under their parent), each with a description and page count, so
an agent routes without downloading.

Descriptions resolve from front-matter/docinfo `description` → an
`html_meta` / `.. meta::` node → a first-paragraph fallback.

## Why not a single `llms-full.txt`

Ray's full corpus is ~1.14M tokens — too large to load whole on most
models, and truncating it (what `sphinx-llms-txt`'s size knobs do) just
yields an arbitrary lossy prefix. Peer projects all ship a single flat
file and none cap; sharding by section keeps every unit independently
loadable.

### Note for existing `llms-full.txt` consumers

This changes what `/llms-full.txt` serves at a stable URL. Today it's
~5.9 MB of concatenated page text; after this it's a small manifest
linking the per-section shards. Anything pointed at that URL expecting
full text should follow the manifest to the shard it needs instead.

## Changes

- New `doc/source/_ext/llms_txt.py` + hermetic test
`doc/source/_ext/test_llms_txt.py`.
- `conf.py`: swap `sphinx_llms_txt` → `llms_txt`; add `llms_txt_title`,
`llms_txt_optional_sections`, `llms_txt_full_max_shard_tokens` (keeps
the existing `llms_txt_summary` / `llms_txt_exclude`).
- Remove `sphinx-llms-txt==0.7.1` from `requirements-doc.txt` and the
docs lock (`python/deplocks/docs/docbuild_depset_py3.11.lock`; clean
leaf removal — `raydepsets --check` consistent).
- New premerge step `doc: test llms.txt extension` in
`.buildkite/doc.rayci.yml` (runs in the `docbuild-py3.11` env, since the
test needs sphinx + myst).

## Forward-compatibility

Written for the in-flight Sphinx 8→9 upgrade: `findall` (not
`traverse`), `root_doc` (not `master_doc`), defensive `getattr` env
access, `docutils.nodes.meta`, and all work in `build-finished`
(parallel-safe).

## Testing

- `doc/source/_ext/test_llms_txt.py` — hermetic in-process Sphinx build
covering all three description sources, exclusion, the `## Optional`
section, sub-shard splitting, and the nested manifest. Passes on the
pinned stack (Sphinx 8.2.3 / MyST 5.1.0 / docutils 0.21.2).
- The full `-W` docs build validates end-to-end in CI here.

## Relationship to ray-project#64330

Independent of [ray-project#64330](ray-project#64330)
(which adds the per-page `<meta name="description">` descriptions) —
zero file overlap, mergeable in either order. Where a page has no
curated description yet, the generator uses its first paragraph, so
output is sensible regardless.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants