Commit graph

28 commits

Author SHA1 Message Date
5142e29ad9 fix(tray): prevent exit when chat window closes
Switched from Builder::run() to Builder::build() + App::run(event_handler)
so ExitRequested can be intercepted. Without this, the hidden chat window
failing to load localhost:1420 triggered a clean exit and Robin disappeared
from the tray silently.
2026-05-20 11:10:24 -07:00
efec0a53ee feat(manage): manage.sh overhaul + exe-relative pattern loading + desktop entry
manage.sh:
- run: foreground execution with auto DISPLAY + RUST_LOG
- start/stop/restart/status: background daemon lifecycle
- logs: tail Robin log file
- build-debug: Rust-only build (no Node/npm needed)
- desktop-install/remove: system application menu entry
- autostart-enable/disable: XDG autostart entry
- install: build-debug + desktop-install + autostart-enable in one step
- uninstall: reverses install cleanly

patterns.rs:
- Add exe-relative candidates: binary-dir/patterns/ and binary-dir/../../patterns/
  This means the binary works from any working directory without requiring
  the user to cd into ~/robin/ first
2026-05-20 11:06:55 -07:00
8e28ac2624 fix(startup): add init logging + fix app_lib → robin_lib in main.rs
- Fix main.rs: app_lib crate name was wrong, should be robin_lib
- Add log::info! on pattern load success/failure — startup was completely
  silent making smoke testing and production diagnosis impossible
- Log pattern count and dual-boot supplement count on load
- Log matched pattern id on every notification dispatch
- These messages appear in ~/.local/share/tech.circuitforge.robin/logs/Robin.log
2026-05-20 09:59:37 -07:00
f0269c62a5 fix(build): add reqwest, fix exhaustive match, tauri deprecation, Cargo.lock
- Add reqwest 0.12 (json + stream features) — was missing from Cargo.toml
  causing chat_stream to fail to compile
- Add Android/IpadOs arms to SourceOs match in chat command
- Add tauri::Manager import to notify.rs (needed for .state())
- Replace deprecated menu_on_left_click with show_menu_on_left_click
- Remove desktopTemplate from tauri.conf.json (not in tauri-utils 2.9.2 schema)
- Commit Cargo.lock so cross-machine builds pin identical crate versions

All 42 unit tests pass on Linux Mint 22.3 (Muninn).
2026-05-20 08:32:39 -07:00
e4a682be2f feat(patterns): mobile-origin users + dual-boot supplement system
New SourceOs variants: Android, IpadOs — routed to android-to-* and
ipad-to-* pattern files respectively. Pattern bodies assume zero terminal
experience; every command explained from first principles with App Store /
iOS analogies.

Dual-boot supplement system: PatternFile::extend() + load_supplement()
in patterns.rs; lib.rs loads dualboot-{windows,macos}.toml on top of the
primary pattern file when migration.dual_boot_with is set. Supplement
covers NTFS dirty flag from Fast Startup, clock skew (RTC local vs UTC),
GRUB overwrite by Windows Update, BitLocker, APFS/HFS+ access, T2 Secure
Boot.

complete_onboarding() now accepts dual_boot_with: Option<String> and
normalises it to "windows"/"macos". Onboarding.vue becomes a 3-step flow:
source OS -> (Linux distro if linux) -> (dual-boot if windows/macos).
Mobile users skip the dual-boot step entirely.

10 new pattern files (8 mobile + 2 supplements), config.rs tests updated.
2026-05-19 09:32:18 -07:00
19286e9860 feat(patterns): full Linux-to-Linux distro matrix + M2 LLM chat wiring
Pattern files: 12 cross-family migration pairs covering debian, fedora, arch,
opensuse — each tuned to the user's prior tooling (apt, dnf, pacman, zypper).
Includes the custom linux-to-arch file for experienced distro-hoppers and
the macos-to-arch / windows-to-debian expansions from the prior session.

Code changes:
- patterns::load() accepts source_distro_family: Option<&str> — tries
  specific debian-to-arch.toml before falling back to linux-to-arch.toml
- MigrationConfig adds source_distro_family: Option<String> with serde default
- complete_onboarding() accepts optional source_distro arg and derives family
  via distro_family() for Linux-to-Linux migrations
- llm.rs: Ollama streaming client with Vec<u8> buffer for UTF-8 safety,
  emit errors logged not silenced
- commands::chat: spawns stream task, returns immediately so frontend
  isn't blocked waiting for full LLM response
- lib.rs: registers mod llm and commands::chat in invoke_handler
2026-05-19 08:24:06 -07:00
89271f08f8 feat(patterns): add linux-to-arch pattern set for experienced distro-hopper on CachyOS
Targets an experienced Debian/Fedora user on first Arch install. Body text
is terse and technical — no hand-holding, just Arch-specific gotchas.

- pacman.log as watched applog source (catches terminal pacman/AUR runs)
- pacman/AUR: db lock, dep conflicts, conflicting files, build failures,
  PGP keys, missing makedepends, partial upgrade warning, Chaotic-AUR sig
- DKMS: build failures + CachyOS kernel module signature mismatch
- System: locale not generated (Arch vs Debian difference), systemd-resolved,
  OOM (zram suggestion), disk I/O
- Audio: PipeWire/WirePlumber, Bluetooth rfkill + profile
- GPU: hang (mesa-git/DKMS version mismatch context), XWayland crash
- Gaming: Proton, Lutris Wine runner
- Network: NetworkManager + Realtek firmware callout for CachyOS
2026-05-19 08:10:13 -07:00
f7639346a6 feat(patterns): expand macOS-to-Arch and Windows-to-Debian pattern sets
macOS-to-Arch: +9 patterns (pacman lock, dep conflict, DKMS build fail,
PipeWire, WirePlumber, Bluetooth rfkill/profile, GPU hang, XWayland crash,
OOM killer, disk I/O, NetworkManager)

Windows-to-Debian: +11 patterns (dpkg interrupted, PipeWire, PulseAudio,
Bluetooth rfkill/profile, NTFS dirty/force flags, disk I/O, USB reset,
OOM killer, GPU hang, NetworkManager, CUPS unavailable)

All patterns target sources Robin actually watches: journald, kmsg, applog.
match_text strings use invariant substrings from real log output.
2026-05-19 08:07:22 -07:00
d8991905d7 fix(m1): address HIGH review findings — journald zombie, silent exit, double-delivery 2026-05-18 18:56:45 -07:00
8195ad98b0 feat(m1): starter pattern files — macos-to-arch and windows-to-debian 2026-05-18 18:25:11 -07:00
c3958553a5 fix(m1): move mut rx inside async block (clippy), log+continue on parse errors in load() 2026-05-18 18:22:50 -07:00
2706b2367d feat(m1): wire classifier loop — pattern file loads on startup, events dispatch to notify
- lib.rs: replaces stub setup with full wiring: loads PatternFile from
  config, extracts log_paths, spawns watcher, runs classifier loop in
  async task, dispatches MatchedEvents via notify::dispatch
- lib.rs: config Mutex lock uses unwrap_or_else(|e| e.into_inner()) to
  recover from poison instead of panicking
- patterns.rs: load() now tries three path candidates in order
  (dev-relative, src-tauri-relative, system) before returning bail!
  Validation loop (match_text, sources) retained inside candidate loop
2026-05-18 18:09:33 -07:00
c0f046bd7c fix(m1): notify — unwrap_or_default on poisoned config lock, log poisoned PENDING, add take_pending test 2026-05-18 18:07:34 -07:00
3b7653d731 feat(m1): notification delivery — tray badge, desktop toast, pending event queue 2026-05-18 17:27:41 -07:00
3c77969680 fix(m1): inotify — use read_to_end for UTF-8 resilience, await spawn_blocking
- read_to_end + from_utf8_lossy replaces read_to_string so Wine/game logs
  with Latin-1 bytes are handled via U+FFFD replacement instead of silently
  dropping all events from that file
- bytes_read from I/O call used for new_pos (not content.len()) for correct
  byte position accounting
- spawn_blocking handle is now awaited so panics inside the blocking task
  surface to the caller instead of being silently swallowed
2026-05-18 17:25:30 -07:00
7eaf22c130 feat(m1): inotify app log watcher — tails log files for known apps 2026-05-18 17:14:10 -07:00
db7d30d4c1 feat(m1): kmsg watcher — reads /dev/kmsg kernel ring buffer 2026-05-18 17:13:36 -07:00
e48536dfbe feat(m1): journald watcher — streams journalctl JSON to event channel 2026-05-18 17:13:23 -07:00
d1bea47495 refactor(m1): restructure watcher into module with EventSource, SystemEvent
Replace flat watcher.rs with watcher/ module containing mod.rs plus stub
sub-modules for journald, kmsg, and inotify. Upgrades spawn() to accept
log_paths and return mpsc::Receiver<SystemEvent>. Updates lib.rs call site.
2026-05-18 17:10:37 -07:00
6acf085c0f fix(m1): validate patterns at load, add Serialize to EventSource, expand tests
- load() now rejects patterns with empty match_text or empty sources list
- EventSource derives Serialize/Deserialize with serde tag for emit() readiness
- AppLog variant changed to struct form (AppLog { app }) for tagged enum compat
- classify() takes &SystemEvent directly (top-level use import, not per-fn)
- #[must_use] on classify()
- 5 new tests: any-source wildcard (journald+kmsg), applog mismatch, empty-field validation
2026-05-18 17:08:25 -07:00
1e733a062b feat(m1): pattern system — PatternFile loader and classify()
Add EventSource enum and update SystemEvent in watcher.rs (M0 stub
updated to support Task 5 clean deletion). Create patterns.rs with
PatternFile/Pattern/MatchedEvent types, TOML loader, and classify()
matching against source + text. Five unit tests covering journald,
applog, no-match, and source discrimination cases.
2026-05-18 16:57:05 -07:00
a94e3dbb66 fix(distro): handle single-quoted IDs, add mint, run cargo fmt
- parse_id now strips both double and single quotes per os-release spec
- distro_family debian arm includes "mint" (legacy Linux Mint ID)
- Add tests: single-quoted ID round-trip, mint family classification
2026-05-18 16:55:06 -07:00
dc45c82aba feat(m1): distro detection from /etc/os-release, update_notification_level command 2026-05-18 15:53:03 -07:00
cee05b5d18 fix(m1): serde defaults on Tier and NotificationLevel, PartialEq on SourceOs 2026-05-18 15:21:03 -07:00
c94fc58296 feat(m1): add Tier and NotificationLevel to config 2026-05-18 15:17:56 -07:00
5216549d0a chore(m1): use notify v8, dirs v6, tighten capabilities permissions 2026-05-18 14:53:05 -07:00
c33d4cf07f chore(m1): add notify dep, fix capabilities window name and permissions 2026-05-18 14:05:16 -07:00
642f89c10b feat: M0 scaffold — Tauri 2 + Vue 3, system tray, first-run onboarding, config layer 2026-05-18 10:06:49 -07:00