rca_corpus_from_maintenance
Turn maintenance work orders into a labeled RCA incident corpus, mapping root causes automatically via taxonomy, synonyms, or keyword inference.
Instructions
[READ][risk=low] Turn a CMMS/work-order export into the RCA incident corpus.
Auto-builds the labeled history learn_cause_weights needs from closed maintenance
records: an explicit taxonomy cause column wins; else a built-in EN/中文 CMMS
synonym table (extendable via 'synonyms'); else UNAMBIGUOUS keyword inference
over the row's free text using the copilot's own cause keywords. Rows it cannot
map land in 'unmapped' with the reason — never silently guessed. 'signals' come
from an explicit column or the symptom/alarm text (may stay empty — no fabricated
evidence). Pure + advisory; with learn=true the learned weights are included.
Args:
rows: Work-order records, one dict each. Recognized cause columns:
cause / root_cause / failure_class / category / problem_code; free-text
columns: description / problem / notes / comment / text / 故障描述;
signal text: symptom(s) / alarm(s) / 现象.
synonyms: Extra site vocabulary, e.g. {"spindle crash": "mechanical_fault"};
values must be taxonomy causes.
learn: Also run learn_cause_weights on the mapped corpus (default true).
min_samples: Passed to learn_cause_weights (default 8).
smoothing: Passed to learn_cause_weights (default 1.0).
Returns dict: {corpus:[{cause, signals}], n_rows, n_mapped, unmapped:[{row,
reason, excerpt}], mapped_via, weights?, next_step}.
Example: rca_corpus_from_maintenance(rows=[{"category":"轴承损坏",
"symptom":"drive overload alarm"}], synonyms={"spindle crash":"mechanical_fault"}).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| learn | No | ||
| synonyms | No | ||
| smoothing | No | ||
| min_samples | No |