Skip to content

Commit d7ef280

Browse files
committed
Add ADR for choosing a new SDLC
1 parent 1d8a5eb commit d7ef280

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed

adr/2022-11-stable-spec.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Selecting a new specification development process
2+
3+
* Status: accepted
4+
* Deciders: @jdesrosiers @relequestual @awwright @handrews @gregsdennis
5+
* Date: 2022-11-02
6+
7+
## Context and Problem Statement
8+
We've chosen to decouple our process from IETF, so we need to choose a new
9+
specification development process to replace it.
10+
11+
## Decision Drivers
12+
* Dropping the "draft" label is an important driver of this change. It's mostly
13+
an artifact of the IETF process and has proven to be confusing for the
14+
community.
15+
* The community wants a stable version of JSON Schema.
16+
* There is a need for JSON Schema to continue to evolve to meet evolving
17+
needs.
18+
* There is a demand for custom keywords/vocabularies/dialects and we want to
19+
continue to support those use cases.
20+
* There is a need to ease the burden of implementations supporting multiple
21+
versions of JSON Schema.
22+
23+
## Considered Options
24+
There have been two proposals put forward. Both address the goal of a stable
25+
specification with the ability to evolve. The third option represents sticking
26+
with the status quo.
27+
28+
### Option 1 - TC-39 inspired
29+
The spec would be converted from I-D XML to Markdown, but can otherwise be
30+
structured however we choose. A system would be put in place to allow us to flag
31+
the stability level of any feature in the spec. There would be only one version
32+
of the spec and that version can change at any time, but changes to stable
33+
features must follow strict backward and forward compatibility requirements.
34+
35+
New features must go through a hardening process to ensure that they are very
36+
unlikely to change before they are considered stable and subject to
37+
compatibility requirements. This process will impose strict requirements
38+
including tests, implementations, documentation, and real world vetting before a
39+
feature or new keyword can be made stable in the spec.
40+
41+
Since the spec is constantly evolving, a "release" is just a matter of promoting
42+
unstable features to "stable" status. Releases would happen once a year and be
43+
designated by the year they were released.
44+
45+
### Option 2 - IETF Inspired
46+
The spec would be reorganized into two parts: "Core Semantics" and "Standard
47+
Extensions".
48+
49+
The "Core Semantics" spec would contain the bare minimum rules that
50+
must be implemented for validators to not produce inaccurate results regardless
51+
of future revisions or extensions. Among other necessities, this would include a
52+
core set of keywords necessary to fully support structural validation and an
53+
extension mechanism. This spec should be considered stable and should rarely
54+
change, but if it does, it must do so in a backward and forward compatible way.
55+
56+
The "Standard Extensions" spec would include the rest of the spec. Features and
57+
keywords included in this spec are so ubiquitous that they should be considered
58+
essential for implementations to support. Changes to this spec must be
59+
compatible with previous releases with exceptions only in extreme cases.
60+
61+
A registry could be maintained that maps keywords to their specified semantics.
62+
User extensions that aren't in the registry should use a URI for their keyword
63+
to avoid conflicts with other third-party extensions or with future standard
64+
extensions.
65+
66+
### Option 3 - Minimal Change
67+
Option 3 represents the minimal amount of change to our process from what we
68+
have been doing. The spec would need to be converted from I-D XML to a Markdown
69+
version that would be served on the website, but otherwise we would continue to
70+
work the way we have been. We would aim for new version release every year with
71+
a patch release mid-cycle. Each release is a distinct version of JSON Schema and
72+
has no compatibility guarantees between versions.
73+
74+
## Decision Outcome
75+
The decision is to go with Option 1 while leaving discussion open for nearly all
76+
of Option 2 because it is mostly compatible with Option 1. Option 2 uses an
77+
immutable spec where each release replaces the last while the Option 1 uses a
78+
mutable spec. The outcome of having only one current version of the spec is
79+
achieved with either option, but the mutable spec allows us to remove some
80+
unnecessary roadblocks in our development processes and allows us to release a
81+
stable spec much sooner. Other than that, discussion for the rest of Option 2
82+
can continue within the constraints of Option 1.
83+
84+
Option 1 puts no constraint on the structure of the spec and restructuring is
85+
allowed at any time as long as it doesn't break compatibility requirements.
86+
Therefore, restructuring the spec as "Core Semantics" and "Standard Extensions"
87+
is compatible with Option 1. We can move forward with Option 1 now while leaving
88+
the restructuring discussion open.
89+
90+
Option 2 defines a new extension mechanism and some new keywords. These features
91+
can be introduced under the stability model described in Option 1. Therefore, we
92+
can move forward with Option 1 while leaving the discussion open for these new
93+
features.
94+
95+
## Pros and Cons of the Options
96+
The biggest benefit is shared between Option 1 and Option 2. Both approaches
97+
result in a stable spec. This will have benefits implementers and users. Because
98+
of the compatibility requirements, whenever you write a schema, you will never
99+
need to change it just to keep up with new features added to JSON Schema. This
100+
is also better for implementers because they don't have to maintain separate
101+
code different semantics in different versions. They just need to code for the
102+
current release and they will automatically have support for past releases.
103+
104+
### Option 1 - TC-39 Inspired
105+
The two things that make this option stand out are the stability model and the
106+
mutability of the spec document.
107+
108+
Having a mutable spec allows us to make clarifications and bug fixes immediately
109+
rather than having to wait months or years for the next release to go out. It
110+
also allows us to iterate faster on unstable features which would allow us to
111+
get them to a stable state much sooner. For example, we have changes to dynamic
112+
references that have been agreed upon and ready to go for over a year, but users
113+
can't benefit from the change until we can get the next full release published.
114+
With this model, the change could have been made available for over a year now
115+
and we would have a years worth of feedback on it's use. Having a mutable spec
116+
also allows us to introduce new features without having to wait for a release.
117+
For example, the `propertyDependencies` keyword has also been waiting for months
118+
for a release. Users could have been benefiting from it for months and providing
119+
feedback.
120+
121+
The downside of a mutable spec is that it can be more difficult for implementers
122+
and users to track when changes happen. We will need to be better at
123+
communicating changes in blog posts or equivalent.
124+
125+
The stability model allows us to ensure we don't make incompatible changes to
126+
stable features, but it also allows us to introduce new features and get real
127+
world feedback without committing to full compatibility requirements. This makes
128+
it much more likely that we don't get stuck with something that doesn't work out
129+
or could be done better.
130+
131+
The stability model also makes it clear to users which features are stable and
132+
how likely an unstable feature is to change in the future. Whether they prefer
133+
to stick with stable features or want to use a new keyword, users have the
134+
information they need to make that decision.
135+
136+
The downside of the stability model is that it presents a very high barrier for
137+
a feature to make it into a stable status. It would typically take two years for
138+
a feature to reach stability which could be a long time to wait for users who
139+
need to stick to the stable feature set but could benefit greatly from a new
140+
feature.
141+
142+
### Option 2 - IETF Inspired
143+
The benefit of this approach is that it's compatible with the IETF process
144+
without imposing some of the constraints and perception issues that we had with
145+
IETF. We can pursue an RFC in the future if we choose to without significant
146+
changes or spec restructuring.
147+
148+
With this proposal, releases are done as a new document that replaces the
149+
previous documents. Compared to the constantly evolving spec in Option 1, change
150+
from non-functional clarifications and bug fixes to adding and evolving new
151+
features takes much longer if you have to wait for the next release to make a
152+
change. This lengthens the feedback loop slowing spec development progress.
153+
154+
The main downside of this approach compared to Option 1 is that it will likely
155+
take quite a while to get to a stable release. The spec restructuring is
156+
controversial and it proposes several new keywords that are also controversial.
157+
Discussing, achieving consensus, specifying, and implementing these changes will
158+
take time. Introducing new features and keywords is much more risky with the new
159+
compatibility requirements, so we have to go extra slow to make sure we get it
160+
right.
161+
162+
### Option 3 - Minimal Changes
163+
The benefit of this solution is that we don't have the overhead of defining
164+
and/or learning a new process. In the short term, we can put more effort into
165+
improving JSON Schema if we don't have the distraction of defining a whole new
166+
process. The problem with this approach is that it doesn't solve the problem
167+
with the "draft" label and doesn't provide the stability the community is
168+
looking for.
169+
170+
## Links
171+
* https://github.com/jdesrosiers/json-schema-spec/blob/main/adr/2022-09-decouple-from-ietf.md -
172+
The ADR for the decision to decouple from IETF
173+
* https://github.com/orgs/json-schema-org/discussions/234 - Proposal submitted
174+
by @jdesrosiers for a process to replace the IETF based process we'd been
175+
using.
176+
* https://github.com/orgs/json-schema-org/discussions/257 - @awwright's vision
177+
for JSON Schema including how it can continue to evolve while still having a
178+
stable core.
179+
* https://github.com/json-schema-org/community/discussions/119 - When we first
180+
started talking about forward compatibility and a stable spec.

0 commit comments

Comments
 (0)