← Back to Pull requests

Add diagnostic text adapter and validate WebFront facade [#69] #79

Closed
unknown closed this pull request without merging on Oct 01, 2026 12:39 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 11:02 UTC
Author

Summary

WebFront's independent severity switches cannot be reproduced by a single minimum-level threshold. Add mddlog.adapter.textlogger with atomic flags that start disabled, explicit severity grouping, and synchronous text delivery through #67's callback registry. Warn can remain disabled while Error is enabled; Trace uses Debug's mask/display and Fatal uses Error's. Atomicity is per group: setLogLevel() and disableAll() update groups sequentially, so concurrent readers may observe a partially applied change.

Validate a webfront::log reference bridge with the original test/LoggerTests.cpp from WebFront 7be626ccfbb50524c9c03296e6c84555ea7d2c7c, copied byte-for-byte. Preserve both historical text layouts, the actual caller location for debug, disabled-call formatting guards, and infoHex's separate second write. The dump ASCII column prints only 0x20 through 0x7E; control bytes, DEL and high bytes render as ., independently of plain char signedness. Multiple registrations return an array of independent opaque handles with registry-backed removal.

Compile-time checks reject AuditEvent across the facade APIs and reject AuditSink registration. Additional specs cover initial disablement, all six severity mappings, source location on LLVM, dump output for all 256 byte values, and independent handle removal.

Following ADR-003 Decision 3, mddlog installs the generic module; the module-free facade header and consuming TU remain a test-only reference for WebFront ownership and adoption in #71. ADR-003 acceptance remains a separate review decision.

Closes #69.

Invitation and contributor agreement

Repository maintainer contribution (ambroise-leclerc).

Verification

Linux, Clang 21.1.8 / libc++ 21 / CMake 4.2.3, Release:

  • Compilation: passed with the ninja-clang preset and in a separate fresh -funsigned-char build.

  • Linking: library, specs, and original WebFront acceptance executable linked successfully.

  • Execution: ctest --preset ninja-clang --output-on-failure --parallel 4 passed 112/112 tests, including source/install consumers and the unmodified WebFront suite. All four facade/adapter acceptance checks also passed in a separate Linux/Clang build with -funsigned-char.

  • clang-tidy 21: all three added translation units passed with warnings promoted to errors against fresh Clang BMIs.

  • scripts/check-format.sh: passed for all 51 files; git diff --check: passed.

  • The PR targets develop and contains only #69 changes.
  • Native GCC and MSVC builds were not run locally.

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

    Summary by CodeRabbit

    New Features
    Added a synchronous text logging adapter with independently configurable severity groups, timestamped output, optional source locations, and hex-dump support.
    Added callback-based output sinks with individual registration and removal.
    Documentation
    Added guidance for configuring diagnostic groups and synchronous text callbacks, plus a WebFront logging facade guide.
    Tests
    * Added coverage for logging behavior, formatting, sink management, and WebFront facade compatibility.

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

    Diff: 406 lines (+304 / -102) across 5 files Reviewer: AM-L Review duration: 97m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 406 lines diff across 5 files
    0.45
    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%
    60%
    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.359
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #79"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 44.8% (MEDIUM) · Higher = larger blast radius
    44.8%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 17.7% · Safe to merge
    17.7%