Files
rtu_v5/.planning/codebase/CONCERNS.md
2026-03-12 00:56:57 +08:00

187 lines
5.3 KiB
Markdown

# Codebase Concerns
**Analysis Date:** 2026-03-12
## Project Status: Greenfield
**Critical Finding:** This is a greenfield project with no actual implementation code. The repository contains only:
- `THE_IDEA.md` - Requirements specification document
- `.opencode/` - OpenCode/GSD framework configuration
**Impact:** There are no code-level technical concerns to document because nothing has been built yet. This document outlines concerns for the future implementation.
---
## Implementation Concerns
### No Source Code Exists
**Issue:** No application code has been implemented
- Files: None (project has not been initialized with source code)
- Impact: Cannot assess code quality, patterns, or technical debt
- Fix approach: Initialize project with proper scaffolding before implementation begins
### Missing Project Initialization
**Issue:** No package.json, build configuration, or source directories at project root
- Files: `package.json`, `tsconfig.json`, `src/` missing
- Impact: No standard development workflow established
- Fix approach: Run project initialization to create proper project structure
---
## Hardware-Specific Concerns
### Low-Power Device Targeting
**Issue:** Target hardware is Raspberry Pi Zero 2W (limited resources)
- Device: Pi Zero 2 W with 512MB RAM, single-core ARMv8
- Concern: UI must be lightweight to run smoothly in Chromium Kiosk Mode
- Mitigation needed:
- Minimal JavaScript bundle size
- Efficient rendering (avoid heavy frameworks if possible)
- Consider static HTML/CSS over SPA for main interface
- Lazy-load any heavy components
### Dual Display Resolution Support
**Issue:** Must support two different display modes
- 7-inch touchscreen: 1024x600 resolution
- Full HD remote access: 1920x1080 resolution
- Concern: Responsive design complexity
- Mitigation needed:
- Clear responsive breakpoints
- Different layouts for touch vs desktop
- Performance testing on actual hardware
---
## Requirements Complexity
### Feature Scope (3 Milestones)
**Issue:** Large feature set across three milestones
- Milestone 1: Modern compact UI
- Milestone 2: CSV processing and workflow
- Milestone 3: Network stack
- Concern: Scope creep and milestone creep
- Priority: High
### Data Types and Processing
**Issue:** Multiple sensor data types require handling
- Rainfall (today, hourly, MAR, yearly)
- Battery voltage
- Solar voltage
- Water level sensors (4-20mA, 0-10vDC)
- GPS coordinates
- Mobile network status
- Concern: Data normalization and storage complexity
### Network Protocol Support
**Issue:** Multiple transfer protocols specified in requirements
- FTP, SCP, SFTP, WEBDAV
- TCP socket connections
- Concern: Implementation complexity and security
- Mitigation: Start with simplest protocol (HTTP), add others as needed
---
## Dependencies at Risk
### OpenCode Framework Dependency
**Issue:** Project configured to use OpenCode/GSD workflow
- Package: `@opencode-ai/plugin` v1.2.24
- Location: `.opencode/package.json`
- Risk: Vendor lock-in to specific workflow tool
- Mitigation: Document standard development practices that work independently
### Zod in node_modules
**Issue:** Zod library present in `.opencode/node_modules/`
- Purpose: Likely used for configuration validation
- Concern: Not yet integrated into project (in .)
- Recommendation: If validationopencode only needed, use zod; otherwise remove dependency
---
## Missing Infrastructure
### No Testing Framework
**Issue:** No test files or configuration detected
- No `jest.config.*`, `vitest.config.*`, or similar
- No `*.test.*` or `*.spec.*` files
- Impact: No test coverage for future implementation
- Priority: High - Testing should be established before implementation
### No Linting/Formatting
**Issue:** No ESLint, Prettier, or biome configuration
- Impact: Inconsistent code style as team grows
- Priority: Medium
### No CI/CD Configuration
**Issue:** No GitHub Actions, GitLab CI, or similar
- Impact: No automated testing or deployment
- Priority: Low (can be added later)
---
## Security Considerations (Future)
### Network Credentials Storage
**Issue:** Requirements mention FTP/SCP credentials
- Files referenced: `THE_IDEA.md` lines 175-184
- Concern: Plain-text credentials in configuration
- Future mitigation:
- Use environment variables, not config files
- Consider OAuth/API keys over username/password
- Encrypt any stored credentials
### GPRS/Mobile Network
**Issue:** Mobile settings stored in system
- Location: `THE_IDEA.md` section 1.7
- Concern: Phone numbers and device IDs stored
- Future mitigation: Encrypt sensitive station data
---
## Performance Targets
### Startup Time
**Target:** Fast enough for Pi Zero 2W Chromium Kiosk
- Concern: Cold start must be under 3 seconds
- Mitigation: Minimize JavaScript, use progressive loading
### Memory Usage
**Target:** Stay within 256MB RAM for UI
- Concern: Chromium + web app + system services
- Mitigation: Avoid large in-memory data structures
---
## Summary of Priorities
| Concern | Priority | Status |
|---------|----------|--------|
| No source code exists | Critical | Not started |
| No testing framework | High | Not started |
| No project initialization | High | Not started |
| Hardware performance | High | Future |
| Requirements scope | Medium | Planned |
| No CI/CD | Low | Not started |
| Security hardening | Medium | Future |
---
*Concerns audit: 2026-03-12*