← Back to Pull requests

feat(sr): use the Session Replay models generated from rum-events-format #1336

Closed
unknown closed this pull request without merging on Dec 01, 2026 23:02 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 15:58 UTC
Author

What and why?

Follow-up to #1310 (PANA-10317): datadog_session_replay now uses the Session Replay models generated from rum-events-format, instead of the hand-written ones. The hand-written models and their json_serializable code (lib/src/sr_data_models.g.dart) are deleted, so schema changes reach the SDK by moving the generator's pin, without porting anything by hand.

How?

  • lib/src/sr_data_models.dart re-exports generated/sr_data_models.dart and keeps what the SDK added to the hand-written models: srTransparentColorString, and isDifferent / mutationsFrom as an extension on SRWireframe. Every file of the SDK already imports it, so none of them change.

  • - isDifferent uses the generated value equality.
    - mutationsFrom covers the six wireframe kinds and every field of their updates. With value equality, any field that changes has to be carried in the update.
  • Non-finite corner radio: the hand-written SRShapeStyle replaced a NaN or infinite cornerRadius with 0, since jsonEncode fails on them. This now happens where the recorders build an SRShapeStyle, through SafeDouble.finiteOr().

  • build.yaml only runs json_serializable on the generated models.

  • The golden test renderer uses the schema defaults for cornerRadius, backgroundColor and the clip sides, which the schema makes optional.

  • SRIntrementalAdd is now spelled SRIncrementalAdd.
  • Review checklist

  • This pull request has appropriate unit and / or integration tests

  • This pull request references a Github or JIRA issue
  • Diff: 198 lines (+148 / -50) across 2 files Reviewer: fuzzybinary Review duration: 423m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 198 lines diff across 2 files
    0.36
    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.317
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1336"
    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: 36.1% (MEDIUM) · Higher = larger blast radius
    36.1%
    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: 14.3% · Safe to merge
    14.3%