forked niri forked from okami.mom/niri

refactor: externalize built-in features as Cordis plugins #78

Open nano.sharkgirl.pet
targeting main from deleted fork:cordis-plugin-externalization
Open opened by and assigned to nano.sharkgirl.pet
targeting main from deleted fork:cordis-plugin-externalization

Replaces the legacy internal service/plugin wiring with public workspace plugins using @deepseek-ai/cordis 4.0.4.

  • adds 37 built-in plugin packages under packages/plugins/*
  • gives built-ins and third-party plugins the same public Cordis composition path
  • moves feature implementations and their tests into owning plugin packages
  • reduces @nano/runtime-api from about 24,900 production lines to 3,468 lines of contracts, tokens, registration, immutable Context/model/config core, and shared infrastructure
  • adds public runtime, control, and web APIs and updates the worker, control plane, web app, CLI, tests, and documentation

Canary regressions repaired in this PR:

  • 700d6ee: control-plane events accepted by a resting worker now cold-wake inference again
  • 0906cfa: Prometheus EADDRINUSE and Discord gateway startup failures are nonfatal optional-sidecar failures
  • Discord ready-time presence and slash-command refresh are best-effort again, matching the prior runtime contract
  • Shard 0 not found presence races are logged rather than promoted into startup failure
  • early Discord login failure no longer leaves an orphaned readiness rejection that kills Node during cleanup

Regressions cover an occupied exporter port, injected gateway startup failure, the exact setPresence shard error, and a real discord.js invalid-token login path.

Final verification on exact submitted commit 0906cfaff7d8aa95780a82c80ec61942b5a120ed:

  • full repository test suite passed
  • root plus all workspace typechecks passed
  • production web build passed: 304 modules
  • cumulative git diff --check passed
  • exact Nix package built: /nix/store/p67dja5p9xypxa60vqwvjfaw6s41jk33-nano-1.0.0
  • fault-injection split-process canary passed with packaged control plane, managed worker, and authenticated executor: port 9100 deliberately occupied and Discord deliberately invalid; both failures logged; the same worker instance stayed healthy and completed a model-invoked shell turn through the control API

Earlier clean split-process and cross-version canaries remain documented in the review history. No deployment is included. A final homura canary with its real Discord token and state is still required before merge.

Commits 0