Specification Development Life Cycle (a collaborative proposal) #671
Replies: 15 comments 36 replies
-
"Version" is an overloaded term. The above process defines a single version as "a collection/sequence of compatible releases." Do we want to use "version" for this, or something else? |
Beta Was this translation helpful? Give feedback.
-
The meta-schema URI needs to declare the version as well as the release. Open to other proposals. Proposal 1
Proposal 2
This has the added benefit of visually indicating that it's an identifier, not a location. We would need to register the |
Beta Was this translation helpful? Give feedback.
-
Governance: For people posting ideas (the "concept" stage), we could have a "proposal" issue template in the spec repo that would help people think about certain aspects of the proposal before posting it. For example:
|
Beta Was this translation helpful? Give feedback.
-
How can we know when an experimental feature is ready to be promoted? Usage?I'm hesitant on requiring the usage metrics since many devs will prefer not to use experimental features, especially if there's a chance the feature could change. I think the worst case is we add a feature that no one uses and it's just deprecated later, but that would also mean wasted time for us and implementers. Minimum time?Should there be a "minimum unchanged time" before a proposal is promoted to stable? What about for breaking changes? For example, should we require that a proposal remain unchanged for six months before releasing it? |
Beta Was this translation helpful? Give feedback.
-
Should a stalled proposal expire? If an existing proposal loses traction for whatever reason, should the proposal be removed? Does removing an experimental feature from the meta-schema constitute a breaking change? (The keyword is allowed but will not be in future meta-schema releases.) |
Beta Was this translation helpful? Give feedback.
-
Do proposals need their own versions so that implementers can indicate their support? A subtle behavior change (non-syntax) could be confusing to a user of an outdated implementation. |
Beta Was this translation helpful? Give feedback.
-
Can a deprecated feature return to "stable" status? |
Beta Was this translation helpful? Give feedback.
-
Can a removed keyword be re-introduced in a later version (a breaking change has occurred after the keyword was removed). If not, does the meta-schema need to enforce this? E.g. {
// ...
"properties": {
"foo": false,
"bar": false,
// ...
}
} |
Beta Was this translation helpful? Give feedback.
-
Governance: Do we need some sort of incentive program to encourage implementor support for experimental features? |
Beta Was this translation helpful? Give feedback.
-
When you say "version", I think this means "major version"? As a version is an atomic thing, e.g. "1.2.3", but a "major version" can encompass a set of versions (where all such versions are internally compatible). I don't mean to bikeshed on the version format; that can be figured out later, whether semver or something else. |
Beta Was this translation helpful? Give feedback.
-
On known/unknown/experimental/supported/unsupported keywords... "Implementations MUST refuse to process schemas which contain unknown keywords." -> clarify this to mean "..where a keyword is not defined by any vocabulary used in the evaluation" or perhaps "..any vocabulary defined by the dialect" [although dialect isn't defined yet.. so that suggests a glossary is needed?] "The keyword prefix x- defines a safe space for users to introduce custom annotations" - are we saying that x- keywords can only be annotations, and have no associated functionality? In the past we've acknowledged that some x- keywords might actually do something, just something recognized onlyby a specific implementation and not formally defined in a vocabulary. Is this change intentional? Was there an ADR produced for it? The next section, which says "To support custom keywords, implementations MUST create a custom meta-schema..." would be unnecessary in that case, as now it's implying that even to use an x- keyword one must define it in a new vocabulary. So I think some rephrasingis needed here, as "experimental" and "custom" seem to be used interchangeably and I'm not sure if they're both referencing the same thing. Which of these is intended to be true?
I would have assumed the first, and would add an explicit caveat that when not using a custom vocabulary (in conjunction with an x- keyword), interoperability is explicitly NOT assumed or expected. |
Beta Was this translation helpful? Give feedback.
-
Re the Lifecycle, I would make a clear distinction between features that can be wholly implemented with a new vocabulary using an existing major version (i.e. it does not require modifications to existing functionality of JSON Schema as a whole or to existing vocabularies and keywords), and features that require changing something essential to JSON Schema as a whole (say something that modifies how errors are produced, or the order of evaluation of keywords, or reference canonicalization etc). In particular, a vocabulary might have a different versioning lifecycle than a specification version (perhaps multiple major revisions of a vocabulary could be released that are compatible with a specific specification major version). |
Beta Was this translation helpful? Give feedback.
-
This is implying that any implementation that supports release N must also support N-1, N-2 etc (presumably back to the first "stable" release). Is that realistic, if there are major changes between versions? There may be fundamental changes in the way evaluation is done between versions such that it is not practical to support both of them in the same implementation. |
Beta Was this translation helpful? Give feedback.
-
Regarding the release cycle period, the proposal says:
Has there been any discussions on this? I am not sure what is the benefit of constraining to an annual release cycle. From my point of view, it can be even slower. |
Beta Was this translation helpful? Give feedback.
-
The topic of availability is not discussed above. Does the JSON Schema Organization guarantee the availability of the specifications in a stable URI? I am guessing yes but it would be very important to clearly express this. Something along the lines of "As long as the JSON Schema Organization continues to exist, all stable specifications will be available with a stable URI" |
Beta Was this translation helpful? Give feedback.
-
A note before we begin
@jdesrosiers and I have spent a couple months building this offline in the hopes that we can present a completed proposal to the team (or at least as close to complete as possible).
The process laid out below is the initial process and may need to be updated as new features are introduced.
For example, since vocabularies are being extracted from the spec into the feature life cycle, support for custom keywords needs to happen another way (which is described below). When vocabularies are eventually promoted to stable status, this process will need to be updated so that vocabularies are recommended way to extend JSON Schema.
The point is that this process is not set in stone, and we can continue to evolve it as we need to.
I've also started a number of threads with questions that Jason and I thought could use some input from the rest of the team. Please read through those and provide your thoughts in the appropriate thread. If you have other questions, please feel free to start new threads. I will update this main post as those questions are resolved.
UPDATE
A PR to create a process document has been opened: json-schema-org/json-schema-spec#1500
Specification Development Life Cycle
Stability guarantees, versioning, and working with breaking changes
Releases will occur annually (e.g. 1 Jan) and will contain features which have achieved "stable" status.
A version consists of a set of consecutive releases which contain no breaking changes (also see the "Meta-schema" section regarding identifying versions).
Stability is implicitly and indefinitely guaranteed within a version.
If a breaking change is necessary, the Core Team will publicly announce the pending breaking change. Typically, the change will be included in the next release, however The Core Team reserves the right to delay releasing breaking changes. The Core Team MAY decide to withhold individual breaking changes until later versions. (Not all changes need to be included in the next version.)
Specification development only occurs in the next release. Published releases will not be updated retroactively. Fixing errata, such as spelling mistakes, MAY be permitted, however changes to feature descriptions might be too much for a back-fix. The Core Team will decide the severity of a back-fix on a case-by-case basis.
Changes within a version
A new release within a version MAY include non-functional changes. Examples of non-functional changes are:
Functional changes within a version MUST be compatible with existing functionality and MUST follow the full feature life cycle. Examples of compatible functional changes are:
If any functionality is broken as a result of a particular change, no matter how little the expected impact, it is considered a breaking change.
Unknown keywords
In order to support future-compatibility, keywords which are not known by the implementation MUST be disallowed.
The keyword prefix
x-
defines a safe space for users to introduce custom annotations without the need for an explicit custom keyword.Implementations MUST refuse to process schemas which contain unknown keywords.
Meta-schema
The published meta-schema will be closed, enforcing the restriction on unknown keywords by using an
unevaluatedProperties
keyword with thefalse
schema.The custom annotation space is enforced in the meta-schema by using a
patternProperties
keyword with a^x-
pattern with atrue
schema. (This can be added to the Core vocabulary meta-schema.)Experimental keywords will be added to the appropriate vocabulary meta-schema with a schema which is empty (no validation) except for a
$comment
keyword to explain that the keyword is experimental and where to find more information. (See the Proposal stage.)To support custom keywords, implementations MUST create a custom meta-schema which defines their keywords and:
unevaluatedProperties
it contains)"$dynamicAnchor": "meta"
Feature life cycle
New features MUST progress through a sequence of stages before being added to the specification, and existing stable features must be formally deprecated before being removed. The stages of the life cycle, in order, are:
Concept
The feature life cycle begins with an idea expressed in a GitHub issue in the specification repository. Initial discussion may occur in Slack or another space, but the life cycle does not formally begin until a GitHub issue is created.
The issue and subsequent discussion should cover how the feature could work, use cases, alternatives, whether it’s a breaking change, etc., with a goal of deciding rough requirements.
During this stage, members of the Core Team will implement private prototypes of the ideas expressed in the issue to get a feel for how it integrates with the stable features. Questions to address:
Proposal
Once the idea has been formed and agreed upon, a proposal will be written, separate from the specification (format TBD), with the goal of precisely defining specification changes.
In addition to the proposal, the published meta-schema for the appropriate vocabulary will be updated at this stage to include any new keywords with a schema containing only a
$comment
keyword to explain that the keyword is experimental and where to find more information. This is done so that these keywords are allowed but are not validated as their definition may change during the proposal/prototype process, and to permit different implementations to support different variations of the proposal throughout this process. It will be up to the implementation to validate these keywords in accordance with their support.Finally, tests are added to the Test Suite (somewhere that indicates they’re still WIP).
Experimentation
With specification language defined, the meta-schema updated, and tests provided, implementations may begin to support the new feature.
It is expected that feedback from implementers and users will result in refinements to the proposal. Sweeping changes MAY occur, but are highly discouraged.
In order to proceed, a minimum number (TBD) of implementations MUST support the feature, and there MUST be evidence of use in the wild (metrics TBD).
Users MUST NOT expect experimental features to be interoperable across implementations.
Stable
The proposal is incorporated into the specification, and the feature will be required as of the next release.
The appropriate vocabulary meta-schema is updated to include a subschema that validates the feature's syntax requirements.
The appropriate tests are moved out of WIP status.
Deprecated
If a feature is no longer useful, e.g. it has been replaced, it may be deprecated.
Implementations MUST still support deprecated features.
Removed
Features MUST remain in the "deprecated" state for a minimum time (TBD). After this time, they are removed with the release of the next version (may not be the next release).
Features to be extracted
propertyDependencies
This feature is new and should be added via the feature life cycle.
Vocabularies
This feature is incomplete (and needs to undergo some changes anyway) and should be added via the feature life cycle.
Because this is being extracted, the specification will need to permit implementations to support custom keywords. However, since this practice produces non-interoperable schemas, it should be discouraged. Text like the following is recommended:
Later, when the vocabularies feature is promoted to a stable, it will be touted as the recommended, interoperable way to support custom keywords.
Output formats
It has been determined that the output formats defined in 2020-12 are geared toward machine consumers, but there are other consumers that the output does not consider, like human readers.
The output formats will be extracted to a new specification, allowing other specifications to fulfill the needs of other target audiences.
The Core specification will only identify terminology that should be used across all output format specifications in order to foster consistency.
Implementation support
Implementations MUST indicate the year of the latest release for which they fully support all stable features. For instance, if an implementation fully supports Release 2024 but only 3 of 4 features from Release 2025, then that implementation is said to support up to Release 2024. Implementations SHOULD also indicate the version associated with the release.
Proposal support
Wider support across implementations increases the likelihood that a feature will be used.
However, it's recognized that implementations are typically open source and often hobby projects. As a result, it's somewhat unrealistic to expect many implementations to stay up-to-date with proposals since many maintainers likely won't have time.
An implementation which does not recognize a proposed feature or the particular form for a proposed feature (i.e. the proposal has iterated) MUST refuse to process the schema.
Beta Was this translation helpful? Give feedback.
All reactions