Clean up documentation: consolidate docs in docs/ directory, simplify README

This commit is contained in:
Timur Gordon
2025-11-06 23:36:10 +01:00
parent 6d518599b8
commit a65c721c64
11 changed files with 21 additions and 1146 deletions

View File

@@ -2,19 +2,19 @@
A Rust-based actor management system for the Hero ecosystem that provides unified process management, job queuing, and optional OpenRPC server integration.
## Architecture Overview
The Hero Supervisor uses a clean, feature-gated architecture that separates library functionality from CLI/server features to avoid dependency cycles and maintain modularity.
## Repository Structure
```
hero-supervisor/
├── src/ # Core library (no CLI dependencies)
│ ├── lib.rs # Main library exports and documentation
│ ├── supervisor.rs # Core supervisor logic and actor management
├── runner.rs # Runner implementation for actor process management
│ ├── job.rs # Job data structures, builder pattern, and Redis key management
│ └── openrpc.rs # OpenRPC server (feature-gated)
├── cmd/ # CLI binaries
supervisor/
├── core/ # Main supervisor library and binary
│ ├── src/
│ ├── bin/supervisor.rs # Supervisor binary
│ └── lib.rs # Library exports
│ ├── examples/ # Usage examples
│ └── tests/ # Integration tests
├── client/ # OpenRPC client library (Rust + WASM)
├── ui/ # Admin UI (Yew WASM application)
└── docs/ # Documentation
## Features
@@ -43,35 +43,6 @@ The Hero Supervisor uses a clean, simplified architecture with centralized resou
- **Direct OpenRPC Integration**: RPC trait implemented directly on `Arc<Mutex<Supervisor>>` (no wrapper layers)
- **Simplified App**: `SupervisorApp::start()` handles everything - runners, OpenRPC server, graceful shutdown
## File Documentation
### Core Library Files
#### `src/lib.rs`
Main library entry point that exports `Supervisor`, `SupervisorBuilder`, `SupervisorApp`, and related types.
#### `src/supervisor.rs`
Core supervisor implementation with builder pattern. Manages runners, owns shared Redis client and process manager. Provides job queuing, runner lifecycle management, and status monitoring.
#### `src/app.rs`
Main application wrapper that provides `start()` method for complete lifecycle management. Handles OpenRPC server startup, graceful shutdown, and keeps the application running.
#### `src/runner.rs`
Simplified runner configuration and management. Contains `Runner` struct with configuration data only - no resource ownership. Integrates with supervisor's shared resources.
#### `src/job.rs`
Job data structures, builder pattern, and Redis key management. Defines `Job` struct with metadata, script content, and status tracking.
#### `src/client.rs`
Client implementation for job management operations. Provides Redis-based job storage, retrieval, status updates, and lifecycle management. Separates job operations from supervisor logic.
#### `src/openrpc.rs`
OpenRPC server implementation that exposes all supervisor functionality over JSON-RPC. Implements RPC trait directly on the supervisor for clean integration.
### Binary Files
#### `cmd/supervisor.rs`
Main supervisor binary that creates a supervisor using the builder pattern and starts the complete application with `app.start()`. The OpenRPC server is always enabled and starts automatically.
## Usage
@@ -195,6 +166,15 @@ RUST_LOG=info cargo run --features openrpc
4. **Conditional Compilation**: Rust's feature system ensures minimal dependencies for library users
5. **Single Binary**: One supervisor binary with optional OpenRPC server integration
## Documentation
- **[Quick Start Guide](docs/QUICK_START.md)** - Get started with Hero Supervisor
- **[Authentication](docs/AUTH.md)** - Secret-based authentication system
- **[Job API Convention](docs/job-api-convention.md)** - Job submission and management API
- **[Mycelium Integration](docs/MYCELIUM.md)** - Optional Mycelium network support
- **[Restructure Notes](docs/RESTRUCTURE.md)** - Repository restructuring details
- **[Test Keypairs](docs/test_keypairs.md)** - Testing with authentication
## License
[Add your license information here]
MIT OR Apache-2.0