Skip to content

format: correct schema examples and drop dead keywords#277

Open
gnidan wants to merge 1 commit into
mainfrom
architect-schema-example-cleanup
Open

format: correct schema examples and drop dead keywords#277
gnidan wants to merge 1 commit into
mainfrom
architect-schema-example-cleanup

Conversation

@gnidan

@gnidan gnidan commented Jul 24, 2026

Copy link
Copy Markdown
Member

This PR corrects a set of example and prose defects surfaced by a sweep over the schemas. All are documentation- or validation-hygiene fixes; none change the accepted shape of any valid instance.

  • type/base — the struct example labeled its members with a member: key, but the canonical struct schema (and every other example) names that field name:. No schema defines member.
  • pointer/collection/list — the example obtained the loop index with { $read: "index" }. $read reads bytes from a named region; the list index declared by each is a scalar variable, referenced bare. Corrected to offset: "index".
  • info/resources — the packed-struct pointer template sized its two uint128 members as 128 (bits) instead of 16 (bytes), which put member y at offset 128, past the word boundary. Both members are now 16 bytes, packing x at offset 0 and y at offset 16 within one slot.
  • program/context/function/invoke — the inlined-call comment said a transform: ["inline"] context accompanies the invoke "typically via gather". gather is for colliding keys; invoke and transform are disjoint and compose flat on one context object, and the comment now says so. The near-duplicate inlined-call example (identical heading and prose, no distinct illustration) is removed.
  • pointer/collection/scopedefine validated its keys with an inline copy of the identifier pattern; it now references the identifier schema via propertyNames, matching collection/reference and collection/templates so the pattern cannot silently drift.
  • type/definition — the description claimed the schema "does not require any particular field", but the anyOf requires name or location. The prose now matches the constraint.
  • Dead additionalItems: false removed where it is inert — the keyword was dropped in JSON Schema 2020-12 and, even under earlier drafts, has no effect when items is a single schema: program, info, pointer/template, and program/context/gather / pick / variables.

Schema example and validity tests pass.

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.
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ethdebug.github.io/format/pr-preview/pr-277/

Built to branch gh-pages at 2026-07-24 02:08 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant