10 releases

new 0.2.0-beta-dev.9 Apr 24, 2024
0.2.0-beta-dev.8 Apr 17, 2024
0.2.0-beta-dev.7 Mar 27, 2024
0.2.0-beta-dev.4 Feb 7, 2024
0.2.0-beta-dev.2 Jan 12, 2024

#4 in #dep

Download history 66/week @ 2024-01-08 24/week @ 2024-01-15 94/week @ 2024-01-22 67/week @ 2024-01-29 132/week @ 2024-02-05 4/week @ 2024-02-12 134/week @ 2024-02-19 150/week @ 2024-02-26 480/week @ 2024-03-04 354/week @ 2024-03-11 489/week @ 2024-03-18 208/week @ 2024-03-25 183/week @ 2024-04-01 353/week @ 2024-04-08 463/week @ 2024-04-15

1,219 downloads per month
Used in 3 crates (via hc_sleuth)

Apache-2.0

115KB
2.5K SLoC

aitia

Experimental library for modeling causality chains, and inferring diagnostic info from observed events

Needs more documentation.

License: Apache-2.0


lib.rs:

aitia, a crate for gaining insights from causal graphs

("aitia" is the root of "etiology", the study of causes, and also an easy-to-type palindrome)

In complex systems, when something is going wrong, it can be difficult to narrow down the dep to some subsystem without doing lots of forensic poking around and exploratory logging. aitia aims to help with this process of narrowing down the possible scope of a problem.

You define a collection of Facts about your system, each of which specifies one or more [Dep]s (dependencies). The causal relationships between Depsimply a graph, with each Fact connected to others. When testing your system, you can check whether a particular Fact is true or not. If it's not true, aitia recursively follows the causal relationships specified, building up a graph of deps, each of which is checked for truth. The traversal stops only when either:

  1. a true fact is encountered, or
  2. a fact without any deps of its own is encountered (an "axiom" so to speak)
  3. a loop of unresolved deps is discovered, in which case that entire branch is discarded. Note that loops in causal relationships are allowed, as long as there is a Fact along the loop which passes, causing the loop to be broken

The result is a directed acyclic graph (DAG) of all facts that are not true, with the original fact as the root. The edges of the graph represent logical conditionals or implications: i.e. an edge A -> B in the graph means "If A is true, then B must be true", and also "if B is not true, then A cannot be true". This means that the leaves of the DAG represent the possible root deps of the problem, i.e. the "most upstream" known facts which could dep the root fact to not be true, and so the leaves would represent the places in the system to look for the reason why your original fact was not true.

aitia is as useful as the Facts you write. You can write very broad, vague facts, which can help you hone in on broader parts of the system for further manual investigation, or you can write very specific facts which can tell you at a glance what may be the problem. It lends itself well to writing facts iteratively, broadly at first, and then adding more specificity as you do the work of diagnosing the problems that it helped you find.

aitia is meant to be an embodiment of the process of deducing the dep of a problem. By encoding your search for a problem into an aitia::Dep, ideally you will never have to hunt for that particular problem again.

Dependencies

~11–23MB
~300K SLoC