Skip to main content

Module audit

Module audit 

Source
Expand description

Native CI audit gates (issue #549).

Exposes 15 AuditGate implementations that run locally and in CI to catch violations of WCAG, schema.org, hreflang reciprocity, CSP + SRI, PQC TLS readiness, HTML5 structure, broken links, OG metadata, markdown style, performance budgets, AI discovery files, RSS/Atom feeds, image optimisation, the localised semantic search index, and JSON-LD inLanguage vs <html lang> consistency.

§Surface

use ssg::audit::{AuditRunner, AuditConfig, Site};
use std::path::Path;

let site = Site::load(Path::new("./public"))?;
let cfg  = AuditConfig::default();
let report = AuditRunner::new(cfg).run(&site);
report.print_text();

Each gate ships with name(), explain(), and a run(&Site) that returns a Vec<Finding>. Findings carry a Severity so callers can filter or fail based on the configured --fail-on threshold.

Some gates depend on other v0.0.44 epics (PQC on E6, AI discovery on E8, semantic search on E1). Those gates emit an info finding when their input files are absent rather than failing — they upgrade to enforcement once the producing epic merges.

Modules§

gates
Per-gate implementations for crate::audit.
output
Output formatters for the audit report: rich text, JSON, JUnit XML, and SARIF v2.1.0.

Structs§

AuditBudgets
[audit.budgets] subsection.
AuditConfig
User-facing configuration for an AuditRunner.
AuditDisabledSection
[audit.disabled] subsection.
AuditOptions
Runtime options passed to every gate at execution time.
AuditReport
Aggregate audit report.
AuditRunner
Orchestrates dispatch across the 15 registered gates.
AuditTomlConfig
Schema for the [audit] table in ssg.toml.
Finding
A single audit finding produced by a gate.
GateResult
Per-gate result block.
SeverityCounts
Tally of severities for a gate result.
Site
A loaded view of a built site for audit gates to consume.

Enums§

Severity
Severity of an audit Finding.

Traits§

AuditGate
Trait implemented by every audit gate.