Capture WebFront diagnostic context at emission [#70] #80
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 458 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.367
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #80"
general
weight: 0.35
AM-L
Summary
Capture WebFront's connection and call context explicitly at emission through a nestable, thread-local
ContextScope. Each producer binds its structured writer to its own SPSC ring, which owns the fields before connection teardown.TransportConsumerandRingSinkAdapterpreserve the context for every diagnostic destination.Encode component directly, WebLinkId in correlationId, and direction plus CallId in operationId (
cpp-js:/js-cpp:). Refuse identifiers beyond the 32/32/40-byte envelope and preserve UTF-8 message truncation.tryWrite()returns structured admission results; legacy void calls expose them throughlastWriteOutcome(). Diagnostic snapshots remain copy- and move-assignable.infoHex()captures the caller's source location for both message and dump and returnsHexWriteOutcomewith separate admission/truncation results. The structured dump remains bounded to 160 bytes, with explicit truncation flags. The summary retains truncation from either admitted record and the first refusal. Enabled legacy text callbacks receive complete diagnostics even when structured admission is refused, including when only the hex message fits in the ring. Existing call syntax, debug caller locations, callback handles and portable ASCII dump rendering are preserved.Document outside-call context, counter reuse and the additional discriminator needed for longer-lived correlation, asynchronous entry points, ring ownership, partial dump admission, writer exception/cleanup contracts and transport feedback suppression. This remains a test-only WebFront adoption reference; formatting and binding may allocate. ADR-003 remains Proposed and audit admission stays separate.
Closes #70.
Verification
LoggerTests.cpp.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added WebFront logging support for scoped context, structured diagnostic records, and write outcomes. Logs can include component and call information, with oversized identifiers and truncated messages reported explicitly.
Added support for routing diagnostic records to a configured writer while retaining legacy text logging behavior.
Documentation
Added guidance on context scopes, record delivery, ring constraints, and logging behavior. The reference implementation does not use WebFront in production; ADR-003 remains proposed.
Tests
* Added coverage for context capture, nested scopes, limits, delivery, and thread isolation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->