Skip to content

docs: add a CLAUDE.md for the Rust rewrite - #883

Merged
cameri merged 5 commits into
rewrite/mainfrom
rewrite/claude-md
Oct 18, 2026
Merged

cameri merged 5 commits into
rewrite/mainfrom
rewrite/claude-md

Conversation

@chappie-daemon

Copy link
Copy Markdown
Collaborator


docs: add a CLAUDE.md for the Rust rewrite

rewrite/main carried no agent instruction file, so every factory job re-derived the
Rust conventions from its own spec.md. This adds one at the branch root holding only
the rules that are specific to this repository and that an agent gets wrong:

  • Validation: the exact five CI commands, --workspace and --all-features, and
    why there are two clippy passes (strict --lib --bins keeps tests free to unwrap).
  • Running Rust here: scripts/rust.sh, and that the toolchain comes from
    rust-toolchain.toml rather than a command-line flag.
  • Crate layout: one crate per module family, workspace-inherited manifest fields,
    and [lints] workspace = true — the line whose absence silently opts a crate out of
    every workspace lint.
  • Error model: <Crate>Error per crate, anyhow confined to the two main.rs
    files, NotImplemented instead of todo!()/panic!(), exit codes 1 and 2 kept
    distinct, and validation findings as Issue values rather than errors.
  • Porting discipline: the labelled-stub rule and the rule against a silent Ok(()).
  • Path filters and the eight required contexts on the rewrite/main ruleset.

Generic Rust guidance is deliberately absent. The empty changeset is expected: no
published package changes.

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6b8dc49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds CLAUDE.md for the Rust rewrite and makes local Clippy checks match CI.

  • Rust agents get one guide to working on the rewrite branch.
  • Workspace Clippy checks now catch unwraps, expects, and panics.

Reviews (2) · Last reviewed commit: "docs: correct the error-model rules Grep..." · Reviewed by Greptile

Comment thread CLAUDE.md Resolved
Comment thread CLAUDE.md Resolved
checks.yml passed -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic only on
the command line. A crate inheriting [lints] workspace = true therefore passed a local
cargo clippy and was rejected by the gate.

The three lints move into [workspace.lints.clippy], and the 17 integration-test targets
that assert by unwrapping or panicking carry an explicit allow at the top of the file. The
allowance names the file rather than exempting test targets workspace-wide, so a new test
file has to ask.

Measured from a clean target directory: fmt clean; all-targets clippy clean; strict
lib+bins pass clean; 157 tests passed, 0 failed; release build succeeds. Proven to fire:
Some(1).unwrap() added to nostream-config/src/lib.rs fails the all-targets pass.
Two contradictions in the CLAUDE.md:
- 'everything outside the two binaries returns CliError' read as 'all libraries depend on
  nostream-cli'. It now says each library module returns its own crate's type, with the CLI's
  library modules returning CliError.
- The anyhow check searched only crates/*/src/lib.rs, so a module file using anyhow would
  pass. It now scans every .rs file, excludes the two allowed main.rs, and skips comment
  lines that merely name the crate. Re-proven by adding an anyhow::Result probe to
  nostream-config/src/load.rs, which the check printed.
@cameri
cameri merged commit 384b283 into rewrite/main Oct 18, 2026
14 checks passed
@cameri
cameri deleted the rewrite/claude-md branch October 18, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants