format: identify info, resources and program objects with their schema and specification version - #305
Open
gnidan wants to merge 8 commits into
Open
format: identify info, resources and program objects with their schema and specification version#305gnidan wants to merge 8 commits into
gnidan wants to merge 8 commits into
Conversation
Contributor
|
gnidan
marked this pull request as ready for review
September 22, 2026 00:14
gnidan
force-pushed
the
architect-identification
branch
from
September 22, 2026 00:14
e5682b3 to
8ed9fdb
Compare
gnidan
force-pushed
the
architect-identification
branch
from
September 22, 2026 00:37
8ed9fdb to
d011ac4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Info, resources and program objects can now say which schema they conform to and which version of the specification defines it:
{ "ethdebug": { "schema": "schema:ethdebug/format/program", "version": "0.1.0-draft.0" }, "contract": { "...": "..." } }The field is optional now and becomes required at the stable
0.1.0release. An object without it predates the field. Theschemapart is the schema's$id; theversionpart is the version of@ethdebug/formatthe producer was built against. A new shared schema, ethdebug/format/identification, defines the object, and each root pinsschemawith aconst(info/resourcesaccepts either its own id orinfo's, because an info document is also a resources object).The
schema:ids stay as they are. They are identifiers in the JSON Schema sense, resolved through the@ethdebug/formatpackage'sschemasmap, not web addresses. They are deliberately not placed in a$schemakey: JSON editors treat$schemaas a URL and report an error for anything they cannot fetch, and no format we looked at (OpenAPI, SARIF, CycloneDX, SPDX) puts a custom-scheme URI there. A namespacedethdebugobject holds both parts without any parsing.Rules, on the new spec page:
major.minorwhile the major is 0 (semver treats 0.x minors as breaking). Within a key it accepts every version and may warn when the version is newer than the one it was built against. Drafts within one key are not distinguished: the field tells a consumer which changelog entries apply, it does not enforce them.One consequence worth knowing:
programandinfoare closed objects (unevaluatedProperties: false), so a consumer that validates against the previous release's schemas rejects an identified object until it updates its schemas. The changelog entry and the spec page state this; the entry keepsConsumers: optional:, in line with the earlier entries for new optional keys on closed objects, since a consumer that does not validate is unaffected.Reference implementation, per the rule that a schema change is not done until the implementation supports it:
@ethdebug/formatexportsversion(generated frompackage.jsonat build time),IdentificationandisIdentification(which checks the same semver pattern as the schema),identify()for producers andsupports()for the consumer rule;Programgains the optional member.specificationverdict in its trace state and warns once on a newer version; the docs site's trace viewer shows a notice instead of the panels for an unsupported one. It never throws on the render path.bin/version.tskeeps the schema examples honest: when@ethdebug/formatmoves, the bump rewrites the version literal in the examples in the samePublishcommit, and refuses to run if the number of literals does not match the number of example sites. A format unit test asserts that every example literal equals the package version.Upstream: neither solc nor soldb is affected by the optional field today (solc emits none; soldb ignores unknown keys). A heads-up issue follows this PR, noting that a solc program will read
evm.bytecode.ethdebug.ethdebugbecause solc already usesethdebugas its namespace key, and that the field becomes required at0.1.0.