Expand description
BC.6 / DX.7 / CR.6: the crate-owned install(boot) entry point.
The diff subsystem registers its own modes + commands through the
generic [SubsystemBoot] surface, collapsing the host wiring into one
Phase-B line (lattice_diff::install(&mut boot)) — the terminal /
claude-code / multibuffer shape.
CR.6 (2026-06-24): the diff subsystem registers its own commands.
Every diff action (action:diff-*, action:hunk-*) and ex-command
(ex:diff* / ex:hunk-* / ex:describe-diff) is declared here via
boot.commands_mut() — the “modes register commands” pattern
(multibuffer precedent). The command declarations are mode-owned; the
command bodies split two ways by what they need:
- mode-owned bodies — the
do/dp, conflict (d2o…dB), and hunk-nav (]c/[c) chords resolve through the modes’action_handlers()(theActionHandlerRegistryis consulted before the CommandSpec), which read theDiffSubsystemHandleservice and return anEffect. The action specs here are pure shells. - host
Effectappliers — the ex-command apply closures parse args and return a host-boundaryEffect(DiffOpen,Diffsplit,DiffGetCmd, …) that the host’shandle_effectapplies. The lifecycle appliers (do_diff_open/diffsplit/off/accept/reject/diffthis) stay host-side: they mutate&mut Editor(pane tree, document actor, task spawning), whichlattice-diffcannot reach without a dependency cycle. This is the Effect-vocabulary-is-the-host-boundary rule.
The commands register under their plain user-facing names (diff,
diffsplit, hunk-next, …) — no ex: prefix and no host alias shim
(the multibuffer pattern); :diff resolves to them directly.
Two diff touch-points still stay host-side, and are not mode-ownership
violations (see docs/dev/architecture/diff-extraction.md, couplings
C6/C10):
- The
DiffSubsystemlifecycle —bindwith the host’sBufferRegistryDocumentResolver, thediff_subsystem/diff_subscription_guard/diff_forwardersEditor fields, and theapply_pending_diff_mode_changesdispatch-tail drain — is host actor-loop state (terminal-invocation-runner category). The subsystem handle is published as a service (DiffSubsystemHandle) so the modes reach it generically. - The
+N ~Mmodeline element is registered against the host’sModelineService, created after the Phase-B install list (boot ordering). The descriptor +diff_contentformatter are mode-owned (incrate::mode); only the registration call is host-sequenced.
Functions§
- install
- Wire the diff subsystem’s modes + commands into the editor at boot.