ADR-003: bounded, non-reentrant transport consumer with independent health [#68] #75
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 · 409 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.360
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #75"
general
weight: 0.35
AM-L
Summary
for issue #68: a bounded,
non-reentrant transport consumer with independent health, following #66 and #67.
mddlog::adapter::TransportConsumer(TransportConsumer.cppm), which drains one or morebounded
RingLogs (ADR-001 Decision 4) on a host-owned consumer thread and dispatches recordsto transport write callbacks through
SinkRegistry(#67, ADR-003 Decision 4). This follows theexisting pull-model convention (
RingSinkAdapter,AuditSinkAdapter): the adapter owns nothread of its own.
Frame::addBuffersynchronous re-entrancy cycle structurally: a logemitted from inside a transport's
write()re-enters the producer path(
RingLog::tryWrite()), not the consumer path, so it is only visible to the nextdrainOnce()call - never re-entered within the current one, on any thread.write()self-detaches the failing transport viaSinkRegistry'sdeferred self-removal (non-blocking, no further invocation admitted). An asynchronous failure
discovered later - from any thread, e.g. a write-completion handler - is reported through
reportFailure(), which detaches via ordinary removal: the slot is retired before waiting, sono invocation starting from that point on can reach the failing transport. Neither path lets a
failing transport receive its own failure record.
TransportHealthSnapshot/TransportHealthexpose delivered/write-failure/reported-failure/detachment/ring-refusal/active-transport counters, readable without going through any sink.
Test plan
cmake --preset ninja-macos-clang -DMDDLOG_BUILD_EXAMPLES=OFF -DMDDLOG_BUILD_TESTS=ONcmake --build build-macos-clang --parallelctest --test-dir build-macos-clang --output-on-failure- 107/107 passed, including 6 newTransportConsumerscenarios (slow transport not blocking a producer, saturation refusal +counter, synchronous reentrant logging not recursing, synchronous failure detachment,
asynchronous cross-thread failure detachment without amplification, health readable without
a sink)
clang-tidy(LLVM 21.1.8, project's pinned version): no findings on the new filesclang-formatapplied to the new filesOut of scope for this issue, per the ADR (left to later WebFront-adoption work): the WebFront
facade itself, the real
Frame::addBuffercall site, and wiring a real WebSocket sink - this PRis the mddlog-side consumer only, exercised through synthetic transports reproducing the same
sync/async failure shapes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added transport delivery for log records, with support for multiple registered logs and transport callbacks.
Added health snapshots covering delivery, transport failures, and records refused by full logs.
Failed transports are detached automatically, whether errors occur during delivery or are reported asynchronously.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->