Skip to content

[Docs] Add a documentation style and grammar guide for contributors and agents - #64518

Merged
elliot-barn merged 2 commits into
ray-project:masterfrom
dstrodtman:djs-260702-docs-writing-style-guide
Jul 7, 2026
Merged

elliot-barn merged 2 commits into
ray-project:masterfrom
dstrodtman:djs-260702-docs-writing-style-guide

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

The Ray documentation had no single prose style standard. Guidance was thin and scattered across three surfaces that didn't agree:

  • docs.md linked to the Google developer style guide with five highlight bullets.
  • A Cursor rule (doc/.cursor/rules/ray-docs-style.mdc) carried a partial style guide that had accumulated topic-specific leftovers.
  • AI coding agents using Claude Code had no prose guidance at all.

This PR establishes a single source of truth and points every surface at it.

New canonical guide. doc/source/ray-contribute/writing-style.md covers voice, word choice, sentence structure, headings, lists, links, admonitions, tables, and MyST formatting, with the Google developer documentation style guide as the fallback for anything it doesn't cover. It's written for both human contributors and AI coding agents.

Wiring:

  • docs.md "Editorial style" now points to the new guide.
  • getting-involved.md toctree includes the new page.
  • doc/.cursor/rules/ray-docs-style.mdc slims to a high-frequency subset plus a pointer to the full guide.
  • doc/.claude/rules/prose-style.md (new) gives Claude Code agents parity with Cursor, scoped to doc/source Markdown and rST.

Note on scope: this PR touches AI agent configuration (.cursor and .claude) so that both agent surfaces reference the same standard as the published guide.

Not in this PR: Vale runs in CI only on doc/source/data and the example gallery. Broadening prose enforcement is a separate, reviewer-sensitive change.

Related issue number

None.

Checks

  • I've signed off every commit (git commit -s) to meet the DCO requirement.
  • I've made sure the tests are passing. This is a docs-only change; the Read the Docs build validates it.
  • Testing strategy: the Read the Docs build (fail_on_warning) is the gate for cross-references and toctree wiring.

🤖 Generated with Claude Code

…nd agents

Add doc/source/ray-contribute/writing-style.md as the canonical style and
grammar standard for the Ray documentation. It covers voice, word choice,
sentence structure, headings, lists, links, admonitions, and MyST formatting,
and builds on the Google developer documentation style guide as a fallback.

Prose guidance was previously thin and scattered: docs.md linked to Google
with five highlights, a Cursor rule carried a partial guide, and Claude agents
had no prose guidance at all. This establishes a single source of truth and
points the agent surfaces at it:

- docs.md "Editorial style" now points to the new guide.
- getting-involved.md toctree includes the new page.
- doc/.cursor/rules/ray-docs-style.mdc slims to a high-frequency subset plus a
  pointer to the full guide.
- doc/.claude/rules/prose-style.md (new) gives Claude agents parity, scoped to
  doc/source Markdown and rST.

This change also touches agent configuration (.cursor and .claude) so both AI
agent surfaces reference the same standard.

Follow-up, not in this change: Vale currently runs only on doc/source/data and
the example gallery. Broadening prose enforcement is a separate, reviewer-
sensitive change.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners July 2, 2026 19:32

@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 introduces a comprehensive house style guide for Ray documentation (writing-style.md) and updates related configuration files, rules, and documentation to reference it. The reviewer pointed out that a link to the Vale documentation in docs.md should be updated to use the {ref} role instead of standard Markdown link syntax, aligning with the newly established guidelines.

* [Use sentence case](https://developers.google.com/style/capitalization)

Vale enforces the editorial style in CI. For more information, see [How to use Vale](vale).
The house guide builds on the [Google developer documentation style guide](https://developers.google.com/style), which is the fallback for anything the house guide doesn't cover. Vale enforces an automated subset of the Google guide in CI. For more information, see [How to use Vale](vale).

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.

medium

The link [How to use Vale](vale) uses standard Markdown link syntax to reference a label (vale)=. According to the new style guide established in this PR, cross-references to labeled targets should use the {ref} role.

Suggested change
The house guide builds on the [Google developer documentation style guide](https://developers.google.com/style), which is the fallback for anything the house guide doesn't cover. Vale enforces an automated subset of the Google guide in CI. For more information, see [How to use Vale](vale).
The house guide builds on the [Google developer documentation style guide](https://developers.google.com/style), which is the fallback for anything the house guide doesn't cover. Vale enforces an automated subset of the Google guide in CI. For more information, see {ref}`vale`.

- Use: "To build the docs, follow these steps:" Not: "Let's build the docs."
- Use: "The Ray project welcomes contributions of all kinds." Not: "We welcome all contributions."

### Capitalize Ray components and product names

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@richardliaw @edoakes @akshay-anyscale I differ to y'all here, but do prefer lowercase. (Even K8s, which has historically really relied on casing for meaning, seems to be moving away from it in their docs and recent style guides).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should use capitalization for product names, except for known exceptions like "pandas"

@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Jul 3, 2026
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Jul 6, 2026

@ronny-anyscale ronny-anyscale 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


Contractions read naturally: don't, doesn't, can't, won't, it's, you're, isn't, aren't, wouldn't, shouldn't. Avoid contractions in a warning or an error message, where the extra weight of the full form helps.

Never use "would've," "could've," "should've," "ain't," or "y'all."

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.

As a texan, I have a problem with the last one not being recognized...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You'll note I used it just lines before in a comment.

- "X vs. Y" → "X versus Y"
- "X/Y" → "X or Y" or "X and Y"

### Don't write "etc." after "such as," "for example," or "including"

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.

I'd argue that we replace all latin abbrs (e.g., etc.), for folks with a different lang base.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Per suggestion from @bveeramani, I plan to greatly expand the Vale vocab lists and enforce these programmatically. Will iterate on this file alongside those rules.

@elliot-barn
elliot-barn merged commit 2214cc2 into ray-project:master Jul 7, 2026
4 checks passed
dstrodtman added a commit that referenced this pull request Aug 14, 2026
)

## Why this change

Ray on Kubernetes docs describe Kubernetes API objects alongside Ray
concepts, and the two vocabularies collide. Deployment, Job, and Service
each name both a Kubernetes API object and a distinct Ray concept, so
capitalization is the only thing telling them apart, and the style guide
didn't say which form to use where. A contributor asking "RayCluster or
Ray cluster?" had to derive the answer from two guides and adjudicate
between them.

This adds a `Writing Ray on Kubernetes and KubeRay docs` section to the
style guide, scoped to the user-facing pages under
`doc/source/cluster/kubernetes/` and the contributor-facing pages in
[ray-project/kuberay](https://github.com/ray-project/kuberay).

The approach is to extend this guide with a Kubernetes deference section
rather than stand up a separate KubeRay style guide. The two guides
already overlap heavily, and a forked guide would drift within a release
or two.

## What the casing scan found

The term list isn't invented. It comes from a prose-only scan of three
corpora: 79 user-facing pages in this repo, 12 contributor pages in
`ray-project/kuberay`, and 128 pages of `kubernetes/website`
(`content/en/docs/concepts/`, commit `bb38117c0`). The scan strips front
matter, fenced code blocks, inline code, MyST roles, and link targets
before counting, so YAML field names and CLI output don't inflate the
figures.

Headline: **these docs already follow the Kubernetes casing rule.**
Upstream Kubernetes capitalizes "Pod" in 71% of prose uses; the Ray-side
KubeRay docs do so in 70%. So this PR documents a rule the docs mostly
already follow, and does not propose a capitalization sweep.

| Term | Ray-side KubeRay docs | Upstream Kubernetes | Read |
|---|---|---|---|
| Pod | 371/527 (70%) | 3712/5195 (71%) | Matches upstream almost
exactly. |
| ConfigMap | 20/21 (95%) | 119/130 (91%) | Healthy. |
| Ingress | 8/15 (53%) | 148/242 (61%) | Roughly aligned. |
| Service | 18/114 (15%) | 515/946 (54%) | Diverges by design. |
| Job | 17/143 (11%) | 522/610 (85%) | Diverges by design. |
| Deployment | 6/53 (11%) | 355/461 (77%) | Diverges by design. |

The three "diverges by design" rows are the reason this section exists.
Sampling shows the lowercase uses are Ray Serve deployments, Ray jobs,
and Ray services, not Kubernetes API objects. That's a naming collision,
not drift, so the fix is a disambiguation rule rather than a sweep.
Kubernetes's own rule expects a mix (UpperCamelCase for the API object,
sentence case for the general concept), which is why the upstream column
isn't 100% either.

The one genuine inconsistency the scan found is **"Ray Autoscaler" (44
uses) against "Ray autoscaler" (35)**, spread across at least eight
files. This guide already says to lowercase generic nouns even when they
name a Ray concept, so lowercase wins. Recording the rule here is the
prerequisite for a mechanical follow-up cleanup. I've left that out of
this PR to keep the rule change reviewable on its own.

## Open questions for reviewers

I've deliberately written only the rules I can support from the two
published guides plus the scan. These five are genuinely open, and I'd
rather resolve them in review than assert them:
All five are now resolved in review. Each entry keeps the original
question for context, since the reasoning behind the answer matters more
than the answer:
1. ~~**Confirm the custom-resource split.**~~ **Resolved** by @win5923:
the split is intentional and consistent with Kubernetes terminology.
Original question: The section documents `RayCluster` (the resource)
versus "Ray cluster" (the running thing it produces), currently 335
against 106 uses in this repo. I read it as intentional and matching the
Kubernetes API-object rule. Worth confirming rather than normalizing to
one form.
1. ~~**"head Pod" versus "head node."**~~ **Resolved** by @win5923: use
"head Pod" consistently when a Ray cluster runs on Kubernetes. Original
question: The section prefers "head Pod" for the Kubernetes-hosted case,
since a node is a machine on Kubernetes.
`doc/source/cluster/kubernetes/index.md` currently says "a head node pod
and a collection of worker node pods," which stacks both vocabularies.
Reasonable, or is "head node" worth keeping for continuity with Ray's
core architecture docs?
1. ~~**Feature graduation phases.**~~ **Resolved** by @win5923: keep the
existing convention, start case for Kubernetes feature stages and
lowercase for Ray and KubeRay stages. The corpus already works this way.
I've added the ownership test for the ambiguous case, a third-party
controller's feature gate, which makes `kueue.md:747` a defect rather
than an exception. No Vale rule, since a substitution can't tell which
project a stage name refers to. Original question: Kubernetes uses start
case ("DRA is Beta"); Ray docs lowercase feature stages. This bites on
pages discussing a Kubernetes feature's stage and a Ray feature's stage
in one paragraph. I left it out of the section rather than pick. Which
wins?
1. ~~**Field values.**~~ **Resolved** by @win5923, who writes values in
backticks: "set `upgradeStrategy.type` to
`NewClusterWithIncrementalUpgrade`." That's also what this guide already
says, so the section now states the divergence from Kubernetes
explicitly rather than leaving the two guides to contradict each other
silently. Original question: Kubernetes wants unquoted, unstyled values
("set `imagePullPolicy` to Always"); this guide says to use backticks
for configuration values and gives `num_replicas: 1`. These are closer
than they look, since one is a bare value and the other a key-value
pair, but the guidance should say which form applies where.
1. ~~**"Ray dashboard" versus "Ray Dashboard"**~~ **Resolved** by
@win5923: lowercase, on the grounds that "dashboard" is a generic noun
for the same reason "autoscaler" is, which makes the rule already in
this guide cover it. Applies to "KubeRay dashboard" too. This is the
largest defect the ruleset now surfaces, at 43 prose uses plus 1, and it
moves `KubeRay.Terms` on these pages from 160 to 204. A fair number sit
in headings, where the sentence-case rule makes them defects too. Sweep
folds into #65423. Original question: 43 title-case against 18
lowercase. This guide implies lowercase, but the dashboard is arguably a
named UI surface. Not addressed in the section pending a call.

Two further items are out of scope here but worth flagging:

- **Line wrapping in the `kuberay` repo.** This guide requires soft
wrap. The Kubernetes guide requires manual wrap, justified by
localization teams diffing per line, which KubeRay doesn't have. Nothing
in this PR changes that, since this guide already governs `doc/source/`.
But `kuberay`'s `.markdownlint.yaml` sets `MD013` to 120 characters via
pre-commit, which is a latent gate: 266 lines in its `docs/` already
exceed it, it isn't enforced in CI, and it isn't auto-fixable, so
contributors hit it unpredictably on whichever file they touch.
Disabling it there would align the two repos, but that's a call for
KubeRay maintainers in their own repo.
- **Turning Vale enforcement on.** This PR now adds the ruleset but
doesn't enforce it. See the section below.

## Staged Vale ruleset

A later commit adds a Vale ruleset for these pages, following the
pattern already used for the Ray Data docs. **Nothing is enforced yet.**
The Vale hook in `.pre-commit-config.yaml` stays scoped to
`^doc/source/data/.*`, so CI checks exactly what it checked before.

- `.vale/styles/config/vocabularies/KubeRay/accept.txt` — the KubeRay
custom resources, the Kubernetes and ecosystem API objects these pages
reference, and project names. Skips what the `General` vocabulary
already accepts (`Kubernetes`, `kubectl`, `CRD(s)?`, `namespace`).
- `.vale/styles/KubeRay/Terms.yml` — a `substitution` rule at `warning`
level covering only the casing forms the new style-guide section
settles, with `vocab: false` (see below). The open questions above are
deliberately absent.
- `.vale.ini` — registers the vocabulary and scopes the style to
`doc/source/cluster/kubernetes/`.

Registering a vocabulary that the hook doesn't exercise matches existing
practice here: `RLlib` and `Train` are already in `Vocab` while the hook
only runs on `doc/source/data/`.

Contributors can run it by hand today:

```
vale doc/source/cluster/kubernetes/
```

To enforce later, widen the `files` pattern on the `vale` hook. I'd
still hold that until the open questions land.

### What I verified

Vale 3.12.0 locally.

**Path scoping works.** The KubeRay rules fire on a file under
`doc/source/cluster/kubernetes/` and stay silent on identical content at
the repo root.

**Current state of these pages** — 146 `KubeRay.Terms` alerts, which
lines up with the casing scan:

| Alert | Count |
|---|---|
| Use 'Ray autoscaler' instead of 'Ray Autoscaler' | 42 |
| Use 'head Pod' instead of 'head pod' | 20 |
| Use 'worker Pod' instead of 'worker pod' | 7 |
| Use 'Ray job' instead of 'ray job' | 2 |
| Use 'Ray Serve' instead of 'Ray serve' | 1 |
| Use 'Ray cluster' instead of 'ray cluster' | 1 |
| Use 'KubeRay' instead of 'Kuberay' | 1 |
| Use 'GCS fault tolerance' instead of 'GCS FT' | 1 |

The 42 matches the scan's count for these pages exactly, which is a
useful cross-check on both. None of it is enforced, so nothing here has
to be fixed in this PR.

**No regression on the gated path.** Alert count on `doc/source/data/`
goes 174 → 173, deterministic across repeated runs in both states, with
no new alerts. A `Vocab` list is global, so it can only widen what's
accepted. The single alert that disappears is a `Google.Parens` hit in
`concurrent-dataset-execution.md`; no term in the new vocabulary appears
on that line, so I'm reporting that as observed rather than claiming I
understand the mechanism. It's a reduction either way, so it can't break
the gate.

### The vocabulary shadowing trap

Worth knowing if you write Vale rules here: a `Vocab` accept entry
shadows its token for **every** rule, case-insensitively. A substitution
whose target appears in an accept list silently never fires, and nothing
warns you.

This bit the `Ray Autoscaler` swap, because `autoscaler` is accepted in
`config/vocabularies/Data/accept.txt`. The fix is `vocab: false` on the
rule, which opts out of the filtering without touching the Data
vocabulary. The rule carries a comment saying so.

Credit to Bugbot for catching it. I'd first shipped that swap commented
out, having concluded the only way to enable it was dropping
`autoscaler` from the Data vocabulary and accepting new spelling alerts
on the gated path. That was wrong, and `vocab: false` avoids the
tradeoff entirely.

## Added after review

Two rules that review surfaced, both in the style-guide section plus the
Vale ruleset.

**Node stays lowercase.** Node is a Kubernetes API object, so
"capitalize Kubernetes API objects" read literally tells contributors to
write "Kubernetes Node." These pages almost always mean the machine, and
all 24 uses are correctly lowercase today, so a literal reading of the
rule would have someone "fix" working prose into wrongness. Kubernetes
applies the same two-part rule it applies elsewhere, capitalizing Node
only for the resource, and the section now says so.

**Don't write "Ray Pod."** This answers the casing question raised in
review, and the answer turned out to be neither casing. A Pod is a
Kubernetes host that contains a Ray node plus any sidecars, so naming it
after Ray overstates what it is. "TPU Pod" also already occupies the
qualified-Pod form in these pages and means a group of TPU chips rather
than a Kubernetes object. The term had no settled form to preserve
either: across the 55 prose lines using it, casing split four ways at
20, 16, 16, and 15.

Stating that alone would be a trap, because a bare "Pod" isn't always an
adequate replacement, so the section gives the test that separates the
cases:

- Qualify when the qualifier distinguishes two referents. That's why
"Ray node" against "Kubernetes node" is correct and should stay.
- Don't qualify when it relabels one thing.
- Keep the scope explicit where a page also describes Pods the
RayCluster doesn't own, such as the operator, Redis, or a `curl` Pod,
and where a nearby command filters by label. "List all Pods" and "List
the Ray cluster's Pods" describe different commands and shouldn't read
the same way.

The cleanup is #65423, which removes all 89 uses from the docs and is
reviewable on its own. This PR is the rule; that one is the sweep.

Vale picks up four swaps for the retired forms. Plurals get their own
entries, for the word-boundary reason @win5923 identified on the `head
pod` swaps. Verified that they don't fire on "Ray head Pod" or "Ray
worker Pods", and that the gated `doc/source/data/` path holds at 173
alerts.

## Not a duplicate

Checked open PRs for this area before starting:

```
gh pr list --repo ray-project/ray --state open --search "writing-style"
gh pr list --repo ray-project/ray --state open --search "style guide in:title"
gh pr list --repo ray-project/ray --state open --search "kuberay style"
```

No open PR touches `doc/source/ray-contribute/writing-style.md` or
proposes KubeRay style guidance. The `writing-style` matches were all
false positives on `write_delta`. This extends the guide added in
#64518.

## Testing

```
pre-commit run --files doc/source/ray-contribute/writing-style.md
```

Passes, but as a no-op on the Markdown: every hook reports "no files to
check," because no pre-commit hook applies to Markdown under
`doc/source/` and Vale is scoped to `doc/source/data/`. Stating that
plainly instead of claiming coverage it doesn't give.

The Vale config files do have hook coverage, and those checks ran for
real:

```
pre-commit run --files .vale.ini .vale/styles/KubeRay/Terms.yml .vale/styles/config/vocabularies/KubeRay/accept.txt
```

`trim trailing whitespace`, `fix end of files`, `check for added large
files`, and `semgrep` all pass.

Vale verification for the ruleset is in the section above: path scoping,
the 31-alert current state, and the 174 → 173 no-regression check on the
gated path.

Verified by hand: the new `(kubernetes-docs-style)=` anchor doesn't
collide with any existing target in `doc/source/`, and the section uses
the same MyST anchor form and Markdown pipe-table style already used
elsewhere in this file. Rendering is verified by the Read the Docs
preview build on this PR.

No code, no API, no behavior change. The prose is a contributor guide;
the Vale files add configuration without widening what CI enforces.

## AI assistance

Written with AI assistance (Claude). I've reviewed every changed line,
generated and inspected the casing counts myself, and can defend the
change end to end. The scan scripts that produced the numbers live
outside this repo; happy to share the methodology or re-run against a
different corpus if a reviewer wants to check a figure.




---

### Update: the vocabulary now covers the ecosystem terms these pages
use (555ebda)

Running `vale doc/source/cluster/kubernetes/`, which this PR's
`.vale.ini` comment tells contributors to do, produced 215
`Vale.Spelling` alerts on correctly spelled terms. The accept list
covered API objects, the custom resources, and project names, but not
the wider ecosystem vocabulary the pages actually contain. Left as is, a
contributor following the instruction learns to ignore Vale on exactly
the paths this PR wants gated.

Added: the ecosystem projects (Istio, Kiali, gVisor, Kata, Krew,
Kustomize, Bottlerocket, Aliyun, GCSFuse, Promtail, Fluentd, Filebeat,
Alertmanager), the Gateway API `HTTPRoute`, and the Kubernetes and
infrastructure terms in use (cgroup, finalizer, kubeconfig, kubelet,
namespaced, namespaces, toleration, upscaling, downscaling, vCPU, FQDN,
AMI, subnet, syscall, hostname, cron, CA, autoscalers).

**Excluded on purpose, since an accept list shouldn't launder a
defect.** `CR` and `CRs`, 12 uses, because this PR's own guidance says
to write "custom resource" and to define CustomResourceDefinition then
use CRD. Real misspellings: `heterogenous`, `replicaset` for ReplicaSet,
`Deepseek` for DeepSeek, `nodepool` for node pool. `gsutil`, which
`gcloud storage` supersedes. Unbackticked code identifiers, which are a
formatting defect rather than a vocabulary gap: `podSpec`,
`podSelector`, `nodeSelector`, `jsonPointers`, `intervalSeconds`,
`workerGroup`, `ignoreDifferences`, `HTTPMode`, `args`, `yaml`. And
generic English that Vale's dictionary lacks, which belongs in the
General vocabulary rather than a KubeRay-specific one.

Three entries are case-tolerant (`[Tt]oleration(s)?`, `[Uu]pscaling`,
`[Dd]ownscaling`). A lowercase-only entry makes `Vale.Terms` flag the
legitimate sentence-start capitalization.

**Verification**, deterministic across repeated runs:

- `doc/source/cluster/kubernetes/`: 1329 alerts to 1178. `Vale.Spelling`
drops from 215 to 72. `KubeRay.Terms` is unchanged at 160, confirming no
swap got shadowed by a new accept entry, which is the trap the `Ray
Autoscaler` comment in `Terms.yml` documents.
- `doc/source/data/`, the only path the pre-commit hook gates: 173 to
170, with **no new alerts**. A `Vocab` is global, so it can only widen
what's accepted.
- One candidate entry was dropped for exactly that reason. A
`runtime(s)?` entry made `Vale.Terms` flag "Runtime" in
`doc/source/data/monitoring-your-workload.rst`, a new alert on the gated
path.

Four new `Vale.Terms` alerts do appear on the KubeRay paths, and all
four are genuine casing defects in existing pages rather than noise:
"Kubelet" twice in `configuring-ippr.md`, lowercase "istio" naming the
project in `rayservice-incremental-upgrade.md`, and "Cgroups" in the
`resource-isolation-with-writable-cgroups.md` H1, which is also title
case. Those are content fixes for a separate change, not this one.

AI assistance was used for this commit, including the Vale sweep and the
before-and-after verification above.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…nd agents (ray-project#64518)

## Why are these changes needed?

The Ray documentation had no single prose style standard. Guidance was
thin and scattered across three surfaces that didn't agree:

- `docs.md` linked to the Google developer style guide with five
highlight bullets.
- A Cursor rule (`doc/.cursor/rules/ray-docs-style.mdc`) carried a
partial style guide that had accumulated topic-specific leftovers.
- AI coding agents using Claude Code had no prose guidance at all.

This PR establishes a single source of truth and points every surface at
it.

**New canonical guide.** `doc/source/ray-contribute/writing-style.md`
covers voice, word choice, sentence structure, headings, lists, links,
admonitions, tables, and MyST formatting, with the Google developer
documentation style guide as the fallback for anything it doesn't cover.
It's written for both human contributors and AI coding agents.

**Wiring:**

- `docs.md` "Editorial style" now points to the new guide.
- `getting-involved.md` toctree includes the new page.
- `doc/.cursor/rules/ray-docs-style.mdc` slims to a high-frequency
subset plus a pointer to the full guide.
- `doc/.claude/rules/prose-style.md` (new) gives Claude Code agents
parity with Cursor, scoped to `doc/source` Markdown and rST.

**Note on scope:** this PR touches AI agent configuration (`.cursor` and
`.claude`) so that both agent surfaces reference the same standard as
the published guide.

**Not in this PR:** Vale runs in CI only on `doc/source/data` and the
example gallery. Broadening prose enforcement is a separate,
reviewer-sensitive change.

## Related issue number

None.

## Checks

- [x] I've signed off every commit (`git commit -s`) to meet the DCO
requirement.
- [x] I've made sure the tests are passing. This is a docs-only change;
the Read the Docs build validates it.
- [x] Testing strategy: the Read the Docs build (`fail_on_warning`) is
the gate for cross-references and toctree wiring.

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

---------

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

## Why this change

Ray on Kubernetes docs describe Kubernetes API objects alongside Ray
concepts, and the two vocabularies collide. Deployment, Job, and Service
each name both a Kubernetes API object and a distinct Ray concept, so
capitalization is the only thing telling them apart, and the style guide
didn't say which form to use where. A contributor asking "RayCluster or
Ray cluster?" had to derive the answer from two guides and adjudicate
between them.

This adds a `Writing Ray on Kubernetes and KubeRay docs` section to the
style guide, scoped to the user-facing pages under
`doc/source/cluster/kubernetes/` and the contributor-facing pages in
[ray-project/kuberay](https://github.com/ray-project/kuberay).

The approach is to extend this guide with a Kubernetes deference section
rather than stand up a separate KubeRay style guide. The two guides
already overlap heavily, and a forked guide would drift within a release
or two.

## What the casing scan found

The term list isn't invented. It comes from a prose-only scan of three
corpora: 79 user-facing pages in this repo, 12 contributor pages in
`ray-project/kuberay`, and 128 pages of `kubernetes/website`
(`content/en/docs/concepts/`, commit `bb38117c0`). The scan strips front
matter, fenced code blocks, inline code, MyST roles, and link targets
before counting, so YAML field names and CLI output don't inflate the
figures.

Headline: **these docs already follow the Kubernetes casing rule.**
Upstream Kubernetes capitalizes "Pod" in 71% of prose uses; the Ray-side
KubeRay docs do so in 70%. So this PR documents a rule the docs mostly
already follow, and does not propose a capitalization sweep.

| Term | Ray-side KubeRay docs | Upstream Kubernetes | Read |
|---|---|---|---|
| Pod | 371/527 (70%) | 3712/5195 (71%) | Matches upstream almost
exactly. |
| ConfigMap | 20/21 (95%) | 119/130 (91%) | Healthy. |
| Ingress | 8/15 (53%) | 148/242 (61%) | Roughly aligned. |
| Service | 18/114 (15%) | 515/946 (54%) | Diverges by design. |
| Job | 17/143 (11%) | 522/610 (85%) | Diverges by design. |
| Deployment | 6/53 (11%) | 355/461 (77%) | Diverges by design. |

The three "diverges by design" rows are the reason this section exists.
Sampling shows the lowercase uses are Ray Serve deployments, Ray jobs,
and Ray services, not Kubernetes API objects. That's a naming collision,
not drift, so the fix is a disambiguation rule rather than a sweep.
Kubernetes's own rule expects a mix (UpperCamelCase for the API object,
sentence case for the general concept), which is why the upstream column
isn't 100% either.

The one genuine inconsistency the scan found is **"Ray Autoscaler" (44
uses) against "Ray autoscaler" (35)**, spread across at least eight
files. This guide already says to lowercase generic nouns even when they
name a Ray concept, so lowercase wins. Recording the rule here is the
prerequisite for a mechanical follow-up cleanup. I've left that out of
this PR to keep the rule change reviewable on its own.

## Open questions for reviewers

I've deliberately written only the rules I can support from the two
published guides plus the scan. These five are genuinely open, and I'd
rather resolve them in review than assert them:
All five are now resolved in review. Each entry keeps the original
question for context, since the reasoning behind the answer matters more
than the answer:
1. ~~**Confirm the custom-resource split.**~~ **Resolved** by @win5923:
the split is intentional and consistent with Kubernetes terminology.
Original question: The section documents `RayCluster` (the resource)
versus "Ray cluster" (the running thing it produces), currently 335
against 106 uses in this repo. I read it as intentional and matching the
Kubernetes API-object rule. Worth confirming rather than normalizing to
one form.
1. ~~**"head Pod" versus "head node."**~~ **Resolved** by @win5923: use
"head Pod" consistently when a Ray cluster runs on Kubernetes. Original
question: The section prefers "head Pod" for the Kubernetes-hosted case,
since a node is a machine on Kubernetes.
`doc/source/cluster/kubernetes/index.md` currently says "a head node pod
and a collection of worker node pods," which stacks both vocabularies.
Reasonable, or is "head node" worth keeping for continuity with Ray's
core architecture docs?
1. ~~**Feature graduation phases.**~~ **Resolved** by @win5923: keep the
existing convention, start case for Kubernetes feature stages and
lowercase for Ray and KubeRay stages. The corpus already works this way.
I've added the ownership test for the ambiguous case, a third-party
controller's feature gate, which makes `kueue.md:747` a defect rather
than an exception. No Vale rule, since a substitution can't tell which
project a stage name refers to. Original question: Kubernetes uses start
case ("DRA is Beta"); Ray docs lowercase feature stages. This bites on
pages discussing a Kubernetes feature's stage and a Ray feature's stage
in one paragraph. I left it out of the section rather than pick. Which
wins?
1. ~~**Field values.**~~ **Resolved** by @win5923, who writes values in
backticks: "set `upgradeStrategy.type` to
`NewClusterWithIncrementalUpgrade`." That's also what this guide already
says, so the section now states the divergence from Kubernetes
explicitly rather than leaving the two guides to contradict each other
silently. Original question: Kubernetes wants unquoted, unstyled values
("set `imagePullPolicy` to Always"); this guide says to use backticks
for configuration values and gives `num_replicas: 1`. These are closer
than they look, since one is a bare value and the other a key-value
pair, but the guidance should say which form applies where.
1. ~~**"Ray dashboard" versus "Ray Dashboard"**~~ **Resolved** by
@win5923: lowercase, on the grounds that "dashboard" is a generic noun
for the same reason "autoscaler" is, which makes the rule already in
this guide cover it. Applies to "KubeRay dashboard" too. This is the
largest defect the ruleset now surfaces, at 43 prose uses plus 1, and it
moves `KubeRay.Terms` on these pages from 160 to 204. A fair number sit
in headings, where the sentence-case rule makes them defects too. Sweep
folds into ray-project#65423. Original question: 43 title-case against 18
lowercase. This guide implies lowercase, but the dashboard is arguably a
named UI surface. Not addressed in the section pending a call.

Two further items are out of scope here but worth flagging:

- **Line wrapping in the `kuberay` repo.** This guide requires soft
wrap. The Kubernetes guide requires manual wrap, justified by
localization teams diffing per line, which KubeRay doesn't have. Nothing
in this PR changes that, since this guide already governs `doc/source/`.
But `kuberay`'s `.markdownlint.yaml` sets `MD013` to 120 characters via
pre-commit, which is a latent gate: 266 lines in its `docs/` already
exceed it, it isn't enforced in CI, and it isn't auto-fixable, so
contributors hit it unpredictably on whichever file they touch.
Disabling it there would align the two repos, but that's a call for
KubeRay maintainers in their own repo.
- **Turning Vale enforcement on.** This PR now adds the ruleset but
doesn't enforce it. See the section below.

## Staged Vale ruleset

A later commit adds a Vale ruleset for these pages, following the
pattern already used for the Ray Data docs. **Nothing is enforced yet.**
The Vale hook in `.pre-commit-config.yaml` stays scoped to
`^doc/source/data/.*`, so CI checks exactly what it checked before.

- `.vale/styles/config/vocabularies/KubeRay/accept.txt` — the KubeRay
custom resources, the Kubernetes and ecosystem API objects these pages
reference, and project names. Skips what the `General` vocabulary
already accepts (`Kubernetes`, `kubectl`, `CRD(s)?`, `namespace`).
- `.vale/styles/KubeRay/Terms.yml` — a `substitution` rule at `warning`
level covering only the casing forms the new style-guide section
settles, with `vocab: false` (see below). The open questions above are
deliberately absent.
- `.vale.ini` — registers the vocabulary and scopes the style to
`doc/source/cluster/kubernetes/`.

Registering a vocabulary that the hook doesn't exercise matches existing
practice here: `RLlib` and `Train` are already in `Vocab` while the hook
only runs on `doc/source/data/`.

Contributors can run it by hand today:

```
vale doc/source/cluster/kubernetes/
```

To enforce later, widen the `files` pattern on the `vale` hook. I'd
still hold that until the open questions land.

### What I verified

Vale 3.12.0 locally.

**Path scoping works.** The KubeRay rules fire on a file under
`doc/source/cluster/kubernetes/` and stay silent on identical content at
the repo root.

**Current state of these pages** — 146 `KubeRay.Terms` alerts, which
lines up with the casing scan:

| Alert | Count |
|---|---|
| Use 'Ray autoscaler' instead of 'Ray Autoscaler' | 42 |
| Use 'head Pod' instead of 'head pod' | 20 |
| Use 'worker Pod' instead of 'worker pod' | 7 |
| Use 'Ray job' instead of 'ray job' | 2 |
| Use 'Ray Serve' instead of 'Ray serve' | 1 |
| Use 'Ray cluster' instead of 'ray cluster' | 1 |
| Use 'KubeRay' instead of 'Kuberay' | 1 |
| Use 'GCS fault tolerance' instead of 'GCS FT' | 1 |

The 42 matches the scan's count for these pages exactly, which is a
useful cross-check on both. None of it is enforced, so nothing here has
to be fixed in this PR.

**No regression on the gated path.** Alert count on `doc/source/data/`
goes 174 → 173, deterministic across repeated runs in both states, with
no new alerts. A `Vocab` list is global, so it can only widen what's
accepted. The single alert that disappears is a `Google.Parens` hit in
`concurrent-dataset-execution.md`; no term in the new vocabulary appears
on that line, so I'm reporting that as observed rather than claiming I
understand the mechanism. It's a reduction either way, so it can't break
the gate.

### The vocabulary shadowing trap

Worth knowing if you write Vale rules here: a `Vocab` accept entry
shadows its token for **every** rule, case-insensitively. A substitution
whose target appears in an accept list silently never fires, and nothing
warns you.

This bit the `Ray Autoscaler` swap, because `autoscaler` is accepted in
`config/vocabularies/Data/accept.txt`. The fix is `vocab: false` on the
rule, which opts out of the filtering without touching the Data
vocabulary. The rule carries a comment saying so.

Credit to Bugbot for catching it. I'd first shipped that swap commented
out, having concluded the only way to enable it was dropping
`autoscaler` from the Data vocabulary and accepting new spelling alerts
on the gated path. That was wrong, and `vocab: false` avoids the
tradeoff entirely.

## Added after review

Two rules that review surfaced, both in the style-guide section plus the
Vale ruleset.

**Node stays lowercase.** Node is a Kubernetes API object, so
"capitalize Kubernetes API objects" read literally tells contributors to
write "Kubernetes Node." These pages almost always mean the machine, and
all 24 uses are correctly lowercase today, so a literal reading of the
rule would have someone "fix" working prose into wrongness. Kubernetes
applies the same two-part rule it applies elsewhere, capitalizing Node
only for the resource, and the section now says so.

**Don't write "Ray Pod."** This answers the casing question raised in
review, and the answer turned out to be neither casing. A Pod is a
Kubernetes host that contains a Ray node plus any sidecars, so naming it
after Ray overstates what it is. "TPU Pod" also already occupies the
qualified-Pod form in these pages and means a group of TPU chips rather
than a Kubernetes object. The term had no settled form to preserve
either: across the 55 prose lines using it, casing split four ways at
20, 16, 16, and 15.

Stating that alone would be a trap, because a bare "Pod" isn't always an
adequate replacement, so the section gives the test that separates the
cases:

- Qualify when the qualifier distinguishes two referents. That's why
"Ray node" against "Kubernetes node" is correct and should stay.
- Don't qualify when it relabels one thing.
- Keep the scope explicit where a page also describes Pods the
RayCluster doesn't own, such as the operator, Redis, or a `curl` Pod,
and where a nearby command filters by label. "List all Pods" and "List
the Ray cluster's Pods" describe different commands and shouldn't read
the same way.

The cleanup is ray-project#65423, which removes all 89 uses from the docs and is
reviewable on its own. This PR is the rule; that one is the sweep.

Vale picks up four swaps for the retired forms. Plurals get their own
entries, for the word-boundary reason @win5923 identified on the `head
pod` swaps. Verified that they don't fire on "Ray head Pod" or "Ray
worker Pods", and that the gated `doc/source/data/` path holds at 173
alerts.

## Not a duplicate

Checked open PRs for this area before starting:

```
gh pr list --repo ray-project/ray --state open --search "writing-style"
gh pr list --repo ray-project/ray --state open --search "style guide in:title"
gh pr list --repo ray-project/ray --state open --search "kuberay style"
```

No open PR touches `doc/source/ray-contribute/writing-style.md` or
proposes KubeRay style guidance. The `writing-style` matches were all
false positives on `write_delta`. This extends the guide added in
ray-project#64518.

## Testing

```
pre-commit run --files doc/source/ray-contribute/writing-style.md
```

Passes, but as a no-op on the Markdown: every hook reports "no files to
check," because no pre-commit hook applies to Markdown under
`doc/source/` and Vale is scoped to `doc/source/data/`. Stating that
plainly instead of claiming coverage it doesn't give.

The Vale config files do have hook coverage, and those checks ran for
real:

```
pre-commit run --files .vale.ini .vale/styles/KubeRay/Terms.yml .vale/styles/config/vocabularies/KubeRay/accept.txt
```

`trim trailing whitespace`, `fix end of files`, `check for added large
files`, and `semgrep` all pass.

Vale verification for the ruleset is in the section above: path scoping,
the 31-alert current state, and the 174 → 173 no-regression check on the
gated path.

Verified by hand: the new `(kubernetes-docs-style)=` anchor doesn't
collide with any existing target in `doc/source/`, and the section uses
the same MyST anchor form and Markdown pipe-table style already used
elsewhere in this file. Rendering is verified by the Read the Docs
preview build on this PR.

No code, no API, no behavior change. The prose is a contributor guide;
the Vale files add configuration without widening what CI enforces.

## AI assistance

Written with AI assistance (Claude). I've reviewed every changed line,
generated and inspected the casing counts myself, and can defend the
change end to end. The scan scripts that produced the numbers live
outside this repo; happy to share the methodology or re-run against a
different corpus if a reviewer wants to check a figure.

---

### Update: the vocabulary now covers the ecosystem terms these pages
use (555ebda)

Running `vale doc/source/cluster/kubernetes/`, which this PR's
`.vale.ini` comment tells contributors to do, produced 215
`Vale.Spelling` alerts on correctly spelled terms. The accept list
covered API objects, the custom resources, and project names, but not
the wider ecosystem vocabulary the pages actually contain. Left as is, a
contributor following the instruction learns to ignore Vale on exactly
the paths this PR wants gated.

Added: the ecosystem projects (Istio, Kiali, gVisor, Kata, Krew,
Kustomize, Bottlerocket, Aliyun, GCSFuse, Promtail, Fluentd, Filebeat,
Alertmanager), the Gateway API `HTTPRoute`, and the Kubernetes and
infrastructure terms in use (cgroup, finalizer, kubeconfig, kubelet,
namespaced, namespaces, toleration, upscaling, downscaling, vCPU, FQDN,
AMI, subnet, syscall, hostname, cron, CA, autoscalers).

**Excluded on purpose, since an accept list shouldn't launder a
defect.** `CR` and `CRs`, 12 uses, because this PR's own guidance says
to write "custom resource" and to define CustomResourceDefinition then
use CRD. Real misspellings: `heterogenous`, `replicaset` for ReplicaSet,
`Deepseek` for DeepSeek, `nodepool` for node pool. `gsutil`, which
`gcloud storage` supersedes. Unbackticked code identifiers, which are a
formatting defect rather than a vocabulary gap: `podSpec`,
`podSelector`, `nodeSelector`, `jsonPointers`, `intervalSeconds`,
`workerGroup`, `ignoreDifferences`, `HTTPMode`, `args`, `yaml`. And
generic English that Vale's dictionary lacks, which belongs in the
General vocabulary rather than a KubeRay-specific one.

Three entries are case-tolerant (`[Tt]oleration(s)?`, `[Uu]pscaling`,
`[Dd]ownscaling`). A lowercase-only entry makes `Vale.Terms` flag the
legitimate sentence-start capitalization.

**Verification**, deterministic across repeated runs:

- `doc/source/cluster/kubernetes/`: 1329 alerts to 1178. `Vale.Spelling`
drops from 215 to 72. `KubeRay.Terms` is unchanged at 160, confirming no
swap got shadowed by a new accept entry, which is the trap the `Ray
Autoscaler` comment in `Terms.yml` documents.
- `doc/source/data/`, the only path the pre-commit hook gates: 173 to
170, with **no new alerts**. A `Vocab` is global, so it can only widen
what's accepted.
- One candidate entry was dropped for exactly that reason. A
`runtime(s)?` entry made `Vale.Terms` flag "Runtime" in
`doc/source/data/monitoring-your-workload.rst`, a new alert on the gated
path.

Four new `Vale.Terms` alerts do appear on the KubeRay paths, and all
four are genuine casing defects in existing pages rather than noise:
"Kubelet" twice in `configuring-ippr.md`, lowercase "istio" naming the
project in `rayservice-incremental-upgrade.md`, and "Cgroups" in the
`resource-isolation-with-writable-cgroups.md` H1, which is also title
case. Those are content fixes for a separate change, not this one.

AI assistance was used for this commit, including the Vale sweep and the
before-and-after verification above.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: 400Ping <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…-project#65239)

## Why this change

Ray on Kubernetes docs describe Kubernetes API objects alongside Ray
concepts, and the two vocabularies collide. Deployment, Job, and Service
each name both a Kubernetes API object and a distinct Ray concept, so
capitalization is the only thing telling them apart, and the style guide
didn't say which form to use where. A contributor asking "RayCluster or
Ray cluster?" had to derive the answer from two guides and adjudicate
between them.

This adds a `Writing Ray on Kubernetes and KubeRay docs` section to the
style guide, scoped to the user-facing pages under
`doc/source/cluster/kubernetes/` and the contributor-facing pages in
[ray-project/kuberay](https://github.com/ray-project/kuberay).

The approach is to extend this guide with a Kubernetes deference section
rather than stand up a separate KubeRay style guide. The two guides
already overlap heavily, and a forked guide would drift within a release
or two.

## What the casing scan found

The term list isn't invented. It comes from a prose-only scan of three
corpora: 79 user-facing pages in this repo, 12 contributor pages in
`ray-project/kuberay`, and 128 pages of `kubernetes/website`
(`content/en/docs/concepts/`, commit `bb38117c0`). The scan strips front
matter, fenced code blocks, inline code, MyST roles, and link targets
before counting, so YAML field names and CLI output don't inflate the
figures.

Headline: **these docs already follow the Kubernetes casing rule.**
Upstream Kubernetes capitalizes "Pod" in 71% of prose uses; the Ray-side
KubeRay docs do so in 70%. So this PR documents a rule the docs mostly
already follow, and does not propose a capitalization sweep.

| Term | Ray-side KubeRay docs | Upstream Kubernetes | Read |
|---|---|---|---|
| Pod | 371/527 (70%) | 3712/5195 (71%) | Matches upstream almost
exactly. |
| ConfigMap | 20/21 (95%) | 119/130 (91%) | Healthy. |
| Ingress | 8/15 (53%) | 148/242 (61%) | Roughly aligned. |
| Service | 18/114 (15%) | 515/946 (54%) | Diverges by design. |
| Job | 17/143 (11%) | 522/610 (85%) | Diverges by design. |
| Deployment | 6/53 (11%) | 355/461 (77%) | Diverges by design. |

The three "diverges by design" rows are the reason this section exists.
Sampling shows the lowercase uses are Ray Serve deployments, Ray jobs,
and Ray services, not Kubernetes API objects. That's a naming collision,
not drift, so the fix is a disambiguation rule rather than a sweep.
Kubernetes's own rule expects a mix (UpperCamelCase for the API object,
sentence case for the general concept), which is why the upstream column
isn't 100% either.

The one genuine inconsistency the scan found is **"Ray Autoscaler" (44
uses) against "Ray autoscaler" (35)**, spread across at least eight
files. This guide already says to lowercase generic nouns even when they
name a Ray concept, so lowercase wins. Recording the rule here is the
prerequisite for a mechanical follow-up cleanup. I've left that out of
this PR to keep the rule change reviewable on its own.

## Open questions for reviewers

I've deliberately written only the rules I can support from the two
published guides plus the scan. These five are genuinely open, and I'd
rather resolve them in review than assert them:
All five are now resolved in review. Each entry keeps the original
question for context, since the reasoning behind the answer matters more
than the answer:
1. ~~**Confirm the custom-resource split.**~~ **Resolved** by @win5923:
the split is intentional and consistent with Kubernetes terminology.
Original question: The section documents `RayCluster` (the resource)
versus "Ray cluster" (the running thing it produces), currently 335
against 106 uses in this repo. I read it as intentional and matching the
Kubernetes API-object rule. Worth confirming rather than normalizing to
one form.
1. ~~**"head Pod" versus "head node."**~~ **Resolved** by @win5923: use
"head Pod" consistently when a Ray cluster runs on Kubernetes. Original
question: The section prefers "head Pod" for the Kubernetes-hosted case,
since a node is a machine on Kubernetes.
`doc/source/cluster/kubernetes/index.md` currently says "a head node pod
and a collection of worker node pods," which stacks both vocabularies.
Reasonable, or is "head node" worth keeping for continuity with Ray's
core architecture docs?
1. ~~**Feature graduation phases.**~~ **Resolved** by @win5923: keep the
existing convention, start case for Kubernetes feature stages and
lowercase for Ray and KubeRay stages. The corpus already works this way.
I've added the ownership test for the ambiguous case, a third-party
controller's feature gate, which makes `kueue.md:747` a defect rather
than an exception. No Vale rule, since a substitution can't tell which
project a stage name refers to. Original question: Kubernetes uses start
case ("DRA is Beta"); Ray docs lowercase feature stages. This bites on
pages discussing a Kubernetes feature's stage and a Ray feature's stage
in one paragraph. I left it out of the section rather than pick. Which
wins?
1. ~~**Field values.**~~ **Resolved** by @win5923, who writes values in
backticks: "set `upgradeStrategy.type` to
`NewClusterWithIncrementalUpgrade`." That's also what this guide already
says, so the section now states the divergence from Kubernetes
explicitly rather than leaving the two guides to contradict each other
silently. Original question: Kubernetes wants unquoted, unstyled values
("set `imagePullPolicy` to Always"); this guide says to use backticks
for configuration values and gives `num_replicas: 1`. These are closer
than they look, since one is a bare value and the other a key-value
pair, but the guidance should say which form applies where.
1. ~~**"Ray dashboard" versus "Ray Dashboard"**~~ **Resolved** by
@win5923: lowercase, on the grounds that "dashboard" is a generic noun
for the same reason "autoscaler" is, which makes the rule already in
this guide cover it. Applies to "KubeRay dashboard" too. This is the
largest defect the ruleset now surfaces, at 43 prose uses plus 1, and it
moves `KubeRay.Terms` on these pages from 160 to 204. A fair number sit
in headings, where the sentence-case rule makes them defects too. Sweep
folds into ray-project#65423. Original question: 43 title-case against 18
lowercase. This guide implies lowercase, but the dashboard is arguably a
named UI surface. Not addressed in the section pending a call.

Two further items are out of scope here but worth flagging:

- **Line wrapping in the `kuberay` repo.** This guide requires soft
wrap. The Kubernetes guide requires manual wrap, justified by
localization teams diffing per line, which KubeRay doesn't have. Nothing
in this PR changes that, since this guide already governs `doc/source/`.
But `kuberay`'s `.markdownlint.yaml` sets `MD013` to 120 characters via
pre-commit, which is a latent gate: 266 lines in its `docs/` already
exceed it, it isn't enforced in CI, and it isn't auto-fixable, so
contributors hit it unpredictably on whichever file they touch.
Disabling it there would align the two repos, but that's a call for
KubeRay maintainers in their own repo.
- **Turning Vale enforcement on.** This PR now adds the ruleset but
doesn't enforce it. See the section below.

## Staged Vale ruleset

A later commit adds a Vale ruleset for these pages, following the
pattern already used for the Ray Data docs. **Nothing is enforced yet.**
The Vale hook in `.pre-commit-config.yaml` stays scoped to
`^doc/source/data/.*`, so CI checks exactly what it checked before.

- `.vale/styles/config/vocabularies/KubeRay/accept.txt` — the KubeRay
custom resources, the Kubernetes and ecosystem API objects these pages
reference, and project names. Skips what the `General` vocabulary
already accepts (`Kubernetes`, `kubectl`, `CRD(s)?`, `namespace`).
- `.vale/styles/KubeRay/Terms.yml` — a `substitution` rule at `warning`
level covering only the casing forms the new style-guide section
settles, with `vocab: false` (see below). The open questions above are
deliberately absent.
- `.vale.ini` — registers the vocabulary and scopes the style to
`doc/source/cluster/kubernetes/`.

Registering a vocabulary that the hook doesn't exercise matches existing
practice here: `RLlib` and `Train` are already in `Vocab` while the hook
only runs on `doc/source/data/`.

Contributors can run it by hand today:

```
vale doc/source/cluster/kubernetes/
```

To enforce later, widen the `files` pattern on the `vale` hook. I'd
still hold that until the open questions land.

### What I verified

Vale 3.12.0 locally.

**Path scoping works.** The KubeRay rules fire on a file under
`doc/source/cluster/kubernetes/` and stay silent on identical content at
the repo root.

**Current state of these pages** — 146 `KubeRay.Terms` alerts, which
lines up with the casing scan:

| Alert | Count |
|---|---|
| Use 'Ray autoscaler' instead of 'Ray Autoscaler' | 42 |
| Use 'head Pod' instead of 'head pod' | 20 |
| Use 'worker Pod' instead of 'worker pod' | 7 |
| Use 'Ray job' instead of 'ray job' | 2 |
| Use 'Ray Serve' instead of 'Ray serve' | 1 |
| Use 'Ray cluster' instead of 'ray cluster' | 1 |
| Use 'KubeRay' instead of 'Kuberay' | 1 |
| Use 'GCS fault tolerance' instead of 'GCS FT' | 1 |

The 42 matches the scan's count for these pages exactly, which is a
useful cross-check on both. None of it is enforced, so nothing here has
to be fixed in this PR.

**No regression on the gated path.** Alert count on `doc/source/data/`
goes 174 → 173, deterministic across repeated runs in both states, with
no new alerts. A `Vocab` list is global, so it can only widen what's
accepted. The single alert that disappears is a `Google.Parens` hit in
`concurrent-dataset-execution.md`; no term in the new vocabulary appears
on that line, so I'm reporting that as observed rather than claiming I
understand the mechanism. It's a reduction either way, so it can't break
the gate.

### The vocabulary shadowing trap

Worth knowing if you write Vale rules here: a `Vocab` accept entry
shadows its token for **every** rule, case-insensitively. A substitution
whose target appears in an accept list silently never fires, and nothing
warns you.

This bit the `Ray Autoscaler` swap, because `autoscaler` is accepted in
`config/vocabularies/Data/accept.txt`. The fix is `vocab: false` on the
rule, which opts out of the filtering without touching the Data
vocabulary. The rule carries a comment saying so.

Credit to Bugbot for catching it. I'd first shipped that swap commented
out, having concluded the only way to enable it was dropping
`autoscaler` from the Data vocabulary and accepting new spelling alerts
on the gated path. That was wrong, and `vocab: false` avoids the
tradeoff entirely.

## Added after review

Two rules that review surfaced, both in the style-guide section plus the
Vale ruleset.

**Node stays lowercase.** Node is a Kubernetes API object, so
"capitalize Kubernetes API objects" read literally tells contributors to
write "Kubernetes Node." These pages almost always mean the machine, and
all 24 uses are correctly lowercase today, so a literal reading of the
rule would have someone "fix" working prose into wrongness. Kubernetes
applies the same two-part rule it applies elsewhere, capitalizing Node
only for the resource, and the section now says so.

**Don't write "Ray Pod."** This answers the casing question raised in
review, and the answer turned out to be neither casing. A Pod is a
Kubernetes host that contains a Ray node plus any sidecars, so naming it
after Ray overstates what it is. "TPU Pod" also already occupies the
qualified-Pod form in these pages and means a group of TPU chips rather
than a Kubernetes object. The term had no settled form to preserve
either: across the 55 prose lines using it, casing split four ways at
20, 16, 16, and 15.

Stating that alone would be a trap, because a bare "Pod" isn't always an
adequate replacement, so the section gives the test that separates the
cases:

- Qualify when the qualifier distinguishes two referents. That's why
"Ray node" against "Kubernetes node" is correct and should stay.
- Don't qualify when it relabels one thing.
- Keep the scope explicit where a page also describes Pods the
RayCluster doesn't own, such as the operator, Redis, or a `curl` Pod,
and where a nearby command filters by label. "List all Pods" and "List
the Ray cluster's Pods" describe different commands and shouldn't read
the same way.

The cleanup is ray-project#65423, which removes all 89 uses from the docs and is
reviewable on its own. This PR is the rule; that one is the sweep.

Vale picks up four swaps for the retired forms. Plurals get their own
entries, for the word-boundary reason @win5923 identified on the `head
pod` swaps. Verified that they don't fire on "Ray head Pod" or "Ray
worker Pods", and that the gated `doc/source/data/` path holds at 173
alerts.

## Not a duplicate

Checked open PRs for this area before starting:

```
gh pr list --repo ray-project/ray --state open --search "writing-style"
gh pr list --repo ray-project/ray --state open --search "style guide in:title"
gh pr list --repo ray-project/ray --state open --search "kuberay style"
```

No open PR touches `doc/source/ray-contribute/writing-style.md` or
proposes KubeRay style guidance. The `writing-style` matches were all
false positives on `write_delta`. This extends the guide added in
ray-project#64518.

## Testing

```
pre-commit run --files doc/source/ray-contribute/writing-style.md
```

Passes, but as a no-op on the Markdown: every hook reports "no files to
check," because no pre-commit hook applies to Markdown under
`doc/source/` and Vale is scoped to `doc/source/data/`. Stating that
plainly instead of claiming coverage it doesn't give.

The Vale config files do have hook coverage, and those checks ran for
real:

```
pre-commit run --files .vale.ini .vale/styles/KubeRay/Terms.yml .vale/styles/config/vocabularies/KubeRay/accept.txt
```

`trim trailing whitespace`, `fix end of files`, `check for added large
files`, and `semgrep` all pass.

Vale verification for the ruleset is in the section above: path scoping,
the 31-alert current state, and the 174 → 173 no-regression check on the
gated path.

Verified by hand: the new `(kubernetes-docs-style)=` anchor doesn't
collide with any existing target in `doc/source/`, and the section uses
the same MyST anchor form and Markdown pipe-table style already used
elsewhere in this file. Rendering is verified by the Read the Docs
preview build on this PR.

No code, no API, no behavior change. The prose is a contributor guide;
the Vale files add configuration without widening what CI enforces.

## AI assistance

Written with AI assistance (Claude). I've reviewed every changed line,
generated and inspected the casing counts myself, and can defend the
change end to end. The scan scripts that produced the numbers live
outside this repo; happy to share the methodology or re-run against a
different corpus if a reviewer wants to check a figure.




---

### Update: the vocabulary now covers the ecosystem terms these pages
use (555ebda)

Running `vale doc/source/cluster/kubernetes/`, which this PR's
`.vale.ini` comment tells contributors to do, produced 215
`Vale.Spelling` alerts on correctly spelled terms. The accept list
covered API objects, the custom resources, and project names, but not
the wider ecosystem vocabulary the pages actually contain. Left as is, a
contributor following the instruction learns to ignore Vale on exactly
the paths this PR wants gated.

Added: the ecosystem projects (Istio, Kiali, gVisor, Kata, Krew,
Kustomize, Bottlerocket, Aliyun, GCSFuse, Promtail, Fluentd, Filebeat,
Alertmanager), the Gateway API `HTTPRoute`, and the Kubernetes and
infrastructure terms in use (cgroup, finalizer, kubeconfig, kubelet,
namespaced, namespaces, toleration, upscaling, downscaling, vCPU, FQDN,
AMI, subnet, syscall, hostname, cron, CA, autoscalers).

**Excluded on purpose, since an accept list shouldn't launder a
defect.** `CR` and `CRs`, 12 uses, because this PR's own guidance says
to write "custom resource" and to define CustomResourceDefinition then
use CRD. Real misspellings: `heterogenous`, `replicaset` for ReplicaSet,
`Deepseek` for DeepSeek, `nodepool` for node pool. `gsutil`, which
`gcloud storage` supersedes. Unbackticked code identifiers, which are a
formatting defect rather than a vocabulary gap: `podSpec`,
`podSelector`, `nodeSelector`, `jsonPointers`, `intervalSeconds`,
`workerGroup`, `ignoreDifferences`, `HTTPMode`, `args`, `yaml`. And
generic English that Vale's dictionary lacks, which belongs in the
General vocabulary rather than a KubeRay-specific one.

Three entries are case-tolerant (`[Tt]oleration(s)?`, `[Uu]pscaling`,
`[Dd]ownscaling`). A lowercase-only entry makes `Vale.Terms` flag the
legitimate sentence-start capitalization.

**Verification**, deterministic across repeated runs:

- `doc/source/cluster/kubernetes/`: 1329 alerts to 1178. `Vale.Spelling`
drops from 215 to 72. `KubeRay.Terms` is unchanged at 160, confirming no
swap got shadowed by a new accept entry, which is the trap the `Ray
Autoscaler` comment in `Terms.yml` documents.
- `doc/source/data/`, the only path the pre-commit hook gates: 173 to
170, with **no new alerts**. A `Vocab` is global, so it can only widen
what's accepted.
- One candidate entry was dropped for exactly that reason. A
`runtime(s)?` entry made `Vale.Terms` flag "Runtime" in
`doc/source/data/monitoring-your-workload.rst`, a new alert on the gated
path.

Four new `Vale.Terms` alerts do appear on the KubeRay paths, and all
four are genuine casing defects in existing pages rather than noise:
"Kubelet" twice in `configuring-ippr.md`, lowercase "istio" naming the
project in `rayservice-incremental-upgrade.md`, and "Cgroups" in the
`resource-isolation-with-writable-cgroups.md` H1, which is also title
case. Those are content fixes for a separate change, not this one.

AI assistance was used for this commit, including the Vale sweep and the
before-and-after verification above.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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 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