ADR-0018: Events in 0.1: invocation events, nullable run id, jsonl on stderr¶
Architecture: Section 11
Amends ADR-0010.
Context¶
ADR-0010 defines the event stream for runs. In 0.1 there is no run yet, but every command (validate, schema export, plugins list, later compile) should report through the same bus, so diagnostics, logs and artifacts do not grow a second path. A few details of the envelope also need fixing before any consumer depends on them.
Options¶
- Keep printing diagnostics directly and add events with runs in 0.2. Two paths to maintain, and the console format would change later.
- Route every command through the bus now, with a small set of invocation events.
Decision¶
Every command is an invocation with its own invocation_id and an event bus.
run_idis nullable. Outside a run it isnull.- New event types:
invocation.started,invocation.completedandplan.compiled.plan.compiledis the compile-only form ofrun.compiled(project, target, plan hash, unit counts, selection).diagnostic,artifact.writtenandsink.disabledare used as in ADR-0010. - The envelope has a
schemakey with the valuepipeloom.event/1, so a line of jsonl identifies itself. datais always a JSON object.- A command collects what it finds and emits at the end, in this order:
invocation.started, diagnostics (sorted by file, line, column, code),plan.compiledandartifact.writtenif any,invocation.completed. --log-format text|json(PIPELOOM_LOG_FORMAT) picks the terminal sink:console(text) orjsonlto stderr (json). Sinks listed underevents.sinksinpipeloom.ymlare added after the project loads and binds. Stdout stays for command results.consoleandjsonlare built-in sink plugins.failure_budget,bufferedandbuffer_sizeapply to every sink. Thejsonlsink takes an optionalpath, relative to the project directory; without it the sink writes to stderr.- A sink that fails
failure_budgettimes in a row is disabled (PLE401, a warning) and the other sinks receivesink.disabled. A sink that is still failing when the bus closes gets the same notice, so failures below the budget are not silent.
Consequences¶
- Scripts read machine output from stderr with
--log-format jsonand command results from stdout. - Diagnostics are visible in events, so later sinks (files, lineage) get them without extra work.
- Nothing is printed until a command ends, so a long command shows no progress. Runs in 0.2 emit as they go.
- Redaction is in the bus, but nothing registers secret values until providers resolve secrets at run time.
Status¶
Accepted. Amended in 1.2 (explain URL, --log-format on every command).
Date¶
2026-11-04
Amendment 1.2: machine-readable diagnostics¶
- The
diagnosticevent gains an optionalexplain_url: the error-code page entry of the code (docs_url(code)), null for a code outside the catalog. It is additive withinpipeloom.event/1: events written before 1.2 have no such field and still validate, and consumers ignore unknown fields. initandexplainaccept--log-format jsonand emitinvocation.startedandinvocation.completed. Every command now has the option.compile --output jsonprints onepipeloom.compile_result/1object on stdout: project, target, plan hash, unit counts, the manifest path (relative to the project dir unless absolute) and its sha256. It does not repeat the manifest. The schema is published asschema/v1/compile_result.jsonwith the other artifact schemas (ADR-0049).plananddiffresults are left to their own changes.
Provenance: clean room, designed from this repository's own event schema.