# Architecture Decision Records (ADRs) ## ADR-001: Separation of Discrete-Event Simulation from 3D Visualization - **Status**: Accepted - **Context**: Omniverse Kit and USD are powerful visualization engines, but coupling simulation logic directly into Kit extension update loops slows testing, complicates continuous integration, and ties discrete event timing to render frame rates. - **Decision**: Keep the discrete-event simulation engine in pure standard Python. The simulation will export time-indexed trajectories (JSON) and event logs. Omniverse Kit will consume these trajectories in Phase 7 as an asynchronous visualizer. - **Consequences**: Fast test execution (headless in < 1s), zero GPU requirement for algorithmic development, clear data interchange boundaries. --- ## ADR-002: Discrete-Event Engine with SimPy & NetworkX - **Status**: Accepted - **Context**: Need a lightweight, deterministic framework for managing asynchronous robot events (orders, traveling, picking, battery discharge, recharging). - **Decision**: Use `SimPy` for the event-scheduling loop and `NetworkX` for graph-based warehouse topology and shortest-path calculation. - **Consequences**: Highly deterministic runs via seeded random streams; no heavy external robotics simulator dependencies during core fleet logic development. --- ## ADR-003: Standalone Operation Without Isaac Sim Dependency - **Status**: Accepted - **Context**: Isaac Sim requires substantial disk space (~30-50+ GB) and the host root drive `/dev/nvme0n1p4` is constrained with only ~8.9 GB free. - **Decision**: Do not require Isaac Sim. Rely on discrete-event kinematics for robot movement. Ensure data models (coordinates, states, speeds) conform to standard robotics conventions so Isaac Sim can be integrated in the future without architectural redesign. - **Consequences**: Enables immediate development on the user's host without risking disk exhaustion. --- ## ADR-004: Low-Disk-Space Mitigation and Secondary Drive Relocation - **Status**: Accepted - **Context**: The root filesystem is at 99% capacity (~8.9 GB free). Simulation logs and trajectory files could exhaust space if unconstrained. - **Decision**: 1. Enforce size-capped rotating log handlers (`RotatingFileHandler` with 10MB limits and 5 backups). 2. Implement an optional `WAREHOUSE_TWIN_SECONDARY_DRIVE` environment variable. When set, all large outputs (`logs/`, `results/`) are redirected to the specified secondary path. 3. Include disk space warnings in `check_environment.sh` and CLI `validate-env`. - **Consequences**: Prevents host crash due to accidental root drive fill-up. --- ## ADR-005: Structured Logging with Rotating Handlers - **Status**: Accepted - **Context**: Need separate logging streams for diagnostic debugging versus simulation event auditing, with automatic size limits. - **Decision**: Provide three dedicated streams: 1. `application.log`: Component lifecycle, config loading, and diagnostic info. 2. `simulation.log`: High-resolution simulation events with timestamp and entity tracking. 3. `errors.log`: Error and critical level events with full stack traces. - **Consequences**: Clean separation of operational concerns, easy debugging, bounded disk usage.