@stravica-ai/rcf-schemas 0.2.0

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 (82) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +202 -0
  3. package/README.md +165 -0
  4. package/docs/README.md +37 -0
  5. package/docs/adr.md +42 -0
  6. package/docs/build-sequence.md +44 -0
  7. package/docs/common.md +43 -0
  8. package/docs/fbs.md +75 -0
  9. package/docs/file-layout.md +62 -0
  10. package/docs/id-conventions.md +60 -0
  11. package/docs/manifest.md +70 -0
  12. package/docs/prd.md +64 -0
  13. package/docs/req.md +57 -0
  14. package/docs/tac.md +49 -0
  15. package/docs/tad.md +76 -0
  16. package/docs/test-suite.md +56 -0
  17. package/docs/user-story.md +61 -0
  18. package/fixtures/invalid/adr/adr-001-authoring-status.json +13 -0
  19. package/fixtures/invalid/adr/adr-002-supersededBy-bad-id.json +14 -0
  20. package/fixtures/invalid/adr/adr-003-missing-tadId.json +12 -0
  21. package/fixtures/invalid/build-sequence/bs-001-legacy-fbs-array.json +11 -0
  22. package/fixtures/invalid/build-sequence/bs-002-missing-prdId.json +7 -0
  23. package/fixtures/invalid/fbs/fbs-001-storyScope-wrapper.json +16 -0
  24. package/fixtures/invalid/fbs/fbs-002-empty-acIds.json +13 -0
  25. package/fixtures/invalid/fbs/fbs-003-authoring-status.json +13 -0
  26. package/fixtures/invalid/fbs/fbs-004-plain-int-acId.json +13 -0
  27. package/fixtures/invalid/fbs/fbs-005-missing-buildOrder.json +12 -0
  28. package/fixtures/invalid/fbs/fbs-006-buildOrder-zero.json +13 -0
  29. package/fixtures/invalid/manifest/manifest-001-userStories-array.json +10 -0
  30. package/fixtures/invalid/manifest/manifest-002-legacy-buildSequence.json +7 -0
  31. package/fixtures/invalid/manifest/manifest-003-wrong-version.json +7 -0
  32. package/fixtures/invalid/prd/prd-001-typoed-status.json +10 -0
  33. package/fixtures/invalid/prd/prd-002-legacy-requirementIds.json +11 -0
  34. package/fixtures/invalid/prd/prd-003-missing-objectives.json +9 -0
  35. package/fixtures/invalid/req/req-001-bad-prefix.json +13 -0
  36. package/fixtures/invalid/req/req-002-unknown-category.json +13 -0
  37. package/fixtures/invalid/req/req-003-missing-prdId.json +12 -0
  38. package/fixtures/invalid/tac/tac-001-empty-responsibilities.json +12 -0
  39. package/fixtures/invalid/tac/tac-002-bad-dependency-kind.json +15 -0
  40. package/fixtures/invalid/tac/tac-003-missing-tadId.json +11 -0
  41. package/fixtures/invalid/tad/tad-001-legacy-componentIds.json +16 -0
  42. package/fixtures/invalid/tad/tad-002-partial-deployment.json +17 -0
  43. package/fixtures/invalid/test-suite/ts-001-missing-usId.json +18 -0
  44. package/fixtures/invalid/test-suite/ts-002-empty-acIds.json +19 -0
  45. package/fixtures/invalid/test-suite/ts-003-bad-tc-id.json +19 -0
  46. package/fixtures/invalid/test-suite/ts-004-bad-tc-status.json +19 -0
  47. package/fixtures/invalid/test-suite/ts-005-bad-test-level.json +12 -0
  48. package/fixtures/invalid/user-story/us-001-empty-acs.json +14 -0
  49. package/fixtures/invalid/user-story/us-002-ac-missing-testable.json +19 -0
  50. package/fixtures/valid/adr/adr-001-minimal.json +13 -0
  51. package/fixtures/valid/adr/adr-002-comprehensive.json +27 -0
  52. package/fixtures/valid/adr/adr-003-draft-status.json +13 -0
  53. package/fixtures/valid/build-sequence/bs-001-minimal.json +8 -0
  54. package/fixtures/valid/build-sequence/bs-002-comprehensive.json +11 -0
  55. package/fixtures/valid/fbs/fbs-001-minimal.json +13 -0
  56. package/fixtures/valid/fbs/fbs-002-comprehensive.json +34 -0
  57. package/fixtures/valid/manifest/manifest-001-minimal.json +7 -0
  58. package/fixtures/valid/manifest/manifest-002-with-description.json +8 -0
  59. package/fixtures/valid/prd/prd-001-minimal.json +12 -0
  60. package/fixtures/valid/prd/prd-002-comprehensive.json +34 -0
  61. package/fixtures/valid/req/req-001-minimal.json +13 -0
  62. package/fixtures/valid/req/req-002-comprehensive.json +15 -0
  63. package/fixtures/valid/tac/tac-001-minimal.json +15 -0
  64. package/fixtures/valid/tac/tac-002-comprehensive.json +49 -0
  65. package/fixtures/valid/tad/tad-001-minimal.json +14 -0
  66. package/fixtures/valid/tad/tad-002-comprehensive.json +71 -0
  67. package/fixtures/valid/test-suite/ts-001-minimal.json +19 -0
  68. package/fixtures/valid/test-suite/ts-002-comprehensive.json +32 -0
  69. package/fixtures/valid/user-story/us-001-minimal.json +20 -0
  70. package/fixtures/valid/user-story/us-002-hierarchical-acs.json +40 -0
  71. package/package.json +44 -0
  72. package/schemas/adr.schema.json +58 -0
  73. package/schemas/build-sequence.schema.json +22 -0
  74. package/schemas/common.schema.json +103 -0
  75. package/schemas/fbs.schema.json +90 -0
  76. package/schemas/manifest.schema.json +17 -0
  77. package/schemas/prd.schema.json +49 -0
  78. package/schemas/req.schema.json +39 -0
  79. package/schemas/tac.schema.json +73 -0
  80. package/schemas/tad.schema.json +162 -0
  81. package/schemas/test-suite.schema.json +61 -0
  82. package/schemas/user-story.schema.json +56 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,62 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@stravica-ai/rcf-schemas` are documented in this file.
4
+
5
+ The format roughly follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Pre-1.0 breaking changes are signalled by a minor bump per semver 0.x convention.
6
+
7
+ ## 0.2.0 (2026-07-02)
8
+
9
+ Structural rework of every parent-child relationship in the RCF chain: each edge is now encoded exactly once, on the child, as a mandatory `<parent>Id` field. Parents no longer store child lists; walkers invert the child references at load time to build the `childrenByParent` map. This makes tree drift structurally impossible.
10
+
11
+ Package moves from GitHub Packages (private, `@stravica` scope) to the public npm registry as `@stravica-ai/rcf-schemas`. The `Stravica/rcf-schemas` and `Stravica/rcf-examples` repositories are made public alongside this release.
12
+
13
+ ### Breaking changes
14
+
15
+ - **Package name** renamed from `@stravica/rcf-schemas` to `@stravica-ai/rcf-schemas`.
16
+ - **Publish target** moved from GitHub Packages to the public npm registry.
17
+ - **Canonical `$id`** URLs bumped from `https://schemas.stravica.io/rcf/v0.1.0/...` to `https://schemas.stravica.io/rcf/v0.2.0/...` on every schema.
18
+ - **`prd.schema.json`**: `requirementIds` removed. REQ carries the mandatory `prdId` back-reference (already present in 0.1.0; now the sole edge).
19
+ - **`tad.schema.json`**: `componentIds` and `architecturalDecisionIds` removed. TAC and ADR each carry the mandatory `tadId` back-reference (already present in 0.1.0; now the sole edges).
20
+ - **`build-sequence.schema.json`**: `fbs[]` array removed. FBS now carries `bsId`, `buildOrder`, `executionStatus`, and `dependsOnFbsIds[]`.
21
+ - **`fbs.schema.json`**:
22
+ - Renamed `status` to `executionStatus` (same enum; new name makes the intent explicit and disambiguates from authoring status).
23
+ - Renamed `dependencies` to `dependsOnFbsIds` (same shape, mandatory with `minItems: 0`).
24
+ - New mandatory `buildOrder` integer (>= 1); duplicates within a BS are a walker-time validation error.
25
+ - **`test-suite.schema.json`**: rewritten to the 0.2.0 shape:
26
+ - New fields: `id` (`TS-\d{3}`), `usId`, `title`, `purpose`, `testLevel` (`unit` | `integration` | `e2e` | `contract` | `manual`), `acIds[]` (mandatory, >= 1), `status` (authoring status).
27
+ - Inline `testCases[]` with per-TC `id` (`TC-\d{3}-<slug>`), `acId`, `description`, optional `testPointer`, and `status` (`pending` | `passing` | `failing` | `skipped`).
28
+ - Removed the 0.1.0 fields `acId`, `prdId`, `version`, and the `given/when/then` TC shape.
29
+
30
+ ### Added
31
+
32
+ - **`common.schema.json`**:
33
+ - `adrStatus` enum gains `draft` (prepended); enum is now `["draft", "proposed", "accepted", "superseded", "deprecated"]`.
34
+ - New `$defs.tsId` (`^TS-\d{3}$`) and updated `$defs.tcId` (`^TC-\d{3}-[a-z0-9-]+$`) - the TC pattern now requires a slug suffix.
35
+ - Targeted per-schema test files (`test/prd.test.js`, `test/req.test.js`, `test/tad.test.js`, `test/tac.test.js`, `test/adr.test.js`, `test/build-sequence.test.js`, `test/fbs.test.js`, `test/test-suite.test.js`) covering the 0.2.0 shape changes. Fixture coverage broadened to match.
36
+
37
+ ### Migration
38
+
39
+ Consumers on 0.1.0 must run the tree-migration script that ships with `Stravica/rcf-build-lite`'s Phase 3.7 walker rewrite. In summary:
40
+
41
+ - Drop `PRD.requirementIds`. REQ files already carry `prdId`.
42
+ - Add `REQ.prdId` if missing (mandatory in 0.2.0).
43
+ - Drop `TAD.componentIds` and `TAD.architecturalDecisionIds`. TAC and ADR files already carry `tadId`.
44
+ - Drop `BS.fbs[]`. For each FBS in the old array, on the corresponding FBS file set `bsId`, `buildOrder` (from the slot's `order`), `executionStatus` (from the slot's `status`), and `dependsOnFbsIds` (defaults to `[]`).
45
+ - Rename any existing `FBS.status` to `FBS.executionStatus` and any `FBS.dependencies` to `FBS.dependsOnFbsIds`.
46
+ - Rewrite any existing `test-suite/*.json` to the new shape (one TS per US, with inline TCs).
47
+
48
+ The build-lite Phase 3.7 PR carries a `scripts/migrate-to-0.2.0.js` that performs this deterministically for a dogfood tree.
49
+
50
+ ## 0.1.0 (initial release)
51
+
52
+ The first private release of the RCF JSON Schema bundle.
53
+
54
+ - 11 schema files in `schemas/`: `common`, `prd`, `req`, `user-story`, `tad`, `tac`, `adr`, `build-sequence`, `fbs`, `test-suite`, `manifest`.
55
+ - Per-schema docs in `docs/` (one page per schema) plus cross-cutting `id-conventions.md` and `file-layout.md`.
56
+ - JSON test fixtures in `fixtures/valid/` and `fixtures/invalid/` covering every schema.
57
+ - Strict by default (`additionalProperties: false`) on every object schema.
58
+ - Cross-file `$ref` via `common.schema.json`: shared id patterns, status enums, version string, timestamp format, and `docRef` shape live in one place.
59
+ - Canonical `$id` URLs (`https://schemas.stravica.io/rcf/v0.1.0/<name>.schema.json`) declared from the first release; the host goes live at Phase 9.
60
+ - Apache 2.0 license.
61
+
62
+ Published as `@stravica/rcf-schemas@0.1.0` on GitHub Packages with `--access restricted` (private during the build phase; public flip in 0.2.0 alongside the npm move).
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Stravica
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,165 @@
1
+ # @stravica-ai/rcf-schemas
2
+
3
+ JSON Schemas for the [Requirements Confidence Framework (RCF)](https://stravica.ai/rcf-methodology/).
4
+
5
+ **Language-neutral. No code in this package, only schema files, docs, and fixtures.** Every consumer language is first-class: Node, Python, Java, or anything else with a JSON Schema 2020-12 validator.
6
+
7
+ > **Status:** v0.2.0 - public preview.
8
+ >
9
+ > This package is available on the public npm registry as a preview. Ship-quality contract, small consumer surface. The methodology's reference implementation (`Stravica/rcf-build-lite`) is being migrated to consume 0.2.0 during Phase 3.7 of the RCF build and stays private until Phase 9; expect the public consumer path to sharpen up as that lands. If you want to experiment, `npm install @stravica-ai/rcf-schemas` is stable; docs at `https://schemas.stravica.io/` land at Phase 9.
10
+
11
+ ## What's here
12
+
13
+ - **11 schema files** in `schemas/`:
14
+ - `common.schema.json` - shared `$defs` (id patterns, status enums, version, timestamp, `docRef`). Referenced via `$ref` from every other schema.
15
+ - `prd`, `req`, `user-story`, `tad`, `tac`, `adr`, `build-sequence`, `fbs`, `test-suite`, `manifest`.
16
+ - **Per-schema docs** in `docs/` (one page per schema) plus cross-cutting `id-conventions.md` and `file-layout.md`.
17
+ - **JSON test fixtures** in `fixtures/valid/` and `fixtures/invalid/` (every schema covered).
18
+ - **CHANGELOG** in `CHANGELOG.md`.
19
+
20
+ ## Install
21
+
22
+ ### Node consumers
23
+
24
+ ```sh
25
+ npm install @stravica-ai/rcf-schemas
26
+ ```
27
+
28
+ The package is on the public npm registry. No scope-registry configuration is needed for installation.
29
+
30
+ ### Python consumers (Phase 9 onwards)
31
+
32
+ ```sh
33
+ pip install stravica-rcf-schemas
34
+ ```
35
+
36
+ ### Java consumers (Phase 9 onwards)
37
+
38
+ Maven coordinate:
39
+
40
+ ```
41
+ io.stravica.rcf:rcf-schemas:0.2.0
42
+ ```
43
+
44
+ ### Direct fetch (Phase 9 onwards)
45
+
46
+ Each schema is fetchable by its canonical `$id`:
47
+
48
+ ```
49
+ https://schemas.stravica.io/rcf/v0.2.0/<name>.schema.json
50
+ ```
51
+
52
+ ## Use
53
+
54
+ The schemas use cross-file `$ref` into `common.schema.json`. Register the bundle once at validator init; after that `$ref` resolution is transparent.
55
+
56
+ ### Node + ajv
57
+
58
+ ```js
59
+ import Ajv from 'ajv/dist/2020.js';
60
+ import addFormats from 'ajv-formats';
61
+ import { readFile } from 'node:fs/promises';
62
+ import { createRequire } from 'node:module';
63
+
64
+ const require = createRequire(import.meta.url);
65
+ const pkgRoot = require.resolve('@stravica-ai/rcf-schemas/package.json').replace(/\/package\.json$/, '');
66
+
67
+ const names = [
68
+ 'common', 'prd', 'req', 'user-story', 'tad', 'tac', 'adr',
69
+ 'build-sequence', 'fbs', 'test-suite', 'manifest'
70
+ ];
71
+
72
+ const ajv = new Ajv({ strict: true, allErrors: true });
73
+ addFormats(ajv);
74
+
75
+ for (const name of names) {
76
+ const schema = JSON.parse(await readFile(`${pkgRoot}/schemas/${name}.schema.json`, 'utf8'));
77
+ ajv.addSchema(schema);
78
+ }
79
+
80
+ const validatePrd = ajv.getSchema('https://schemas.stravica.io/rcf/v0.2.0/prd.schema.json');
81
+ const ok = validatePrd(myPrdDoc);
82
+ if (!ok) console.error(validatePrd.errors);
83
+ ```
84
+
85
+ ### Python + jsonschema
86
+
87
+ ```python
88
+ from importlib.resources import files
89
+ from jsonschema import Draft202012Validator
90
+ from referencing import Registry, Resource
91
+ import json
92
+
93
+ # Phase 9: pip install stravica-rcf-schemas
94
+ pkg = files('stravica_rcf_schemas') / 'schemas'
95
+
96
+ names = [
97
+ 'common', 'prd', 'req', 'user-story', 'tad', 'tac', 'adr',
98
+ 'build-sequence', 'fbs', 'test-suite', 'manifest'
99
+ ]
100
+
101
+ resources = []
102
+ for name in names:
103
+ schema = json.loads((pkg / f'{name}.schema.json').read_text())
104
+ resources.append((schema['$id'], Resource.from_contents(schema)))
105
+
106
+ registry = Registry().with_resources(resources)
107
+ prd_schema = json.loads((pkg / 'prd.schema.json').read_text())
108
+ validator = Draft202012Validator(prd_schema, registry=registry)
109
+ errors = list(validator.iter_errors(my_prd_doc))
110
+ ```
111
+
112
+ ### Java + everit-json-schema or networknt/json-schema-validator
113
+
114
+ Configure a `SchemaClient` (everit) or `SchemaLoader` (networknt) that resolves `$id` URLs from a local map populated from the bundled schemas on the classpath. See your validator's docs for the exact recipe; both libraries support multi-file `$ref` for JSON Schema 2020-12.
115
+
116
+ ### Any other language
117
+
118
+ The schemas use JSON Schema Draft 2020-12. Any validator that supports 2020-12 + multi-file `$ref` will work. Register the 11 schemas (with `common.schema.json` first) and resolve by `$id`.
119
+
120
+ ## Chain shape (0.2.0)
121
+
122
+ Every parent-child edge in the RCF chain is encoded exactly once, on the child, as a mandatory `<parent>Id` field. Parents never store child lists; walkers invert the child references at load time to build the `childrenByParent` map. This makes tree drift structurally impossible.
123
+
124
+ - PRD is the root of the requirements chain. REQ carries `prdId`.
125
+ - US carries `reqId` (unchanged from 0.1.0). AC lives inline in US as `acceptanceCriteria[]`.
126
+ - TAD is the root of the architecture chain. TAC and ADR each carry `tadId`.
127
+ - BS is the root of the build-sequence chain. FBS carries `bsId`, `buildOrder`, `executionStatus`, and `dependsOnFbsIds[]`.
128
+ - TS carries `usId` and `acIds[]` (the ACs verified). TC lives inline in TS with per-TC `acId`.
129
+
130
+ ## Schema reference
131
+
132
+ Per-schema docs in [`docs/`](./docs/README.md):
133
+
134
+ - [common](./docs/common.md) | [prd](./docs/prd.md) | [req](./docs/req.md) | [user-story](./docs/user-story.md)
135
+ - [tad](./docs/tad.md) | [tac](./docs/tac.md) | [adr](./docs/adr.md)
136
+ - [build-sequence](./docs/build-sequence.md) | [fbs](./docs/fbs.md) | [test-suite](./docs/test-suite.md)
137
+ - [manifest](./docs/manifest.md)
138
+
139
+ Cross-cutting:
140
+
141
+ - [id-conventions](./docs/id-conventions.md) - the `^<PREFIX>-\d{3,}$` pattern, prefix table, hierarchical AC ids.
142
+ - [file-layout](./docs/file-layout.md) - recommended `rcf/` tree (not enforced).
143
+
144
+ ## What's deliberately NOT shipped
145
+
146
+ The schemas repo is intentionally narrow:
147
+
148
+ - **No validator CLI.** Pick the JSON Schema validator native to your language.
149
+ - **No language-specific consumer SDKs or wrappers.**
150
+ - **No cross-document reference validation.** That's traceability tooling (Phase 5 of `rcf-build-lite`).
151
+ - **No status derivation from runtime evidence.** TS/TC pass/fail is runtime state, derived by traceability tooling.
152
+ - **No file-layout enforcement.** Recommendations live in `docs/file-layout.md`; the schemas describe documents, not where they sit on disk.
153
+ - **No SDD adapter.** The `rcf build <fbs-id>` markdown-assembly logic lives in `rcf-build-lite` (Phase 6 of that project), not here.
154
+
155
+ ## Versioning
156
+
157
+ Pre-1.0 (0.x): breaking changes are signalled by a minor bump (`0.1.0` -> `0.2.0`) per semver 0.x convention. Patch bumps are additive only.
158
+
159
+ Post-1.0: breaking changes require a documented migration path.
160
+
161
+ See [CHANGELOG.md](./CHANGELOG.md).
162
+
163
+ ## License
164
+
165
+ Apache 2.0, see [LICENSE](./LICENSE).
package/docs/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # RCF Schemas docs
2
+
3
+ Per-schema reference + cross-cutting conventions for `@stravica-ai/rcf-schemas`.
4
+
5
+ ## Per-schema pages
6
+
7
+ One page per schema file under `schemas/`.
8
+
9
+ - [common](./common.md) - shared `$defs` referenced from every other schema.
10
+ - [prd](./prd.md) - Product Requirements Document (shell).
11
+ - [req](./req.md) - individual Requirement.
12
+ - [user-story](./user-story.md) - User Story with inline Acceptance Criteria.
13
+ - [tad](./tad.md) - master Technical Architecture Document.
14
+ - [tac](./tac.md) - Technical Architecture Component.
15
+ - [adr](./adr.md) - Architectural Decision Record.
16
+ - [build-sequence](./build-sequence.md) - ordered FBS plan.
17
+ - [fbs](./fbs.md) - Functional Build Specification.
18
+ - [test-suite](./test-suite.md) - Test Suite for a single AC.
19
+ - [manifest](./manifest.md) - project roots-only manifest.
20
+
21
+ ## Cross-cutting
22
+
23
+ - [id-conventions](./id-conventions.md) - the `^<PREFIX>-\d{3,}$` pattern, prefix table, hierarchical AC ids, and the file/nested asymmetry.
24
+ - [file-layout](./file-layout.md) - recommended `rcf/` tree, with TS files outside it (code-adjacent).
25
+
26
+ ## Out of scope (deliberately)
27
+
28
+ What lives elsewhere:
29
+
30
+ - No validator CLI ships from this repo. Use the JSON Schema validator native to your language.
31
+ - No language-specific consumer SDKs or wrappers.
32
+ - No cross-document reference validation (Phase 5 traceability tooling territory).
33
+ - No status derivation from runtime test evidence (Phase 5 traceability).
34
+ - No file-layout enforcement (the schemas describe documents, not where they sit on disk).
35
+ - No SDD adapter (Phase 6 of `rcf-build-lite`).
36
+
37
+ See the top-level [README](../README.md) for install and consumer-setup guidance across Node, Python, and Java.
package/docs/adr.md ADDED
@@ -0,0 +1,42 @@
1
+ # adr.schema.json
2
+
3
+ Architectural Decision Record. One per decision, one file each. Follows the Nygard convention (and MADR variant).
4
+
5
+ ## Canonical `$id`
6
+
7
+ `https://schemas.stravica.io/rcf/v0.2.0/adr.schema.json`
8
+
9
+ ## Required fields
10
+
11
+ | Field | Type | Notes |
12
+ |---|---|---|
13
+ | `adrId` | `^ADR-\d{3,}$` | This ADR's identifier. |
14
+ | `prdId` | `^PRD-\d{3,}$` | Root PRD. |
15
+ | `tadId` | `^TAD-\d{3,}$` | Parent TAD. |
16
+ | `version` | semver | Per-document version. |
17
+ | `status` | `adrStatus` enum: `draft`, `proposed`, `accepted`, `superseded`, `deprecated` | ADR-specific lifecycle. `draft` prepended in 0.2.0 for pre-proposal work-in-progress. |
18
+ | `title` | string, min 1 | One-line decision title. |
19
+ | `context` | string, min 1 | The situation that forced the decision. |
20
+ | `decision` | string, min 1 | The decision itself. |
21
+ | `consequences` | string, min 1 | What follows from it (positive and negative). |
22
+ | `createdAt` / `updatedAt` | ISO 8601 date-time | Lifecycle timestamps. |
23
+
24
+ ## Optional fields
25
+
26
+ | Field | Type | Purpose |
27
+ |---|---|---|
28
+ | `alternativesConsidered` | array of `alternative` | The MADR extension. |
29
+ | `supersededBy` | `adrId` | When status is `superseded`, point at the ADR that replaced this. |
30
+ | `relatedAdrs` | array of `adrId` | Cross-links between related decisions. |
31
+
32
+ ## Status enum (different from the authoring-status used by other docs)
33
+
34
+ ADRs don't go through `draft -> review -> needsRevision -> approved`. They're optionally `draft` (pre-proposal notes), then `proposed`, then `accepted`, then potentially `superseded` (by a later decision) or `deprecated` (the area itself went away). This is intentional: the Nygard / MADR convention is widely understood and worth following.
35
+
36
+ ## Why ADRs are one file each
37
+
38
+ Per-decision git history is the entire point. A decision evolves: it gets proposed, accepted, then years later superseded by a different decision. Squashing them into one big doc destroys that history and produces merge conflicts on every append. One file each: clean blame, clean supersession diff, append-friendly.
39
+
40
+ ## Example
41
+
42
+ See `fixtures/valid/adr/adr-002-comprehensive.json` for a `superseded` ADR with alternatives considered and a `supersededBy` link.
@@ -0,0 +1,44 @@
1
+ # build-sequence.schema.json
2
+
3
+ Build Sequence. One per project. Pure planning shell. FBS files each carry the mandatory `bsId` back-reference plus `buildOrder` and `executionStatus`. The walker computes the ordered FBS list by loading every FBS under `rcf/fbs/`, filtering by `bsId`, and sorting by `buildOrder`. Duplicate `buildOrder` values within one BS are a validation error at walker load time.
4
+
5
+ ## Canonical `$id`
6
+
7
+ `https://schemas.stravica.io/rcf/v0.2.0/build-sequence.schema.json`
8
+
9
+ ## Required fields
10
+
11
+ | Field | Type | Notes |
12
+ |---|---|---|
13
+ | `bsId` | `^BS-\d{3,}$` | This Build Sequence's identifier. |
14
+ | `prdId` | `^PRD-\d{3,}$` | Root PRD. |
15
+ | `version` | semver | Per-document version. |
16
+ | `status` | `authoringStatus` enum | Lifecycle status of the sequence itself. |
17
+ | `createdAt` / `updatedAt` | ISO 8601 date-time | Lifecycle timestamps. |
18
+
19
+ ## Optional top-level fields
20
+
21
+ | Field | Type | Purpose |
22
+ |---|---|---|
23
+ | `title` | string | Human-readable title for the sequence. |
24
+ | `buildPhilosophy` | string | One-paragraph "how we're going to attack this". |
25
+ | `generationStrategy` | enum: `verticalSlice`, `dependencyFirst`, `domainGrouped`, `riskFrontLoaded` | The strategy used to order FBS items. |
26
+
27
+ ## Ordering and execution status
28
+
29
+ Live on the FBS file, not on the BS. Each FBS carries:
30
+
31
+ - `bsId` - parent BS.
32
+ - `buildOrder` (integer >= 1) - position in the ordered sequence. Duplicates within one BS are a walker-time validation error.
33
+ - `executionStatus` - `notStarted`, `inProgress`, `complete`, `verified`.
34
+ - `dependsOnFbsIds[]` - other FBS ids this one depends on. Present on the derived (FBS) side; the walker inverts these into a dependents map at load time.
35
+
36
+ **No `fbs[]` array on the BS.** Removed in 0.2.0. This eliminates the sync burden between the BS slot and the FBS file and makes drift impossible by construction.
37
+
38
+ ## Why this minimum-viable shape
39
+
40
+ The BS exists to encode strategy and high-level context. Ordering, execution status, and dependencies live on the FBS file so that inserting, reordering, or deleting an FBS is a single-file edit. One source of truth, no drift risk.
41
+
42
+ ## Example
43
+
44
+ See `fixtures/valid/build-sequence/bs-002-comprehensive.json` for a BS with a `verticalSlice` strategy. FBS ordering examples: `fixtures/valid/fbs/`.
package/docs/common.md ADDED
@@ -0,0 +1,43 @@
1
+ # common.schema.json
2
+
3
+ Shared `$defs` referenced via `$ref` from every other RCF schema. ID patterns, status enums, version string, timestamp format, and the `docRef` shape live here. This file is not itself a document schema; consumers register it alongside the other 10 schemas at validator init.
4
+
5
+ ## Canonical `$id`
6
+
7
+ `https://schemas.stravica.io/rcf/v0.2.0/common.schema.json`
8
+
9
+ ## What's in `$defs`
10
+
11
+ | Name | Shape | Used by |
12
+ |---|---|---|
13
+ | `prdId` | string, `^PRD-\d{3,}$` | every schema that references a PRD |
14
+ | `reqId` | string, `^REQ-\d{3,}$` | `prd`, `req`, `user-story` |
15
+ | `usId` | string, `^US-\d{3,}$` | `user-story`, `test-suite` |
16
+ | `acId` | string, `^AC-\d{3,}(-\d+)?$` | `user-story.acceptanceCriteria[].id`, `fbs.acIds[]`, `test-suite.acId` |
17
+ | `tadId` | string, `^TAD-\d{3,}$` | `tad`, `tac`, `adr` |
18
+ | `tacId` | string, `^TAC-\d{3,}$` | `tac`, `fbs.contextRequirements.tacIds[]` |
19
+ | `adrId` | string, `^ADR-\d{3,}$` | `adr`, `fbs.contextRequirements.adrIds[]` |
20
+ | `bsId` | string, `^BS-\d{3,}$` | `build-sequence`, `fbs.bsId` |
21
+ | `fbsId` | string, `^FBS-\d{3,}$` | `fbs.fbsId`, `fbs.dependsOnFbsIds[]` |
22
+ | `tsId` | string, `^TS-\d{3}$` | `test-suite.id` |
23
+ | `tcId` | string, `^TC-\d{3}-[a-z0-9-]+$` | `test-suite.testCases[].id` |
24
+ | `version` | string, `^\d+\.\d+\.\d+$` | every doc-type schema |
25
+ | `timestamp` | string, format `date-time` | every doc-type schema |
26
+ | `authoringStatus` | enum: `draft`, `review`, `needsRevision`, `approved`, `superseded` | PRD, REQ, US, TAD, TAC, BS |
27
+ | `adrStatus` | enum: `draft`, `proposed`, `accepted`, `superseded`, `deprecated` | ADR |
28
+ | `executionStatus` | enum: `notStarted`, `inProgress`, `complete`, `verified` | FBS doc + BS slot |
29
+ | `docRef` | object `{ id, path }` | manifest `prd`, `tad`, `bs` |
30
+
31
+ ## Why these are shared
32
+
33
+ These types appear in many places and must stay identical. Inlining the patterns or enums in every schema would create a maintenance hazard, one edit becomes ten. The cross-file `$ref` setup eliminates that risk.
34
+
35
+ The trade-off is that consumers register the schema bundle once at validator init rather than per document. See the [top-level README](../README.md) for the language-by-language registration recipe.
36
+
37
+ ## What's not here
38
+
39
+ Per-doc-type enums (REQ `category`, REQ `priority`, FBS `riskLevel`, BS `generationStrategy`, etc.) stay local to their schema; they're not shared, so they don't earn a slot in `common`.
40
+
41
+ ## Version
42
+
43
+ Carried on the `$id` URL path segment (`/v0.2.0/`). Bumps in lock-step with the bundle.