8 Commits

Author SHA1 Message Date
3caddc6370 Simplify architecture: read-only cache + one-way SD upload
Replace OverlayFS + sync daemon with two independent subsystems:
- Read-only cache: rclone --read-only + Samba read only = yes
- SD Uploader: staging → SFTP direct upload to NAS (temp file + rename)

Remove: OverlayFS, sync daemon, three-timestamp model, write-back,
conflict detection, dirty file tracking. Net -299 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:35:43 +08:00
d40997312b Redesign conflict UX: in-place copies like Dropbox/iCloud (4.16)
Instead of moving conflict files to a separate conflict/ directory,
keep them in the original directory with naming convention:
  {name} (Warpgate Conflict {YYYY-MM-DD HH-mm}).{ext}

Benefits:
- Lightroom/Finder see both versions side by side
- Preserved extension ensures app compatibility
- Matches Dropbox/iCloud behavior users already know
- Conflict copies auto-sync to NAS via rclone (backed up)

Remote-deleted + local-dirty: file stays in place (no rename),
marked as orphan-conflict, user decides whether to re-upload.

Updated: decision matrix diagrams, scenario walkthroughs,
cache_files lifecycle, CLI commands, config section, directory
structure description.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 21:44:51 +08:00
823d20606a Add adaptive throttle for write-back bandwidth (4.14)
Throughput-based congestion detection: when sustained throughput
drops >30% over sliding window with rising RTT, auto-reduce
write-back speed to 50% of current throughput, then probe back up
at +10% every 2 minutes.

- Throttle state visible via `warpgate status`
- User can disable with BW_ADAPTIVE=no
- Only affects write-back uploads, not read fetches
- New config: BW_ADAPTIVE, BW_ADAPTIVE_WINDOW, BW_ADAPTIVE_PROBE_INTERVAL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 21:42:00 +08:00
7fd1934be5 Clarify metadata.db must be on local filesystem, not FUSE mount
SQLite WAL depends on POSIX file locks and shared memory (-shm),
which FUSE/network filesystems cannot support correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 21:38:08 +08:00
aaf947859f Convert all ASCII art diagrams to Mermaid
Replace 20 ASCII box-drawing diagrams with Mermaid equivalents:
- System architecture → flowchart with subgraphs
- Multi-protocol cache → flowchart LR
- Write-back decision matrix → flowchart with branches
- SD card import decision tree → flowchart
- Read cache validation → markdown table (cleaner than ASCII grid)
- 5 scenario walkthroughs → flowcharts with timeline context
- 4-table ER diagram → erDiagram
- Deletion detection flow → flowchart
- Write-back dual-pipeline → flowchart with subgraphs
- Import state machine → stateDiagram-v2
- Tiered polling strategy → flowchart
- NAS agent push → flowchart LR
- Read/write flows → flowcharts
- Cache eviction → flowchart
- Headscale infrastructure → flowchart BT
- Cloud backup → flowchart with subgraph
- TM write-back strategy → flowchart LR

Kept directory tree structure as plain text (standard convention).
Cache protection measures converted to structured markdown list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 21:28:03 +08:00
ddcfb87b36 Add captive portal setup AP as P1 feature (4.11)
Hotel/airport WiFi requires web-based captive portal authentication,
which is impossible on a headless device without this feature.

- New P1 feature 4.11: Setup AP + Captive Portal proxy
  - Box auto-enters setup mode when no network is available
  - Phone connects to temporary AP, completes portal auth via proxy
  - Requires WiFi AP+STA concurrent mode
- Fallback options: USB tethering, mobile hotspot, ethernet, MAC clone
- New CLI commands: warpgate setup-wifi, warpgate clone-mac
- New config section for setup AP parameters
- Updated hardware requirements: WiFi module must support AP+STA
- Updated roadmap v1.5 to include setup AP
- Added risk entry and glossary terms
- Renumbered 4.12-4.23 accordingly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 18:20:42 +08:00
aa2db2bf5f Rename product to Warpgate — Make your NAS feel local
- Rename NAS Cache Proxy → Warpgate throughout PRD
- Update CLI commands: nas-cache → warpgate
- Update paths: /mnt/ssd/nas-cache → /mnt/ssd/warpgate
- Rename file: nas-cache-proxy-prd-v3.md → warpgate-prd-v3.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 18:05:23 +08:00
c3b458bced Add NAS Cache Proxy PRD v3
Complete product requirements document covering:
- Transparent SMB/NFS/WebDAV cache proxy with rclone VFS
- SD card ingest + auto archive pipeline for photographers
- Three-timestamp consistency model with write-back controller
- Time Machine backup target with independent sparsebundle sync
- Layered SFTP polling for remote change detection
- Cache space protection and import state machine
- Paid services: Headscale + DERP relay, cloud disaster backup
- Hardware appliance roadmap (v1.0 MVP → v3.0 hardware product)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 18:00:44 +08:00