1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// SPDX-License-Identifier: Apache-2.0
//! # API Support Debug Lab — diagnostic library
//!
//! This library is the engine behind the `api-debug-lab` CLI. It loads a
//! [`Case`] from a fixture directory or a `case.json` path, runs a fixed
//! set of rules over it, and returns a [`Report`] that ranks the firing
//! diagnoses by confidence.
//!
//! ## How the pieces fit together
//!
//! ```text
//! fixtures/cases/<name>/case.json → Case (serde, schema-validated)
//! fixtures/cases/<name>/server.log → &str (lazy load via Case::load_log)
//! fixtures/cases/<name>/secret.txt → Vec<u8> (via Case::load_secret)
//! │
//! ▼
//! all_rules() : Vec<Box<dyn Rule>>
//! │
//! ▼ one Rule::evaluate per rule, all measured by diagnose_traced
//! Diagnosis[] ─ sorted by confidence desc, alphabetical tiebreak ─► Report
//! ```
//!
//! ## Determinism
//!
//! Every code path here is deterministic. Headers iterate via
//! [`std::collections::BTreeMap`], reproductions inline the body so
//! output paths never bake in machine-specific filesystem state, no
//! system clock or RNG is consulted. The byte-stable contract is held
//! to via snapshot tests in `tests/snapshots.rs`.
//!
//! ## No I/O beyond local files
//!
//! No network calls. No environment variables. No global state. The
//! library is pure with respect to the inputs you hand it; the CLI
//! does its own filesystem reads via [`Case::load`].
//!
//! ## Public surface
//!
//! Most callers will use the re-exports below: load a case with
//! [`Case::load`], call [`diagnose`] or [`diagnose_traced`], and render
//! the resulting [`Report`] through [`Report::render`].
//!
//! ```ignore
//! use api_debug_lab::{Case, diagnose, Format};
//! use std::path::Path;
//!
//! let case = Case::load("auth_missing", Path::new("fixtures")).unwrap();
//! let report = diagnose(&case);
//! print!("{}", report.render(Format::Human));
//! std::process::exit(report.exit_code());
//! ```
pub use ;
pub use ;
pub use ;
pub use ;