Repository navigation
[doc] Seed RLlib and shared Ray Vale style rules (warn-first, not yet enforced) - #66236
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Vale style rules and terminology configurations for RLlib and Ray documentation, including rules to flag filler words, permit verbs, time-relative words, and plain-word substitutions. Feedback was provided to correct the grammatical inflections for the utilize and leverage substitutions in .vale/styles/Ray/Terms.yml (e.g., mapping utilizes to uses and utilized to used) to ensure the automated suggestions remain grammatically correct.
fe9f985 to
b655e4d
Compare
Adds deterministic prose rules ahead of enforcement, following the KubeRay pattern (ray#65239). Warn-level, not yet wired into .vale.ini or CI, since the RLlib pages are still reStructuredText on master and a path-scoped glob would match zero files (the empty-glob trap). Enforcement follows the MyST conversion. - .vale/styles/Ray/: shared, library-agnostic package. Terms.yml swaps the plain-word cases from writing-style.md (utilize/leverage->use, via->through, prior to->before, in order to->to, refer to->see); Filler.yml, TimeRelative.yml, and PermitVerbs.yml flag filler, time-relative words, and the allows/enables/lets-you construction. - .vale/styles/RLlib/Terms.yml: RLlib terminology, seeded from corpus evidence. Standardizes on "multi-agent" over "multiagent" (majority form) and "RLModule" over "RL module". Grows as the RLlib style pass surfaces more terms. - Accept "multi-agent" in the RLlib vocabulary alongside "multiagent". All rules are level: warning with vocab: false, validated to fire cleanly (0 errors) against sample prose. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
…warn-first Wires the styles from the previous commit to doc/source/rllib pages, following the KubeRay block's registered-but-not-CI-enforced pattern. Vale's pre-commit hook is still scoped to doc/source/data/, so this doesn't run in CI; it lets contributors run `vale doc/source/rllib/` by hand during the RLlib style pass. The shared Ray style is scoped to RLlib for now and moves to the global section once other libraries adopt it. Verified: the Ray and RLlib rules fire on RLlib pages and don't leak onto other paths. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Map the inflected forms to inflected replacements (utilizes->uses, utilized->used, leverages->uses, leveraged->used) so the suggestion reads grammatically, e.g. "The system uses a cache" rather than "The system use a cache". Addresses review feedback. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Bare "refer to" collides with the "pertain to" sense ("these examples
refer to the old API stack"), where swapping to "see" is wrong. Because
these swaps auto-apply, a broad rule silently corrupts prose. Restrict
the swap to the unambiguous "please refer to" form and leave the bare
verb to a human/LLM pass.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
0bdcc69 to
3b3d785
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3b3d785. Configure here.
| # No literal string separates imperative "Refer to X" from "Y refers to X", | ||
| # and this file's swaps auto-apply (scripts/ray_style_autofix.py), so a broad | ||
| # "refer to" swap silently corrupts prose. Leave the bare form to the LLM pass. | ||
| please refer to: see |
There was a problem hiding this comment.
Substitution suggestions drop sentence case
Low Severity
Ray.Terms sets ignorecase: true so capitalized phrasing still matches, but it never sets capitalize: true. Suggested replacements therefore stay lowercase even when the match starts a sentence, and applying them would drop required sentence-case capitalization.
Reviewed by Cursor Bugbot for commit 3b3d785. Configure here.
…ing-style guide (#66239) ## Summary Two things across the converted RLlib documentation pages under `doc/source/rllib/`: a prose/style pass against the [Ray writing-style guide](https://docs.ray.io/en/latest/ray-contribute/writing-style.html), and a set of technical corrections surfaced during that pass and by RLlib-maintainer review. This is the style-pass layer of the RLlib IA pilot stack, sitting on top of the soft-wrap PR (#66214) and the Vale-rules PR (#66236), whose warn-first rules this pass uses as its deterministic net. Opening as a **draft** for review. All 26 pages have had the pass; the stack still needs a rebase as the lower PRs merge. ## How the style pass runs A deterministic-first pipeline, so the model never spends effort on what a linter catches: - **Layer 0 (deterministic, no model):** `codespell` for typos, then the shared `Ray/` and `RLlib/` Vale term swaps applied to prose only (code, inline code, MyST roles, anchors, and URLs are shielded). Two semantic false positives were caught by hand: `refer to → see` is correct for a reference but wrong for the "pertain to" sense, and a `N(ot)` math token inside inline code isn't a typo. - **Comprehensive pass (per page):** active voice, second person, present tense, no first-person plural, filler cut, "such as" not "like", hedges turned into direct advice, parentheticals and long sentences restructured, headings to sentence case. Meaning is held invariant; code, role targets, and anchors are never touched, and soft-wrap is preserved. - **Cleanup pass (per page):** list punctuation, parentheticals, and the prose inside figure captions, admonition bodies, and `list-table` cells — the seam the comprehensive pass misses. Every prose edit is verified against the `git diff`, not the editor's self-report: code-fence counts, `{ref}`/`{py:*}` role targets, `(label)=` anchors, and URLs are diffed to confirm they didn't move. ## Technical corrections (from maintainer review and code introspection) The prose pass is meaning-preserving by design, but reviewing it surfaced pre-existing technical errors in the docs. These are **not** style edits, and each one is validated against the RLlib source rather than guessed: - **Broken cross-references and copy-paste errors:** dead `{py:class}`/`{ref}` targets (for example a Unicode `®ay`, `OffLinePreLearner`, `default_model_cnofig`), a SAC diagram captioned "DQN", a DeepMind Control Suite figure captioned "Atari 100k tasks", and an OpenSpiel section that pointed at the `PettingZooEnv` wrapper. Each corrected form was confirmed against the source tree before applying. - **`external-envs.md` RLlink protocol section, rewritten:** the published section described message bodies that don't exist in the code. @pseudo-rnd-thoughts flagged the section as materially wrong during review; the rewrite is validated through direct discussion with him and by introspecting the implementation (`rllib/env/external/rllink.py`, `env_runner_server_for_external_inference.py`, and the reference client). It corrects the wire format (msgpack, with a body-length header), the `SET_STATE` body (`rl_module` state plus `weights_seq_no`, not an `onnx_file`/`mlir_file`), the `SET_CONFIG` body (a pickled `AlgorithmConfig`, not `env_steps_per_sample`/`force_on_policy`), and the `EPISODES_AND_GET_STATE` body (`SingleAgentEpisode.get_state()` dicts plus `timesteps`), and documents the previously omitted `EPISODES` and `GET_STATE` message types. External-environment support is an early, still-changing area of RLlib. This PR corrects the docs to match the current implementation and keeps the section's "early draft" note; deeper protocol tech debt is expected to be follow-up work for eng. The three open questions the review raised (a Ray 2.52/2.53 version mismatch, a TensorFlow-support contradiction, and the RLlink framing) were answered by the maintainer and are resolved in the commits above. ## Scope and status All 26 soft-wrapped RLlib pages are in scope for the prose pass; the technical corrections touch the subset where review found errors. Vale enforcement (widening the hook and CI paths) stays deferred to #66236's plan. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
… enforced) (ray-project#66236) ## Summary Seeds deterministic prose enforcement for RLlib docs ahead of the style pass, following the KubeRay pattern established in ray-project#65239. All rules are warn-level and **not yet run in CI** (the Vale pre-commit hook is still scoped to `doc/source/data/`); they're registered so contributors can run `vale doc/source/rllib/` by hand. This sits in the RLlib conversion stack, between the soft-wrap PR and the upcoming style/grammar pass, so the rules exist before that pass edits prose. ## What's here - **`.vale/styles/Ray/`** — a shared, library-agnostic style package: `Terms.yml` (plain-word swaps: utilize/leverage→use, via→through, prior to→before, in order to→to, refer to→see) plus `Filler.yml`, `TimeRelative.yml`, and `PermitVerbs.yml` (the allows/enables/lets-you construction). Scoped to RLlib for now; it moves to the global section once other libraries adopt it. - **`.vale/styles/RLlib/Terms.yml`** — RLlib terminology, seeded from corpus evidence: standardize on `multi-agent` (majority form) over `multiagent`, and `RLModule` over `RL module`. Grows as the style pass surfaces more terms. - **`.vale.ini`** — a path-scoped section registering these styles for `doc/source/rllib/**`, warn-first and not CI-enforced, mirroring the KubeRay block. All rules use `level: warning` and `vocab: false` (so an accept-list entry can't silently shadow a swap — verified: with `vocab: true` the `multiagent` swap goes dark). Confirmed the rules fire on RLlib pages and don't leak onto other paths. ## Notes Enforcement (widening the Vale hook's `files` pattern and the CI paths) is deliberately deferred until the RLlib MyST conversion lands, to avoid blocking the byte-identical conversion PRs on pre-existing prose. Every commit is DCO signed-off. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
…ing-style guide (ray-project#66239) ## Summary Two things across the converted RLlib documentation pages under `doc/source/rllib/`: a prose/style pass against the [Ray writing-style guide](https://docs.ray.io/en/latest/ray-contribute/writing-style.html), and a set of technical corrections surfaced during that pass and by RLlib-maintainer review. This is the style-pass layer of the RLlib IA pilot stack, sitting on top of the soft-wrap PR (ray-project#66214) and the Vale-rules PR (ray-project#66236), whose warn-first rules this pass uses as its deterministic net. Opening as a **draft** for review. All 26 pages have had the pass; the stack still needs a rebase as the lower PRs merge. ## How the style pass runs A deterministic-first pipeline, so the model never spends effort on what a linter catches: - **Layer 0 (deterministic, no model):** `codespell` for typos, then the shared `Ray/` and `RLlib/` Vale term swaps applied to prose only (code, inline code, MyST roles, anchors, and URLs are shielded). Two semantic false positives were caught by hand: `refer to → see` is correct for a reference but wrong for the "pertain to" sense, and a `N(ot)` math token inside inline code isn't a typo. - **Comprehensive pass (per page):** active voice, second person, present tense, no first-person plural, filler cut, "such as" not "like", hedges turned into direct advice, parentheticals and long sentences restructured, headings to sentence case. Meaning is held invariant; code, role targets, and anchors are never touched, and soft-wrap is preserved. - **Cleanup pass (per page):** list punctuation, parentheticals, and the prose inside figure captions, admonition bodies, and `list-table` cells — the seam the comprehensive pass misses. Every prose edit is verified against the `git diff`, not the editor's self-report: code-fence counts, `{ref}`/`{py:*}` role targets, `(label)=` anchors, and URLs are diffed to confirm they didn't move. ## Technical corrections (from maintainer review and code introspection) The prose pass is meaning-preserving by design, but reviewing it surfaced pre-existing technical errors in the docs. These are **not** style edits, and each one is validated against the RLlib source rather than guessed: - **Broken cross-references and copy-paste errors:** dead `{py:class}`/`{ref}` targets (for example a Unicode `®ay`, `OffLinePreLearner`, `default_model_cnofig`), a SAC diagram captioned "DQN", a DeepMind Control Suite figure captioned "Atari 100k tasks", and an OpenSpiel section that pointed at the `PettingZooEnv` wrapper. Each corrected form was confirmed against the source tree before applying. - **`external-envs.md` RLlink protocol section, rewritten:** the published section described message bodies that don't exist in the code. @pseudo-rnd-thoughts flagged the section as materially wrong during review; the rewrite is validated through direct discussion with him and by introspecting the implementation (`rllib/env/external/rllink.py`, `env_runner_server_for_external_inference.py`, and the reference client). It corrects the wire format (msgpack, with a body-length header), the `SET_STATE` body (`rl_module` state plus `weights_seq_no`, not an `onnx_file`/`mlir_file`), the `SET_CONFIG` body (a pickled `AlgorithmConfig`, not `env_steps_per_sample`/`force_on_policy`), and the `EPISODES_AND_GET_STATE` body (`SingleAgentEpisode.get_state()` dicts plus `timesteps`), and documents the previously omitted `EPISODES` and `GET_STATE` message types. External-environment support is an early, still-changing area of RLlib. This PR corrects the docs to match the current implementation and keeps the section's "early draft" note; deeper protocol tech debt is expected to be follow-up work for eng. The three open questions the review raised (a Ray 2.52/2.53 version mismatch, a TensorFlow-support contradiction, and the RLlink framing) were answered by the maintainer and are resolved in the commits above. ## Scope and status All 26 soft-wrapped RLlib pages are in scope for the prose pass; the technical corrections touch the subset where review found errors. Vale enforcement (widening the hook and CI paths) stays deferred to ray-project#66236's plan. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
…enforced) (#66640) ## Why are these changes needed? Seeds deterministic prose enforcement for Ray Core docs ahead of the style pass, following the pattern from #65239 (KubeRay) and #66236 (RLlib). Every rule is warn-level and **not run in CI yet**. The Vale pre-commit hook is commented out, and when it was on it covered only `doc/source/data/`. Registering the config lets contributors run `vale doc/source/core/` by hand during the style pass. **Stacked on #66605**, which moves `doc/source/ray-core/` to `doc/source/core/`. The path-scoped section is written against the final path, so this PR targets that branch. Retarget to `master` once #66605 merges. Ray Core defines the object vocabulary the rest of the docs reference, so the forms settled here are the ones other libraries inherit. ## What's here - **`.vale/styles/Core/Terms.yml` and `Core/Capitalization.yml`:** case-sensitive `substitution` swaps at `level: warning`, seeded from a prose-only count over `doc/source/core/`. `Terms.yml` holds the swaps that are safe to apply blindly. `Capitalization.yml` holds the ones that lowercase a whole phrase and would drop a heading's or sentence's initial capital, so it has no replace action: - `raylet` lowercase mid-sentence. The source code uses the lowercase form about 8 to 1. The swaps carry a preceding word, such as `the Raylet`, so a sentence that opens with "Raylet" doesn't alert. - `Plasma store`: Plasma keeps its capital as the implementation's name, and "store" stays lowercase. - `object ref` in prose, with `ObjectRef` in code style for the type. - `runtime env` to `runtime environment`. - Title-cased generic nouns, mostly in headings, such as `Placement Group`, `Fault Tolerance`, and `Head Node`. These live in `Capitalization.yml`, with `Raylets` and `Object Ref(s)`. `Ray/Capitalization.yml` already covers `Ray Task`, `Ray Actor`, and similar. - **Accept lists:** - `Core` gains Ray Core mechanism terms (`asyncio`, `Gloo`, `GPUDirect`, `libfabric`, `subreaper`, `retryable`, and others), and `RPC` becomes `RPC(s)?`. - `General` gains cross-cutting technical words and vendor names that other libraries also hit (`backoff`, `serializer`, `protobuf`, `Cython`, `CuPy`, `Gaudi`, `NPU(s)?`, and others). - Casing-only fixes such as `AsyncIO` and `GLOO` rely on the accept list driving `Vale.Terms`, not on a swap, so a token never alerts twice. - **`.vale.ini`:** a `[doc/source/core/**/*.{md,rst}]` section with `Vale, Google, Ray, Core`, mirroring the RLlib block. The KubeRay and RLlib comments also get corrected enforcement steps: enforcing means uncommenting the hook and widening both its `files` pattern and the top-level `exclude` carve-out. - **`writing-style.md`:** a "Writing Ray Core docs" section with a Ray Core terms table. Both Core rules link to it through the `ray-core-docs-style` label. - **Replace actions on the term rules:** `Ray/`, `RLlib/`, `KubeRay/`, and `Core/Terms.yml` set `action: {name: replace}`, so Vale's JSON output carries each swap's replacement text. A tool can then apply the swaps from Vale's own alerts instead of re-implementing Vale's path scoping and code-span handling. Every swap in these four files is a literal that's safe to apply without judgment. A swap that needs a human decision belongs in a rule without the action. No prose under `doc/source/core/` changes here. The style pass that fixes the alerts follows in separate PRs stacked on this one, split by section. ## Duplicate check No open PR adds Ray Core Vale rules. I searched open `ray-project/ray` PRs for `vale core` and for `writing-style.md`. #66639, my own PR, also edits `writing-style.md`, in a different section. Whichever lands second takes a trivial rebase. ## Testing - **Vale 3.12.0 on `doc/source/core/`:** the two Core rules raise 85 alerts, 45 from `Core.Terms` and 40 from `Core.Capitalization`, all of them true positives on review. No position alerts twice across `Vale.Terms`, the Core rules, `Ray.Terms`, and `Ray.Capitalization`. Vale.Spelling drops from 373 to 168. What's left is mostly unbackticked code that the prose pass will fix, not vocabulary. - **Rule check against the new guide table:** linting the table under the Core scope fires on every "Not" form that has a swap or accept entry, and on none of the "Use" forms. - **Other scopes:** alert counts for `doc/source/rllib`, `doc/source/data`, and `doc/source/cluster/kubernetes` stay the same apart from fewer Vale.Spelling hits. `walkthrough` isn't on the accept list, because an entry there would shadow `Google.WordList`'s `walk-through` swap. It now alerts twice in `doc/source/core` and twice in `doc/source/kuberay`. - **Lookbehind check:** a `(?<=...)Raylet` swap key misreported its position and missed the mid-sentence match in Vale 3.12, which is why the file uses explicit preceding-word keys. - **Replace actions don't change the alerts:** with and without the `action` lines, Vale reports the same checks, lines, spans, and messages on `doc/source/core`, `doc/source/rllib`, and `doc/source/cluster/kubernetes`, compared by a stable hash of the full alert list. Every `*.Terms` alert in those areas now carries a `replace` action, and `Core.Capitalization` alerts carry none. - **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](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…t enforced) (#66885) ## Why are these changes needed? This PR adds Vale terminology rules for Ray Train docs ahead of a style pass over those pages. It follows the pattern from #65239 (KubeRay), #66236 (RLlib), and #66640 (Ray Core). Every rule is warn-level and **doesn't run in CI yet**. Registering the config lets contributors run `vale doc/source/train/` by hand during the style pass. **Stacked on #66883**, which renames the Train landing page and hyphenates page slugs. The path-scoped section targets the final paths, so this PR targets that branch. Retarget it to `master` once #66883 merges. ## What's here - **`.vale/styles/Train/Terms.yml`:** case-sensitive `substitution` swaps at `level: warning`, each safe to apply without judgment, so the file sets `action: replace`. The forms follow the four concepts `train/overview.md` defines: - `train function` becomes `training function`. - `scaling config`, `run config`, and `checkpoint config` are spelled out in prose. The classes keep code style. - `finetune` and its forms become `fine-tune`. - `Train v2` becomes `Train V2`. - **`.vale/styles/Train/Capitalization.yml`:** title-cased generic nouns, such as `Fault Tolerance`, `Local Mode`, and `Worker Group`, plus `Trainer` written as the Ray Train concept. 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 bare "Trainer" in prose is often a third-party class, such as the Lightning or Hugging Face Transformers `Trainer`. Those need code style, not lowercase. The rule's keys carry a preceding word, such as `the Trainer` and `your Trainer`, and leave the decision to a person. - **Trainer casing:** prose uses "trainer" lowercase for the concept, with class names in code style. That matches the guide's rule to lowercase generic nouns even when they name a Ray concept, the way Ray Core treats "placement group." `overview.md` capitalizes it today, so the style pass changes that page. - **Accept lists:** - `Train` gains `JAX`, `Flax`, `Optax`, `Orbax`, `TensorBoard`, `torchrun`, `allreduce`, and `resharding`. - `General` gains cross-library words and vendor names: `Trainium`, `Backblaze`, `Filestore`, `preemption(s)`, `bottleneck(ed|ing)`, `iterable(s)`, `serializable`, and `colocated`. - Casing-only fixes such as `Jax` and `Tensorboard` come from the accept list driving `Vale.Terms` rather than from a swap, so no token alerts twice. - **RLlib accept list fix:** `[Pp]y[Tt]orch` and `[Tt]ensor[Ff]low` become `PyTorch` and `TensorFlow`. Vocabularies register globally, so those bracket classes accepted `Pytorch` and `Tensorflow` in every library and silently overrode the Train vocabulary's casing. The change adds no alerts under `doc/source/rllib`. It surfaces 15 miscased brand names in prose elsewhere, across Serve, Tune, KubeRay, cluster, getting-started, and Train pages. It also flags the "Not" column of the new guide table, as intended, and one `:link:` false positive, described under Testing. - **`Ray/Brands.yml`:** adds `WandB` → `W&B`. It's case-sensitive, so the lowercase package name `wandb` doesn't match. - **`.vale.ini`:** a `[doc/source/train/**/*.{md,rst}]` section with `Vale, Google, Ray, Train`, which mirrors the Core block. - **`writing-style.md`:** a "Writing Ray Train docs" section with a terms table. Both Train rules link to it through the `ray-train-docs-style` label. The section also places a Train worker relative to a Ray Core worker process. No prose under `doc/source/train/` changes here. The style pass that fixes the alerts follows in separate PRs stacked on this one. ## Duplicate check No open PR adds Ray Train Vale rules. I searched open `ray-project/ray` PRs for `vale train` and for `writing-style.md`. The only hits are #66809, my own CI change with no Vale or style-guide edits, and #65707, a KubeRay docs change. ## Testing Commands, run from the repo root: ```bash vale --output=JSON doc/source/train/ vale --output=line doc/source/ # before and after, diffed pre-commit run --files <changed files> ``` Results with Vale 3.12.0: - **`doc/source/train/`:** total alerts go from 839 to 802. `Train.Terms` raises 5 alerts, all true positives. `Train.Capitalization` raises 29: `Trainer` concept uses, title-cased `Fault Tolerance` and `Local Mode`, and the Lightning and Transformers `Trainer` mentions that the style pass should put in code style. `Vale.Spelling` drops from 77 to 43. The rest is mostly unbackticked code and identifiers for the prose pass. No position alerts twice across `Vale.Terms`, `Vale.Spelling`, `Train.*`, `Ray.Terms`, and `Ray.Brands`. - **Rule check against the new guide table:** linting the table rows under the Train scope fires on every "Not" form except a bare `Trainer`, which the rule deliberately doesn't match. - **Other scopes:** compared alert by alert over `doc/source/rllib`, `doc/source/core`, and `doc/source/kuberay`, the accept-list entries remove 4 false positives (`serializable`, `colocated`, `JAX`, and one `Google.Parens`). The only new alerts are 5 true-positive `WandB` hits in RLlib, from the shared `Ray/Brands.yml`. Across all of `doc/source`, the RLlib accept-list fix is the only other source of new alerts. - **Known false positive:** Vale reads a sphinx-design `:link:` option as prose. `train/more-frameworks.md:43` (`:link: distributed-tensorflow-keras`) alerted on `keras` before this PR and now also alerts on `tensorflow`. A section-scoped `TokenIgnores = (:link: \S+)` didn't suppress it, so it's left as a follow-up. Five `:link:` lines exist across `doc/source`. - **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](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…enforced) (#67017) ## Why are these changes needed? This PR adds Vale terminology rules for Ray Tune 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/tune/` by hand during the style pass. Builds on #67015 (merged), which renamed the Tune tutorials landing and hyphenated page slugs. The style pass PRs stacked on this one edit pages under those final names. ## What's here - **`.vale/styles/Tune/Terms.yml`:** case-sensitive `substitution` swaps at `level: warning`, each safe to apply without judgment, so the file sets `action: replace`. It spells out abbreviations in prose: `search alg`, `config dict`, `trial dir`, and `experiment dir`. The arguments and attributes keep code style. - **`.vale/styles/Tune/Capitalization.yml`:** title-cased generic nouns, such as `Search Algorithm`, `Trial Scheduler`, `Function API`, and `Bayesian Optimization`, plus `Trainable` written as the concept. 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 bare "Trainable" in prose is often the class, which needs code style rather than lowercase. The rule's keys carry a preceding word, such as `the Trainable` and `your Trainable`, and leave the decision to a person. - "Bayesian Optimization" sometimes names the `bayesian-optimization` package rather than the technique. - **"Scheduler" is deliberately not a rule.** Ray Core and Kubernetes both have schedulers. The guide asks for "trial scheduler" where a page discusses more than one kind, and the rule flags only the title-cased `Trial Scheduler`. - **Accept lists:** - New `Tune` vocabulary: `trainable(s)`, `syncer(s)`, the search libraries `Hyperopt`, `Optuna`, `Nevergrad`, `BayesOpt`, `ZOOpt`, `HEBO`, and `Ax`, and the algorithm names `Hyperband`, `ASHA`, `BOHB`, `PBT`, `PB2`, and `TPE`. - `General` gains cross-library words: `docstring(s)`, `traceback(s)`, `runtimes`, `errored`, and `underperforming`. - Casing-only fixes such as `HyperOpt` and `HyperBand` come from the accept list driving `Vale.Terms` rather than from a swap, so no token alerts twice. - **`.vale.ini`:** registers `Tune` on the `Vocab` line and adds a `[doc/source/tune/**/*.{md,rst}]` section with `Vale, Google, Ray, Tune`, which mirrors the Train block. - **`writing-style.md`:** a "Writing Ray Tune docs" section with a terms table. Both Tune rules link to it through the `ray-tune-docs-style` label. The section also separates "trial" from "experiment," which the current prose uses loosely. An experiment is one `Tuner.fit()` call, and a trial is one run of the trainable with one hyperparameter configuration. No prose under `doc/source/tune/` changes here. The style pass that fixes the alerts follows in separate PRs stacked on this one. ## Duplicate check No open PR adds Ray Tune Vale rules. I searched open `ray-project/ray` PRs for `vale tune`, `writing-style.md`, and Tune docs titles. The hits are #66809, my own CI change with no Vale or style-guide edits, #65707, a KubeRay docs change, #64137, a Ray Core NIXL guide, and #67015, the rename this work builds on (now merged). ## Testing Commands, run from the repo root: ```bash vale --output=JSON doc/source/tune/ vale --output=line doc/source/ # on the base branch and on this branch, diffed pre-commit run --files <changed files> ``` Results with Vale 3.12.0: - **`doc/source/tune/`:** total alerts go from 1,239 to 1,437. Most of the increase is the shared `Ray` style now applying to Tune. `Tune.Capitalization` raises 118 alerts and `Tune.Terms` raises 1, all in title-cased concept nouns or spelled-out abbreviations. `Vale.Spelling` drops from 88 to 50. No position alerts twice across `Vale.Terms`, `Vale.Spelling`, and `Tune.*`. - **Two alert sources the style pass should handle rather than suppress:** - Library names in `api/suggestion.rst` headings, such as `Optuna (tune.search.optuna.OptunaSearch)`, now alert under `Vale.Terms` on the lowercase module segment. The module path belongs in code style. - `tutorials/tune-lifecycle.md` alerts on `ERRORED`, which it lists as a trial status. The source defines the status as `ERROR` (`Trial.ERROR` in `python/ray/tune/experiment/trial.py`), so that's a doc correction. - **Rule check against the new guide table:** linting the table rows fires `Vale.Terms` on `HyperBand`, `HyperOpt`, `hyperopt`, and `AX` in the "Not" column, as intended, the same as the Train table. - **Other scopes:** compared alert by alert across all of `doc/source` outside `tune/`, the only change is 17 removed alerts. They're false positives on `runtimes`, `errored`, `docstring`, `traceback`, and `Hyperopt` in Core, KubeRay, Serve, Train, observability, and contributor pages, plus one `Google.Parens` alert in `kuberay/user-guides/configuring-ippr.md:281` that the accept list now shadows. No new alerts. - **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](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>


Summary
Seeds deterministic prose enforcement for RLlib docs ahead of the style pass, following the KubeRay pattern established in #65239. All rules are warn-level and not yet run in CI (the Vale pre-commit hook is still scoped to
doc/source/data/); they're registered so contributors can runvale doc/source/rllib/by hand.This sits in the RLlib conversion stack, between the soft-wrap PR and the upcoming style/grammar pass, so the rules exist before that pass edits prose.
What's here
.vale/styles/Ray/— a shared, library-agnostic style package:Terms.yml(plain-word swaps: utilize/leverage→use, via→through, prior to→before, in order to→to, refer to→see) plusFiller.yml,TimeRelative.yml, andPermitVerbs.yml(the allows/enables/lets-you construction). Scoped to RLlib for now; it moves to the global section once other libraries adopt it..vale/styles/RLlib/Terms.yml— RLlib terminology, seeded from corpus evidence: standardize onmulti-agent(majority form) overmultiagent, andRLModuleoverRL module. Grows as the style pass surfaces more terms..vale.ini— a path-scoped section registering these styles fordoc/source/rllib/**, warn-first and not CI-enforced, mirroring the KubeRay block.All rules use
level: warningandvocab: false(so an accept-list entry can't silently shadow a swap — verified: withvocab: truethemultiagentswap goes dark). Confirmed the rules fire on RLlib pages and don't leak onto other paths.Notes
Enforcement (widening the Vale hook's
filespattern and the CI paths) is deliberately deferred until the RLlib MyST conversion lands, to avoid blocking the byte-identical conversion PRs on pre-existing prose. Every commit is DCO signed-off.🤖 Generated with Claude Code