From 119ec0ea4540a49b203cd0cf0a6250f3781b8f16 Mon Sep 17 00:00:00 2001 From: gramps Date: Thu, 2 Apr 2026 19:34:40 -0700 Subject: [PATCH] Update README and CLAUDE.md to reflect current project state - Project structure updated: amqp.rs, lib.rs, tests/, templates/, env_* config files - Configuration section updated: BEDS_ENV-based env file selection - Status table updated: completed items marked done, next steps listed - CLAUDE.md: split current structure from planned additions Co-Authored-By: Claude Sonnet 4.6 --- README.md | 40 +++++++++++++++++++++++++++++----------- claude.md | 52 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 64 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index a2e1426..a349680 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,24 @@ Every node runs the same binary. Configuration determines what it does. rustybeds/ ├── src/ │ ├── config/ -│ │ ├── mod.rs # Loader — layered TOML, base + env override +│ │ ├── mod.rs # Loader — load() and load_from() for testability │ │ └── structs.rs # Typed config structs (serde Deserialize) +│ ├── amqp.rs # RabbitMQ transport — validate(), future channel/queue ops +│ ├── lib.rs # Public API surface for integration test harness │ ├── logging.rs # tracing + journald init -│ └── main.rs +│ └── main.rs # ipl() sequence + main() ├── config/ │ ├── beds.toml # Base config — checked in, no credentials -│ └── env.toml # Environment overrides — gitignored +│ ├── env_dev.toml # Dev overrides — gitignored +│ ├── env_qa.toml # QA overrides — gitignored +│ └── env_prod.toml # Prod overrides — gitignored +├── templates/ +│ ├── example_rec.toml # Canonical self-documenting REC template +│ └── mst_logger_rec.toml # Logger collection template (msLogs) +├── tests/ +│ ├── common/mod.rs # Shared test helpers — load_test_config() +│ └── fixtures/ +│ └── beds_test.toml # Canonical test config fixture └── Cargo.toml ``` @@ -99,7 +110,7 @@ rustybeds/ ## Configuration -Two-file layered TOML system. `beds.toml` contains production defaults and is checked into version control. `env.toml` overrides per-environment values and is never committed. +Layered TOML system. `beds.toml` holds production-safe defaults and is checked into version control. An env override file (`env_{BEDS_ENV}.toml`) is layered on top and is never committed. Set `BEDS_ENV` to `dev`, `qa`, or `prod` — defaults to `dev`. ```toml # beds.toml — base @@ -107,13 +118,13 @@ Two-file layered TOML system. `beds.toml` contains production defaults and is ch host = "prod-broker.internal" port = 5672 -# env.toml — local override +# env_dev.toml — local override (gitignored) [broker_services.app_server] host = "localhost" -pass = "your-actual-password" +pass = "your-dev-password" ``` -The `config` crate deep-merges these at startup. Only keys present in `env.toml` are overridden — everything else inherits from base. +The `config` crate deep-merges these at startup. Only keys present in the env file are overridden — everything else inherits from the base. --- @@ -121,11 +132,18 @@ The `config` crate deep-merges these at startup. Only keys present in `env.toml` | Component | Status | |---|---| -| Config loading | Done | -| Structured logging (journald + console) | Done | -| Broker pool | Next | +| Config loading (layered TOML + env select) | Done | +| Structured logging (journald + console mirror) | Done | +| IPL sequence with env-aware error handling | Done | +| RabbitMQ reachability validation | Done | +| Unit test scaffolding + config fixture pattern | Done | +| MongoDB reachability validation | Next | +| MariaDB reachability validation | Next | +| Shared filesystem validation | Next | +| AMQP channel / queue declaration | Planned | +| Broker pool (Tokio tasks) | Planned | | NamasteCore trait | Planned | -| Database adapters (MySQL, MongoDB) | Planned | +| Database adapters (MariaDB, MongoDB) | Planned | | Factory dispatch | Planned | | AI database object generation | Phase 2 | diff --git a/claude.md b/claude.md index 470f250..f10b760 100644 --- a/claude.md +++ b/claude.md @@ -23,32 +23,50 @@ This is not a greenfield project. The architecture is proven. The Rust rewrite e 4. **Template-driven CRUD** — each data domain is a Rust struct implementing the `NamasteCore` trait. Adding a domain means adding a struct. Nothing else changes. 5. **Single codebase, config-driven nodes** — all service nodes run the same binary. Node role (appServer, admin, segundo, tercero) is determined entirely by startup configuration. -## Project Structure (Target) +## Project Structure ``` -beds/ +rustybeds/ ├── src/ -│ ├── core/ -│ │ ├── trait.rs # NamasteCore trait definition -│ │ ├── factory.rs # Template name → adapter dispatch -│ │ └── meta.rs # Request metadata parsing -│ ├── adapters/ -│ │ ├── mysql.rs # gacPDO equivalent -│ │ └── mongodb.rs # gacMongoDB equivalent -│ ├── brokers/ -│ │ ├── pool.rs # Broker pool management -│ │ └── broker.rs # Individual broker task -│ ├── templates/ # Domain-specific structs (one per data domain) │ ├── config/ -│ │ └── loader.rs # TOML config loading and merging -│ └── main.rs +│ │ ├── mod.rs # load() + load_from() — layered TOML config +│ │ └── structs.rs # Typed config structs (serde Deserialize) +│ ├── amqp.rs # RabbitMQ transport — validate(), future channel/queue ops +│ ├── lib.rs # Public API surface for integration test harness +│ ├── logging.rs # tracing + journald + console mirror init +│ └── main.rs # ipl() sequence + main() ├── config/ -│ ├── beds.toml # Base production config -│ └── env.toml # Environment overrides +│ ├── beds.toml # Base config — checked in, no credentials +│ ├── env_dev.toml # Dev overrides — gitignored +│ ├── env_qa.toml # QA overrides — gitignored +│ └── env_prod.toml # Prod overrides — gitignored +├── templates/ +│ ├── example_rec.toml # Canonical self-documenting REC template +│ └── mst_logger_rec.toml # Logger collection template (msLogs) +├── tests/ +│ ├── common/mod.rs # Shared test helpers — load_test_config() +│ └── fixtures/ +│ └── beds_test.toml # Canonical test config fixture ├── Cargo.toml └── CLAUDE.md ``` +### Planned additions (not yet implemented) + +``` +src/ +├── core/ +│ ├── trait.rs # NamasteCore trait definition +│ ├── factory.rs # Template name → adapter dispatch +│ └── meta.rs # Request metadata parsing +├── adapters/ +│ ├── mysql.rs # gacPDO equivalent +│ └── mongodb.rs # gacMongoDB equivalent +└── brokers/ + ├── pool.rs # Broker pool management + └── broker.rs # Individual broker task +``` + ## Key Rust Mappings from PHP | PHP | Rust |