Expand description
The decoration/ui boundary conversions (plugin-host.md §5 decorations/ui,
PH7.9a).
Mirrors Mode::gutter_decorations + GutterDecoration (lattice-mode) — the
per-line gutter data a plugin decoration provider produces. Two directions:
GutterDecorationcrosses guest→host (the producer’s return): aWitBoundaryround-trip (compiler-exhaustive both ways — a new arm can’t land without a mapping; theeffectprecedent). Per-line scalars only; no draw calls cross.decoration-contextcrosses host→guest (one-way, the grammarproject_*precedent). The nativeDecorationCtxisbuffer_id+ aServiceRegistryof render-state snapshots (host-owned, can’t cross), and a plugin producer runs OFF the render path anyway — so the host builds the owned context from buffer metadata (id / path / line count) when it triggers the producer. Bulk buffer text rideshost-services/ the deferreddocumenthandle, not this record.
The ui emit surface had a modeline half here that was type-mirror-only,
and OC.3 / ML.6 gave it a real producer — ui.wit plus ui_host, which
builds native ModelineElement / ModelineElementUpdate values directly
rather than round-tripping a record, so nothing here converts for it. The
ui-segment record that used to be mirrored is gone with it: building the
producer against a real consumer showed it conflated the descriptor’s zone
with the content’s text (see the note in types.wit).
ui-notification is still mirror-only and still has no producer — a plugin
notifies via effect.echo — so the smoke test below keeps sizing it for the
freeze.
Functions§
- decoration_
from_ wit - SG.3b — the registry-aware guest→host conversion, and the one the producer call site uses.
- decoration_
to_ wit - SG.3b — the registry-aware host→guest conversion.
- project_
decoration_ context - Build the owned
decoration-contextthe host hands a producer (host→guest, one-way). The host has the buffer metadata off the render path when it triggers the producer; the guest computes per-line decorations from these scalars (+host-servicesfor external data like git HEAD). A non-UTF-8 path is dropped toNone(a decoration producer keys off the buffer, not the path text — losing an un-representable path degrades gracefully rather than failing the whole trigger, unlike an event delivery).