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

4 Commits

Author SHA1 Message Date
vikingowl 0242e48707 chore(owlry): bump version to 2.0.1
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.
2026-05-13 03:52:23 +02:00
vikingowl 048c446b26 feat(aur/install-hook): proactive legacy-cruft detection
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).
2026-05-13 03:52:20 +02:00
vikingowl e88525fa19 fix(providers): surface dynamic providers in doctor + providers list
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).
2026-05-13 03:52:06 +02:00
vikingowl 1075eefbf3 docs(phase-3): full Lua API spec + D23/D24 decisions
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.
2026-05-13 03:41:11 +02:00