Bootstrap crate skeleton, dependencies, and core error types #1

Closed
opened 2026-04-11 10:55:37 +00:00 by charles · 0 comments
Owner

User story

As a framework maintainer, I want a clean Cargo crate with a module skeleton and the public TestError type defined, so that subsequent stories can build their components on a stable foundation without re-deciding the public surface.

Scope

Set up the Rust crate, declare dependencies, create empty module files, and implement the error types that every other module will reference.

Acceptance criteria

  • Cargo.toml declares the package and pulls in:
    • tokio = { version = "1", features = ["full"] }
    • tokio-tungstenite = "0.26"
    • serde_json = "1"
    • futures-util = "0.3"
    • reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
    • anyhow = "1"
    • colored = "2"
    • clap = { version = "4", features = ["derive"], optional = true }
  • src/lib.rs declares modules: harness, client, assert, runner, report, error, plus a prelude module re-exporting the public surface (ProcessHarness, RpcClient, TestRunner, TestResult, TestError, json!).
  • src/error.rs defines TestError enum with variants:
    • Assertion { expected: String, got: String, context: Option<String>, location: &'static str }
    • Timeout { event: String, duration: Duration }
    • Connection(String)
    • RpcError { code: i32, message: String }
    • Skip(String) (new — see spec review §7)
    • Other(anyhow::Error)
  • pub type TestResult = Result<(), TestError>;
  • TestError implements Display, Debug, From<anyhow::Error>, From<tungstenite::Error>, std::error::Error.
  • cargo build and cargo check succeed on the empty modules.
  • cargo doc builds without warnings.

Out of scope

  • Module bodies — only the skeleton and error.rs are populated.
  • CLI feature is declared but not implemented (issue area:cli).

References

  • Spec §1 (Crate structure), §3.4 (TestError), §2 (Dependencies)
## User story As a **framework maintainer**, I want a clean Cargo crate with a module skeleton and the public `TestError` type defined, so that subsequent stories can build their components on a stable foundation without re-deciding the public surface. ## Scope Set up the Rust crate, declare dependencies, create empty module files, and implement the error types that every other module will reference. ## Acceptance criteria - [ ] `Cargo.toml` declares the package and pulls in: - `tokio = { version = "1", features = ["full"] }` - `tokio-tungstenite = "0.26"` - `serde_json = "1"` - `futures-util = "0.3"` - `reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }` - `anyhow = "1"` - `colored = "2"` - `clap = { version = "4", features = ["derive"], optional = true }` - [ ] `src/lib.rs` declares modules: `harness`, `client`, `assert`, `runner`, `report`, `error`, plus a `prelude` module re-exporting the public surface (`ProcessHarness`, `RpcClient`, `TestRunner`, `TestResult`, `TestError`, `json!`). - [ ] `src/error.rs` defines `TestError` enum with variants: - `Assertion { expected: String, got: String, context: Option<String>, location: &'static str }` - `Timeout { event: String, duration: Duration }` - `Connection(String)` - `RpcError { code: i32, message: String }` - `Skip(String)` *(new — see spec review §7)* - `Other(anyhow::Error)` - [ ] `pub type TestResult = Result<(), TestError>;` - [ ] `TestError` implements `Display`, `Debug`, `From<anyhow::Error>`, `From<tungstenite::Error>`, `std::error::Error`. - [ ] `cargo build` and `cargo check` succeed on the empty modules. - [ ] `cargo doc` builds without warnings. ## Out of scope - Module bodies — only the skeleton and `error.rs` are populated. - CLI feature is declared but not implemented (issue area:cli). ## References - Spec §1 (Crate structure), §3.4 (TestError), §2 (Dependencies)
charles added this to the v0.1.0 milestone 2026-04-11 10:55:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/ws-rpc-test#1
No description provided.