You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
style: comment consistency sweep across the crate (#20)
## Summary
Follow-up style pass deferred from PR #19's `dda3ff5`, which only
cleaned up comments added that round. This PR extends the cleanup to the
rest of `crates/oxide-code/src/`, closing four drift classes identified
by a fresh survey. Pure style / docs; `cargo test` passes with the same
733 count before and after, and `cargo llvm-cov` stays at 93.08% line /
92.57% region.
- **Drop design-attribution references to `claude-code`** (`bd932d2`) —
rewrites comments like "matches Claude Code's `prependUserContext()`"
into rationale that stands on its own (cache-invalidation behavior,
API-shape requirements). Wire-compat literals
(`CLAUDE_CODE_BETA_HEADER`, identity prefix, `x-claude-code-session-id`
header, Keychain service name, billing salt) and user-facing CLI prose
in `config` / `config::oauth` stay verbatim — those aren't attribution,
they're interop identifiers or the user's mental model.
- **Add module-level `//!` preambles across the crate** (`0c2a03a`) —
lifts coverage from 8 of 50 `.rs` files to 25 of 50. All ten top-level
module roots (`agent`, `client`, `config`, `main`, `message`, `prompt`,
`session`, `tool`, `tui`, `util`) plus seven heavyweight submodules
(`client/anthropic`, `config/oauth`, `session/{manager, store, entry}`,
`tui/app`, `tui/markdown/render` — all the ~1.5K+ line files) now open
with a noun-phrase role statement. Trivial / name-self-describing
submodules (per-tool files, TUI style helpers, `util/env`, `util/lock`,
etc.) intentionally left uncommented.
- **Unify first-line doc-comment voice to third-person indicative**
(`b8886b9`) — the crate was ~50/50 between imperative (`Build a foo.`)
and third-person indicative (`Builds a foo.`). Stdlib is consistently
third-person, and the existing `//!` preambles already follow it; this
commit aligns every free-function, method, and associated-function first
line. CLI `--help` strings (clap `#[arg(...)]`) stay imperative — that's
the `man`-page convention and mixing voices in a single help output
would read worse than diverging from the rest of the crate.
- **Trim narrate-the-what residue** (`3b74af8`) — two targeted fixes:
`ToolOutput::with_title` doc now explains fluent-construction rationale
instead of restating the method signature, and
`prompt::instructions::load`'s discovery-locations list gets a missing
terminal period on item 1.
The re-survey also revealed that the original plan over-scoped two drift
classes: numbered-list formatting was already canonical on all four
sites after PR #19 (only the one missing period remained), and
narrate-the-what was not a class-wide issue (two real cases, not a
sweep). First-line voice was missing from the original plan entirely and
ended up the largest class.
## Changes
| Area | Files | Notes |
| ---- | ----- | ----- |
| Attribution rewrites | `client/anthropic.rs`, `prompt.rs`,
`prompt/environment.rs` | 10 design-attribution sites rephrased as cache
/ API-shape rationale; +25 / −25 |
| Module preambles | 17 files (10 top-level roots + 7 heavyweight
submodules) | +137 / 0, all additive `//!` blocks |
| Voice unification | 27 files across `client`, `config`, `message`,
`prompt`, `session`, `tool`, `tui`, `util` | +119 / −119 mechanical;
verb takes `-s` suffix on first-line summaries |
| Narrate-the-what | `tool.rs`, `prompt/instructions.rs` | 2 targeted
fixes |
## Test plan
- [x] `cargo fmt --all --check`
- [x] `cargo clippy --all-targets -- -D warnings` — zero warnings
- [x] `cargo test` — 733 pass (unchanged from `main`)
- [x] `cargo llvm-cov --ignore-filename-regex 'main\.rs'` — 93.08% line
/ 93.65% function / 92.57% region (unchanged from `main`)
- [x] `pnpm lint` — 0 errors across 16 files
- [x] `pnpm spellcheck` — 0 errors across 72 files; `.cspell/words.txt`
unchanged
- [ ] GitHub Actions: `rust-check`, `coverage`, `node-check` all green
on this PR
0 commit comments