← Back to Pull requests

[#35] Add fixed-capacity governed record #45

Closed
unknown closed this pull request without merging on Sep 25, 2026 20:28 UTC
View on GitHub
unknown unknown commented on Sep 25, 2026 20:16 UTC
Author

Summary

  • Add mddlog.core.record to mddlog-core with a fixed-capacity GovernedRecord, host-supplied RawTime, captured source location, and bounded context identifiers.

  • Refuse overlong identifiers without changing the previous record; truncate the descriptive message at a UTF-8 boundary and retain its truncation flag in the record and WriteResult.

  • Add SpecLab coverage for capacity boundaries, ownership, refusal priority, unchanged state, UTF-8 truncation, and both host-time states. Extend the installed core consumer to import and use the new module, and update the README to distinguish implemented record support from the planned ring and adapter integration.

  • Default omitted input level to Info and capture the source location at aggregate initialization. Align ADR-001's field list and memory estimate with the stored message-truncation flag.
  • Refs #35.

    Contract notes

  • The new type is named GovernedRecord because the existing allocating adapter type already occupies mddlog::core::LogRecord and remains unchanged by this issue.

  • Issue #35 asks for a MalformedTime refusal, while accepted ADR-001 Decision 7 makes malformed RawTime unconstructible and admits RawTime::unavailable(). This implementation follows the ADR and tests the two constructible states. MalformedTime remains in the refusal enum for a future validated time representation; it is not returned by this module.
  • Invitation and contributor agreement

    Maintainer-authored PR by the repository owner (Ambroise Leclerc); invitation and CLA-record issue are not applicable.

    Verification

  • cmake --build --preset ninja-macos-clang --parallel — passed.

  • ctest --test-dir build-macos-clang --output-on-failure — 56/56 passed, including the installed core consumer.

  • Clang Format 21 and Clang Tidy 21 — passed for the new module and spec.
  • The local macOS SDK did not define INFINITY and NAN while compiling LLVM's std module. Verification used an ignored, build-local forced-include header that defines those macros; no workaround is included in this PR.

    Diff: 260 lines (+195 / -65) across 3 files Reviewer: ambroise-leclerc Review duration: 12m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 260 lines diff across 3 files
    0.39
    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.333
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #45"
    general weight: 0.35
    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: 39.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    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: 15.5% · Safe to merge
    15.5%