owlry 2.0.1: doctor visibility + proactive migration hints #7
Reference in New Issue
Block a user
Delete Branch "fix/dynamic-providers-doctor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
owlry 2.0.1
A small patch release covering two quality-of-life items that surfaced from the v2 release.
fix(providers): dynamic providers visible in doctor + providers list
`owlry doctor` and `owlry providers ` now report dynamic providers (`calc`, `conv`, `websearch`, `filesearch`). They've always run fine — `= 2+2` produces `4`, `:web rust docs` returns a URL, etc. — they just weren't enumerated because `ProviderManager::available_providers()` iterated only the static `Vec<Box>` field, never the parallel `Vec<Box>`.
After 2.0.1:
```
[providers] 11 registered
app Applications prefix=:app
cmd Commands prefix=:cmd
power Power prefix=:power
clipboard Clipboard prefix=:clip
emoji Emoji prefix=:emoji
ssh SSH prefix=:ssh
uuctl User Units prefix=:uuctl
calc Calculator prefix=:calc
conv Converter prefix=:conv
websearch Web Search prefix=:web
filesearch File Search prefix=:file
```
Internally, the `DynamicProvider` trait gained `prefix()`, `icon()`, `tab_label()`, `search_noun()` as defaulted methods (matching the static `Provider` trait shape); the four dynamic provider impls override them with sensible values.
feat(aur/install-hook): proactive legacy-cruft detection
The hook now does read-only detection of two common upgrade snags from pre-v2 setups, both of which silently break things if missed:
Stale `~/.config/systemd/user/owlry{,d}.{service,socket}` overrides. systemd-user gives precedence to user-level units over `/usr/lib/systemd/user/*`. A leftover override pointing at a dev-time `target/debug/owlry-core` path (anyone who ran `just install-local` in a 1.x tree) silently shadows the AUR-shipped unit.
Compositor configs with `owlryd` references — Hyprland (`hyprland.conf` + the include dir), Sway, i3, river, niri. `exec-once = owlryd` etc. won't resolve anymore.
Each affected user gets a banner with the exact `rm` + `systemctl --user` commands to run, and the `owlryd` → `owlry -d` substitution for compositor configs. The hook never modifies user files — it reads, classifies, and prints. The user runs the cleanup themselves.
Runs on:
Testing
248 tests pass with `--features full` (was 245). Three new TDD characterization tests for the doctor visibility fix; install hook syntax + detection logic verified against a synthetic stale-config homedir.
No breaking changes
No config / API breakage. Safe drop-in upgrade from 2.0.0.
docs/lua-api.md (new, 380 lines): - Section 1-2: Why Lua + file location (owlry.lua, NOT init.lua per D23) - Section 3: Quick reference (one self-contained example covering every surface) - Section 4: API reference (owlry.set / providers / tabs / provider / theme) with per-field tables and rules - Section 5: Host API in scope (full stdlib + owlry.util convenience helpers); no sandbox in 2.1 - Section 6: How providers/tabs/provider{} compose at runtime — the three orthogonal axes (compiled in / enabled / shown as tab) made explicit with a worked example and a what-if table - Section 7: Hot reload via notify crate (re-added in Phase 3) - Section 8: Validation via 'owlry config validate' / 'config show' - Section 9: Migration via 'owlry migrate-config' with full TOML→Lua mapping table - Section 10: Open questions resolved before Phase 3 ships - Section 11: Version compatibility roadmap (2.0 -> 2.1 -> 2.2 -> 3.0) - Section 12: Implementation outline (handoff to engineering) docs/RESTRUCTURE-V2.md: - D23: config file named owlry.lua (brand identity over init.lua convention; file is loaded explicitly, not via Lua's require) - D24: owlry.providers vs owlry.tabs distinction made explicit — three orthogonal axes (compiled in / enabled / shown as tab), full composition spec lives in lua-api.md §6 The Lua API doc is intended as both the design spec we're committing to AND the user-facing reference once Phase 3 ships.Common upgrade snags from pre-v2 setups that the 2.0.0 hook didn't catch in time. Both detected read-only and reported with precise remediation; the hook never modifies user files. 1. Stale ~/.config/systemd/user/owlry{,d}.{service,socket} overrides. systemd-user gives precedence to ~/.config/systemd/user/* over /usr/lib/systemd/user/*. A leftover dev-time override (e.g. from 'just install-local' in a 1.x tree) silently masks the AUR-shipped unit. We classify them: - references the deleted owlryd binary - points at a dev-time target/debug or target/release path - redundant override of the canonical /usr/bin/owlry - non-standard ExecStart (flagged for review) 2. Compositor autostart referencing 'owlryd': ~/.config/hypr/hyprland.conf and any *.conf / *.hyprlang in hypr/ ~/.config/sway/config ~/.config/i3/config ~/.config/river/init ~/.config/niri/config.kdl Each affected user gets a banner with the exact rm + systemctl --user commands to run (and what to replace 'owlryd' with in compositor configs). The hook reads only — it never executes the cleanup itself. Runs on: - 1.x -> 2.x upgrades (alongside the existing rename banner) - 2.0.0 -> 2.0.1 upgrade (re-runs the detection idempotently for users who missed cleanup the first time around) The 1.x banner copy is touched lightly: bookmarks now appears in the 'deferred' line alongside the widgets (D22).