Skip to content

[doc][serve] Seed the Ray Serve Vale term library (warn-first, not yet enforced) - #67018

Draft
dstrodtman wants to merge 1 commit into
masterfrom
doc-1547-serve-vale-terms
Draft

dstrodtman wants to merge 1 commit into
masterfrom
doc-1547-serve-vale-terms

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

This PR adds Vale terminology rules for Ray Serve docs ahead of a style pass over those pages. It follows the pattern from #65239 (KubeRay), #66236 (RLlib), #66640 (Ray Core), and #66885 (Ray Train). Every rule is warn-level and doesn't run in CI yet. Registering the config lets contributors run vale doc/source/serve/ by hand during the style pass.

What's here

  • .vale/styles/Serve/Terms.yml: case-sensitive substitution swaps at level: warning, each safe to apply without judgment, so the file sets action: replace:
    • Ray serve and RayServe become Ray Serve. KubeRay's style carries the same swap, but both styles are path-scoped, so they never fire on the same page.
    • Serve app becomes Serve application, the name serve/key-concepts.md gives the unit of upgrade.
    • kv cache, kv-cache, and KV Cache become KV cache.
    • prefill/decode disaggregation becomes prefill-decode disaggregation. The hyphenated form is the majority in Serve docs, 20 to 12, and it's what the LLM landing page, the architecture page title, and the serving-patterns/prefill-decode path use.
  • .vale/styles/Serve/Capitalization.yml: title-cased generic nouns, such as Serve Application, Serve Controller, HTTP Proxy, Serve Autoscaler, Serve Config File, and Model Multiplexing. Applying any of these takes judgment, so this rule has no replace action:
    • Lowercasing would also drop the capital at the start of a heading or sentence, which has to stay.
    • A capitalized Deployment is sometimes the Deployment class written without backticks, which needs code style rather than lowercase. Those keys carry a preceding article, such as the Deployment, and leave the decision to a person.
  • .vale/styles/Serve/Usage.yml: wording that's usually wrong but needs a sentence rewrite, also without a replace action:
    • deployment graph names the older composition API. .bind() now returns an Application (python/ray/serve/deployment.py), so most uses mean "application," and some need a different rewrite.
    • KV-cache keeps its hyphen only as a compound modifier before a noun.
  • Accept lists:
    • A new Serve vocabulary: FastAPI, Starlette, Uvicorn, Pydantic, gRPC, Gradio, LMCache, Mooncake, FFmpeg, etcd, Arize, Seldon, DLQ(s), and prefill with its forms.
    • General gains cross-library words: GitHub, HPU(s), SLO(s), ResNet, autoscaled, mixin(s), and protobuf(s).
    • Casing-only fixes, such as fastapi and GRPC in prose, come from the accept list driving Vale.Terms rather than from a swap, so no token alerts twice.
  • .vale.ini: registers Serve on the Vocab line and adds a [doc/source/serve/**/*.{md,rst}] section with Vale, Google, Ray, Serve, which mirrors the Core and Train blocks.
  • writing-style.md: a "Writing Ray Serve docs" section with a terms table. All three Serve rules link to it through the ray-serve-docs-style label. The section covers the two senses of "deployment," the Serve object and the act of deploying, which is why it handles that word with guidance and article-anchored keys rather than a blanket swap.

No prose under doc/source/serve/ changes here. The style pass that fixes the alerts follows in separate PRs stacked on this one.

Duplicate check

No open PR adds Ray Serve Vale rules. I searched open ray-project/ray PRs for vale serve, serve writing-style, serve terminology, and vale in the title. #67017, my Ray Tune seed PR, edited the same four shared spots: the Vocab line, the end of .vale.ini, the end of General/accept.txt, and the style guide after the Train section. It has since merged, and this branch is rebased on it.

Testing

Commands, run from the repo root:

vale --output=JSON doc/source/   # before and after, compared alert by alert
pre-commit run --files <changed files>

Results with Vale 3.12.0:

  • doc/source/serve/: total alerts go from 2,076 to 2,116. Most of the increase is the shared Ray style now applying to Serve pages, the same step the Core and Train PRs took: Ray.Filler 70, Ray.Terms 55, Ray.PermitVerbs 42, Ray.TimeRelative 16, Ray.LeadIns 13, and a few others. The new Serve rules raise 92: Serve.Capitalization 57, Serve.Usage 19, and Serve.Terms 16. Vale.Spelling drops by 238. No position alerts twice across Vale.Terms, Vale.Spelling, Serve.*, and Ray.*.
  • Swaps dropped to avoid double alerts: I drafted swaps for threadpool, timeseries, and Dockerhub, but Vale.Spelling already flags all three at the same positions. The guide table lists the right forms instead.
  • Other scopes: compared by line content, so the shifted lines in writing-style.md don't count as churn. Outside doc/source/serve/, the changes come from the General additions: 8 Vale.Spelling false positives go away (three autoscaled, one HPUs, and four Pydantic), and one github alert in cluster/vms/user-guides/community/lsf.md moves from Vale.Spelling to Vale.Terms. Accepting GitHub also removes 80 Google.Parens alerts on the ([GitHub](...)) links in ray-governance/people.md, because a vocabulary entry masks its token for every rule. The new guide table alerts on its own "Not" column, as intended.
  • Known false positive, not fixed here: the General vocabulary's REST entry makes Vale.Terms flag the ordinary word "rest" ("the rest of"), 14 times across doc/source, 2 of them in Serve. Removing the entry trades those for 19 Google.Acronyms alerts on real uses of REST, so it stays as is for now.
  • pre-commit: passed on the changed files.
  • Not run locally: the Sphinx build. The only doc/source change is one new section and label in writing-style.md. The RtD preview covers it.

Prepared with AI assistance (Claude Code). Draft until the submitter has reviewed every changed line.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Oct 29, 2026
@dstrodtman
dstrodtman force-pushed the doc-1547-serve-vale-terms branch from 368bd4b to 5f9d68b Compare October 29, 2026 20:42
@github-actions github-actions Bot added unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it. and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Oct 30, 2026
…t enforced)

Add Serve.Terms, Serve.Capitalization, and Serve.Usage rules, a Serve
vocabulary, a path-scoped .vale.ini section for doc/source/serve/, and a
"Writing Ray Serve docs" section in the style guide that the rules link to.
Nothing runs in CI yet. No Serve prose changes here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1547-serve-vale-terms branch from 5f9d68b to d5cc5d1 Compare October 30, 2026 16:56
dstrodtman added a commit that referenced this pull request Oct 30, 2026
## Description

This PR retires the notebook authoring templates and the contributor
guidance that points new examples at notebooks.

`doc/source/_templates/template.ipynb` is a Jupyter starter for new doc
examples. It isn't a page, because `templates_path` keeps `_templates/`
out of the source files Sphinx reads. Nothing includes it, and no bazel
target runs it. Its MyST sibling, `template.md`, is out of date. It
imports `ray.rllib.agents.ppo`, demos `{eval-rst}` and `{margin}`, and
teaches `{code-cell}` notebooks that no build or test target executes.
The "Creating a notebook example" section of the contributor guide links
both templates, tells contributors to download the page as an `.ipynb`,
and recommends converting their draft to `.ipynb` when they finish.

This PR deletes the Jupyter template and turns `template.md` into a
template for an end-to-end guide written as an ordinary MyST page. The
contributor guidance now says that a guide like this is a Markdown page
its author ran, not a tested asset, and sends examples that need testing
to the template-collections flow. The template and guidance changes come
from #67428, which merged into this branch.

### What this PR changes

- Deletes `doc/source/_templates/template.ipynb`.
- `doc/source/_templates/template.md`: rewrites it as an end-to-end
guide skeleton. It uses only MyST, sphinx-design (`tab-set`,
`dropdown`), colon-fence admonitions, and `{ref}` and `{py:func}` roles,
with no myst-nb notebook syntax. A maintainer-only HTML comment under
the title records that Ray CI doesn't test the guide and which Ray
version its author last ran it with. The example code is a minimal Ray
Core task. Sphinx still excludes the file through `_templates/`.
- `doc/source/ray-contribute/docs.md`:
- Replaces "Creating a notebook example" (label
`creating-notebook-example`) with "Writing an end-to-end guide"
(`writing-e2e-guide`). The new section points to the template and says
Ray CI doesn't run the guide's code, so the author runs every step and
records the Ray version. It sends tested examples to the
template-collections flow and says not to add notebooks or notebook
front matter. To convert an existing notebook, it gives `jupyter
nbconvert --to markdown`.
- Removes what the old section taught: the Jupyter template link,
downloading the page as an `.ipynb`, the Tune Hyperopt notebook as a
model, the kernel specification front matter, `code-cell` examples, cell
tags, reference labels, removed-cell testing, and the `jupytext`
conversions. It also drops the claim that CI tests every notebook placed
in the Tune `examples` folder.
- Updates the format overview and the "two types of documents" list so
they no longer present notebooks as the format for new examples.
- "Adding code to an `.rST` or `.md` file": drops the claim that every
snippet is tested and the `.. code-cell:: python` recommendation. Tested
code uses `testcode` or a `literalinclude` script, and code that CI
can't run goes in a plain fenced block.
  - Links "How to write code snippets" by its `.md` file name.
- "Writing an end-to-end guide": offers an `examples.yml` gallery only
for Ray Data, Ray Serve, and Ray Train, the only libraries that have
one. `conf.py` marks gallery-linked pages as orphans, so the page needs
no `orphan` front matter. It also says what `nbconvert` does with
outputs and images.
- Replaces "Every Python file in the `doc_code` directory is
automatically tested." Some files and directories have no target in
`doc/BUILD.bazel`, so it now tells contributors to check that a target
covers their script.
- `doc/source/ray-contribute/writing-style.md`, "Code blocks": replaces
"Every runnable snippet in the docs is tested." It now names the two
tested forms, a `testcode` block on a page with a doctest target in
`doc/BUILD.bazel` and a `doc_code/` script included with
`literalinclude`. It limits both to code that runs as written and that
CI should test, and says CI doesn't run a plain fenced block. Since
#67432, no documentation page runs a `>>>` example, and #67429 updates
`writing-code-snippets.md` to match.
- `doc/source/ray-contribute/publishing-examples-legacy.md`: takes over
the cell-tag guidance (`hide-*`, `remove-*`, and overriding realistic
values in a removed cell), rewritten for `.ipynb` cell metadata. It
applies only to the remaining in-tree notebooks.
- `doc/source/ray-contribute/publishing-examples.md`: repoints its
cross-reference to `writing-e2e-guide`. No reference to the old label
remains.
- `.buildkite/test.rules.txt`: deletes the `doc/source/_templates/` skip
rule. It existed to keep `template.ipynb` off the `doc/*.ipynb`
catch-all. Every remaining file under `_templates/` (`.html`, `.rst`,
`.md`, `.gitkeep`) gets the same tags without it: `.md` and `.rst` files
hit the leading prose skip first, and the rest fall through to the broad
`doc/` skip.
- `.buildkite/test.rules.test.txt`: replaces the `template.ipynb` case
with `doc/source/_templates/layout.html:`.

### Merge-order note for #67012

#67012 adds `doc/asset_allowlists/notebooks.txt`, which lists
`doc/source/_templates/template.ipynb`, and its check fails on an entry
whose file is gone. Neither PR depends on the other, and they merge
without textual conflicts. Whichever merges second deletes that line. If
this PR merges first, `python doc/test_doc_assets.py --update` on #67012
removes it. With this branch, current master, and #67012 merged
together, the check fails only on that line and passes once it's
deleted.

## Related issues

Includes #67428, which merged into this branch. #67429 is stacked on
this branch, and #67639 is stacked on #67429. #67639 limits the legacy
notebook page to maintaining the two remaining notebook examples.
Follows #67008, which rewrote the same comment blocks in
`test.rules.txt` and `test.rules.test.txt`, and #66974, which moved
never-run `testcode` blocks to plain code blocks.

## Additional information

### Duplicate check

I searched open PRs for `template.ipynb`, `template.md`, `_templates`,
`notebook template`, `end-to-end guide`, `creating-notebook-example`,
`ray-contribute/docs.md`, `writing-style.md`, and `publishing-examples`,
then compared the files each docs PR in the results changes with this
PR's. No open PR removes either template or rewrites these sections. The
open PRs that touch the same files edit other hunks:

- #66462 and #67012 edit `test.rules.txt` and `test.rules.test.txt`.
Each merges with this branch without conflicts. #67204, which edited
`docs.md` and `writing-style.md`, has merged, and this branch is rebased
on it.
- #67018 edits a section of `writing-style.md` about 170 lines below
this PR's hunk.
- #67429 and #67639 are stacked on this branch.

### Testing

On this branch's head, rebased on master on 2026-10-30:

- `rayci test-rules`, using v0.51.0, the version `.rayciversion` pins,
built from `ray-project/rayci`: 197/197 cases pass, and the check also
passes with the branch merged with current master. Changing the new
`layout.html` case to expect `doc` makes it fail, so the case is live.
- Routing equivalence: I added every file under `doc/source/_templates/`
as a case that expects no tags. `rayci test-rules` passes both with and
without the deleted rule. The only file whose routing the rule changes
is `template.ipynb`, which routes to `doc_example` without it.
- `pre-commit run --files` on the changed files passes, including the
check that links to files on master resolve.
- `vale` on the changed pages: `docs.md` goes from 98 alerts to 71, and
the other pages stay level or drop. The only new alerts are spelling
flags on "toctree" and "doctest", terms these guides already use, and a
passive-voice flag on an unchanged sentence in `docs.md`.
- `jupyter nbconvert your-example.ipynb --to markdown`, with nbconvert
7.17.2 on a copy of a Tune notebook, writes a Markdown file with
`python` code fences and no Jupyter front matter.
- The Read the Docs preview renders "Writing an end-to-end guide", the
`writing-e2e-guide` references in `docs.md` and `publishing-examples.md`
resolve to it, and the legacy page renders "Hide and remove cells".

From #67428:

- The template's example code, run with `ray[default]` 2.59.0 on Python
3.11, prints `[0, 1, 4, 9]`.
- A copy of the template with its placeholders filled in builds without
warnings using Sphinx 8.2.3, myst-parser 5.1.0, sphinx-design, and the
`myst_enable_extensions` from `conf.py`. The tab set, dropdown, and tip
render.

This PR was prepared with AI assistance (Claude Code), including the
commits from #67428. Each author reviewed every line they changed.

🤖 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 5.5 <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant