← Back to Pull requests

Migrate logAudit to explicit admission and retire Audit severity [#58] #63

Closed
unknown closed this pull request without merging on Sep 28, 2026 05:29 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 19:53 UTC
Author

Summary

  • Change SimpleLogger::logAudit() and Log::logAudit() to accept a complete AuditInput and return synchronous AuditWriteResult from a configured audit ring. Missing ring configuration returns Unconfigured; invalid stream identity and invalid fields retain their explicit refusal reasons.

  • Remove the positional-string audit overload, LogLevel::Audit, and audit-only fields on diagnostic LogRecord. Unknown severity strings, including AUDIT, now yield nullopt from fromString() instead of silently becoming Info.

  • Update public API specs, legacy call sites, examples, README and migration notes. Diagnostic sinks and thresholds do not govern audit admission; audit sink configuration and hand-off failures remain observable through AuditSinkAdapter.
  • Validation

  • Clang 21 configuration, module compilation and linking: passed with tests and examples enabled.

  • CTest: 86/86 passed, including source and installed core consumers and governed boundary checks.

  • Both updated examples: built and ran successfully.

  • LLVM 21 clang-format dry run over the formatted scope: passed.

  • LLVM 21 clang-tidy on the changed logger, facade and public audit spec: passed with no promoted diagnostics.

  • A cache-integrity test timed out during an earlier run concurrent with clang-tidy and a rebuild; it passed in 3.6 seconds in isolation and the subsequent full suite passed.
  • Migration and scope

    The old positional call must be rewritten with a category, phase, action, target, actor, correlation and host time as applicable. message becomes detail; a free-form riskLevel does not automatically become riskRef. A ring binding must be cleared before its ring is destroyed. The return value promises only in-memory admission. Durable confirmation remains in #11; ADR-002 remains Proposed and epic #9 remains open pending separate review.

    Closes #58.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Audit events can now be submitted as structured records to a bounded in-memory ring, with clear results for accepted or refused submissions.
    Applications can connect and clear an audit ring, and optionally hand records off through a separate audit sink. Sink health is observable; durable, tamper-evident storage is not provided.
    Audit records can include a stable risk-control reference.

    Updates
    Audit events are separated from diagnostic logging and its severity filters. Unknown severity names, including “AUDIT,” are no longer treated as valid diagnostic levels.
    * Updated examples and migration guidance describe structured audit submission, admission results, and the limits of in-memory storage.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 351 lines (+263 / -88) across 4 files Reviewer: AM-L Review duration: 576m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.66) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.66 · 351 lines diff across 4 files
    0.66
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.351
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.066
    Real PR Conversation Timeline
    1 comments
    "Review active on #63"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 65.6% (HIGH) · Higher = larger blast radius
    65.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.6% · Safe to merge
    27.6%