Add rBroker + wBroker pool, BrokerPayload, NamasteCore trait stub

- src/brokers/: pool manager, r_broker (rec.read), w_broker (rec.write),
  BrokerPayload struct, BrokerError type
- src/core/: NamasteCore trait — fetch/write/update/delete interface, stubs
- IPL step 6: spawns rBroker + wBroker pools after exchange declaration
- tests/broker_pool_test.rs: integration tests for pool spawn (skip if broker down)
- BrokerPayload unit tests + doctest in payload.rs
- Added futures-lite, serde_json to Cargo.toml
- README.md, CLAUDE.md, wiki updated to reflect new structure and status

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 20:18:31 -07:00
parent f50396b390
commit ebefb15a87
13 changed files with 1042 additions and 19 deletions

33
src/brokers/error.rs Normal file
View File

@@ -0,0 +1,33 @@
//! # brokers/error.rs — Broker Error Types
//!
//! Defines the error type for all broker task operations in BEDS.
//!
//! ## Calling Agents
//! - `brokers::r_broker` — returned from spawn and consume operations
//! - `brokers::mod` — surfaced from pool management
//!
//! **Author:** mks
//! **Version:** 1.0
//!
//! ## History
//! * `2026-04-05` - mks - original coding
/// Errors that can occur in any BEDS broker task.
///
/// AMQP protocol errors are wrapped transparently via the `From` impl.
/// Additional variants cover broker-specific failure modes.
///
/// # History
///
/// * `2026-04-05` - mks - original coding
#[derive(Debug, thiserror::Error)]
pub enum BrokerError {
#[error("AMQP protocol error: {0}")]
Protocol(#[from] lapin::Error),
#[error("Broker task '{0}' failed to start: {1}")]
StartupFailed(String, String),
#[error("Message decode error in broker '{0}': {1}")]
DecodeFailed(String, String),
}