Category: refactor Severity: major
Location: crates/arcp-core/src/messages/mod.rs:1-13
What
messages/mod.rs is 1430 lines and combines the central enum, wire-name mapping, helper predicates, re-exports, and large tests. The module is difficult to review when message-shape conformance changes touch one very large file.
Evidence
//! Wire-level message payload types.
//!
//! [`MessageType`] is a tagged enum (`#[serde(tag = "type", content =
//! "payload")]`) so on the wire a message renders flat:
//!
//! ```json
//! { "type": "ping", "payload": { "nonce": "..." } }
//! ```
//!
//! When this is `#[serde(flatten)]`-embedded into [`crate::envelope::Envelope`]
//! the `type` and `payload` keys appear at the envelope level alongside the
//! other metadata fields, matching the canonical wire format from ARCP v1.1
//! §5.
Proposed fix
Move message enum wiring, helper predicates, and tests into smaller cohesive modules while leaving payload structs in their existing per-surface files.
Acceptance criteria
Category: refactor Severity: major
Location:
crates/arcp-core/src/messages/mod.rs:1-13What
messages/mod.rsis 1430 lines and combines the central enum, wire-name mapping, helper predicates, re-exports, and large tests. The module is difficult to review when message-shape conformance changes touch one very large file.Evidence
Proposed fix
Move message enum wiring, helper predicates, and tests into smaller cohesive modules while leaving payload structs in their existing per-surface files.
Acceptance criteria