Repository navigation
[doc] add sphinx-llms-txt to generate /llms.txt and /llms-full.txt - #63130
Conversation
Read the Docs serves /llms.txt and /llms-full.txt automatically from the default version's build output once those files are present, but Ray docs don't currently emit them. This adds the sphinx-llms-txt extension so they're generated at build time. Picked sphinx-llms-txt (jdillard/sphinx-llms-txt, MIT) as the lighter shipping path. Used by 30+ Python OSS projects including scrapy/scrapy, apache/hamilton, plone/documentation, pola-rs/polars-cloud-client, and NVIDIA-NeMo/Evaluator. Active maintenance: 11 releases in 2025, last commit March 2026, with external contributors merged from Google and NVIDIA. The heavier sibling NVIDIA/sphinx-llm (which also emits per-page markdown twins) is a possible follow-up if richer agent output becomes worthwhile; the two extensions are designed to be complementary, not competing. Once docs.ray.io's `latest` rebuilds, the following URLs go live: https://docs.ray.io/llms.txt https://docs.ray.io/llms-full.txt Three files changed: - doc/requirements-doc.txt: add sphinx-llms-txt==0.7.1 - doc/source/conf.py: add sphinx_llms_txt to extensions list - python/deplocks/docs/docbuild_depset_py3.10.lock: lock entry plus via-comment update on sphinx package The extension's only runtime dep is sphinx, already pinned in the lock. No transitive dependency chase needed. DOC-875 in anyscale/docs Jira tracking. Strategy context lives in anyscale/docs:strategy/ray-docs/agent-llm-assessment.md. Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request integrates the sphinx-llms-txt extension into the documentation build process by updating the requirements, configuration, and lock files. The reviewer suggests configuring the extension to limit its scope or exclude specific patterns to avoid generating excessively large and noisy output files. Additionally, it is recommended to consider setting the output format to Markdown for better utility with LLM agents.
| "sphinx.ext.intersphinx", | ||
| "sphinx_docsearch", | ||
| "sphinx_collections", | ||
| "sphinx_llms_txt", |
There was a problem hiding this comment.
For a documentation set as large as Ray's, the default output of sphinx-llms-txt may be extremely large and contain significant noise (e.g., thousands of auto-generated API reference pages). To improve the utility for LLM agents and avoid potential issues with massive text files, consider adding configuration to filter the scope (using llms_txt_scope or llms_txt_exclude_patterns) or specify a custom introduction. Additionally, consider setting llms_txt_full_format = 'md' if the extension supports it, as Markdown is generally preferred by LLM agents over reStructuredText for the full corpus.
Per review feedback on the initial sphinx-llms-txt addition, configure two settings to keep llms-full.txt useful for agentic consumption: 1. `llms_txt_summary`: explicit one-paragraph description so the summary header doesn't fall back to whatever the index page produces by default. 2. `llms_txt_exclude`: filter low-signal pages (search, genindex, 404, _TableOfContents) plus the auto-generated API reference directories. The autodoc-heavy paths mirror what's already in `remove_from_toctrees`. Without filtering, the per-method/class pages would dominate the corpus with autodoc boilerplate. Agents needing specific API details can still hit per-page markdown twins via Read the Docs' Markdown for Agents. Skipped a `llms_txt_full_max_size` cap for v1 — the aggressive excludes should keep the file modestly sized; we'll add a cap if observed line count is unwieldy. Skipped `llms_txt_title` since Ray's `project = "Ray"` already produces the right default. Further refinement of the exclude list, evaluation of Markdown output via an alternate Sphinx builder, and a possible follow-up adoption of NVIDIA/sphinx-llm for per-page Markdown twins are tracked in DOC-876. DOC-875. Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 7500a8d. Configure here.
| "train/api/doc/*", | ||
| "tune/api/doc/*", | ||
| "serve/api/doc/*", | ||
| "rllib/package_ref/*", |
There was a problem hiding this comment.
Glob pattern excludes wrong rllib pages from corpus
Medium Severity
The rllib/package_ref/* pattern in llms_txt_exclude uses fnmatch-style matching where * doesn't cross path separators. This excludes the content-rich landing pages directly under rllib/package_ref/ (e.g. algorithm.rst, callback.rst, index.rst) while failing to exclude the auto-generated per-class/method API pages in subdirectories (e.g. rllib/package_ref/algorithm/*, rllib/package_ref/policy/*). The remove_from_toctrees list it claims to mirror targets the opposite set of pages — the subdirectory children, not the parents.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7500a8d. Configure here.
Signed-off-by: Douglas Strodtman <[email protected]>
## Why After #63130 shipped, the generated `llms-full.txt` corpus is polluted by raw Jupyter notebook source. `sphinx-llms-txt` reads each docname's source from `_sources/` verbatim, so for the 127 `.ipynb` pages under `doc/source/` it appends the full notebook JSON (cells, outputs, embedded base64 images, metadata) into the file. That's the largest source of low-signal bytes in the corpus targeted at agents. ## What Append computed notebook docnames to the existing `llms_txt_exclude` list in `doc/source/conf.py`. `llms_txt_exclude` matches docnames (extension stripped) via `fnmatch.fnmatch` — see [`sphinx_llms_txt/collector.py`](https://github.com/jdillard/sphinx-llms-txt/blob/main/sphinx_llms_txt/collector.py). A pattern such as `**/*.ipynb` can't match because the docname carries no extension. The change enumerates `*.ipynb` files under the source directory at conf-load time and converts each path to its docname (relative to the source dir, suffix stripped, posix separators). Scope: - Affects only `llms.txt` / `llms-full.txt`. The Sphinx HTML build is governed by the separate `exclude_patterns` list (line 351 of `conf.py`), which is untouched. All 127 notebooks remain fully rendered on `docs.ray.io`. - Notebooks already in `exclude_patterns` (e.g. `serve/tutorials/video-analysis/*.ipynb`) aren't built, so adding their docnames to `llms_txt_exclude` is a harmless no-op. ## Verification After RtD builds the PR preview: - Fetch `llms-full.txt` from the PR build and confirm no `"cell_type": "code"` / `"output_type": "stream"` / base64 image data appears in the corpus. - Confirm `llms.txt` (the summary index) still resolves and looks sane. - Spot-check that a couple of notebook pages still render normally in the HTML preview. ## Context Tracked under [DOC-908]. Follow-up to #63130 (DOC-875). Part of [DOC-844] (Agent Ray docs umbrella). Tuning this list further (other low-signal page types) is deferred until the rebuilt corpus can be inspected directly. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…ay-project#63130) ## Why Read the Docs serves `/llms.txt` and `/llms-full.txt` automatically from the default version's build output once those files are present. Ray docs don't currently emit them, so `https://docs.ray.io/llms.txt` 404s. This is the largest remaining agent-facing gap on `docs.ray.io` per Anyscale's agent-friendliness assessment. ## What Adds the [`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt) extension so Sphinx generates `llms.txt` and `llms-full.txt` at build time. RtD then serves them at the domain root with no further config. Three files changed: - `doc/requirements-doc.txt`: add `sphinx-llms-txt==0.7.1`. - `doc/source/conf.py`: add `sphinx_llms_txt` to the `extensions` list. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus via-comment update on the `sphinx` package. The extension's only runtime dep is `sphinx`, already pinned, so no further transitives. ## Verification After this lands and `latest` rebuilds, the expected outcome: - `https://docs.ray.io/llms.txt` returns 200 with a markdown summary of the doc structure. - `https://docs.ray.io/llms-full.txt` returns 200 with the full corpus in reStructuredText. - Spot-check the generated `llms.txt` to confirm headers and links look sane. ## Extension diligence Picked `sphinx-llms-txt` (MIT) as the lighter shipping path. Active maintenance: 11 releases since May 2025, last commit March 2026. External contributors have landed PRs from Google (`kaycebasques`) and NVIDIA (`jacobtomlinson`). 30+ Python OSS projects use it including `scrapy/scrapy`, `apache/hamilton`, `plone/documentation`, `pola-rs/polars-cloud-client`, `NVIDIA-NeMo/Evaluator`, `wagtail/sphinx-wagtail-theme`, `requests-cache/requests-cache`, `pyrogram`. The heavier sibling [`NVIDIA/sphinx-llm`](https://github.com/NVIDIA/sphinx-llm) (Apache 2.0) also emits per-page markdown twins. The two extensions are designed to be complementary; we can adopt `sphinx-llm` later as a follow-up if per-page twins become worthwhile. ## Context Tracked under `DOC-875` in the anyscale/docs Jira (private). Part of a broader rebuild-free legacy-version fix sweep (`DOC-849`). Lives alongside the recent sphinx-sitemap fix in ray-project#63115. --------- Signed-off-by: Douglas Strodtman <[email protected]>
…ect#63228) ## Why After ray-project#63130 shipped, the generated `llms-full.txt` corpus is polluted by raw Jupyter notebook source. `sphinx-llms-txt` reads each docname's source from `_sources/` verbatim, so for the 127 `.ipynb` pages under `doc/source/` it appends the full notebook JSON (cells, outputs, embedded base64 images, metadata) into the file. That's the largest source of low-signal bytes in the corpus targeted at agents. ## What Append computed notebook docnames to the existing `llms_txt_exclude` list in `doc/source/conf.py`. `llms_txt_exclude` matches docnames (extension stripped) via `fnmatch.fnmatch` — see [`sphinx_llms_txt/collector.py`](https://github.com/jdillard/sphinx-llms-txt/blob/main/sphinx_llms_txt/collector.py). A pattern such as `**/*.ipynb` can't match because the docname carries no extension. The change enumerates `*.ipynb` files under the source directory at conf-load time and converts each path to its docname (relative to the source dir, suffix stripped, posix separators). Scope: - Affects only `llms.txt` / `llms-full.txt`. The Sphinx HTML build is governed by the separate `exclude_patterns` list (line 351 of `conf.py`), which is untouched. All 127 notebooks remain fully rendered on `docs.ray.io`. - Notebooks already in `exclude_patterns` (e.g. `serve/tutorials/video-analysis/*.ipynb`) aren't built, so adding their docnames to `llms_txt_exclude` is a harmless no-op. ## Verification After RtD builds the PR preview: - Fetch `llms-full.txt` from the PR build and confirm no `"cell_type": "code"` / `"output_type": "stream"` / base64 image data appears in the corpus. - Confirm `llms.txt` (the summary index) still resolves and looks sane. - Spot-check that a couple of notebook pages still render normally in the HTML preview. ## Context Tracked under [DOC-908]. Follow-up to ray-project#63130 (DOC-875). Part of [DOC-844] (Agent Ray docs umbrella). Tuning this list further (other low-signal page types) is deferred until the rebuilt corpus can be inspected directly. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
## Why Add `sphinxext-opengraph` — per-page Open Graph metadata. `ogp_site_url` is pinned to `html_baseurl` so the `og:url` tag stays aligned with Sphinx's `<link rel="canonical">`. Improves rich-link previews when docs pages get shared and tightens SEO signal. Low-effort additive change called out as a Bucket 1 quick win in the Anyscale docs team's agent-friendliness assessment. ## What - `doc/requirements-doc.txt`: add `sphinxext-opengraph==0.13.0`. - `doc/source/conf.py`: append `"sphinxext.opengraph"` to `extensions`; set `ogp_site_url = html_baseurl`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus via-comment addition on `sphinx` (the only runtime dep, already pinned, so no further transitives). Matches the manual-lock-edit pattern used in [#63130](#63130). ## Verification After this lands and `latest` rebuilds: - A representative doc page's `<head>` includes `<meta property="og:*">` tags reflecting page title, description, and the site URL. - No new warnings in the RtD build log (`fail_on_warning: true`). ## Extension diligence [`sphinxext-opengraph`](https://github.com/sphinx-doc/sphinxext-opengraph) — official `sphinx-doc` org project, BSD-2-Clause. Latest release 0.13.0 (March 2026). Pure-Python, depends only on Sphinx (already pinned to 7.3.7), no system-level requirements. ## What changed in the force-push This PR originally also bundled [`sphinx-notfound-page`](https://github.com/readthedocs/sphinx-notfound-page) to give the Ray docs a 404 page with absolute URLs. Dropped on 2026-05-15 because the RtD PR preview build surfaced a sitewide regression: 732 of 756 `<a class="reference internal">` sidebar hrefs were emitted with a `.//en/<ver>/...` prefix that doubles when the browser resolves them against the build's `/en/<ver>/` deploy path. Production docs.ray.io (which doesn't have the extension) was unaffected (0/747 hrefs). The cause is sphinx-notfound-page's `html-page-context` hook: it overrides `pathto`/`toctree` for **every** page in the build, prepending a URL prefix derived from `READTHEDOCS_CANONICAL_URL`. The extension docs imply this is "for the 404 page only," but the override fires on every page-context event. On a PR preview where the canonical URL differs from `html_baseurl`, this produces the doubled-prefix anti-pattern across the entire sidebar. The 404-page-with-absolute-URLs goal is tracked separately so it can be re-attempted with a config or extension that doesn't break sitewide navigation. Options to revisit: `notfound_urls_prefix = None`, a custom 404 template that bypasses the global `pathto` override, or `html_extra_path` with a static 404. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Pattern mirrors the merged [DOC-898](https://anyscale1.atlassian.net/browse/DOC-898) probe ([#63197](#63197)) and the obsolete-env-var removal in [#63196](#63196). Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` "Low effort" section. This is the bottom of a stacked series: 1. **#63343 — sphinxext-opengraph (this PR)** 2. [#63344](#63344) — pydata-sphinx-theme bump 3. [#63359](#63359) — notebook `language_info.name` fix 4. [#63360](#63360) — myst-nb 1.4.0 bump [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
## Why `tf-keras==2.20.0` is pinned in `doc/requirements-doc.txt` and was yanked from PyPI. The RtD build log on [#63344](#63344) surfaced the warning: ``` WARNING: The candidate selected for download or install is a yanked version: 'tf-keras' candidate (version 2.20.0 at https://files.pythonhosted.org/packages/50/9b/.../tf_keras-2.20.0-py3-none-any.whl) Reason for being yanked: <none given> ``` The warning doesn't fail the build today (`fail_on_warning: true` doesn't catch yank warnings), but a yanked version may be removed from the index in the future and break the lock. ## What Patch bump to the next non-yanked release: - `doc/requirements-doc.txt`: `tf-keras==2.20.0` → `tf-keras==2.20.1`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update the `tf-keras` entry with the 2.20.1 wheel and sdist hashes. 2.20.1 has identical `requires_dist` to 2.20.0 (`tensorflow<2.21,>=2.20`), so the existing `tensorflow==2.20.0` pin still satisfies the constraint and no transitive deps churn. Manual lock edit per the [#63130](#63130) pattern is appropriate here. The ML / `dl-cpu-requirements.txt` / `dl-gpu-requirements.txt` pins and the `doctest_depset` lockfile also reference 2.20.0; those are out of scope for this `doc`-tagged PR and can follow up separately. ## Verification RtD PR preview build with `fail_on_warning: true`. Confirm the yanked-version warning disappears and no new warnings appear. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Independent of the other open probes ([#63343](#63343), [#63344](#63344), [#63354](#63354)) — targets `master` directly. [DOC-941](https://anyscale1.atlassian.net/browse/DOC-941) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
## Why `myst-nb` is pinned at `1.0.0rc0` (a release candidate) in `doc/requirements-doc.txt`. Latest stable is `1.4.0` — four minor releases ahead. The `# Pin when new release is made` comment is stale: 1.0.0 shipped, and the project has moved on. Notebook parsing/output is downstream of `myst-nb`. Ray ships 127 Jupyter notebooks (`RUN_NOTEBOOKS=off` by default), parsed from stored cell outputs. The bump tests the parsing path against existing outputs without requiring re-execution. ## What - `doc/requirements-doc.txt`: `myst-nb==1.0.0rc0` → `myst-nb==1.4.0`. Drops the stale "pin when new release is made" comment. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update version + hashes for `myst-nb`. ## Lock-file scope myst-nb 1.4.0 declares more core dependencies than 1.0.0rc0 — `ipython`, `ipykernel`, `nbclient`, `pyyaml`, `typing-extensions`, `importlib-metadata`, and `sphinx>=5`. I verified that **all** of these are already present in `docbuild_depset_py3.10.lock` as transitives from other packages, so the hand-edit per the [#63130](#63130) pattern works here without regenerating the full lock. The lock's `# via` comments for those transitives don't yet include `myst-nb` as a source. Those comments are informational (they don't affect resolution), but `raydepsets --check` in CI will flag them if it cares about the discrepancy. If CI complains, the fix is either to update via-comments by hand or regenerate via: ```bash bazelisk run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/docs.depsets.yaml ``` ## Validation surface - RtD PR preview build with `fail_on_warning: true`. Build must succeed. - Spot check a notebook-rendered page (e.g., Tune tutorials, RLlib examples). - Look for new warnings in build logs. ## Risks - 1.0 → 1.4 may have changed default output rendering for some MIME types. The `nb_mime_priority_overrides` and `nb_execution_mode = "off"` settings in `conf.py` should still apply but warrant a visual check. - Migrations between rc and stable can be sensitive on edge cases. - The cell-id `MissingIDFieldWarning` ([DOC-944](https://anyscale1.atlassian.net/browse/DOC-944)) may escalate to a hard error under stricter validation in 1.4.0. The strict `language_info.name` error is fixed below in the stack ([#63359](#63359)). ## Stack This PR is stacked on: 1. [#63343](#63343) — [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) (additive extensions) 2. [#63344](#63344) — [DOC-934](https://anyscale1.atlassian.net/browse/DOC-934) (pydata-sphinx-theme bump) 3. [#63359](#63359) — [DOC-942](https://anyscale1.atlassian.net/browse/DOC-942) (notebook `language_info.name` fix) Base is `master` per the team's fork-stack convention; the diff temporarily includes the lower PRs and shrinks as they merge. The CI signal for this PR validates the combined state of the four changes. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` and `config-deep-dive.md`. [DOC-935](https://anyscale1.atlassian.net/browse/DOC-935) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
## Why Add `sphinxext-opengraph` — per-page Open Graph metadata. `ogp_site_url` is pinned to `html_baseurl` so the `og:url` tag stays aligned with Sphinx's `<link rel="canonical">`. Improves rich-link previews when docs pages get shared and tightens SEO signal. Low-effort additive change called out as a Bucket 1 quick win in the Anyscale docs team's agent-friendliness assessment. ## What - `doc/requirements-doc.txt`: add `sphinxext-opengraph==0.13.0`. - `doc/source/conf.py`: append `"sphinxext.opengraph"` to `extensions`; set `ogp_site_url = html_baseurl`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus via-comment addition on `sphinx` (the only runtime dep, already pinned, so no further transitives). Matches the manual-lock-edit pattern used in [ray-project#63130](ray-project#63130). ## Verification After this lands and `latest` rebuilds: - A representative doc page's `<head>` includes `<meta property="og:*">` tags reflecting page title, description, and the site URL. - No new warnings in the RtD build log (`fail_on_warning: true`). ## Extension diligence [`sphinxext-opengraph`](https://github.com/sphinx-doc/sphinxext-opengraph) — official `sphinx-doc` org project, BSD-2-Clause. Latest release 0.13.0 (March 2026). Pure-Python, depends only on Sphinx (already pinned to 7.3.7), no system-level requirements. ## What changed in the force-push This PR originally also bundled [`sphinx-notfound-page`](https://github.com/readthedocs/sphinx-notfound-page) to give the Ray docs a 404 page with absolute URLs. Dropped on 2026-05-15 because the RtD PR preview build surfaced a sitewide regression: 732 of 756 `<a class="reference internal">` sidebar hrefs were emitted with a `.//en/<ver>/...` prefix that doubles when the browser resolves them against the build's `/en/<ver>/` deploy path. Production docs.ray.io (which doesn't have the extension) was unaffected (0/747 hrefs). The cause is sphinx-notfound-page's `html-page-context` hook: it overrides `pathto`/`toctree` for **every** page in the build, prepending a URL prefix derived from `READTHEDOCS_CANONICAL_URL`. The extension docs imply this is "for the 404 page only," but the override fires on every page-context event. On a PR preview where the canonical URL differs from `html_baseurl`, this produces the doubled-prefix anti-pattern across the entire sidebar. The 404-page-with-absolute-URLs goal is tracked separately so it can be re-attempted with a config or extension that doesn't break sitewide navigation. Options to revisit: `notfound_urls_prefix = None`, a custom 404 template that bypasses the global `pathto` override, or `html_extra_path` with a static 404. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Pattern mirrors the merged [DOC-898](https://anyscale1.atlassian.net/browse/DOC-898) probe ([ray-project#63197](ray-project#63197)) and the obsolete-env-var removal in [ray-project#63196](ray-project#63196). Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` "Low effort" section. This is the bottom of a stacked series: 1. **ray-project#63343 — sphinxext-opengraph (this PR)** 2. [ray-project#63344](ray-project#63344) — pydata-sphinx-theme bump 3. [ray-project#63359](ray-project#63359) — notebook `language_info.name` fix 4. [ray-project#63360](ray-project#63360) — myst-nb 1.4.0 bump [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: phattruong <[email protected]>
## Why `tf-keras==2.20.0` is pinned in `doc/requirements-doc.txt` and was yanked from PyPI. The RtD build log on [ray-project#63344](ray-project#63344) surfaced the warning: ``` WARNING: The candidate selected for download or install is a yanked version: 'tf-keras' candidate (version 2.20.0 at https://files.pythonhosted.org/packages/50/9b/.../tf_keras-2.20.0-py3-none-any.whl) Reason for being yanked: <none given> ``` The warning doesn't fail the build today (`fail_on_warning: true` doesn't catch yank warnings), but a yanked version may be removed from the index in the future and break the lock. ## What Patch bump to the next non-yanked release: - `doc/requirements-doc.txt`: `tf-keras==2.20.0` → `tf-keras==2.20.1`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update the `tf-keras` entry with the 2.20.1 wheel and sdist hashes. 2.20.1 has identical `requires_dist` to 2.20.0 (`tensorflow<2.21,>=2.20`), so the existing `tensorflow==2.20.0` pin still satisfies the constraint and no transitive deps churn. Manual lock edit per the [ray-project#63130](ray-project#63130) pattern is appropriate here. The ML / `dl-cpu-requirements.txt` / `dl-gpu-requirements.txt` pins and the `doctest_depset` lockfile also reference 2.20.0; those are out of scope for this `doc`-tagged PR and can follow up separately. ## Verification RtD PR preview build with `fail_on_warning: true`. Confirm the yanked-version warning disappears and no new warnings appear. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Independent of the other open probes ([ray-project#63343](ray-project#63343), [ray-project#63344](ray-project#63344), [ray-project#63354](ray-project#63354)) — targets `master` directly. [DOC-941](https://anyscale1.atlassian.net/browse/DOC-941) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: phattruong <[email protected]>
## Why `myst-nb` is pinned at `1.0.0rc0` (a release candidate) in `doc/requirements-doc.txt`. Latest stable is `1.4.0` — four minor releases ahead. The `# Pin when new release is made` comment is stale: 1.0.0 shipped, and the project has moved on. Notebook parsing/output is downstream of `myst-nb`. Ray ships 127 Jupyter notebooks (`RUN_NOTEBOOKS=off` by default), parsed from stored cell outputs. The bump tests the parsing path against existing outputs without requiring re-execution. ## What - `doc/requirements-doc.txt`: `myst-nb==1.0.0rc0` → `myst-nb==1.4.0`. Drops the stale "pin when new release is made" comment. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update version + hashes for `myst-nb`. ## Lock-file scope myst-nb 1.4.0 declares more core dependencies than 1.0.0rc0 — `ipython`, `ipykernel`, `nbclient`, `pyyaml`, `typing-extensions`, `importlib-metadata`, and `sphinx>=5`. I verified that **all** of these are already present in `docbuild_depset_py3.10.lock` as transitives from other packages, so the hand-edit per the [ray-project#63130](ray-project#63130) pattern works here without regenerating the full lock. The lock's `# via` comments for those transitives don't yet include `myst-nb` as a source. Those comments are informational (they don't affect resolution), but `raydepsets --check` in CI will flag them if it cares about the discrepancy. If CI complains, the fix is either to update via-comments by hand or regenerate via: ```bash bazelisk run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/docs.depsets.yaml ``` ## Validation surface - RtD PR preview build with `fail_on_warning: true`. Build must succeed. - Spot check a notebook-rendered page (e.g., Tune tutorials, RLlib examples). - Look for new warnings in build logs. ## Risks - 1.0 → 1.4 may have changed default output rendering for some MIME types. The `nb_mime_priority_overrides` and `nb_execution_mode = "off"` settings in `conf.py` should still apply but warrant a visual check. - Migrations between rc and stable can be sensitive on edge cases. - The cell-id `MissingIDFieldWarning` ([DOC-944](https://anyscale1.atlassian.net/browse/DOC-944)) may escalate to a hard error under stricter validation in 1.4.0. The strict `language_info.name` error is fixed below in the stack ([ray-project#63359](ray-project#63359)). ## Stack This PR is stacked on: 1. [ray-project#63343](ray-project#63343) — [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) (additive extensions) 2. [ray-project#63344](ray-project#63344) — [DOC-934](https://anyscale1.atlassian.net/browse/DOC-934) (pydata-sphinx-theme bump) 3. [ray-project#63359](ray-project#63359) — [DOC-942](https://anyscale1.atlassian.net/browse/DOC-942) (notebook `language_info.name` fix) Base is `master` per the team's fork-stack convention; the diff temporarily includes the lower PRs and shrinks as they merge. The CI signal for this PR validates the combined state of the four changes. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` and `config-deep-dive.md`. [DOC-935](https://anyscale1.atlassian.net/browse/DOC-935) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: phattruong <[email protected]>
…ay-project#63130) ## Why Read the Docs serves `/llms.txt` and `/llms-full.txt` automatically from the default version's build output once those files are present. Ray docs don't currently emit them, so `https://docs.ray.io/llms.txt` 404s. This is the largest remaining agent-facing gap on `docs.ray.io` per Anyscale's agent-friendliness assessment. ## What Adds the [`sphinx-llms-txt`](https://github.com/jdillard/sphinx-llms-txt) extension so Sphinx generates `llms.txt` and `llms-full.txt` at build time. RtD then serves them at the domain root with no further config. Three files changed: - `doc/requirements-doc.txt`: add `sphinx-llms-txt==0.7.1`. - `doc/source/conf.py`: add `sphinx_llms_txt` to the `extensions` list. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus via-comment update on the `sphinx` package. The extension's only runtime dep is `sphinx`, already pinned, so no further transitives. ## Verification After this lands and `latest` rebuilds, the expected outcome: - `https://docs.ray.io/llms.txt` returns 200 with a markdown summary of the doc structure. - `https://docs.ray.io/llms-full.txt` returns 200 with the full corpus in reStructuredText. - Spot-check the generated `llms.txt` to confirm headers and links look sane. ## Extension diligence Picked `sphinx-llms-txt` (MIT) as the lighter shipping path. Active maintenance: 11 releases since May 2025, last commit March 2026. External contributors have landed PRs from Google (`kaycebasques`) and NVIDIA (`jacobtomlinson`). 30+ Python OSS projects use it including `scrapy/scrapy`, `apache/hamilton`, `plone/documentation`, `pola-rs/polars-cloud-client`, `NVIDIA-NeMo/Evaluator`, `wagtail/sphinx-wagtail-theme`, `requests-cache/requests-cache`, `pyrogram`. The heavier sibling [`NVIDIA/sphinx-llm`](https://github.com/NVIDIA/sphinx-llm) (Apache 2.0) also emits per-page markdown twins. The two extensions are designed to be complementary; we can adopt `sphinx-llm` later as a follow-up if per-page twins become worthwhile. ## Context Tracked under `DOC-875` in the anyscale/docs Jira (private). Part of a broader rebuild-free legacy-version fix sweep (`DOC-849`). Lives alongside the recent sphinx-sitemap fix in ray-project#63115. --------- Signed-off-by: Douglas Strodtman <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
…ect#63228) ## Why After ray-project#63130 shipped, the generated `llms-full.txt` corpus is polluted by raw Jupyter notebook source. `sphinx-llms-txt` reads each docname's source from `_sources/` verbatim, so for the 127 `.ipynb` pages under `doc/source/` it appends the full notebook JSON (cells, outputs, embedded base64 images, metadata) into the file. That's the largest source of low-signal bytes in the corpus targeted at agents. ## What Append computed notebook docnames to the existing `llms_txt_exclude` list in `doc/source/conf.py`. `llms_txt_exclude` matches docnames (extension stripped) via `fnmatch.fnmatch` — see [`sphinx_llms_txt/collector.py`](https://github.com/jdillard/sphinx-llms-txt/blob/main/sphinx_llms_txt/collector.py). A pattern such as `**/*.ipynb` can't match because the docname carries no extension. The change enumerates `*.ipynb` files under the source directory at conf-load time and converts each path to its docname (relative to the source dir, suffix stripped, posix separators). Scope: - Affects only `llms.txt` / `llms-full.txt`. The Sphinx HTML build is governed by the separate `exclude_patterns` list (line 351 of `conf.py`), which is untouched. All 127 notebooks remain fully rendered on `docs.ray.io`. - Notebooks already in `exclude_patterns` (e.g. `serve/tutorials/video-analysis/*.ipynb`) aren't built, so adding their docnames to `llms_txt_exclude` is a harmless no-op. ## Verification After RtD builds the PR preview: - Fetch `llms-full.txt` from the PR build and confirm no `"cell_type": "code"` / `"output_type": "stream"` / base64 image data appears in the corpus. - Confirm `llms.txt` (the summary index) still resolves and looks sane. - Spot-check that a couple of notebook pages still render normally in the HTML preview. ## Context Tracked under [DOC-908]. Follow-up to ray-project#63130 (DOC-875). Part of [DOC-844] (Agent Ray docs umbrella). Tuning this list further (other low-signal page types) is deferred until the rebuilt corpus can be inspected directly. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
## Why Add `sphinxext-opengraph` — per-page Open Graph metadata. `ogp_site_url` is pinned to `html_baseurl` so the `og:url` tag stays aligned with Sphinx's `<link rel="canonical">`. Improves rich-link previews when docs pages get shared and tightens SEO signal. Low-effort additive change called out as a Bucket 1 quick win in the Anyscale docs team's agent-friendliness assessment. ## What - `doc/requirements-doc.txt`: add `sphinxext-opengraph==0.13.0`. - `doc/source/conf.py`: append `"sphinxext.opengraph"` to `extensions`; set `ogp_site_url = html_baseurl`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus via-comment addition on `sphinx` (the only runtime dep, already pinned, so no further transitives). Matches the manual-lock-edit pattern used in [ray-project#63130](ray-project#63130). ## Verification After this lands and `latest` rebuilds: - A representative doc page's `<head>` includes `<meta property="og:*">` tags reflecting page title, description, and the site URL. - No new warnings in the RtD build log (`fail_on_warning: true`). ## Extension diligence [`sphinxext-opengraph`](https://github.com/sphinx-doc/sphinxext-opengraph) — official `sphinx-doc` org project, BSD-2-Clause. Latest release 0.13.0 (March 2026). Pure-Python, depends only on Sphinx (already pinned to 7.3.7), no system-level requirements. ## What changed in the force-push This PR originally also bundled [`sphinx-notfound-page`](https://github.com/readthedocs/sphinx-notfound-page) to give the Ray docs a 404 page with absolute URLs. Dropped on 2026-05-15 because the RtD PR preview build surfaced a sitewide regression: 732 of 756 `<a class="reference internal">` sidebar hrefs were emitted with a `.//en/<ver>/...` prefix that doubles when the browser resolves them against the build's `/en/<ver>/` deploy path. Production docs.ray.io (which doesn't have the extension) was unaffected (0/747 hrefs). The cause is sphinx-notfound-page's `html-page-context` hook: it overrides `pathto`/`toctree` for **every** page in the build, prepending a URL prefix derived from `READTHEDOCS_CANONICAL_URL`. The extension docs imply this is "for the 404 page only," but the override fires on every page-context event. On a PR preview where the canonical URL differs from `html_baseurl`, this produces the doubled-prefix anti-pattern across the entire sidebar. The 404-page-with-absolute-URLs goal is tracked separately so it can be re-attempted with a config or extension that doesn't break sitewide navigation. Options to revisit: `notfound_urls_prefix = None`, a custom 404 template that bypasses the global `pathto` override, or `html_extra_path` with a static 404. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Pattern mirrors the merged [DOC-898](https://anyscale1.atlassian.net/browse/DOC-898) probe ([ray-project#63197](ray-project#63197)) and the obsolete-env-var removal in [ray-project#63196](ray-project#63196). Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` "Low effort" section. This is the bottom of a stacked series: 1. **ray-project#63343 — sphinxext-opengraph (this PR)** 2. [ray-project#63344](ray-project#63344) — pydata-sphinx-theme bump 3. [ray-project#63359](ray-project#63359) — notebook `language_info.name` fix 4. [ray-project#63360](ray-project#63360) — myst-nb 1.4.0 bump [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
## Why `tf-keras==2.20.0` is pinned in `doc/requirements-doc.txt` and was yanked from PyPI. The RtD build log on [ray-project#63344](ray-project#63344) surfaced the warning: ``` WARNING: The candidate selected for download or install is a yanked version: 'tf-keras' candidate (version 2.20.0 at https://files.pythonhosted.org/packages/50/9b/.../tf_keras-2.20.0-py3-none-any.whl) Reason for being yanked: <none given> ``` The warning doesn't fail the build today (`fail_on_warning: true` doesn't catch yank warnings), but a yanked version may be removed from the index in the future and break the lock. ## What Patch bump to the next non-yanked release: - `doc/requirements-doc.txt`: `tf-keras==2.20.0` → `tf-keras==2.20.1`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update the `tf-keras` entry with the 2.20.1 wheel and sdist hashes. 2.20.1 has identical `requires_dist` to 2.20.0 (`tensorflow<2.21,>=2.20`), so the existing `tensorflow==2.20.0` pin still satisfies the constraint and no transitive deps churn. Manual lock edit per the [ray-project#63130](ray-project#63130) pattern is appropriate here. The ML / `dl-cpu-requirements.txt` / `dl-gpu-requirements.txt` pins and the `doctest_depset` lockfile also reference 2.20.0; those are out of scope for this `doc`-tagged PR and can follow up separately. ## Verification RtD PR preview build with `fail_on_warning: true`. Confirm the yanked-version warning disappears and no new warnings appear. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Independent of the other open probes ([ray-project#63343](ray-project#63343), [ray-project#63344](ray-project#63344), [ray-project#63354](ray-project#63354)) — targets `master` directly. [DOC-941](https://anyscale1.atlassian.net/browse/DOC-941) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
## Why `myst-nb` is pinned at `1.0.0rc0` (a release candidate) in `doc/requirements-doc.txt`. Latest stable is `1.4.0` — four minor releases ahead. The `# Pin when new release is made` comment is stale: 1.0.0 shipped, and the project has moved on. Notebook parsing/output is downstream of `myst-nb`. Ray ships 127 Jupyter notebooks (`RUN_NOTEBOOKS=off` by default), parsed from stored cell outputs. The bump tests the parsing path against existing outputs without requiring re-execution. ## What - `doc/requirements-doc.txt`: `myst-nb==1.0.0rc0` → `myst-nb==1.4.0`. Drops the stale "pin when new release is made" comment. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update version + hashes for `myst-nb`. ## Lock-file scope myst-nb 1.4.0 declares more core dependencies than 1.0.0rc0 — `ipython`, `ipykernel`, `nbclient`, `pyyaml`, `typing-extensions`, `importlib-metadata`, and `sphinx>=5`. I verified that **all** of these are already present in `docbuild_depset_py3.10.lock` as transitives from other packages, so the hand-edit per the [ray-project#63130](ray-project#63130) pattern works here without regenerating the full lock. The lock's `# via` comments for those transitives don't yet include `myst-nb` as a source. Those comments are informational (they don't affect resolution), but `raydepsets --check` in CI will flag them if it cares about the discrepancy. If CI complains, the fix is either to update via-comments by hand or regenerate via: ```bash bazelisk run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/docs.depsets.yaml ``` ## Validation surface - RtD PR preview build with `fail_on_warning: true`. Build must succeed. - Spot check a notebook-rendered page (e.g., Tune tutorials, RLlib examples). - Look for new warnings in build logs. ## Risks - 1.0 → 1.4 may have changed default output rendering for some MIME types. The `nb_mime_priority_overrides` and `nb_execution_mode = "off"` settings in `conf.py` should still apply but warrant a visual check. - Migrations between rc and stable can be sensitive on edge cases. - The cell-id `MissingIDFieldWarning` ([DOC-944](https://anyscale1.atlassian.net/browse/DOC-944)) may escalate to a hard error under stricter validation in 1.4.0. The strict `language_info.name` error is fixed below in the stack ([ray-project#63359](ray-project#63359)). ## Stack This PR is stacked on: 1. [ray-project#63343](ray-project#63343) — [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) (additive extensions) 2. [ray-project#63344](ray-project#63344) — [DOC-934](https://anyscale1.atlassian.net/browse/DOC-934) (pydata-sphinx-theme bump) 3. [ray-project#63359](ray-project#63359) — [DOC-942](https://anyscale1.atlassian.net/browse/DOC-942) (notebook `language_info.name` fix) Base is `master` per the team's fork-stack convention; the diff temporarily includes the lower PRs and shrinks as they merge. The CI signal for this PR validates the combined state of the four changes. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` and `config-deep-dive.md`. [DOC-935](https://anyscale1.atlassian.net/browse/DOC-935) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
## Why Add `sphinxext-opengraph` — per-page Open Graph metadata. `ogp_site_url` is pinned to `html_baseurl` so the `og:url` tag stays aligned with Sphinx's `<link rel="canonical">`. Improves rich-link previews when docs pages get shared and tightens SEO signal. Low-effort additive change called out as a Bucket 1 quick win in the Anyscale docs team's agent-friendliness assessment. ## What - `doc/requirements-doc.txt`: add `sphinxext-opengraph==0.13.0`. - `doc/source/conf.py`: append `"sphinxext.opengraph"` to `extensions`; set `ogp_site_url = html_baseurl`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: package entry plus via-comment addition on `sphinx` (the only runtime dep, already pinned, so no further transitives). Matches the manual-lock-edit pattern used in [ray-project#63130](ray-project#63130). ## Verification After this lands and `latest` rebuilds: - A representative doc page's `<head>` includes `<meta property="og:*">` tags reflecting page title, description, and the site URL. - No new warnings in the RtD build log (`fail_on_warning: true`). ## Extension diligence [`sphinxext-opengraph`](https://github.com/sphinx-doc/sphinxext-opengraph) — official `sphinx-doc` org project, BSD-2-Clause. Latest release 0.13.0 (March 2026). Pure-Python, depends only on Sphinx (already pinned to 7.3.7), no system-level requirements. ## What changed in the force-push This PR originally also bundled [`sphinx-notfound-page`](https://github.com/readthedocs/sphinx-notfound-page) to give the Ray docs a 404 page with absolute URLs. Dropped on 2026-05-15 because the RtD PR preview build surfaced a sitewide regression: 732 of 756 `<a class="reference internal">` sidebar hrefs were emitted with a `.//en/<ver>/...` prefix that doubles when the browser resolves them against the build's `/en/<ver>/` deploy path. Production docs.ray.io (which doesn't have the extension) was unaffected (0/747 hrefs). The cause is sphinx-notfound-page's `html-page-context` hook: it overrides `pathto`/`toctree` for **every** page in the build, prepending a URL prefix derived from `READTHEDOCS_CANONICAL_URL`. The extension docs imply this is "for the 404 page only," but the override fires on every page-context event. On a PR preview where the canonical URL differs from `html_baseurl`, this produces the doubled-prefix anti-pattern across the entire sidebar. The 404-page-with-absolute-URLs goal is tracked separately so it can be re-attempted with a config or extension that doesn't break sitewide navigation. Options to revisit: `notfound_urls_prefix = None`, a custom 404 template that bypasses the global `pathto` override, or `html_extra_path` with a static 404. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Pattern mirrors the merged [DOC-898](https://anyscale1.atlassian.net/browse/DOC-898) probe ([ray-project#63197](ray-project#63197)) and the obsolete-env-var removal in [ray-project#63196](ray-project#63196). Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` "Low effort" section. This is the bottom of a stacked series: 1. **ray-project#63343 — sphinxext-opengraph (this PR)** 2. [ray-project#63344](ray-project#63344) — pydata-sphinx-theme bump 3. [ray-project#63359](ray-project#63359) — notebook `language_info.name` fix 4. [ray-project#63360](ray-project#63360) — myst-nb 1.4.0 bump [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
## Why `tf-keras==2.20.0` is pinned in `doc/requirements-doc.txt` and was yanked from PyPI. The RtD build log on [ray-project#63344](ray-project#63344) surfaced the warning: ``` WARNING: The candidate selected for download or install is a yanked version: 'tf-keras' candidate (version 2.20.0 at https://files.pythonhosted.org/packages/50/9b/.../tf_keras-2.20.0-py3-none-any.whl) Reason for being yanked: <none given> ``` The warning doesn't fail the build today (`fail_on_warning: true` doesn't catch yank warnings), but a yanked version may be removed from the index in the future and break the lock. ## What Patch bump to the next non-yanked release: - `doc/requirements-doc.txt`: `tf-keras==2.20.0` → `tf-keras==2.20.1`. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update the `tf-keras` entry with the 2.20.1 wheel and sdist hashes. 2.20.1 has identical `requires_dist` to 2.20.0 (`tensorflow<2.21,>=2.20`), so the existing `tensorflow==2.20.0` pin still satisfies the constraint and no transitive deps churn. Manual lock edit per the [ray-project#63130](ray-project#63130) pattern is appropriate here. The ML / `dl-cpu-requirements.txt` / `dl-gpu-requirements.txt` pins and the `doctest_depset` lockfile also reference 2.20.0; those are out of scope for this `doc`-tagged PR and can follow up separately. ## Verification RtD PR preview build with `fail_on_warning: true`. Confirm the yanked-version warning disappears and no new warnings appear. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Independent of the other open probes ([ray-project#63343](ray-project#63343), [ray-project#63344](ray-project#63344), [ray-project#63354](ray-project#63354)) — targets `master` directly. [DOC-941](https://anyscale1.atlassian.net/browse/DOC-941) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
## Why `myst-nb` is pinned at `1.0.0rc0` (a release candidate) in `doc/requirements-doc.txt`. Latest stable is `1.4.0` — four minor releases ahead. The `# Pin when new release is made` comment is stale: 1.0.0 shipped, and the project has moved on. Notebook parsing/output is downstream of `myst-nb`. Ray ships 127 Jupyter notebooks (`RUN_NOTEBOOKS=off` by default), parsed from stored cell outputs. The bump tests the parsing path against existing outputs without requiring re-execution. ## What - `doc/requirements-doc.txt`: `myst-nb==1.0.0rc0` → `myst-nb==1.4.0`. Drops the stale "pin when new release is made" comment. - `python/deplocks/docs/docbuild_depset_py3.10.lock`: update version + hashes for `myst-nb`. ## Lock-file scope myst-nb 1.4.0 declares more core dependencies than 1.0.0rc0 — `ipython`, `ipykernel`, `nbclient`, `pyyaml`, `typing-extensions`, `importlib-metadata`, and `sphinx>=5`. I verified that **all** of these are already present in `docbuild_depset_py3.10.lock` as transitives from other packages, so the hand-edit per the [ray-project#63130](ray-project#63130) pattern works here without regenerating the full lock. The lock's `# via` comments for those transitives don't yet include `myst-nb` as a source. Those comments are informational (they don't affect resolution), but `raydepsets --check` in CI will flag them if it cares about the discrepancy. If CI complains, the fix is either to update via-comments by hand or regenerate via: ```bash bazelisk run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/docs.depsets.yaml ``` ## Validation surface - RtD PR preview build with `fail_on_warning: true`. Build must succeed. - Spot check a notebook-rendered page (e.g., Tune tutorials, RLlib examples). - Look for new warnings in build logs. ## Risks - 1.0 → 1.4 may have changed default output rendering for some MIME types. The `nb_mime_priority_overrides` and `nb_execution_mode = "off"` settings in `conf.py` should still apply but warrant a visual check. - Migrations between rc and stable can be sensitive on edge cases. - The cell-id `MissingIDFieldWarning` ([DOC-944](https://anyscale1.atlassian.net/browse/DOC-944)) may escalate to a hard error under stricter validation in 1.4.0. The strict `language_info.name` error is fixed below in the stack ([ray-project#63359](ray-project#63359)). ## Stack This PR is stacked on: 1. [ray-project#63343](ray-project#63343) — [DOC-933](https://anyscale1.atlassian.net/browse/DOC-933) (additive extensions) 2. [ray-project#63344](ray-project#63344) — [DOC-934](https://anyscale1.atlassian.net/browse/DOC-934) (pydata-sphinx-theme bump) 3. [ray-project#63359](ray-project#63359) — [DOC-942](https://anyscale1.atlassian.net/browse/DOC-942) (notebook `language_info.name` fix) Base is `master` per the team's fork-stack convention; the diff temporarily includes the lower PRs and shrinks as they merge. The CI signal for this PR validates the combined state of the four changes. ## Context Part of the [DOC-932](https://anyscale1.atlassian.net/browse/DOC-932) campaign: Ray docs dependency upgrades. Strategy context: `anyscale/docs:strategy/ray-docs/sphinx-rtd-viability.md` and `config-deep-dive.md`. [DOC-935](https://anyscale1.atlassian.net/browse/DOC-935) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>


Why
Read the Docs serves
/llms.txtand/llms-full.txtautomatically from the default version's build output once those files are present. Ray docs don't currently emit them, sohttps://docs.ray.io/llms.txt404s. This is the largest remaining agent-facing gap ondocs.ray.ioper Anyscale's agent-friendliness assessment.What
Adds the
sphinx-llms-txtextension so Sphinx generatesllms.txtandllms-full.txtat build time. RtD then serves them at the domain root with no further config.Three files changed:
doc/requirements-doc.txt: addsphinx-llms-txt==0.7.1.doc/source/conf.py: addsphinx_llms_txtto theextensionslist.python/deplocks/docs/docbuild_depset_py3.10.lock: package entry plus via-comment update on thesphinxpackage. The extension's only runtime dep issphinx, already pinned, so no further transitives.Verification
After this lands and
latestrebuilds, the expected outcome:https://docs.ray.io/llms.txtreturns 200 with a markdown summary of the doc structure.https://docs.ray.io/llms-full.txtreturns 200 with the full corpus in reStructuredText.llms.txtto confirm headers and links look sane.Extension diligence
Picked
sphinx-llms-txt(MIT) as the lighter shipping path. Active maintenance: 11 releases since May 2025, last commit March 2026. External contributors have landed PRs from Google (kaycebasques) and NVIDIA (jacobtomlinson). 30+ Python OSS projects use it includingscrapy/scrapy,apache/hamilton,plone/documentation,pola-rs/polars-cloud-client,NVIDIA-NeMo/Evaluator,wagtail/sphinx-wagtail-theme,requests-cache/requests-cache,pyrogram.The heavier sibling
NVIDIA/sphinx-llm(Apache 2.0) also emits per-page markdown twins. The two extensions are designed to be complementary; we can adoptsphinx-llmlater as a follow-up if per-page twins become worthwhile.Context
Tracked under
DOC-875in the anyscale/docs Jira (private). Part of a broader rebuild-free legacy-version fix sweep (DOC-849). Lives alongside the recent sphinx-sitemap fix in #63115.