Skip to main content

Crate lattice_plugin_trace

Crate lattice_plugin_trace 

Source
Expand description

The buffer-backed plugin boundary-trace views: plugin-trace-mode and the :plugin-trace ex-command (PO.4).

A pure PROVIDER crate (the lattice-plugin-manager shape): it owns plugin-trace-mode (major, read-only) + the :plugin-trace ex-command, and reads the host’s PluginTracer (PO.1/PO.3) via the PluginTracerHandle service at activation. Everything wires through the generic SubsystemBoot seam, so adding it to the editor is one line in the host’s Phase-B install list and zero host internals — no Editor:: method, no host Action variant (the mode-ownership acid test).

Open flow, all generic primitives (no provider-specific host code):

  1. :plugin-trace (registered here) returns Effect::OpenSyntheticBuffer { name: "*plugin-trace*", mode_id: "plugin-trace-mode" }.
  2. The host generically ensures that buffer under plugin-trace-mode + activates it (Editor::open_synthetic_buffer).
  3. PluginTraceMode::on_activate seeds from the tracer ring + subscribes to PluginTracePushed for the live tail (off-thread).

The per-plugin *plugin-trace:<name>* view + the :plugins manager t drill-in land in PO.4.2; the live plugin.trace-level option in PO.4.3.

Design: docs/dev/architecture/plugin-observability.md §6.

Structs§

PluginTraceMode
The *plugin-trace* / *plugin-trace:<name>* buffers’ major mode.

Constants§

SHARED_BUFFER_NAME
The shared synthetic buffer name + the major mode that owns the trace views.
TRACE_MODE_ID

Functions§

format_trace_line
Format one record into a single line (no trailing newline — the drain joins with \n).
install
Install the plugin-trace views: register plugin-trace-mode + the :plugin-trace ex-command. Seated in the host’s Phase-B install list (before the registry freeze), so it registers directly via boot.modes_mut() / boot.commands_mut().
parse_per_plugin_name
The plugin name inside a *plugin-trace:<name>* buffer name, or None for the shared *plugin-trace* (or any non-trace name). Inverse of per_plugin_buffer_name.
per_plugin_buffer_name
The per-plugin buffer name for plugin (*plugin-trace:<name>*) — the manager t drill-in target (PO.4.2). Single-sources the naming scheme with parse_per_plugin_name so the manager (producer) and the mode (consumer) can’t drift.