fix(protocol): keep generic trace schema compatible with v2 and v3

Split standalone v2/v3 schemas and drop TraceV2 deny_unknown_fields so legacy traces with extra keys still parse; mix and version checks stay in RecordedTrace.
This commit is contained in:
“haonan”
2026-08-23 21:26:39 +08:00
committed by GitHub
parent 368507b07d
commit e64f4cac9f
10 changed files with 1471 additions and 495 deletions
+1 -2
View File
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "TraceV2",
"description": "Persisted user-action trace exported by legacy `tool.record_stop` / `await`.",
"description": "Persisted user-action trace exported by legacy `tool.record_stop` / `await`.\n\nUnknown extension fields are ignored so older traces remain readable. Mixed v2/v3 envelopes are rejected by `RecordedTrace` classification.",
"type": "object",
"required": [
"entry",
@@ -42,7 +42,6 @@
}
}
},
"additionalProperties": false,
"definitions": {
"KeyModifier": {
"description": "Keyboard modifier flags. Multiple flags may be combined; the extension folds them into CDP's bitfield (`alt=1, ctrl=2, meta=4, shift=8`).",