MCPcopy Create free account
hub / github.com/AIScientists-Dev/Flowtrace / split_root

Function split_root

crates/flowtrace-cli/src/explain.rs:53–68  ·  view source on GitHub ↗

Split `reply.evidence.figure` into (`reply`, `["evidence", "figure"]`). Errors with a hint if the root is unknown.

(path: &str)

Source from the content-addressed store, hash-verified

51/// Split `reply.evidence.figure` into (`reply`, `["evidence", "figure"]`).
52/// Errors with a hint if the root is unknown.
53fn split_root(path: &str) -> Result<(&'static str, Vec<&str>)> {
54 let mut parts = path.split('.');
55 let root_input = parts.next().unwrap_or("");
56 let root = ROOTS
57 .iter()
58 .find(|r| **r == root_input)
59 .copied()
60 .ok_or_else(|| {
61 anyhow!(
62 "unknown root `{}`; expected one of: {}",
63 root_input,
64 ROOTS.join(", ")
65 )
66 })?;
67 Ok((root, parts.collect()))
68}
69
70/// Build the root JsonSchema for `reply` / `state` / `trace` / `run_detail`.
71fn root_schema_for(root: &str) -> RootSchema {

Callers 1

explainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…