Skip to content

loader audit follow-up: repo-wide thiserror-vs-snafu contradiction #86

Description

@forkwright

Finding

Every crate in the workspace uses thiserror for its error enum, contradicting the standing non-negotiable shape for this fleet's Rust work: "snafu for errors, one error enum per crate, #[non_exhaustive]. Never thiserror, never anyhow in a library."

Evidence

grep -rl "derive(thiserror::Error" across crates/*/src/error.rs matches all 11 crates that have an error.rs: loader, cache, core, decode, embed, encoders, hipcore, praxis, taxis, kernels, tokenize, transformers. thiserror also appears as a direct dependency in every crate's Cargo.toml (loader/Cargo.toml:13, cache/Cargo.toml, taxis/Cargo.toml:14, etc. — 13 Cargo.toml hits total). No crate uses snafu.

Why this matters

This is repo-wide, not local drift in one file — a genuine migration, not a spot-fix. Filed separately rather than folded into #56/#60 (a loader-only audit-batch PR) because touching every crate's error type would explode that PR's scope far past its stated findings, and this box currently has other agents concurrently working sibling crates in the same shared .git — a workspace-wide error-handling rewrite here would conflict with all of them.

Desired correction

Either:

  1. Migrate every crate's error enum from thiserror to snafu, crate by crate, each as its own reviewable PR; or
  2. If thiserror is the deliberate, accepted choice for this repo (overriding the fleet-wide default), update the standard to say so explicitly for logismos, the same way kanon#3473 already documents the #[must_use]-on-Result contradiction between RUST.md and the enforced lint set.

Whichever direction is chosen, the current state — a written rule everyone violates uniformly — is the thing to resolve; leaving it unstated is what lets it get re-violated by every future PR.

Done when: either every crate's error.rs derives snafu::Snafu instead of thiserror::Error, or the standard has an explicit, dated exception recorded for this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions