Session Replay models generator, part 1: read and fetch the schemas #1310
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 322 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.346
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1310"
general
weight: 0.35
joepeeples
What and why?
The Session Replay data models of
datadog_session_replayare written by hand (lib/src/sr_data_models.dart), while dd-sdk-ios and dd-sdk-android generate theirs from rum-events-format. The Flutter models have drifted from the schema: embedded content wireframes, shape gradients, the composition tree, and the view end and visual viewport records are missing, and every schema change has to be ported by hand.This is the first part of
tools/sr_models_generator, a Dart tool that will generate those models from rum-events-format. This part covers getting and reading the schemas; nothing is generated yet, and no package code changes.The work targets
juan.naranjo/sr-schemas, which collects the parts before it is merged intodevelop:1. Read and fetch the schemas (this PR)
2. Resolve the schemas into a description of the types (classes, unions, enums)
3. Print that description as Dart code
4. Command line:
--check,--ref,--schemas, plus a round-trip test over therum-events-format samples
5. The generated models, plus a CI check that they are up to date
How?
Each commit adds one piece with its tests; reading them in order is the easiest way to review:
1. Package skeleton.
tools/sr_models_generatorwith lints, a--helpentry point and a README describing the design.2.
SchemaNode/SchemaLoader. A schema object together with its location (file and JSON pointer), and a loader that reads each file once and resolves the$refforms rum-events-format uses: relative files (../common/x.json), fragments in another file (x.json#/definitions/y) and in the same file (#/allOf/0). Chains of references are followed, and cycles fail with the full chain in the message.3. Configuration.
sr_models_generator.yamlis the only reference this repository keeps to rum-events-format: the repository, the pinned commit, the root schema and the output file. The commit must be a full SHA, so the same pin always produces the same models.writeCommitupdates the pin without touching comments.4. Fetching the schemas.
checkoutCommitchecks out the pinned commit in.dart_tool/rum-events-format, downloading only that commit and reusing it offline afterwards.fetchLatestdownloads the commit a branch or tag points to, which is how the pin will be moved. The schemas are never committed.Review checklist