Skip to content

[TD-14] anyhow used in 8 library crates contradicts CLAUDE.md convention #332

@intendednull

Description

@intendednull

Audit finding from #300 (commit 679f9fe)

Severity: medium
Category: tech debt / convention
File: crates/network/Cargo.toml, crates/storage/Cargo.toml, crates/replay/Cargo.toml, crates/transport/Cargo.toml, crates/worker/Cargo.toml; CLAUDE.md "Code Conventions"
Obvious fix: no (requires defining the error enums)

Description

CLAUDE.md explicitly mandates thiserror in libraries and anyhow only in application/binary code. Yet network, storage, replay, transport, and worker (all library or library+binary crates) depend on anyhow. This is a documented convention mismatch, not a stylistic preference.

Impact / Threat

Maintenance — convention erodes; new contributors will copy whichever dep is already in the Cargo.toml.

Suggested fix

Remove the anyhow dep from the library targets (push it down to */main.rs only via a separate binary target if needed) and replace public APIs with thiserror enums.

Verify

grep -l '^anyhow' crates/*/Cargo.toml

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions