Expand description
PO.1 — the plugin boundary-trace substrate (Layer 1 of the observability
stack, design fragment docs/dev/architecture/plugin-observability.md).
The host owns the whole Component-Model boundary, so it can record every
host↔guest call independent of the guest’s source language. This module
is the sink for those records: a per-plugin ring + a boot-wired event
publisher, mirroring the LSP logging substrate (LspLogger / LspLogPushed)
that already proves the ring + publisher + off-thread-drain shape.
This slice is the pipe only — no seam is instrumented yet (PO.2 / PO.3).
Emission stays OFF the editor hot path by contract (design §4): trace is a
cheap gate + push + publish; all formatting + buffer append happen off-thread
on the drain side (PO.4), never on the UI/actor thread.
Structs§
- HotGate
- The hot-path verbosity gate — a per-plugin atomic the tracer publishes and the
sync grammar trampoline reads once per guest call (design §4: “a single
relaxed-atomic per-plugin gate load and a predicted-not-taken branch when
off”). The
Arc<AtomicU8>is owned by thePluginTracer(its single source of truth for verbosity) and cloned into the trampoline; a:set plugin.trace-levelwrite updates the atomic, so the very next keystroke reads the new level with no lock and no cross-plugin cost. - Plugin
Trace Pushed - Fired when
PluginTracer::traceappends a record. Aregister_event!typed event streamed viapublish_typed; the trace-buffer views (PO.4) subscribe and drain it off-thread, theLspLogPushedprecedent. - Plugin
Trace Record - One boundary event. Structured (not a pre-formatted line) so the view owns
presentation and filters key on fields.
pluginis the host-issued id (the same idSourceLayer::Plugin/Event::PluginCrashed.plugincarry), so Layer-0 crash rows and Layer-1 trace rows join cleanly. - Plugin
Tracer - The boundary-trace sink — the
LspLoggeranalogue. Cheap totraceinto (gate → push → publish); everything expensive is deferred to the off-thread drain.
Enums§
- Direction
- Which way a boundary call crossed.
- Trace
Level - Trace verbosity. Ordered least→most verbose; a record at
record.levelis kept iffrecord.level <= gate. Records always carryError..=Trace;Offis a gate-only value (a gate ofOffkeeps nothing). - Trace
Outcome - How a boundary call ended.
Type Aliases§
- Plugin
Tracer Handle - Shared handle alias (ServiceRegistry Arc/TypeId rule: register and look
up as
PluginTracerHandle).