Follow-up from the end-of-train refactor analysis. Target: L3 . Priority: medium.
Problem
classify(error_type: &str), is_already_submitted(error_type: &str), and the internal GeneratedRow.error_type: &'static str operate on raw wire strings (crates/cow-venue/src/classification.rs:42, :80, :88), and the adapter calls them on api.error_type: String (crates/cow-venue/src/adapter.rs:391, :418). But cowprotocol::ApiError already exposes error_kind() -> OrderbookApiErrorType (a typed enum with an Unknown(String) fallback), and the crate's own parity test at classification.rs:287-:297 already trusts OrderbookApiErrorType to assert every table row names a real error type. So the typed key exists but the hot path stays stringly, and a call site can pass an arbitrary or misspelt &str with no compile-time signal.
Change
Have the public classify/is_already_submitted take OrderbookApiErrorType; the adapter passes api.error_kind() instead of &api.error_type. Key GeneratedRow lookups by comparing against the enum's canonical spelling. The build.rs-generated table may stay string-backed internally (compare via as_str()), but the boundary the adapter crosses becomes typed and the Unknown(_) case becomes explicit rather than an unlisted-string default.
Acceptance criteria
classify and is_already_submitted accept OrderbookApiErrorType, not &str.
- The adapter passes
api.error_kind(); no &str error-type flows across the classifier boundary.
- The
Unknown(_) variant is handled explicitly at the call site.
- The existing parity test still passes; classification behaviour is unchanged for known types.
Problem
classify(error_type: &str),is_already_submitted(error_type: &str), and the internalGeneratedRow.error_type: &'static stroperate on raw wire strings (crates/cow-venue/src/classification.rs:42,:80,:88), and the adapter calls them onapi.error_type: String(crates/cow-venue/src/adapter.rs:391,:418). Butcowprotocol::ApiErroralready exposeserror_kind() -> OrderbookApiErrorType(a typed enum with anUnknown(String)fallback), and the crate's own parity test atclassification.rs:287-:297already trustsOrderbookApiErrorTypeto assert every table row names a real error type. So the typed key exists but the hot path stays stringly, and a call site can pass an arbitrary or misspelt&strwith no compile-time signal.Change
Have the public
classify/is_already_submittedtakeOrderbookApiErrorType; the adapter passesapi.error_kind()instead of&api.error_type. KeyGeneratedRowlookups by comparing against the enum's canonical spelling. Thebuild.rs-generated table may stay string-backed internally (compare viaas_str()), but the boundary the adapter crosses becomes typed and theUnknown(_)case becomes explicit rather than an unlisted-string default.Acceptance criteria
classifyandis_already_submittedacceptOrderbookApiErrorType, not&str.api.error_kind(); no&strerror-type flows across the classifier boundary.Unknown(_)variant is handled explicitly at the call site.