Root Cause TreePro
Why a run failed, drawn as a fault tree: guesses under OR and AND gates are checked one at a time and ruled out or confirmed, the confirmed route to the failure is highlighted, and any node opens its verdict and evidence.
oxyn add root-cause-treeRoot cause
Investigating6 hypotheses · 0 ruled out4 of 12 basket totals are one cent off.
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Show how an agent works out why a run failed: the failure on top, candidate causes below joined by OR / AND gates, each checked in turn and ruled out or confirmed, with the verdict and evidence for whichever node you pick.
When not to use
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
- An agent's question in its own card above the composer: use Decision Card instead.
Installation
Root Cause Tree is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add root-cause-treeUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Live
The agent works through its guesses one by one; when both halves of the AND branch hold, the route up to the failure turns violet and the other branches fade. Then it starts over.
Root cause
Investigating6 hypotheses · 0 ruled out4 of 12 basket totals are one cent off.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Checking
Early on: the first hypothesis spins as Checking, the rest are Not checked and the header says Investigating.
Root cause
Investigating6 hypotheses · 0 ruled outChecking this now…
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Ruled out
A ruled-out guess picked: its verdict and the tool call that settled it.
Root cause
Investigating6 hypotheses · 2 ruled outThe same 4 baskets fail on every rerun, so it is not timing.
run 1: 4 failed run 2: 4 failed run 3: 4 failed
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Found
A root cause picked: the diff that caused it, with Retry from here and Fix it.
Root cause
6 hypotheses · 2 ruled outRounding now happens before tax, so 4 of the 12 baskets come out one cent low.
- const net = round(subtotal * (1 - rate)) + const net = round(subtotal) * (1 - rate) return net + tax(net)
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Pending
A branch that was never needed: Not checked, dimmed off the found route.
Root cause
6 hypotheses · 2 ruled outNot checked – the cause was found elsewhere or it is still queued.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Failure
The failure itself picked: Cause found, and what went wrong in one line.
Root cause
6 hypotheses · 2 ruled out4 of 12 basket totals are one cent off.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Narrow
Under 600 px the tree becomes an indented outline with the gates inline.
Root cause
6 hypotheses · 2 ruled outRounding now happens before tax, so 4 of the 12 baskets come out one cent low.
- const net = round(subtotal * (1 - rate)) + const net = round(subtotal) * (1 - rate) return net + tax(net)
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Classic
Classic style: one framed card with a header band and squarer nodes.
Root cause
6 hypotheses · 2 ruled outRounding now happens before tax, so 4 of the 12 baskets come out one cent low.
- const net = round(subtotal * (1 - rate)) + const net = round(subtotal) * (1 - rate) return net + tax(net)
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
RootCauseTree
| Prop | Type | Default | Description |
|---|---|---|---|
failure | Option<RcNode> | Default::default() | The failure with its hypotheses (the demo's when `None`). |
at | Option<u32> | Default::default() | Run seconds; `None` plays the demo (looping). |
selected | Option<String> | Default::default() | The node whose evidence shows from the start (the newest checked one when `None`). |
title | String | "Root cause" | Heading. |
nowrequired | ClockMs | — | The clock (drives the demo). |
style | String | Default::default() | `clean`, `classic`, or empty to follow `data-cstyle`. |
on_select | EventHandler<String> | — | A node was picked (id). |
on_retry | EventHandler<String> | — | "Retry from here" on a root cause (its id). |
on_fix | EventHandler<String> | — | "Fix it" on a root cause (its id). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Into the tree, then the evidence buttons |
| ←or→or↑or↓ | Previous or next node, depth first |
| HomeorEnd | The failure, or the last hypothesis |
Accessibility
- The tree is role=tree; every node is a treeitem button with its level, selection and status in its name.
- Status is always in words (Ruled out, Confirmed, Root cause), never colour alone; the counts are a status region.
- Reduced motion stops the spinner, the fades and the scale-in.
Responsive behaviour
- Wide: a top-down tree, cards 124 px, gates between levels and elbows joining siblings.
- Under 600 px: an indented outline, full-width cards, the evidence below.
Edge cases (spec)
Wide: a top-down tree centred in the width (scrolls sideways if a very wide tree does not fit). Under 600 px (container query) it becomes an indented outline: full-width cards, gate chips inline, left rails for the connectors.
Notes for AI
- Import
RootCauseTreefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
RootCauseTreeElinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.