Skip to main content

Module error_parser_host

Module error_parser_host 

Source
Expand description

CM.6: the host side of the plugin-contributed compilation-parser seam.

Design: compilation-mode.md §5 (the parser registry as an extensibility seam) and the error-parser WIT interface.

A plugin implementing error-parser-plugin gets fed every captured compilation line and returns the diagnostics it recognised. The native CompilationParser trait is a one-method interface, so the WIT world mirrors it rather than inventing a second shape for the same job.

§Sync, unlike most seams here

The other async seams here exist because their work is genuinely concurrent — a picker query, an event fan-out. Parsing one line is not: it is a pure function of the line plus the guest’s pending state, called in strict arrival order by a single reader. An async call per line would buy nothing and cost a suspend per line of build output.

It is off the UI and actor threads (the compilation reader owns it), but it is on the critical path of a fast producer, so it carries the same Reflex-class budget the grammar seam uses rather than the generous lifecycle default.

§Guest output is untrusted

Every returned entry is validated host-side and dropped on failure, never trapped on. A guest returning an empty path or a line number that cannot be a line number is a buggy plugin, and a buggy plugin must cost its own entries — not the build.

Structs§

WasmErrorParser
A plugin-backed compilation parser, ready to be registered into the native ParserRegistry.
WasmErrorParserFactory
CM.6b: mints a WasmErrorParser per compilation pipe reader.