oxidecomputer / oxidecomputer/omicron
fm: extract shared keyed-case adoption scaffolding from the saga and certificate engines
@smklein is already working on this.
Since Sep 4, 2026.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
The saga and certificate diagnosis engines (nexus/fm/src/diagnosis/saga.rs
and arriving in https://github.com/oxidecomputer/omicron/pull/11238, certificate.rs) each carry a near line-for-line copy of the same bookkeeping around parent-forwarded cases:
- an UninterpretableCase enum (ForeignFact, Disagreeings, NoFacts)
- the loop that closes uninterpretable cases with a "cannot interpret case" comment and a "closing uninterpretable case" warning
- the BTreeMap Entry::Vacant/Occupied loop that dedups cases by key, keeping the lowest CaseUuid and closing the rest as duplicates
The uninterpretable half also appears a third time in physical_disk.rs.
Per-engine fact modeling (what a parsed case's payload looks like) is, and SHOULD be,
engine-specific as described in RFD 603, but this adoption scaffolding is
engine-agnostic, and a fix to the tiebreak or the close messages today has
to be made in three places.
Proposal: a helper in diagnosis/mod.rs along the lines of
fn adopt_keyed_cases<K: Ord + Display, P>(
builder: &mut SitrepBuilder<'_>,
de: DiagnosisEngineKind,
parse: impl Fn(&Case) -> Result<(K, P), impl Display>,
) -> BTreeMap<K, (CaseUuid, P)>
that saga.rs and certificate.rs call, keeping only their own parse_case
bodies. physical_disk.rs could adopt the uninterpretable half in the same
change or a follow-up. Existing tests in all three engines already cover
uninterpretable and duplicate cases.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.