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” authored and GitHub committed 2026-08-22 17:01:15 +08:00
1 parent f1a97b16ab
commit 825abde4cb
10 files changed
+1471 -495

No files matched your search

+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`).",