From 8db84f90aa3e64bd8a13452a50615ebd940a0978 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 23 Jul 2026 22:04:01 -0400 Subject: [PATCH] format: correct schema examples and drop dead keywords Fixes example and prose defects found in the schema sweep: - type/base: struct example labeled members with `member:`; the canonical struct schema names that field `name:`. - pointer/collection/list: example read the loop index with `$read`, which reads bytes from a named region; the index is a scalar variable, so it is referenced bare as `offset: "index"`. - info/resources: the packed-struct pointer template sized its two uint128 members in bits (128) rather than bytes (16), pushing member y past the word boundary. - program/context/function/invoke: the inlined-call comment said the `transform` annotation rides along "typically via `gather`"; disjoint keys compose flat on one context object, so the comment now reflects that, and the near-duplicate example that added no distinct illustration is removed. - pointer/collection/scope: `define` validated its keys with an inline copy of the identifier pattern; it now references the identifier schema by `propertyNames` like its siblings. - type/definition: the description claimed no particular field was required, but the anyOf requires `name` or `location`; the prose now matches. - Dropped `additionalItems: false` where it is a no-op (removed in JSON Schema 2020-12, and inert when `items` is a single schema): program, info, pointer/template, program/context/gather, pick, and variables. --- schemas/info.schema.yaml | 1 - schemas/info/resources.schema.yaml | 4 ++-- schemas/pointer/collection/list.schema.yaml | 3 +-- schemas/pointer/collection/scope.schema.yaml | 8 +++---- schemas/pointer/template.schema.yaml | 1 - schemas/program.schema.yaml | 1 - .../context/function/invoke.schema.yaml | 24 +++---------------- schemas/program/context/gather.schema.yaml | 1 - schemas/program/context/pick.schema.yaml | 1 - schemas/program/context/variables.schema.yaml | 1 - schemas/type/base.schema.yaml | 4 ++-- schemas/type/definition.schema.yaml | 3 +-- 12 files changed, 13 insertions(+), 39 deletions(-) diff --git a/schemas/info.schema.yaml b/schemas/info.schema.yaml index 13eaede978..0b9aa712be 100644 --- a/schemas/info.schema.yaml +++ b/schemas/info.schema.yaml @@ -14,7 +14,6 @@ properties: type: array items: $ref: "schema:ethdebug/format/program" - additionalItems: false compilation: $ref: "schema:ethdebug/format/materials/compilation" diff --git a/schemas/info/resources.schema.yaml b/schemas/info/resources.schema.yaml index 1c323b6755..3e26221a50 100644 --- a/schemas/info/resources.schema.yaml +++ b/schemas/info/resources.schema.yaml @@ -63,7 +63,7 @@ examples: location: storage slot: contract_variable_slot__struct__Coordinate__storage offset: 0 - length: 128 + length: 16 - name: member__y__struct__Coordinate__storage location: storage slot: contract_variable_slot__struct__Coordinate__storage @@ -71,4 +71,4 @@ examples: $sum: - .offset: member__x__struct__Coordinate__storage - .length: member__x__struct__Coordinate__storage - length: 128 + length: 16 diff --git a/schemas/pointer/collection/list.schema.yaml b/schemas/pointer/collection/list.schema.yaml index 9c2abbdf94..4694ecd327 100644 --- a/schemas/pointer/collection/list.schema.yaml +++ b/schemas/pointer/collection/list.schema.yaml @@ -38,6 +38,5 @@ examples: each: "index" is: location: memory - offset: - $read: "index" + offset: "index" length: 1 diff --git a/schemas/pointer/collection/scope.schema.yaml b/schemas/pointer/collection/scope.schema.yaml index f1c4bc42d5..d175bc01f1 100644 --- a/schemas/pointer/collection/scope.schema.yaml +++ b/schemas/pointer/collection/scope.schema.yaml @@ -16,10 +16,10 @@ properties: define: title: Mapping of variables to expression value type: object - patternProperties: - "^[a-zA-Z_\\-]+[a-zA-Z0-9$_\\-]*$": - $ref: "schema:ethdebug/format/pointer/expression" - additionalProperties: false + propertyNames: + $ref: "schema:ethdebug/format/pointer/identifier" + additionalProperties: + $ref: "schema:ethdebug/format/pointer/expression" in: $ref: "schema:ethdebug/format/pointer" diff --git a/schemas/pointer/template.schema.yaml b/schemas/pointer/template.schema.yaml index 5324685a73..262adf74a4 100644 --- a/schemas/pointer/template.schema.yaml +++ b/schemas/pointer/template.schema.yaml @@ -16,7 +16,6 @@ properties: type: array items: $ref: "schema:ethdebug/format/pointer/identifier" - additionalItems: false for: $ref: "schema:ethdebug/format/pointer" diff --git a/schemas/program.schema.yaml b/schemas/program.schema.yaml index 1426dd577d..8e023553d1 100644 --- a/schemas/program.schema.yaml +++ b/schemas/program.schema.yaml @@ -50,7 +50,6 @@ properties: The full array of instructions for the bytecode. items: $ref: "schema:ethdebug/format/program/instruction" - additionalItems: false required: - contract diff --git a/schemas/program/context/function/invoke.schema.yaml b/schemas/program/context/function/invoke.schema.yaml index 11c8d9edf7..c22748f0ad 100644 --- a/schemas/program/context/function/invoke.schema.yaml +++ b/schemas/program/context/function/invoke.schema.yaml @@ -314,27 +314,9 @@ examples: # is no physical call instruction and no code target to # point at. The invoke context still records the callee's # identity so the debugger can maintain a source-level call - # stack. - - invoke: - identifier: "transfer" - declaration: - source: - id: 0 - range: - offset: 128 - length: 95 - jump: true - - # ----------------------------------------------------------- - # Inlined internal call: no target pointer - # ----------------------------------------------------------- - # When the compiler inlines a function, the JUMP that would - # normally carry the invoke context has been elided — there - # is no physical call instruction and no code target to - # point at. The invoke context still records the callee's - # identity so the debugger can maintain a source-level call - # stack, and a `transform: ["inline"]` context (typically - # via `gather`) annotates the inlining. + # stack, and a `transform: ["inline"]` context annotates the + # inlining — composed flat alongside the invoke on the same + # context object (the two carry disjoint keys). - invoke: identifier: "transfer" declaration: diff --git a/schemas/program/context/gather.schema.yaml b/schemas/program/context/gather.schema.yaml index 23137660d1..a5396df597 100644 --- a/schemas/program/context/gather.schema.yaml +++ b/schemas/program/context/gather.schema.yaml @@ -14,7 +14,6 @@ properties: items: $ref: "schema:ethdebug/format/program/context" minItems: 2 - additionalItems: false required: - gather diff --git a/schemas/program/context/pick.schema.yaml b/schemas/program/context/pick.schema.yaml index 3250900d4d..0be4448176 100644 --- a/schemas/program/context/pick.schema.yaml +++ b/schemas/program/context/pick.schema.yaml @@ -15,7 +15,6 @@ properties: items: $ref: "schema:ethdebug/format/program/context" minItems: 2 - additionalItems: false required: - pick diff --git a/schemas/program/context/variables.schema.yaml b/schemas/program/context/variables.schema.yaml index 9987a1856c..1e563b3e2d 100644 --- a/schemas/program/context/variables.schema.yaml +++ b/schemas/program/context/variables.schema.yaml @@ -19,7 +19,6 @@ properties: items: $ref: "#/$defs/Variable" minItems: 1 - additionalItems: false required: - variables diff --git a/schemas/type/base.schema.yaml b/schemas/type/base.schema.yaml index b39e8c28d9..eeca1e9ceb 100644 --- a/schemas/type/base.schema.yaml +++ b/schemas/type/base.schema.yaml @@ -66,11 +66,11 @@ $defs: bits: 256 - kind: struct contains: - - member: x + - name: x type: kind: uint bits: 256 - - member: y + - name: y type: kind: uint bits: 256 diff --git a/schemas/type/definition.schema.yaml b/schemas/type/definition.schema.yaml index 05e38de2ab..dc6e4247d7 100644 --- a/schemas/type/definition.schema.yaml +++ b/schemas/type/definition.schema.yaml @@ -5,8 +5,7 @@ title: ethdebug/format/type/definition description: | Object containing name and location information for a type. - This schema does not require any particular field, but it **must** contain - at least one property. + This schema **must** specify at least one of `name` or `location`. type: object properties: