Files
compliance-scanner-agent/compliance-agent/src/controls/mod.rs
T
Sharang ParnerkarandClaude Opus 4.8 51aae6665a
CI / Check (push) Skipped
CI / Check (pull_request) Successful in 5m48s
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
feat(agent): OscalControlsProvider — pull + snapshot breakpilot OSCAL catalog
Implements ControlsProvider by fetching GET /api/compliance/v1/oscal/catalog from
breakpilot-compliance, snapshotting the exact bytes to disk, and mapping the
catalog into the corpus controls the mapping engine consumes. Deterministic /
offline-capable: on fetch failure it falls back to the last snapshot so scans
still run (matters for on-prem/werkbank).

- controls/oscal_provider.rs: HTTP fetch (bearer-optional) + atomic snapshot +
  offline fallback + naive context ranking; ControlsProvider impl ("breakpilot-oscal")
- controls/mod.rs + lib.rs: register module
- 3 lib tests: url/path building, context ranking, snapshot round-trip + fallback

Not yet wired into startup — no ControlsProvider consumer exists until the
assessment-plan router lands. clippy -D warnings + fmt --all --check clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 18:01:03 +02:00

11 lines
376 B
Rust

//! Controls corpus providers.
//!
//! Implementations of [`compliance_core::traits::ControlsProvider`] that supply
//! the control corpus the mapping engine assesses findings against. Currently:
//! [`OscalControlsProvider`], which pulls breakpilot-compliance's OSCAL catalog
//! and snapshots it locally.
mod oscal_provider;
pub use oscal_provider::OscalControlsProvider;