Expand description
The incident write-up, as a tool.
render_rca is the ninth MCP tool and the only one that takes more than it
gives back: structured fields in, one markdown document out. It is here
because the last mile of an incident is not a query. It is the write-up, and
an agent left to format that itself produces a different document every
time, with the evidence inlined as prose that nobody can re-run.
§Two things make this more than a template
Every evidence item carries a citation — a trace id or a query document —
and Rca::render cannot be called until every one of them has been re-run
against the store. A citation that returns nothing is an error naming it,
not a footnote: an RCA whose evidence has aged out of retention reads
exactly like one whose evidence was invented, and telling those apart is
most of what the document is worth.
The other is prevention. The alerting rule the write-up proposes is parsed
by the same crate::alert::rule that loads alerts.kyaml, so what comes
back in the fence is a rule that will load rather than one that looks like
it would. That is the fourth reading of principle 2 — self-tuning — reduced
to the only mechanism that is honest about it: the incident emits the rule
that would have caught it.
§It still does not act
Nothing in this file changes anything outside Mira, and there is no
counterpart to it that does. The remediation section is text for whoever is
on call, and Rca::render says so in the document’s own body. Mira
supplies evidence; the fixing is done elsewhere, with tools that were built
for it (architecture section 14).
Structs§
Constants§
- UNREADABLE 🔒
- The citation could not be checked at all, as opposed to checked and empty. Rendered the same way in the error, because both mean “do not publish this”.
Functions§
- bullets 🔒
- cell 🔒
- A pipe inside a table cell ends the cell. Nothing else in GitHub-flavoured markdown can break a row, and a newline cannot arrive here — KYAML scalars keep theirs, so they are turned into spaces rather than escaped.
- doc 🔒
- Parse a
render_rcaargument document. - fact 🔒
- filter 🔒
- Terms in the filter-bar grammar, so a reader can paste the citation into
Mira’s UI. The same spelling
alert::filter_ofputs in a page. - flag 🔒
- kyaml 🔒
- A
Yamlnode back out as KYAML. - list 🔒
- one 🔒
- span 🔒
- A window length, for the line under the title.
- strings 🔒
- An optional list of quoted scalars. Absent is empty; a bare string is not a list of one, because a model that wrote one bullet meant to write a list.
- text 🔒
- A required, quoted scalar.
- trace_
query 🔒 {"trace_id": ...}as a query.- utc 🔒
- UTC, RFC 3339, to the second.
- write 🔒