robin/src-tauri/patterns/arch-to-debian.toml
pyr0ball 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

146 lines
6.9 KiB
TOML

[meta]
source_os = "linux"
target_distro_family = "debian"
# Arch/Manjaro/EndeavourOS user moving to Debian/Ubuntu/Mint.
# Body text assumes pacman, AUR, and rolling release familiarity.
[log_paths]
steam = "~/.local/share/Steam/logs/content_log.txt"
proton = "~/.local/share/Steam/logs/proton_log.txt"
# ── apt / dpkg ────────────────────────────────────────────────────────────────
[[patterns]]
id = "apt-lock"
sources = ["journald"]
match_text = "Could not get lock /var/lib/dpkg/lock"
severity = "warn"
title = "Package manager is locked"
body = "Another apt process is running — often unattended-upgrades (automatic background updates, no Arch equivalent). Wait a minute. If stuck: sudo rm /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock && sudo dpkg --configure -a"
[[patterns]]
id = "dpkg-interrupted"
sources = ["journald"]
match_text = "dpkg was interrupted"
severity = "warn"
title = "Package install was interrupted"
body = "Like a pacman transaction that got killed, but dpkg needs manual recovery. Fix: sudo dpkg --configure -a"
[[patterns]]
id = "apt-unmet-dependency"
sources = ["journald"]
match_text = "Unmet dependencies"
severity = "warn"
title = "Package dependency conflict"
body = "Unlike pacman which puts the conflict choice on you, apt tries to auto-resolve. Let it: sudo apt --fix-broken install — if it can't, read the message for which packages conflict."
# ── System ────────────────────────────────────────────────────────────────────
[[patterns]]
id = "kernel-driver-firmware"
sources = ["kmsg"]
match_text = "firmware: failed to load"
severity = "warn"
title = "Firmware file missing"
body = "On Debian: sudo apt install firmware-linux firmware-linux-nonfree (enable non-free sources first). On Ubuntu: sudo apt install linux-firmware. Unlike Arch's single linux-firmware package, Debian splits firmware by license."
[[patterns]]
id = "oom-killer"
sources = ["kmsg"]
match_text = "Out of memory: Kill process"
severity = "warn"
title = "OOM killer fired"
body = "Debian stable has conservative defaults — Ubuntu enables zswap, Debian doesn't. If you used zram-generator on Arch, set up a swapfile here: fallocate -l 4G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile"
[[patterns]]
id = "disk-io-error"
sources = ["kmsg"]
match_text = "Buffer I/O error on device"
severity = "warn"
title = "Disk I/O error"
body = "Check SMART: sudo smartctl -a /dev/sdX — install: sudo apt install smartmontools"
[[patterns]]
id = "locale-error"
sources = ["journald"]
match_text = "failed to set locale"
severity = "info"
title = "Locale configuration error"
body = "Debian generates locales via dpkg-reconfigure: sudo dpkg-reconfigure locales — select your locale in the curses UI. Unlike Arch where you edit /etc/locale.gen directly, Debian abstracts this."
# ── AppArmor ──────────────────────────────────────────────────────────────────
[[patterns]]
id = "apparmor-denial"
sources = ["journald"]
match_text = "apparmor=\"DENIED\""
severity = "info"
title = "AppArmor access denied"
body = "Debian/Ubuntu ships AppArmor — Arch doesn't use MAC by default. An app is blocked by a security profile. Check: sudo aa-status — audit: sudo aa-logprof — or put the profile in complain mode: sudo aa-complain /etc/apparmor.d/<profile>"
# ── Audio ─────────────────────────────────────────────────────────────────────
[[patterns]]
id = "pipewire-connect-fail"
sources = ["journald"]
match_text = "Failed to connect to PipeWire"
severity = "warn"
title = "PipeWire not responding"
body = "Ubuntu 22.04+/Debian 12+ ship PipeWire like Arch. Restart: systemctl --user restart pipewire pipewire-pulse wireplumber"
[[patterns]]
id = "pulseaudio-connect-fail"
sources = ["journald"]
match_text = "Failed to connect to pulseaudio"
severity = "warn"
title = "PulseAudio not responding"
body = "Older Debian systems still use PulseAudio. Restart: pulseaudio --kill && pulseaudio --start — you can migrate to PipeWire: sudo apt install pipewire-audio"
[[patterns]]
id = "bluetooth-rfkill-blocked"
sources = ["journald"]
match_text = "Blocked through rfkill"
severity = "warn"
title = "Bluetooth rfkill blocked"
body = "rfkill unblock bluetooth — same as Arch."
# ── GPU / display ─────────────────────────────────────────────────────────────
[[patterns]]
id = "gpu-hang"
sources = ["kmsg"]
match_text = "GPU HANG"
severity = "warn"
title = "GPU hang"
body = "GPU stopped responding. For NVIDIA on Ubuntu: sudo apt install nvidia-driver-<version> or ubuntu-drivers autoinstall. Debian requires non-free sources: apt install nvidia-driver"
# ── Network ───────────────────────────────────────────────────────────────────
[[patterns]]
id = "networkmanager-activation-fail"
sources = ["journald"]
match_text = "Activation failed"
severity = "info"
title = "NetworkManager: connection failed"
body = "nmcli device status — Debian minimal installs may use ifupdown instead of NetworkManager. Check: systemctl status NetworkManager — install if missing: sudo apt install network-manager"
# ── Printing ──────────────────────────────────────────────────────────────────
[[patterns]]
id = "cups-server-error"
sources = ["journald"]
match_text = "Unable to connect to CUPS server"
severity = "info"
title = "Printer service not running"
body = "sudo systemctl start cups && sudo systemctl enable cups — Debian/Ubuntu handle printing through CUPS; Arch also uses CUPS but it's not always enabled by default."
# ── Gaming ────────────────────────────────────────────────────────────────────
[[patterns]]
id = "proton-runtime-missing"
sources = ["applog:proton"]
match_text = "wine: cannot find"
severity = "warn"
title = "Proton runtime issue"
body = "Right-click game in Steam -> Properties -> Local Files -> Verify integrity."