owlry 2.0.1: doctor visibility + proactive migration hints #7

Merged
vikingowl merged 4 commits from fix/dynamic-providers-doctor into main 2026-05-13 03:54:34 +02:00
Owner

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:

  1. 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.

  2. 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:

  • 1.x → 2.x upgrades (alongside the existing rename banner)
  • 2.0.0 → 2.0.1 (re-runs the detection idempotently for users who missed cleanup the first time)

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.

## 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 <id>\` 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<dyn Provider>>\` field, never the parallel \`Vec<Box<dyn DynamicProvider>>\`. 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: 1. **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. 2. **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: - 1.x → 2.x upgrades (alongside the existing rename banner) - 2.0.0 → 2.0.1 (re-runs the detection idempotently for users who missed cleanup the first time) ## 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.
vikingowl added 4 commits 2026-05-13 03:53:14 +02:00
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.
ProviderManager::available_providers() and available_provider_types()
iterated only the static `Vec<Box<dyn Provider>>` field, never the
parallel `Vec<Box<dyn DynamicProvider>>`. Result: calc, conv,
websearch, filesearch ran fine but were silently absent from
`owlry doctor` and `owlry providers <id>` outputs.

Fix:
- Add prefix(), icon(), tab_label(), search_noun() as defaulted methods
  on the DynamicProvider trait (matching the static Provider trait
  shape). Default values: None / "application-x-addon" / None / None.
- Override those methods on the four dynamic provider impls with sensible
  values (e.g. calculator: ":calc" / "accessories-calculator" /
  "Calc" / "math expression").
- Extend available_providers() and available_provider_types() to iterate
  builtin_dynamic too. Each dynamic provider always reports as
  ProviderType::Plugin(<type_id>) — Application/Command/Dmenu variants
  are static-only, but the match is defensive.

Tests added (TDD characterization for 2.0.1):
- available_providers_includes_dynamic_providers — synthetic DynRich
  provider with every overridable method set; asserts the descriptor
  comes back with the right id/prefix/icon/position/tab_label/search_noun.
- available_provider_types_includes_dynamic_providers — verifies the
  type list returns both static and dynamic types.
- dynamic_provider_trait_defaults_return_documented_values — minimal
  impl returns the documented defaults.

After this fix, `owlry doctor` reports 11 providers instead of 7 on
a default --features full build, and `owlry providers calc` returns
the calculator's full metadata instead of 'No provider with id'.

248 tests pass with --features full (was 245).
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).
Patch release covering:
- fix(providers): dynamic providers (calc, conv, websearch, filesearch)
  now appear in owlry doctor and owlry providers <id> output
- feat(aur/install-hook): proactive detection of stale owlryd references
  in user-level systemd units and compositor configs

No behavioural changes beyond diagnostic visibility and upgrade-time
warnings. No config or API breakage; safe drop-in upgrade.

Cargo.toml + PKGBUILD bumped together; .SRCINFO regenerated; b2sum
will be refreshed by 'just aur-update' once the tag is pushed.
vikingowl merged commit 9921c5f280 into main 2026-05-13 03:54:34 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Owlibou/owlry#7