Skip to main content

stygian_charon/
lib.rs

1#![warn(missing_docs, rustdoc::broken_intra_doc_links)]
2#![deny(unsafe_code)]
3
4//! stygian-charon
5//!
6//! Defensive anti-bot diagnostics for Stygian.
7//! The crate classifies likely anti-bot providers from transaction evidence
8//! and from HTTP Archive (HAR) files.
9
10/// Mapping layer from runtime policy to acquisition strategy hints.
11pub mod acquisition;
12/// Adaptive SLO policy interfaces and regression-history implementation.
13pub mod adaptive;
14/// Versioned analyzer interfaces and profile selection.
15pub mod analyzer;
16/// Historical HAR replay across analyzer profiles.
17pub mod backtest;
18/// Diagnostic bundle API with redaction policy.
19pub mod bundle;
20/// Investigation report cache backends and cache key helpers.
21#[cfg(feature = "caching")]
22pub mod cache;
23/// Provider signature classification logic.
24pub mod classifier;
25/// Mode differential regression runner across snapshot capture modes.
26pub mod differential;
27/// HAR parsing and extraction utilities.
28pub mod har;
29/// Investigation reports and baseline/candidate diffing.
30pub mod investigation;
31/// Telemetry and metrics collection (feature-gated).
32#[cfg(feature = "metrics")]
33pub mod metrics;
34/// External observatory runner and comparison reports.
35pub mod observatory;
36/// Runtime policy planning based on investigation output.
37pub mod policy;
38/// Challenge-style probe pack for adversarial and regression testing.
39pub mod probe;
40/// Release risk scoring and release-candidate trend reporting.
41pub mod release_risk;
42/// Normalized fingerprint snapshot schema types and compatibility checks.
43pub mod snapshot;
44/// Public types for transaction and report models.
45pub mod types;
46
47pub use acquisition::{
48    AcquisitionModeHint, AcquisitionPolicy, AcquisitionStartHint, RuntimePolicyHints,
49    map_adapter_strategy, map_policy_hints, map_runtime_policy,
50};
51pub use adaptive::{AdaptivePolicyError, AdaptiveSloPolicy, RegressionHistoryPolicy};
52pub use analyzer::{AnalyzerProfile, AnalyzerVersion, ProviderAnalyzer};
53pub use backtest::{
54    BacktestCase, BacktestDisagreement, BacktestError, BacktestReport, BacktestSample,
55    run_profile_backtest,
56};
57pub use bundle::{
58    BundleCoherenceViolation, BundleError, BundleMetadata, BundleRedactionPolicy, DiagnosticBundle,
59    apply_redaction, build_diagnostic_bundle, build_diagnostic_bundle_with_snapshot,
60    diagnostic_bundle_from_investigation,
61};
62#[cfg(feature = "redis-cache")]
63pub use cache::RedisInvestigationCache;
64#[cfg(feature = "caching")]
65pub use cache::{InvestigationReportCache, MemoryInvestigationCache, investigation_cache_key};
66pub use classifier::{
67    classify_har, classify_har_with_profile, classify_transaction,
68    classify_transaction_with_profile,
69};
70pub use differential::{
71    ModeComparison, ModeDifferentialCorpus, ModeDifferentialError, ModeDifferentialPairResult,
72    ModeDifferentialRunReport, ModeDifferentialThresholds, run_mode_differential_regression,
73};
74pub use investigation::{
75    compare_reports, infer_requirements, infer_requirements_with_target_class, investigate_har,
76    investigate_har_with_profile,
77};
78#[cfg(feature = "caching")]
79pub use investigation::{investigate_har_cached, investigate_har_cached_with_target_class};
80#[cfg(feature = "live-validation")]
81pub use observatory::{LiveObservatoryProbe, run_external_observatory_live};
82pub use observatory::{
83    ObservatoryCase, ObservatoryComparison, ObservatoryError, ObservatoryEscalation,
84    ObservatoryReport, ObservatorySample, run_external_observatory_from_hars,
85};
86pub use policy::{analyze_and_plan, build_runtime_policy, plan_from_report};
87pub use probe::{
88    ChallengeProbe, ProbeCategory, ProbeExpectation, ProbePackReport, ProbeRunResult,
89    challenge_probe_pack, run_probe_pack,
90};
91pub use release_risk::{
92    ReleaseCandidateRiskSnapshot, ReleaseRiskAssessment, ReleaseRiskBreakdown, ReleaseRiskInput,
93    ReleaseRiskLevel, ReleaseRiskThresholds, ReleaseRiskWeights, ReleaseTrendDirection,
94    ReleaseTrendPoint, ReleaseTrendReport, assess_release_risk, build_release_trend_report,
95    release_risk_input_from_reports,
96};
97pub use snapshot::{
98    FingerprintSignals, NormalizedFingerprintSnapshot, ScreenFingerprint, SnapshotCoherenceReport,
99    SnapshotCoherenceViolation, SnapshotCollectionError, SnapshotCompatibilityError,
100    SnapshotDeterminismOptions, SnapshotDriftReport, SnapshotMode, SnapshotSignalDrift,
101    SnapshotSignalDriftKind, TlsFingerprint, WebGlFingerprint,
102    collect_deterministic_snapshot_bytes, compare_snapshot_signal_drift,
103    evaluate_snapshot_coherence, normalize_snapshot_for_determinism,
104    validate_snapshot_compatibility,
105};
106pub use types::{
107    AdapterStrategy, AntiBotProvider, AntiBotRequirement, BlockedRatioSlo, Detection,
108    ExecutionMode, HarClassificationReport, HarRequestSummary, HostSummary,
109    IntegrationRecommendation, InvestigationBundle, InvestigationDiff, InvestigationReport,
110    MarkerCount, ProviderScore, RequirementLevel, RequirementsProfile, RuntimePolicy, SessionMode,
111    TargetClass, TelemetryLevel, TransactionView,
112};