Skip to content

[doc] Always use contractions, and move docs agent instructions into doc/AGENTS.md - #66639

Merged
dstrodtman merged 4 commits into
masterfrom
doc-1719-ray-always-contractions
Oct 1, 2026
Merged

dstrodtman merged 4 commits into
masterfrom
doc-1719-ray-always-contractions

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

The Ray writing-style guide told authors to use contractions except in warnings and error messages. This PR drops that exception, so the guide and the prose-style agent rule now say to always use contractions.

The exception also conflicted with the Vale config. Google.Contractions flags the expanded forms in warning bodies too, so authors who followed the guide got Vale findings.

Changed files:

  • doc/source/ray-contribute/writing-style.md: the "Use contractions" section.
  • doc/AGENTS.md (new): the agent instructions for doc/, moved out of doc/.claude/CLAUDE.md so that every agent reads them, plus a short "Prose style" section that points to writing-style.md.
  • doc/.claude/CLAUDE.md: now imports doc/AGENTS.md with @../AGENTS.md and keeps only Claude Code-specific content, the skills list.
  • doc/.claude/rules/prose-style.md and doc/.cursor/rules/ray-docs-style.mdc: deleted.
  • doc/source/ray-contribute/agent-development.md: one line documenting doc/AGENTS.md.

Why the agent files changed: the docs agent guidance was split by tool. doc/.claude/CLAUDE.md held the CI routing, PR scope, lockfile, and cross-reference guidance, but only Claude Code loads it, so Cursor users never saw it. The prose rules lived in two summaries of the style guide, one for Claude Code and one for Cursor. Every rule in those summaries is already in writing-style.md, and keeping three copies in sync is how the contraction exception survived in more than one place. Now doc/AGENTS.md holds everything that isn't tool-specific, Cursor and other agents read it directly, and Claude Code loads it through the import. The moved sections are unchanged.

Note for agent-config owners: this adds Ray's first AGENTS.md below the repo root, and it makes doc/ the first directory where <dir>/.claude/CLAUDE.md imports a shared AGENTS.md instead of holding the instructions itself. The same pattern could apply to the library directories, but this PR only changes doc/. It doesn't touch the root AGENTS.md contribution policy.

Related issue number

None.

Checks

  • Not a duplicate: no open PR touches writing-style.md, prose-style.md, or the Cursor rules file, and a search for "contractions" in open PRs returned nothing related.
  • Ran vale on writing-style.md before and after the change: 67 findings in both, none on the edited lines. vale on agent-development.md shows no findings on the added line.
  • Checked that every non-comment line of the old doc/.claude/CLAUDE.md appears in the new doc/AGENTS.md or doc/.claude/CLAUDE.md. No pre-commit hook covers doc/source/ Markdown.
  • AI assistance (Claude Code) was used to draft this change. I reviewed every changed line.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners October 1, 2026 19:29

@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 updates the documentation style guides in doc/.claude/rules/prose-style.md and doc/source/ray-contribute/writing-style.md to mandate the use of contractions in all contexts, removing the previous exception for warnings and error messages. The reviewer recommends also updating doc/.cursor/rules/ray-docs-style.mdc to maintain consistency across all AI assistant rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman changed the title [doc] Always use contractions in the Ray writing-style guide [doc] Always use contractions, and consolidate docs agent style rules into doc/AGENTS.md Oct 1, 2026
dstrodtman and others added 2 commits October 1, 2026 15:44
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman changed the title [doc] Always use contractions, and consolidate docs agent style rules into doc/AGENTS.md [doc] Always use contractions, and move docs agent instructions into doc/AGENTS.md Oct 1, 2026
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 1, 2026
@dstrodtman
dstrodtman enabled auto-merge (squash) October 1, 2026 20:00
@dstrodtman
dstrodtman merged commit dbaa45f into master Oct 1, 2026
6 of 8 checks passed
@dstrodtman
dstrodtman deleted the doc-1719-ray-always-contractions branch October 1, 2026 20:06
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…doc/AGENTS.md (ray-project#66639)

## Why are these changes needed?

The Ray writing-style guide told authors to use contractions except in
warnings and error messages. This PR drops that exception, so the guide
and the prose-style agent rule now say to always use contractions.

The exception also conflicted with the Vale config.
`Google.Contractions` flags the expanded forms in warning bodies too, so
authors who followed the guide got Vale findings.

Changed files:

- `doc/source/ray-contribute/writing-style.md`: the "Use contractions"
section.
- `doc/AGENTS.md` (new): the agent instructions for `doc/`, moved out of
`doc/.claude/CLAUDE.md` so that every agent reads them, plus a short
"Prose style" section that points to `writing-style.md`.
- `doc/.claude/CLAUDE.md`: now imports `doc/AGENTS.md` with
`@../AGENTS.md` and keeps only Claude Code-specific content, the skills
list.
- `doc/.claude/rules/prose-style.md` and
`doc/.cursor/rules/ray-docs-style.mdc`: deleted.
- `doc/source/ray-contribute/agent-development.md`: one line documenting
`doc/AGENTS.md`.

Why the agent files changed: the docs agent guidance was split by tool.
`doc/.claude/CLAUDE.md` held the CI routing, PR scope, lockfile, and
cross-reference guidance, but only Claude Code loads it, so Cursor users
never saw it. The prose rules lived in two summaries of the style guide,
one for Claude Code and one for Cursor. Every rule in those summaries is
already in `writing-style.md`, and keeping three copies in sync is how
the contraction exception survived in more than one place. Now
`doc/AGENTS.md` holds everything that isn't tool-specific, Cursor and
other agents read it directly, and Claude Code loads it through the
import. The moved sections are unchanged.

Note for agent-config owners: this adds Ray's first `AGENTS.md` below
the repo root, and it makes `doc/` the first directory where
`<dir>/.claude/CLAUDE.md` imports a shared `AGENTS.md` instead of
holding the instructions itself. The same pattern could apply to the
library directories, but this PR only changes `doc/`. It doesn't touch
the root `AGENTS.md` contribution policy.

## Related issue number

None.

## Checks

- Not a duplicate: no open PR touches `writing-style.md`,
`prose-style.md`, or the Cursor rules file, and a search for
"contractions" in open PRs returned nothing related.
- Ran `vale` on `writing-style.md` before and after the change: 67
findings in both, none on the edited lines. `vale` on
`agent-development.md` shows no findings on the added line.
- Checked that every non-comment line of the old `doc/.claude/CLAUDE.md`
appears in the new `doc/AGENTS.md` or `doc/.claude/CLAUDE.md`. No
pre-commit hook covers `doc/source/` Markdown.
- AI assistance (Claude Code) was used to draft this change. I 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]>
dstrodtman added a commit that referenced this pull request Oct 7, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants