vyges-events — structured events & logging
Foundation, not a sign-off engine.
vyges-eventsis the shared structured-event and logging contract that every Loom engine emits — and the substrate the MCP layer and cross-stage analysis consume. Likevyges-layoutit’s a foundation crate, not a promotedvyges loomsubcommand.
In an LLM/MCP-driven flow you need a queryable trail of what each tool did and why, so a
late failure can be traced back to its early cause. vyges-events is that trail: each engine
emits one structured vyges-events/1.0 event per finding, plus a completion event, on
stderr, as newline-delimited JSON. The report/data on stdout is never touched.
Logs and events are one path
A plain log line is just an event with no code/objects. The same records render two ways,
controlled by two environment knobs:
| Variable | Effect |
|---|---|
VYGES_LOG=<level> | severity filter — trace|debug|info|warn|error (default info) |
VYGES_LOG_FORMAT=json|text | force the rendering; default auto — human text at a terminal, JSONL when piped |
vyges-drc check block.gds --rules deck.rules # report → stdout; events → stderr
# at a terminal: [WARN vyges-drc DRC-WIDTH] width < min on layer 66 [layer:66]
# when piped: {"schema":"vyges-events/1.0",…,"code":"DRC-WIDTH","objects":["layer:66"]}
VYGES_LOG=error vyges-drc check block.gds --rules deck.rules # only errors on stderr
The event
| Field | Meaning |
|---|---|
schema | always vyges-events/1.0 |
ts_ms | unix epoch milliseconds |
tool | emitting engine (vyges-drc, vyges-lvs, …) |
severity | trace/debug/info/warn/error |
code | structured code (DRC-WIDTH, LVS-MISMATCH, …) — the clustering key |
objects | design objects named (net:data[3], cell:sram0, layer:66) — the cross-stage co-reference key |
raw_msg / msg_template | the message (full / with variable parts masked) |
run_id / step_index / stage | orchestration context (stamped by the runner) |
file | source location, if applicable |
The full JSON Schema is self-published by the crate — dump it with vyges-events --schema.
How it flows (the causal trail)
- Engines emit events on stderr.
- The MCP layer (
vyges mcp/vyges model) parses them into theloom-resultenvelope’slogsblock (a compact summary — counts by severity, the codes seen — plus the events), and streams each line live as an MCPnotifications/messagewhile a long tool call runs, so you see progress instead of a capture-at-end blob. - A
vyges modelrun aggregates every step’s events into~/.vyges/runs/<run_id>/events.jsonl— one ordered event stream across the whole multi-step flow, each event stamped with itsrun_idandstep_index.
Because every event carries the design objects it touched, a late failure (e.g. a routing
DRC error) can be linked back to the early event that caused it (e.g. a synthesis warning on
the same net) — cause to effect, across stages.
For engine authors
Depend on the crate (vyges-tools/events, Apache-2.0) and emit via standard tracing macros:
#![allow(unused)]
fn main() {
tracing::warn!(code = "DRC-0142", objects = "net:data[3],macro:sram0", "spacing < min");
}
or build an Event directly. See the crate README for the tracing bridge and the sink
(default: JSONL on stderr). Emission is daemonless — each engine writes locally; the
orchestrator aggregates.