@soustack/spec 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/LICENSE +121 -0
  2. package/README.md +275 -0
  3. package/SOUSTACK_SPEC_VERSION +1 -0
  4. package/SPEC.md +226 -0
  5. package/defs/common.schema.json +46 -0
  6. package/defs/duration.schema.json +33 -0
  7. package/defs/entities.schema.json +111 -0
  8. package/defs/ingredientQuantified.schema.json +9 -0
  9. package/defs/quantity.schema.json +16 -0
  10. package/defs/scalingRule.schema.json +127 -0
  11. package/defs/temperature.schema.json +63 -0
  12. package/dist/index.d.ts +4 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +4 -0
  15. package/dist/index.js.map +1 -0
  16. package/fixtures/content/illustrated-step.valid.json +24 -0
  17. package/fixtures/invalid/equipment-unknown-reference.invalid.json +38 -0
  18. package/fixtures/invalid/mise-en-place-unknown-equipment.invalid.json +37 -0
  19. package/fixtures/invalid/mise-en-place-unknown-input.invalid.json +41 -0
  20. package/fixtures/invalid/storage-leftovers-missing-method.invalid.json +31 -0
  21. package/fixtures/invalid/storage-leftovers-wrong-type.invalid.json +23 -0
  22. package/fixtures/level/base-full.valid.json +162 -0
  23. package/fixtures/level/base-missing-yield.invalid.json +12 -0
  24. package/fixtures/level/lite-min.valid.json +14 -0
  25. package/fixtures/profile/profile-base.valid.json +20 -0
  26. package/fixtures/profile/profile-equipped.valid.json +28 -0
  27. package/fixtures/profile/profile-illustrated.valid.json +28 -0
  28. package/fixtures/profile/profile-lite.valid.json +13 -0
  29. package/fixtures/profile/profile-prepped.valid.json +31 -0
  30. package/fixtures/profile/profile-scalable-missing-scaling.invalid.json +29 -0
  31. package/fixtures/profile/profile-scalable.valid.json +49 -0
  32. package/fixtures/profile/profile-timed-missing-structured.invalid.json +30 -0
  33. package/fixtures/scaling/bakers-percent-missing-ref.invalid.json +41 -0
  34. package/fixtures/scaling/bakers-percent.valid.json +51 -0
  35. package/fixtures/scaling/discrete-range.invalid.json +36 -0
  36. package/fixtures/scaling/missing-quantified.invalid.json +40 -0
  37. package/fixtures/scaling/reject-bakersPercentage.invalid.json +50 -0
  38. package/fixtures/stacks/compute-missing-timed.invalid.json +32 -0
  39. package/fixtures/stacks/dietary-no-signal.invalid.json +16 -0
  40. package/fixtures/stacks/illustrated-empty.invalid.json +13 -0
  41. package/fixtures/stacks/quantified-string.invalid.json +22 -0
  42. package/fixtures/stacks/referenced-missing-input.invalid.json +32 -0
  43. package/fixtures/stacks/storage-min.valid.json +20 -0
  44. package/fixtures/stacks/storage-no-duration.invalid.json +16 -0
  45. package/fixtures/stacks/timed-implies-structured.valid.json +50 -0
  46. package/fixtures/stacks/timed-range.invalid.json +33 -0
  47. package/fixtures/valid/equipment-scaling-rules.valid.json +76 -0
  48. package/fixtures/valid/equipment-strings.valid.json +31 -0
  49. package/fixtures/valid/equipment-structured-uses.valid.json +47 -0
  50. package/fixtures/valid/mise-en-place-basic.valid.json +31 -0
  51. package/fixtures/valid/mise-en-place-referenced-equipment.valid.json +51 -0
  52. package/fixtures/valid/prep-ingredient-strings.valid.json +48 -0
  53. package/fixtures/valid/prep-ingredient-structured.valid.json +45 -0
  54. package/fixtures/valid/profile-equipped.valid.json +29 -0
  55. package/fixtures/valid/profile-prepped.valid.json +32 -0
  56. package/fixtures/valid/quantified-nested-ingredient-sections.valid.json +61 -0
  57. package/fixtures/valid/referenced-scaling.valid.json +67 -0
  58. package/fixtures/valid/storage-leftovers-simple.valid.json +27 -0
  59. package/fixtures/valid/storage-leftovers-structured.valid.json +43 -0
  60. package/fixtures/valid/structured-nested-step-sections.valid.json +84 -0
  61. package/package.json +54 -0
  62. package/schemas/stacks-registry.schema.json +108 -0
  63. package/soustack.schema.json +2379 -0
  64. package/src/index.js +3 -0
  65. package/src/index.ts +3 -0
  66. package/stacks/compute.schema.json +7 -0
  67. package/stacks/compute@1.md +22 -0
  68. package/stacks/dietary.schema.json +45 -0
  69. package/stacks/dietary@1.md +24 -0
  70. package/stacks/equipment.schema.json +98 -0
  71. package/stacks/equipment@1.md +244 -0
  72. package/stacks/illustrated.schema.json +54 -0
  73. package/stacks/illustrated@1.md +24 -0
  74. package/stacks/prep.schema.json +76 -0
  75. package/stacks/prep@1.md +276 -0
  76. package/stacks/quantified.schema.json +74 -0
  77. package/stacks/quantified@1.md +24 -0
  78. package/stacks/referenced.schema.json +96 -0
  79. package/stacks/referenced@1.md +23 -0
  80. package/stacks/registry.json +112 -0
  81. package/stacks/scaling.schema.json +99 -0
  82. package/stacks/scaling@1.md +238 -0
  83. package/stacks/storage.schema.json +132 -0
  84. package/stacks/storage@1.md +256 -0
  85. package/stacks/structured.schema.json +48 -0
  86. package/stacks/structured@1.md +24 -0
  87. package/stacks/substitutions.schema.json +43 -0
  88. package/stacks/substitutions@1.md +24 -0
  89. package/stacks/techniques.schema.json +28 -0
  90. package/stacks/techniques@1.md +23 -0
  91. package/stacks/timed.schema.json +60 -0
  92. package/stacks/timed@1.md +23 -0
package/LICENSE ADDED
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
package/README.md ADDED
@@ -0,0 +1,275 @@
1
+
2
+ # Soustack Specification
3
+
4
+ **Soustack** is an open standard for representing recipes as **structured, interoperable, and computational data**.
5
+
6
+ The goal of Soustack is **universal adoption**: recipes should be publishable with minimal friction, while enabling progressively more powerful capabilities such as scaling, timing, scheduling, and rich UI rendering.
7
+
8
+ This repository defines the **normative specification**:
9
+
10
+ * JSON Schemas
11
+ * Profiles (adoption ladder)
12
+ * Stack contracts
13
+ * Conformance rules
14
+ * Validation fixtures
15
+
16
+ Runtime behavior lives in **soustack-core**.
17
+ UI and integrations live in **Soustack Blocks**.
18
+
19
+ ---
20
+
21
+ ## What Soustack Is (and Is Not)
22
+
23
+ **Soustack is:**
24
+
25
+ * A stable, versioned recipe data standard
26
+ * Designed for incremental adoption
27
+ * Built to support *computational* recipes (not just descriptive ones)
28
+ * The source of truth for validation and conformance
29
+
30
+ **Soustack is not:**
31
+
32
+ * A recipe app
33
+ * A hosted service
34
+ * A runtime library
35
+ * A CMS or database schema
36
+
37
+ > **The format is the product.** Everything else is derived.
38
+
39
+ ---
40
+
41
+ ## Adoption Philosophy
42
+
43
+ Soustack is designed around **incremental compliance**, not all-or-nothing adoption: publishers can start at **Lite** with minimal structure, move to **Base** by adding `yield` and `time`, and then opt into stack-backed profiles like **Timed**, **Scalable**, or **Illustrated** as they add structure—without changing the overall document shape.
44
+
45
+ ---
46
+
47
+ ## Profiles (Public Contract)
48
+
49
+ **Profiles** are the human-facing compatibility levels a publisher or consumer can claim.
50
+
51
+ Examples:
52
+
53
+ * “We publish **Base** Soustack”
54
+ * “This site supports **Scalable** recipes”
55
+ * “Our embed works for **Timed** recipes”
56
+
57
+ Profiles define:
58
+
59
+ * what fields must exist
60
+ * what guarantees consumers can rely on
61
+
62
+ Profiles are defined normatively in **SPEC.md**.
63
+
64
+ ### Common Profiles
65
+
66
+ | Profile | Purpose |
67
+ | ----------------------------- | -------------------------------------- |
68
+ | Lite | Lowest-friction publishing |
69
+ | Base | Minimum cookable baseline |
70
+ | Timed | Step-level timing |
71
+ | Scalable | Interoperable scaling rules |
72
+ | Illustrated | Media present |
73
+ | Equipped | Required tools/equipment |
74
+ | Prepped | Prep guidance and/or mise en place |
75
+
76
+ ---
77
+
78
+ ## Stacks (Enforcement Mechanism)
79
+
80
+ **Stacks** are the composable capability contracts that implement profiles.
81
+
82
+ They:
83
+
84
+ * activate additional schema and semantic rules
85
+ * are declared explicitly in recipe documents
86
+ * are versioned independently
87
+
88
+ Example:
89
+
90
+ ```json
91
+ {
92
+ "profile": "scalable",
93
+ "stacks": { "quantified": 1, "scaling": 1 },
94
+ "yield": { "amount": 4, "unit": "servings" },
95
+ "time": { "total": { "minutes": 30 } }
96
+ }
97
+ ```
98
+
99
+ Stacks are **machine-facing**.
100
+ Profiles are **human-facing**.
101
+
102
+ ---
103
+
104
+ ## Stack Versioning (`@1`)
105
+
106
+ Stacks are versioned using the syntax:
107
+
108
+ ```
109
+ <stack-name>@<major>
110
+ ```
111
+
112
+ Example:
113
+
114
+ * `quantified@1`
115
+ * `scaling@1`
116
+ * `timed@1`
117
+
118
+ ### Important Rules
119
+
120
+ * **`@1` appears only in stack declarations and contract names**
121
+ * Schema filenames are **version-agnostic**
122
+ * Schema `$id`s are **version-agnostic**
123
+ * `$ref`s are **version-agnostic**
124
+
125
+ Versioning applies to the **contract**, not the implementation file.
126
+
127
+ This allows:
128
+
129
+ * safe evolution of stack semantics
130
+ * future `@2` stacks without breaking existing recipes
131
+ * stable schema paths for tooling
132
+
133
+ ---
134
+
135
+ ## Scaling (Why Soustack Exists)
136
+
137
+ Soustack explicitly supports **interoperable recipe scaling**, including cases where simple multipliers fail.
138
+
139
+ The `scaling@1` stack standardizes:
140
+
141
+ * linear scaling
142
+ * fixed ingredients
143
+ * discrete items (e.g. eggs)
144
+ * “to taste” quantities
145
+ * baker’s percentages
146
+
147
+ This ensures two independent implementations scale the same recipe the same way.
148
+
149
+ Scaling semantics are defined normatively in the spec and implemented in **soustack-core**.
150
+
151
+ ---
152
+
153
+ ## Repository Structure
154
+
155
+ ```
156
+ .
157
+ ├── soustack.schema.json # Root schema
158
+ ├── SPEC.md # Normative specification
159
+ ├── README.md # This file
160
+ ├── defs/ # Reusable schema definitions
161
+ ├── stacks/ # Stack schemas (version-agnostic filenames)
162
+ ├── fixtures/ # Valid/invalid conformance fixtures
163
+ ├── scripts/ # Validation & policy scripts
164
+ └── .github/workflows/ # CI validation
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Validation & Conformance
170
+
171
+ This repository provides:
172
+
173
+ * JSON Schema validation
174
+ * semantic validation (DAGs, references, scaling rules)
175
+ * fixtures that define expected behavior
176
+
177
+ ### Local Validation
178
+
179
+ ```bash
180
+ npm install
181
+ npm test
182
+ ```
183
+
184
+ This runs:
185
+
186
+ 1. policy guards
187
+ 2. schema reference resolution
188
+ 3. fixture validation
189
+
190
+ If `npm test` passes, the spec is internally consistent.
191
+
192
+ ---
193
+
194
+ ## Relationship to Other Repos
195
+
196
+ * **soustack-spec**
197
+ The authoritative definition of the standard.
198
+
199
+ * **soustack-core**
200
+ Runtime implementation: validation, scaling, Schema.org conversion, scraping.
201
+
202
+ * **Soustack Blocks**
203
+ UI and integration packages that drive adoption:
204
+
205
+ * embeds
206
+ * web components
207
+ * CMS/framework adapters
208
+ * conformance badges
209
+
210
+ The spec is the source of truth. All other repos consume it.
211
+
212
+ ---
213
+
214
+ ## Stability Guarantees
215
+
216
+ * Backwards-compatible evolution is preferred
217
+ * Breaking changes require a new major stack version (`@2`)
218
+ * Existing stack contracts (`@1`) will not be silently broken
219
+ * Migration and canonicalization belong in **soustack-core**, not the spec
220
+
221
+ ---
222
+
223
+ ## Contributing
224
+
225
+ Contributions should:
226
+
227
+ * preserve incremental adoption
228
+ * avoid adding complexity to Lite/Base
229
+ * respect stack versioning rules
230
+ * include fixtures for new behavior
231
+
232
+ If in doubt, **opt for clarity over cleverness**.
233
+
234
+ > **Note:** Do not commit `dist/`; it is build output. The `prepack` script builds it automatically before npm publishing.
235
+
236
+ ---
237
+
238
+ ## License
239
+
240
+ MIT
241
+
242
+
243
+ <!-- BEGIN GENERATED: STACK REGISTRY -->
244
+
245
+ ## Profiles
246
+
247
+ | Profile | Requires Profiles | Requires Stacks | Description |
248
+ | ------- | ---------------- | -------------- | ----------- |
249
+ | **Base** | lite | — | Minimum cookable baseline with yield + time |
250
+ | **Equipped** | base | equipment | Recipe declares required tools/equipment. |
251
+ | **Illustrated** | base | illustrated | Media present |
252
+ | **Lite** | — | — | Lowest-friction publishing with minimal structure |
253
+ | **Prepped** | base | prep | Recipe includes prep guidance and/or mise en place tasks. |
254
+ | **Scalable** | base | quantified, scaling | Quantified + scaling |
255
+ | **Timed** | base | structured, timed | Structured + timed |
256
+
257
+ ## Stacks
258
+
259
+ | Stack ID | Latest Major | Requires | Required by Profiles | Schema | Docs |
260
+ | -------- | ----------- | -------- | -------------------- | ------ | ---- |
261
+ | **compute** | 1 | quantified, timed | — | `stacks/compute.schema.json` | `stacks/compute@1.md` |
262
+ | **dietary** | 1 | — | — | `stacks/dietary.schema.json` | `stacks/dietary@1.md` |
263
+ | **equipment** | 1 | — | equipped | `stacks/equipment.schema.json` | `stacks/equipment@1.md` |
264
+ | **illustrated** | 1 | — | illustrated | `stacks/illustrated.schema.json` | `stacks/illustrated@1.md` |
265
+ | **prep** | 1 | — | prepped | `stacks/prep.schema.json` | `stacks/prep@1.md` |
266
+ | **quantified** | 1 | — | scalable | `stacks/quantified.schema.json` | `stacks/quantified@1.md` |
267
+ | **referenced** | 1 | structured | — | `stacks/referenced.schema.json` | `stacks/referenced@1.md` |
268
+ | **scaling** | 1 | quantified | scalable | `stacks/scaling.schema.json` | `stacks/scaling@1.md` |
269
+ | **storage** | 1 | — | — | `stacks/storage.schema.json` | `stacks/storage@1.md` |
270
+ | **structured** | 1 | — | timed | `stacks/structured.schema.json` | `stacks/structured@1.md` |
271
+ | **substitutions** | 1 | referenced | — | `stacks/substitutions.schema.json` | `stacks/substitutions@1.md` |
272
+ | **techniques** | 1 | — | — | `stacks/techniques.schema.json` | `stacks/techniques@1.md` |
273
+ | **timed** | 1 | structured | timed | `stacks/timed.schema.json` | `stacks/timed@1.md` |
274
+
275
+ <!-- END GENERATED: STACK REGISTRY -->
@@ -0,0 +1 @@
1
+ 0.0.2
package/SPEC.md ADDED
@@ -0,0 +1,226 @@
1
+ # Soustack Specification
2
+
3
+ ## 1. Scope and Purpose
4
+
5
+ Soustack is an open specification for representing recipes as structured, interoperable, and progressively computable data.
6
+
7
+ The primary design goal of this specification is **universal adoption**: recipes should be publishable with minimal friction, while enabling increasingly powerful capabilities (scaling, timing, scheduling, visualization) as structure is added.
8
+
9
+ Soustack achieves this by defining:
10
+
11
+ * a small, stable core document shape
12
+ * **Profiles** as human-facing conformance targets
13
+ * **Stacks** as machine-enforced capability requirements
14
+ * semantic validation rules that ensure interoperability beyond JSON Schema alone
15
+
16
+ This document is **normative** unless otherwise noted.
17
+
18
+ ---
19
+
20
+ ## 2. Terminology
21
+
22
+ * **Document**: A JSON object conforming to the Soustack root schema.
23
+ * **Profile**: A named, human-facing conformance target describing what a consumer may rely on.
24
+ * **Stack**: A declared capability that activates additional structural and/or semantic requirements.
25
+ * **Conformance**: Passing both schema validation and all required semantic checks.
26
+ * **Badge**: A derived, informative label emitted by tooling based on observed conformance.
27
+
28
+ ---
29
+
30
+ ## 3. Profiles (Normative)
31
+
32
+ Profiles are the **primary public contract** of the Soustack specification.
33
+
34
+ A Profile defines a bundle of requirements expressed in terms of:
35
+
36
+ * required `stacks`
37
+ * required semantic validation rules
38
+
39
+ Profiles support an **adoption ladder**: publishers can start at **Lite** with minimal structure, move to **Base** by adding `yield` and `time`, and then opt into stack-backed profiles like **Timed**, **Scalable**, or **Illustrated** as they add structure—without changing the overall document shape.
40
+
41
+ ### 3.1 Profile Declaration
42
+
43
+ * A document MAY declare a profile explicitly using a top-level `profile` field. The field is OPTIONAL; omission MUST NOT change document validity.
44
+ * Tools MAY infer the profile from declared `stacks` and required core fields when `profile` is absent.
45
+ * `profile` is a single primary claim (no arrays or multi-profile declarations).
46
+ * If a document declares both a `profile` and explicit `stacks`, they MUST NOT contradict. Contradictions MUST be treated as non-conformant.
47
+
48
+ ### 3.2 Stack Semantics
49
+
50
+ If a document declares a stack in the `stacks` map (e.g., `"stacks": { "timed": 1 }`), it MUST satisfy all requirements of that stack as defined by this specification.
51
+
52
+ Stacks that impose no additional structural or semantic requirements are not permitted in future major versions.
53
+
54
+ ---
55
+
56
+ ## 4. Profile Definitions
57
+
58
+ ### Profile: Lite
59
+
60
+ **Purpose:** Lowest-friction publishing and ingestion.
61
+
62
+ **Requirements**
63
+
64
+ * No additional requirements beyond the core schema.
65
+
66
+ **Guarantees**
67
+
68
+ * Valid Soustack container structure.
69
+ * Ingredients and instructions MAY be unstructured strings.
70
+
71
+ ---
72
+
73
+ ### Profile: Base
74
+
75
+ **Purpose:** Minimum cookable baseline.
76
+
77
+ **Requirements**
78
+
79
+ * `yield` and `time` MUST be present.
80
+
81
+ **Guarantees**
82
+
83
+ * Document includes `yield` and `time`.
84
+
85
+ ---
86
+
87
+ ### Profile: Illustrated
88
+
89
+ **Purpose:** Visually rich, embeddable recipes.
90
+
91
+ **Requirements**
92
+
93
+ * `stacks.illustrated` MUST be `1`.
94
+
95
+ **Semantic Requirements**
96
+
97
+ * At least one media item MUST be present at the recipe or step level.
98
+
99
+ ---
100
+
101
+ ### Profile: Equipped
102
+
103
+ **Purpose:** Declare required tools/equipment.
104
+
105
+ **Requirements**
106
+
107
+ * `stacks.equipment` MUST be `1`.
108
+
109
+ ---
110
+
111
+ ### Profile: Prepped
112
+
113
+ **Purpose:** Prep guidance and/or mise en place tasks.
114
+
115
+ **Requirements**
116
+
117
+ * `stacks.prep` MUST be `1`.
118
+
119
+ ---
120
+
121
+ ### Profile: Timed
122
+
123
+ **Purpose:** Step-level timing.
124
+
125
+ **Requirements**
126
+
127
+ * `stacks.structured` MUST be `1` and `stacks.timed` MUST be `1`.
128
+
129
+ ---
130
+
131
+ ### Profile: Scalable
132
+
133
+ **Purpose:** Interoperable scaling.
134
+
135
+ **Requirements**
136
+
137
+ * `stacks.quantified` MUST be `1` and `stacks.scaling` MUST be `1`.
138
+
139
+ **Semantic Requirements**
140
+
141
+ * Baker's percentage references MUST resolve to declared ingredient ids.
142
+ * Discrete scaling ranges MUST have `min` less than or equal to `max`.
143
+
144
+ ---
145
+
146
+ ## 5. Stacks
147
+
148
+ Stacks define capability-specific structural and semantic requirements. Each stack is versioned and defined in its own schema and documentation.
149
+
150
+ High-value optional stacks include `equipment@1` for declaring required equipment with scaling-aware counts and step-level usage references.
151
+
152
+ ---
153
+
154
+ ## 6. Semantic Validation
155
+
156
+ In addition to schema validation, conforming tools MUST enforce semantic rules, including but not limited to:
157
+
158
+ * ID uniqueness
159
+ * Reference resolution
160
+ * Dependency graph acyclicity
161
+ * Timing coherence
162
+
163
+ ---
164
+
165
+ ## 7. Derived Badges (Informative)
166
+
167
+ Validators MAY emit derived badges such as:
168
+
169
+ * **Computable**
170
+ * **Scalable**
171
+
172
+ Badges are informative and do not replace profile conformance.
173
+
174
+ ---
175
+
176
+ ## 8. Versioning
177
+
178
+ This specification uses semantic versioning. Schema identifiers and conformance rules are versioned and MUST be treated as immutable once published.
179
+
180
+ ---
181
+
182
+ ## 9. Non-Normative Notes
183
+
184
+ Non-normative guidance, examples, and adoption notes MAY be published separately and are not part of this specification.
185
+
186
+ ### 9.1 Legacy Namespace
187
+
188
+ **Note:** This section is non-normative.
189
+
190
+ The canonical host for Soustack schema identifiers and references is `https://spec.soustack.org`. The previous host `https://soustack.spec` is legacy and MUST NOT be used for new identifiers or references. Implementations should use `https://spec.soustack.org` for all schema resolution and validation.
191
+
192
+
193
+
194
+ <!-- BEGIN GENERATED: STACK REGISTRY -->
195
+
196
+ ## Profiles
197
+
198
+ | Profile | Requires Profiles | Requires Stacks | Description |
199
+ | ------- | ---------------- | -------------- | ----------- |
200
+ | **Base** | lite | — | Minimum cookable baseline with yield + time |
201
+ | **Equipped** | base | equipment | Recipe declares required tools/equipment. |
202
+ | **Illustrated** | base | illustrated | Media present |
203
+ | **Lite** | — | — | Lowest-friction publishing with minimal structure |
204
+ | **Prepped** | base | prep | Recipe includes prep guidance and/or mise en place tasks. |
205
+ | **Scalable** | base | quantified, scaling | Quantified + scaling |
206
+ | **Timed** | base | structured, timed | Structured + timed |
207
+
208
+ ## Stacks
209
+
210
+ | Stack ID | Latest Major | Requires | Required by Profiles | Schema | Docs |
211
+ | -------- | ----------- | -------- | -------------------- | ------ | ---- |
212
+ | **compute** | 1 | quantified, timed | — | `stacks/compute.schema.json` | `stacks/compute@1.md` |
213
+ | **dietary** | 1 | — | — | `stacks/dietary.schema.json` | `stacks/dietary@1.md` |
214
+ | **equipment** | 1 | — | equipped | `stacks/equipment.schema.json` | `stacks/equipment@1.md` |
215
+ | **illustrated** | 1 | — | illustrated | `stacks/illustrated.schema.json` | `stacks/illustrated@1.md` |
216
+ | **prep** | 1 | — | prepped | `stacks/prep.schema.json` | `stacks/prep@1.md` |
217
+ | **quantified** | 1 | — | scalable | `stacks/quantified.schema.json` | `stacks/quantified@1.md` |
218
+ | **referenced** | 1 | structured | — | `stacks/referenced.schema.json` | `stacks/referenced@1.md` |
219
+ | **scaling** | 1 | quantified | scalable | `stacks/scaling.schema.json` | `stacks/scaling@1.md` |
220
+ | **storage** | 1 | — | — | `stacks/storage.schema.json` | `stacks/storage@1.md` |
221
+ | **structured** | 1 | — | timed | `stacks/structured.schema.json` | `stacks/structured@1.md` |
222
+ | **substitutions** | 1 | referenced | — | `stacks/substitutions.schema.json` | `stacks/substitutions@1.md` |
223
+ | **techniques** | 1 | — | — | `stacks/techniques.schema.json` | `stacks/techniques@1.md` |
224
+ | **timed** | 1 | structured | timed | `stacks/timed.schema.json` | `stacks/timed@1.md` |
225
+
226
+ <!-- END GENERATED: STACK REGISTRY -->
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://spec.soustack.org/defs/common.schema.json",
4
+ "title": "Common definitions for Soustack",
5
+ "type": "object",
6
+ "properties": {
7
+ "stackId": {
8
+ "type": "string",
9
+ "anyOf": [
10
+ {
11
+ "enum": [
12
+ "quantified@1",
13
+ "structured@1",
14
+ "timed@1",
15
+ "referenced@1",
16
+ "compute@1",
17
+ "storage@1",
18
+ "dietary@1",
19
+ "substitutions@1",
20
+ "techniques@1",
21
+ "illustrated@1",
22
+ "scaling@1",
23
+ "nutrition@1"
24
+ ]
25
+ },
26
+ {
27
+ "pattern": "^x-[A-Za-z0-9_-]+@[0-9]+$",
28
+ "description": "Extension stacks must use x- prefix and include a major version"
29
+ }
30
+ ]
31
+ },
32
+ "extensionLane": {
33
+ "type": "string",
34
+ "pattern": "^x-[A-Za-z0-9_-]+$"
35
+ },
36
+ "extensionLaneValue": {
37
+ "description": "Accept any JSON value for extension lanes while keeping the top-level property name constrained.",
38
+ "type": ["object", "array", "string", "number", "boolean", "null"]
39
+ },
40
+ "uri": {
41
+ "type": "string",
42
+ "format": "uri"
43
+ }
44
+ },
45
+ "additionalProperties": false
46
+ }