Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .planning/DEVELOPMENT_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Development Notes

## Git Workflow

**NEVER push to master/main directly.**

Use feature branches:
```bash
git checkout -b feature/my-feature
# work work work
git push -u origin feature/my-feature
# Create PR on GitHub
```

## Current Repos
- survon-council-seat: https://github.com/SeanCannon/survon-council-seat
- survon-os: https://github.com/survon/survon-os
- runtime-base-rust: https://github.com/survon/runtime-base-rust

## Key Files
- Council UI: src/ui/screens/council/mod.rs
- Council logic: src/module/strategies/council.rs
- survon-os menu: survon-os/scripts/survon.sh

## Testing
- Run council tests: `cargo test council`
42 changes: 42 additions & 0 deletions .planning/NEXT_SESSION_PROMPT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Next Session Prompt

## Context
Continue working on Phase 6 Multi-Member Council implementation for runtime-base-rust.

## What Was Completed
1. Fixed critical parse error in `src/app.rs` - mismatched braces causing compilation failure
2. Added `Council` variant to `OverviewFocus` enum and fixed all related code paths
3. Created comprehensive council test suite (6 tests passing in `src/module/strategies/council.rs`)
4. Council CLI commands exist in `src/cli/commands/council.rs` but not integrated into main binary
5. Basic Council UI exists in `src/ui/screens/council/mod.rs`

## Current Build Status
- ✅ `cargo build` - Compiles successfully
- ✅ `cargo test council` - 6 tests passing

## Remaining Tasks (from .planning/phases/06-multi-member-council/06-multi-member-council-PLAN.md)

### Task 3: Add Council UI Interface
- Basic UI exists but needs enhancement
- File: `src/ui/screens/council/mod.rs`
- Needs: Real advisor list from discovery, chat history integration, interactive message handling

### Task 4: Add Council Documentation
- Create `docs/council/` directory with:
- Usage examples
- Configuration guides
- Troubleshooting

## Quick Reference
- Run tests: `cargo test council`
- Build: `cargo build`
- Council UI: `src/ui/screens/council/mod.rs`
- Council logic: `src/module/strategies/council.rs`
- Previous session state: `.planning/phases/06-multi-member-council/SESSION_STATE.md`

## Recommended Next Steps
1. **Option A**: Enhance Council UI (Task 3) - Add real functionality to the UI
2. **Option B**: Create documentation (Task 4)
3. **Option C**: Integrate CLI commands into main binary

Choose based on priority.
115 changes: 115 additions & 0 deletions .planning/PROJECT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Survon System

## What This Is

An offline, off-grid survival system designed for resilience in challenging scenarios where reliability, modularity, and adaptability are crucial. Survon puts humanity and freedom first, fostering societal resilience and safeguarding knowledge.

### Runtime Architecture
Survon consists of a **modular ecosystem** with three main runtime components:

1. **`runtime-base-rust`** - Core runtime (TUI application)
2. **`runtime-field-rust`** - Portable field runtime
3. **`survon-os`** - Minimal bash-driven bootable system for Raspberry Pi

## Core Value

A reliable offline system that enables survival resilience through real-time monitoring, control, intelligent guidance, and knowledge preservation without cloud dependencies.

## Requirements

### Validated

- ✓ Modular IoT hub architecture with message bus routing
- ✓ Hardware integration via BLE, radio, USB, and serial connections
- ✓ Knowledge data ingestion from PDFs and text files
- ✓ Basic LLM integration with lightweight models
- ✓ Raspberry Pi deployment with solar power considerations
- ✓ Real-time TUI interface with modular screens
- ✓ Message bus architecture for event routing
- ✓ Transport manager for serial/USB/Bluetooth communication

### Active

- [ ] Council member chat interface with domain-specific advice
- [ ] Lightweight LLM integration with context-aware responses
- [ ] Separate council member service architecture
- [ ] Environmental variable configuration for model selection
- [ ] Reference linking to source documentation
- [ ] Enhanced knowledge retrieval with semantic search
- [ ] Multi-member council support with expertise routing
- [ ] Performance optimization for battery-conscious operation

### Out of Scope

- Heavy AI model training (cost and hardware constraints)
- Real-time video or voice interactions
- Cloud-based knowledge storage
- Multi-user concurrent access
- Mobile app interface
- GPU acceleration (not available on most Raspberry Pi models)
- Docker container deployment (adds overhead)

## Context

Survon is built as a modular IoT hub that intercepts sensor data and device commands from various sources—USB peripherals, Bluetooth devices, radio modules, and custom IoT hardware. The system presents them through a real-time TUI interface.

Current capabilities include:
- Remote gate control via Arduino-based controllers sending open/close commands via radio
- Environmental monitoring with pressure sensors, temperature gauges, and water flow meters
- Equipment status monitoring for well pumps, generators, and greenhouse automation
- Message bus architecture routing events between hardware modules and UI components
- Compatible hardware can be built using Survon protocol adapters on microcontrollers like Arduino, ESP32, or similar platforms
- Devices broadcast sensor readings and accept commands via radio (LoRa, 433MHz), Bluetooth, or direct serial connection to Raspberry Pi hub

All sensor data, control commands, and system events flow through the central message bus, enabling real-time monitoring and control of homestead infrastructure from a single interface.

## Constraints

- **Hardware**: Raspberry Pi 3B+ or newer, solar-powered, limited CPU/RAM (512MB-4GB)
- **Power**: Battery-conscious operation, must work on solar power
- **Cost**: Affordable for homestead deployment ($50-100 per unit)
- **Offline**: No cloud dependencies, must work without internet
- **Real-time**: Sub-second response for critical operations
- **Modularity**: Must support plug-and-play hardware modules
- **Reliability**: 99%+ uptime for essential functions
- **Security**: Local-only data, no external exposure

## Key Decisions

| Decision | Rationale | Outcome |
|----------|-----------|---------|
| Rust TUI application | Memory safety, performance, existing codebase | ✓ Good |
| Message bus architecture | Decouples hardware from UI, enables modularity | ✓ Good |
| Raspberry Pi deployment | Low cost, low power, proven hardware | ✓ Good |
| Knowledge data ingestion | Enables offline intelligent guidance | ✓ Good |
| Lightweight LLM models | Balance capability with resource constraints | — Pending |
| Council member services | Offload heavy processing, allow dedicated hardware | — Pending |
| Separate OS installer | Simplifies deployment for non-technical users | ✓ Good |
| Solar power focus | Enables true off-grid operation | ✓ Good |

## Council System Context

The council system is **Phase 4** of a 7-phase roadmap, representing the **pivotal middle phase** that transforms Survon from:
- **Basic functionality** → **Intelligent guidance**
- **Hardware control** → **Knowledge-based decision support**
- **Simple queries** → **Domain-specific expertise**

## Council System Architecture

The council system provides domain-specific advice through a service discovery architecture:
- **Separate service architecture** - Council members run as independent processes
- **Service discovery** - Uses mDNS to find `survon-*.local` services
- **REST/gRPC communication** - For client-server interaction
- **Knowledge integration** - Connects to document storage and retrieval

### Council Member Types

Based on the roadmap, council members provide **domain-specific expertise** in areas like:
- Homestead management
- Survival techniques
- Technical troubleshooting
- Agricultural advice
- Emergency response

---
*Last updated: 2026-03-01 after comprehensive planning*
138 changes: 138 additions & 0 deletions .planning/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Requirements: Survon System

**Defined:** 2026-03-01
**Core Value:** Users can ask practical survival questions and receive helpful, accurate guidance that references relevant knowledge data.

## v1 Requirements (14 total)

### Foundation (5 requirements)

- [ ] **FOUND-01**: Service starts within 5 seconds
- [ ] **FOUND-02**: Hardware modules (BLE, USB, radio) communicate successfully
- [ ] **FOUND-03**: Message bus routes events between modules
- [ ] **FOUND-04**: Transport manager handles serial/USB/Bluetooth
- [ ] **FOUND-05**: Basic UI displays connected devices

### Knowledge Base (5 requirements)

- [ ] **KNOW-01**: PDF/text files ingested successfully
- [ ] **KNOW-02**: Full-text search returns relevant results
- [ ] **KNOW-03**: Document metadata indexed
- [ ] **KNOW-04**: Knowledge base accessible to other components
- [ ] **KNOW-05**: Search performance under 2 seconds

### Basic LLM (5 requirements)

- [ ] **LLM-01**: Model loads from environment variables
- [ ] **LLM-02**: Simple queries return responses under 5 seconds
- [ ] **LLM-03**: Memory usage stays under 500MB
- [ ] **LLM-04**: Model handles basic conversation
- [ ] **LLM-05**: Error handling for model failures

### Council System (5 requirements)

- [ ] **COUNCIL-01**: Council member service runs as separate process
- [ ] **COUNCIL-02**: User can start conversation with council member
- [ ] **COUNCIL-03**: Typing indicators display during processing
- [ ] **COUNCIL-04**: Conversation history maintained
- [ ] **COUNCIL-05**: Basic domain-specific responses provided

### Enhanced Knowledge (5 requirements)

- [ ] **ENH-01**: Semantic search with embeddings
- [ ] **ENH-02**: Context injection into LLM prompts
- [ ] **ENH-03**: Reference linking to source documents
- [ ] **ENH-04**: Citation display in responses
- [ ] **ENH-05**: Context-aware responses

### Multi-Member (5 requirements)

- [ ] **MM-01**: Multiple council members supported
- [ ] **MM-02**: Expertise routing to appropriate member
- [ ] **MM-03**: Consensus building for related queries
- [ ] **MM-04**: Conflict resolution for contradictory advice
- [ ] **MM-05**: Council member discovery and registration

### Optimization (5 requirements)

- [ ] **OPT-01**: Sub-10 second response times consistently
- [ ] **OPT-02**: 99%+ uptime availability
- [ ] **OPT-03**: Memory usage under 1GB total
- [ ] **OPT-04**: Battery usage optimized for solar power
- [ ] **OPT-05**: Graceful degradation for failures

## v2 Requirements

### Advanced Features

- **ADV-01**: Batch processing for multiple queries
- **ADV-02**: Response caching for common questions
- **ADV-03**: Memory usage optimization
- **ADV-04**: CPU usage monitoring
- **ADV-05**: Safety warnings for dangerous topics

### Performance

- **PERF-01**: Progressive enhancement capabilities
- **PERF-02**: Resource monitoring in real-time
- **PERF-03**: Hardware abstraction for compatibility
- **PERF-04**: Performance targets enforcement

## Out of Scope

| Feature | Reason |
|---------|--------|
| Heavy AI models (70B+ parameters) | Resource constraints on Raspberry Pi |
| Cloud-based knowledge storage | Offline requirement |
| Real-time voice interaction | Hardware limitations |
| Multi-user concurrent access | Single-user TUI design |
| Mobile app interface | Web-first, terminal priority |
| Video content | Storage/bandwidth constraints |

## Traceability

| Requirement | Status |
|-------------|--------|
| FOUND-01 | Pending |
| FOUND-02 | Pending |
| FOUND-03 | Pending |
| FOUND-04 | Pending |
| FOUND-05 | Pending |
| KNOW-01 | Pending |
| KNOW-02 | Pending |
| KNOW-03 | Pending |
| KNOW-04 | Pending |
| KNOW-05 | Pending |
| LLM-01 | Pending |
| LLM-02 | Pending |
| LLM-03 | Pending |
| LLM-04 | Pending |
| LLM-05 | Pending |
| COUNCIL-01 | Pending |
| COUNCIL-02 | Pending |
| COUNCIL-03 | Pending |
| COUNCIL-04 | Pending |
| COUNCIL-05 | Pending |
| ENH-01 | Pending |
| ENH-02 | Pending |
| ENH-03 | Pending |
| ENH-04 | Pending |
| ENH-05 | Pending |
| MM-01 | Pending |
| MM-02 | Pending |
| MM-03 | Pending |
| MM-04 | Pending |
| MM-05 | Pending |
| OPT-01 | Pending |
| OPT-02 | Pending |
| OPT-03 | Pending |
| OPT-04 | Pending |
| OPT-05 | Pending |

**Coverage:**
- v1 requirements: 14 total (all included) ✓
- All requirements included ✓

---
*Requirements defined: 2026-03-01*
*Last updated: 2026-03-01 after research completion*
Loading
Loading