pub fn build_diagnostic_bundle(
har_json: &str,
redaction_policy: BundleRedactionPolicy,
) -> Result<DiagnosticBundle, BundleError>Expand description
Build a DiagnosticBundle from a raw HAR payload.
Runs investigation, requirement inference, policy planning, and the built-in
probe pack. Applies the given BundleRedactionPolicy to sanitise sensitive
fields before returning.
The T89 vendor classification is computed from the HAR using
VendorClassifier::with_builtin_defaults. When no vendor-specific
signals are detected, the resulting vendor_classification field is
still populated with an “unknown” classification (so consumers can
always inspect the field), but the JSON form omits it via
skip_serializing_if = "Option::is_none".
Pass a custom classifier via
build_diagnostic_bundle_with_vendor_classifier to override the
threshold or supply custom vendor definitions.
§Errors
Returns BundleError::Har when the HAR payload is invalid.
§Example
use stygian_charon::bundle::{build_diagnostic_bundle, BundleRedactionPolicy};
let empty_har = r#"{"log":{"version":"1.2","creator":{"name":"test","version":"0"},"entries":[]}}"#;
let bundle = build_diagnostic_bundle(empty_har, BundleRedactionPolicy::Standard).unwrap();
assert!(bundle.probe_report.total > 0);