@oscaner-skills/cdd-engine 1.0.0 → 3.0.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 (120) hide show
  1. package/README.md +11 -10
  2. package/README.zh-CN.md +11 -10
  3. package/package.json +16 -22
  4. package/src-next/__tests__/bin.test.ts +128 -0
  5. package/src-next/__tests__/dead-decl.guard.test.ts +39 -0
  6. package/src-next/__tests__/floor.guard.test.ts +69 -0
  7. package/src-next/__tests__/issue-body.guard.test.ts +66 -0
  8. package/src-next/__tests__/phase-suffix.guard.test.ts +72 -0
  9. package/src-next/__tests__/smoke.integration.test.ts +185 -0
  10. package/src-next/__tests__/support/strip-comments.ts +99 -0
  11. package/src-next/__tests__/zero-dep.test.ts +94 -0
  12. package/src-next/bin.ts +61 -0
  13. package/src-next/contract/__tests__/__snapshots__/project.schema.overall-spec.snap +256 -0
  14. package/src-next/contract/__tests__/__snapshots__/project.schema.phase-spec.snap +165 -0
  15. package/src-next/contract/__tests__/__snapshots__/project.schema.plan.snap +190 -0
  16. package/src-next/contract/__tests__/__snapshots__/project.schema.single-spec.snap +106 -0
  17. package/src-next/contract/__tests__/__snapshots__/project.shape.overall-spec.snap +240 -0
  18. package/src-next/contract/__tests__/__snapshots__/project.shape.phase-spec.snap +165 -0
  19. package/src-next/contract/__tests__/__snapshots__/project.shape.plan.snap +190 -0
  20. package/src-next/contract/__tests__/__snapshots__/project.shape.single-spec.snap +100 -0
  21. package/src-next/contract/__tests__/declare.test.ts +481 -0
  22. package/src-next/contract/__tests__/doc.test.ts +527 -0
  23. package/src-next/contract/__tests__/dockey.guard.test.ts +58 -0
  24. package/src-next/contract/__tests__/edge-conditions.guard.test.ts +81 -0
  25. package/src-next/contract/__tests__/frontmatter.test.ts +164 -0
  26. package/src-next/contract/__tests__/judge.test.ts +1111 -0
  27. package/src-next/contract/__tests__/lint.test.ts +324 -0
  28. package/src-next/contract/__tests__/project.test.ts +460 -0
  29. package/src-next/contract/__tests__/structure-pin.test.ts +186 -0
  30. package/src-next/contract/__tests__/translate.test.ts +96 -0
  31. package/src-next/contract/declare.ts +1071 -0
  32. package/src-next/contract/doc.ts +816 -0
  33. package/src-next/contract/frontmatter.ts +233 -0
  34. package/src-next/contract/home-extractors.ts +397 -0
  35. package/src-next/contract/invariants.ts +1413 -0
  36. package/src-next/contract/judge.ts +151 -0
  37. package/src-next/contract/lint.ts +239 -0
  38. package/src-next/contract/project.ts +656 -0
  39. package/src-next/contract/skill-anatomy.ts +301 -0
  40. package/src-next/contract/translate.ts +113 -0
  41. package/src-next/face/__tests__/board-view.test.ts +1151 -0
  42. package/src-next/face/__tests__/capsule.test.ts +300 -0
  43. package/src-next/face/__tests__/channel-closure.guard.test.ts +129 -0
  44. package/src-next/face/__tests__/cli.test.ts +4897 -0
  45. package/src-next/face/__tests__/face.test.ts +289 -0
  46. package/src-next/face/__tests__/graph-view.test.ts +61 -0
  47. package/src-next/face/__tests__/host.test.ts +24 -0
  48. package/src-next/face/__tests__/install-rows.guard.test.ts +58 -0
  49. package/src-next/face/__tests__/negation.ts +6 -0
  50. package/src-next/face/__tests__/preview.test.ts +374 -0
  51. package/src-next/face/__tests__/projection.test.ts +303 -0
  52. package/src-next/face/__tests__/repo-root.guard.test.ts +120 -0
  53. package/src-next/face/__tests__/termination.test.ts +650 -0
  54. package/src-next/face/__tests__/words.guard.test.ts +93 -0
  55. package/src-next/face/artifacts.ts +248 -0
  56. package/src-next/face/board-view.ts +652 -0
  57. package/src-next/face/capsule.ts +163 -0
  58. package/src-next/face/cli.ts +1028 -0
  59. package/src-next/face/declare.ts +323 -0
  60. package/src-next/face/gate.ts +171 -0
  61. package/src-next/face/graph-view.ts +74 -0
  62. package/src-next/face/host.ts +302 -0
  63. package/src-next/face/lifecycle.ts +725 -0
  64. package/src-next/face/preview.ts +151 -0
  65. package/src-next/face/projection.ts +285 -0
  66. package/src-next/face/route-render.ts +185 -0
  67. package/src-next/face/termination.ts +573 -0
  68. package/src-next/face/words.ts +314 -0
  69. package/src-next/infra/__tests__/infra.test.ts +333 -0
  70. package/src-next/infra/__tests__/root.test.ts +56 -0
  71. package/src-next/infra/config.ts +42 -0
  72. package/src-next/infra/doc-roots.ts +29 -0
  73. package/src-next/infra/git.ts +39 -0
  74. package/src-next/infra/process.ts +34 -0
  75. package/src-next/infra/root.ts +73 -0
  76. package/src-next/infra/runtime.ts +132 -0
  77. package/src-next/infra/workspace.ts +322 -0
  78. package/src-next/render/__tests__/render.test.ts +550 -0
  79. package/src-next/render/__tests__/skeleton.test.ts +684 -0
  80. package/src-next/render/brief.ts +121 -0
  81. package/src-next/render/issue-body.ts +162 -0
  82. package/src-next/render/skeleton.ts +502 -0
  83. package/src-next/render/templates.ts +645 -0
  84. package/src-next/session/__tests__/graph.test.ts +277 -0
  85. package/src-next/session/__tests__/handoff-plane.guard.test.ts +48 -0
  86. package/src-next/session/__tests__/handoff-schema.test.ts +310 -0
  87. package/src-next/session/__tests__/ledger.test.ts +745 -0
  88. package/src-next/session/__tests__/next.test.ts +460 -0
  89. package/src-next/session/__tests__/preflight.test.ts +545 -0
  90. package/src-next/session/__tests__/round-naming.test.ts +142 -0
  91. package/src-next/session/__tests__/run.test.ts +1026 -0
  92. package/src-next/session/__tests__/wave-line-phase.guard.test.ts +49 -0
  93. package/src-next/session/__tests__/wave.test.ts +476 -0
  94. package/src-next/session/faces.ts +110 -0
  95. package/src-next/session/graph.ts +411 -0
  96. package/src-next/session/handoff-schema.ts +373 -0
  97. package/src-next/session/ledger.ts +1076 -0
  98. package/src-next/session/next.ts +293 -0
  99. package/src-next/session/preflight.ts +271 -0
  100. package/src-next/session/round-naming.ts +84 -0
  101. package/src-next/session/run.ts +610 -0
  102. package/src-next/session/state.ts +30 -0
  103. package/src-next/session/wave.ts +139 -0
  104. package/templates/report/issue-body.json +17 -65
  105. package/dist/chunks/branch.mjs +0 -480
  106. package/dist/chunks/docs.mjs +0 -253
  107. package/dist/chunks/task.mjs +0 -913
  108. package/dist/cli.mjs +0 -5457
  109. package/dist/documents/schema/add-phase-protocol.json +0 -126
  110. package/dist/documents/schema/overall.json +0 -361
  111. package/dist/documents/schema/phase-spec.json +0 -145
  112. package/dist/documents/schema/plan.json +0 -191
  113. package/dist/documents/schema/skill-anatomy.json +0 -233
  114. package/dist/resources/harness-registry.json +0 -49
  115. package/dist/shared/cdd-engine.liioziig.mjs +0 -184
  116. package/templates/engine-config.json +0 -302
  117. package/templates/schema/cache-profile-schema.json +0 -23
  118. package/templates/schema/docs-handoff-schema.json +0 -129
  119. package/templates/schema/task-handoff-schema.json +0 -332
  120. package/templates/template-contract.json +0 -231
@@ -0,0 +1,256 @@
1
+ {
2
+ "docType": "overall-spec",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "overall-spec document structure",
5
+ "description": "Derived JSON Schema — 42 declared elements · 35 required",
6
+ "type": "object",
7
+ "properties": {
8
+ "title": {
9
+ "type": "string",
10
+ "pattern": "^.+$",
11
+ "description": "presence: required · home: frontmatter · ref: none"
12
+ },
13
+ "doc-type": {
14
+ "type": "string",
15
+ "pattern": "^(overall-spec|plan|phase-spec|single-spec)$",
16
+ "description": "presence: required · home: frontmatter · ref: none"
17
+ },
18
+ "version": {
19
+ "type": "string",
20
+ "pattern": "^v\\d+\\.\\d+$",
21
+ "description": "presence: required · home: frontmatter · ref: version-lineage"
22
+ },
23
+ "date": {
24
+ "type": "string",
25
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
26
+ "description": "presence: required · home: frontmatter · ref: none"
27
+ },
28
+ "status": {
29
+ "type": "string",
30
+ "pattern": "^(Draft|Approved|In progress|Complete)$",
31
+ "description": "presence: required · home: frontmatter · ref: none"
32
+ },
33
+ "author": {
34
+ "type": "string",
35
+ "pattern": "^.+$",
36
+ "description": "presence: required · home: frontmatter · ref: none"
37
+ },
38
+ "## Document scope": {
39
+ "type": "string",
40
+ "pattern": "^## Document scope$",
41
+ "description": "presence: required · home: section · ref: none"
42
+ },
43
+ "## File paths": {
44
+ "type": "string",
45
+ "pattern": "^## File paths$",
46
+ "description": "presence: required · home: section · ref: none"
47
+ },
48
+ "## Program charter": {
49
+ "type": "string",
50
+ "pattern": "^## Program charter$",
51
+ "description": "presence: required · home: section · ref: none"
52
+ },
53
+ "## Issue inventory": {
54
+ "type": "string",
55
+ "pattern": "^## Issue inventory$",
56
+ "description": "presence: required · home: section · ref: none"
57
+ },
58
+ "## Phase inventory": {
59
+ "type": "string",
60
+ "pattern": "^## Phase inventory$",
61
+ "description": "presence: required · home: section · ref: none"
62
+ },
63
+ "## Dependency graph": {
64
+ "type": "string",
65
+ "pattern": "^## Dependency graph( \\(ASCII\\))?$",
66
+ "description": "presence: required · home: section · ref: none"
67
+ },
68
+ "## Boundary rules": {
69
+ "type": "string",
70
+ "pattern": "^## Boundary rules$",
71
+ "description": "presence: required · home: section · ref: none"
72
+ },
73
+ "## Constraints": {
74
+ "type": "string",
75
+ "pattern": "^## Constraints$",
76
+ "description": "presence: required · home: section · ref: none"
77
+ },
78
+ "Constraint delta bullet": {
79
+ "type": "string",
80
+ "pattern": "^- ",
81
+ "description": "presence: required · home: section · ref: none"
82
+ },
83
+ "## Maintenance": {
84
+ "type": "string",
85
+ "pattern": "^## Maintenance$",
86
+ "description": "presence: required · home: section · ref: none"
87
+ },
88
+ "## Change history": {
89
+ "type": "string",
90
+ "pattern": "^## Change history$",
91
+ "description": "presence: required · home: section · ref: none"
92
+ },
93
+ "### Goal": {
94
+ "type": "string",
95
+ "pattern": "^### Goal",
96
+ "description": "presence: required · home: facet · ref: none"
97
+ },
98
+ "### Non-goals": {
99
+ "type": "string",
100
+ "pattern": "^### Non-goals",
101
+ "description": "presence: required · home: facet · ref: none"
102
+ },
103
+ "### Cross-cutting": {
104
+ "type": "string",
105
+ "pattern": "^### Cross-cutting",
106
+ "description": "presence: required · home: facet · ref: none"
107
+ },
108
+ "#### [MFRBEN] group": {
109
+ "type": "string",
110
+ "pattern": "^#### [MFRBEN] group",
111
+ "description": "presence: optional · home: facet · ref: none"
112
+ },
113
+ "#### Upstream Endorsements": {
114
+ "type": "string",
115
+ "pattern": "^#### Upstream Endorsements$",
116
+ "description": "presence: optional · home: facet · ref: none"
117
+ },
118
+ "Issue inventory columns": {
119
+ "type": "string",
120
+ "pattern": "^\\| Phase \\| Issue \\(ref\\) \\| Title summary \\|$",
121
+ "description": "presence: required · home: table · ref: none"
122
+ },
123
+ "Issue row": {
124
+ "type": "string",
125
+ "pattern": "^\\|\\s*P\\d+(\\.\\d+)*\\s*\\|",
126
+ "description": "presence: required · home: table · ref: issue-ref"
127
+ },
128
+ "Issue ref cell": {
129
+ "type": "string",
130
+ "pattern": "^(none|#\\d+|\\[#\\d+\\]|#\\d+#issuecomment-\\d+|([^)]*)|\\([^)]*\\))$",
131
+ "description": "presence: required · home: table · ref: issue-ref"
132
+ },
133
+ "issuecomment anchor": {
134
+ "type": "string",
135
+ "pattern": "^#\\d+#issuecomment-\\d+$",
136
+ "description": "presence: conditional · home: table · ref: issue-ref"
137
+ },
138
+ "Phase inventory columns": {
139
+ "type": "string",
140
+ "pattern": "^\\| # \\| Phase \\| Scope \\| Design spec \\| Implementation plan \\| Acceptance criteria \\| Dependency \\|$",
141
+ "description": "presence: required · home: table · ref: none"
142
+ },
143
+ "Phase row": {
144
+ "type": "string",
145
+ "pattern": "^\\|\\s*P\\d+(\\.\\d+)*\\s*\\|",
146
+ "description": "presence: required · home: table · ref: phase-id"
147
+ },
148
+ "Phase id token": {
149
+ "type": "string",
150
+ "pattern": "^P\\d+(\\.\\d+)*$",
151
+ "description": "presence: required · home: table · ref: phase-id"
152
+ },
153
+ "Implementation plan cell": {
154
+ "type": "string",
155
+ "pattern": "^(Pending|\\[Pending\\]|In-flight|\\[In-flight\\]|Done|\\[[^\\]]+\\]\\([^)]+\\))$",
156
+ "description": "presence: required · home: table · ref: markdown-link"
157
+ },
158
+ "Design spec cell": {
159
+ "type": "string",
160
+ "pattern": "^(\\[[^\\]]+\\]\\([^)]+\\)|P\\d+(\\.\\d+)*-design|Done|\\[Pending\\])$",
161
+ "description": "presence: required · home: table · ref: spec-ref"
162
+ },
163
+ "Dependency cell": {
164
+ "type": "string",
165
+ "pattern": "^P\\d+(\\.\\d+)*\\s*->",
166
+ "description": "presence: required · home: table · ref: phase-id"
167
+ },
168
+ "Hard edge": {
169
+ "type": "string",
170
+ "pattern": "^P\\d+(\\.\\d+)*\\s*->\\s*P\\d+(\\.\\d+)*",
171
+ "description": "presence: required · home: graph · ref: phase-id"
172
+ },
173
+ "Soft edge": {
174
+ "type": "string",
175
+ "pattern": "^P\\d+(\\.\\d+)*\\s*->\\s*\\(?\\s*soft\\s*\\)?",
176
+ "description": "presence: optional · home: graph · ref: phase-id"
177
+ },
178
+ "Graph legend": {
179
+ "type": "string",
180
+ "pattern": "^(?:- )?`?->\\s*(?:\\(soft\\))?\\s*`? = hard block|^(?:- )?`?->\\s*\\(soft\\)\\s*`? = suggestion only",
181
+ "description": "presence: required · home: graph · ref: none"
182
+ },
183
+ "File path row": {
184
+ "type": "string",
185
+ "pattern": "^\\| [^|]+ \\| `[^`]+` \\|$",
186
+ "description": "presence: required · home: table · ref: none"
187
+ },
188
+ "Change history row": {
189
+ "type": "string",
190
+ "pattern": "^\\|\\s*v\\d+\\.\\d+\\s*\\|",
191
+ "description": "presence: required · home: table · ref: version-lineage"
192
+ },
193
+ "Version token": {
194
+ "type": "string",
195
+ "pattern": "^v\\d+\\.\\d+$",
196
+ "description": "presence: required · home: table · ref: version-lineage"
197
+ },
198
+ "Change history date": {
199
+ "type": "string",
200
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
201
+ "description": "presence: required · home: table · ref: none"
202
+ },
203
+ "Backfill clause": {
204
+ "type": "string",
205
+ "pattern": "(Pending|\\[Pending\\])\\s*(→|->)\\s*\\S+",
206
+ "description": "presence: conditional · home: table · ref: version-lineage"
207
+ },
208
+ "Design claim token": {
209
+ "type": "string",
210
+ "pattern": "^P\\d+(\\.\\d+)*-design$",
211
+ "description": "presence: conditional · home: table · ref: spec-ref"
212
+ },
213
+ "Phase range ref": {
214
+ "type": "string",
215
+ "pattern": "^P\\d+(\\.\\d+)*\\s*[-–—]\\s*P\\d+(\\.\\d+)*$",
216
+ "description": "presence: optional · home: table · ref: phase-id"
217
+ }
218
+ },
219
+ "required": [
220
+ "title",
221
+ "doc-type",
222
+ "version",
223
+ "date",
224
+ "status",
225
+ "author",
226
+ "## Document scope",
227
+ "## File paths",
228
+ "## Program charter",
229
+ "## Issue inventory",
230
+ "## Phase inventory",
231
+ "## Dependency graph",
232
+ "## Boundary rules",
233
+ "## Constraints",
234
+ "Constraint delta bullet",
235
+ "## Maintenance",
236
+ "## Change history",
237
+ "### Goal",
238
+ "### Non-goals",
239
+ "### Cross-cutting",
240
+ "Issue inventory columns",
241
+ "Issue row",
242
+ "Issue ref cell",
243
+ "Phase inventory columns",
244
+ "Phase row",
245
+ "Phase id token",
246
+ "Implementation plan cell",
247
+ "Design spec cell",
248
+ "Dependency cell",
249
+ "Hard edge",
250
+ "Graph legend",
251
+ "File path row",
252
+ "Change history row",
253
+ "Version token",
254
+ "Change history date"
255
+ ]
256
+ }
@@ -0,0 +1,165 @@
1
+ {
2
+ "docType": "phase-spec",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "phase-spec document structure",
5
+ "description": "Derived JSON Schema — 27 declared elements · 19 required",
6
+ "type": "object",
7
+ "properties": {
8
+ "title": {
9
+ "type": "string",
10
+ "pattern": "^.+$",
11
+ "description": "presence: required · home: frontmatter · ref: none"
12
+ },
13
+ "doc-type": {
14
+ "type": "string",
15
+ "pattern": "^(overall-spec|plan|phase-spec|single-spec)$",
16
+ "description": "presence: required · home: frontmatter · ref: none"
17
+ },
18
+ "version": {
19
+ "type": "string",
20
+ "pattern": "^v\\d+\\.\\d+$",
21
+ "description": "presence: required · home: frontmatter · ref: version-lineage"
22
+ },
23
+ "date": {
24
+ "type": "string",
25
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
26
+ "description": "presence: required · home: frontmatter · ref: none"
27
+ },
28
+ "status": {
29
+ "type": "string",
30
+ "pattern": "^(Draft|Approved|Plan pending|Shipped)$",
31
+ "description": "presence: required · home: frontmatter · ref: none"
32
+ },
33
+ "author": {
34
+ "type": "string",
35
+ "pattern": "^.+$",
36
+ "description": "presence: required · home: frontmatter · ref: none"
37
+ },
38
+ "parent-program": {
39
+ "type": "string",
40
+ "pattern": "^.+$",
41
+ "description": "presence: required · home: frontmatter · ref: parent-program"
42
+ },
43
+ "parent-version": {
44
+ "type": "string",
45
+ "pattern": "^v\\d+\\.\\d+$",
46
+ "description": "presence: optional · home: frontmatter · ref: version-lineage"
47
+ },
48
+ "depends-on": {
49
+ "type": "string",
50
+ "pattern": "^.+$",
51
+ "description": "presence: required · home: frontmatter · ref: none"
52
+ },
53
+ "## Design": {
54
+ "type": "string",
55
+ "pattern": "^## Design$",
56
+ "description": "presence: required · home: design-body · ref: none"
57
+ },
58
+ "### N. group heading": {
59
+ "type": "string",
60
+ "pattern": "^### \\d+\\. ",
61
+ "description": "presence: required · home: design-body · ref: none"
62
+ },
63
+ "#### N.M item heading": {
64
+ "type": "string",
65
+ "pattern": "^#### \\d+\\.\\d+ ",
66
+ "description": "presence: required · home: design-body · ref: none"
67
+ },
68
+ "### Acceptance criteria": {
69
+ "type": "string",
70
+ "pattern": "^### Acceptance criteria$",
71
+ "description": "presence: required · home: design-body · ref: none"
72
+ },
73
+ "Acceptance entry": {
74
+ "type": "string",
75
+ "pattern": "^- `",
76
+ "description": "presence: required · home: design-body · ref: none"
77
+ },
78
+ "## Constraints": {
79
+ "type": "string",
80
+ "pattern": "^## Constraints$",
81
+ "description": "presence: required · home: section · ref: none"
82
+ },
83
+ "Constraint delta bullet": {
84
+ "type": "string",
85
+ "pattern": "^- ",
86
+ "description": "presence: required · home: section · ref: none"
87
+ },
88
+ "## Deviations": {
89
+ "type": "string",
90
+ "pattern": "^## Deviations$",
91
+ "description": "presence: conditional · home: conditional · ref: none"
92
+ },
93
+ "Deviations columns": {
94
+ "type": "string",
95
+ "pattern": "^\\| Overall assumption \\| Phase decision \\| Overall updated\\? \\|$",
96
+ "description": "presence: conditional · home: conditional · ref: none"
97
+ },
98
+ "Deviations row": {
99
+ "type": "string",
100
+ "pattern": "^\\|\\s*[^|]+\\s*\\|\\s*[^|]+\\s*\\|\\s*(Yes|No)\\b",
101
+ "description": "presence: conditional · home: conditional · ref: none"
102
+ },
103
+ "Overall updated answer": {
104
+ "type": "string",
105
+ "pattern": "^Yes",
106
+ "description": "presence: conditional · home: conditional · ref: none"
107
+ },
108
+ "## Incremental warning": {
109
+ "type": "string",
110
+ "pattern": "^## Incremental warning$",
111
+ "description": "presence: conditional · home: conditional · ref: none"
112
+ },
113
+ "## Notes for downstream": {
114
+ "type": "string",
115
+ "pattern": "^## Notes for downstream$",
116
+ "description": "presence: conditional · home: conditional · ref: none"
117
+ },
118
+ "## Review record": {
119
+ "type": "string",
120
+ "pattern": "^## Review record$",
121
+ "description": "presence: conditional · home: conditional · ref: none"
122
+ },
123
+ "## Change history": {
124
+ "type": "string",
125
+ "pattern": "^## Change history$",
126
+ "description": "presence: required · home: section · ref: none"
127
+ },
128
+ "Change history row": {
129
+ "type": "string",
130
+ "pattern": "^\\|\\s*v\\d+\\.\\d+\\s*\\|",
131
+ "description": "presence: required · home: table · ref: version-lineage"
132
+ },
133
+ "Version token": {
134
+ "type": "string",
135
+ "pattern": "^v\\d+\\.\\d+$",
136
+ "description": "presence: required · home: table · ref: version-lineage"
137
+ },
138
+ "Change history date": {
139
+ "type": "string",
140
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
141
+ "description": "presence: required · home: table · ref: none"
142
+ }
143
+ },
144
+ "required": [
145
+ "title",
146
+ "doc-type",
147
+ "version",
148
+ "date",
149
+ "status",
150
+ "author",
151
+ "parent-program",
152
+ "depends-on",
153
+ "## Design",
154
+ "### N. group heading",
155
+ "#### N.M item heading",
156
+ "### Acceptance criteria",
157
+ "Acceptance entry",
158
+ "## Constraints",
159
+ "Constraint delta bullet",
160
+ "## Change history",
161
+ "Change history row",
162
+ "Version token",
163
+ "Change history date"
164
+ ]
165
+ }
@@ -0,0 +1,190 @@
1
+ {
2
+ "docType": "plan",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "plan document structure",
5
+ "description": "Derived JSON Schema — 31 declared elements · 24 required",
6
+ "type": "object",
7
+ "properties": {
8
+ "title": {
9
+ "type": "string",
10
+ "pattern": "^.+$",
11
+ "description": "presence: required · home: frontmatter · ref: none"
12
+ },
13
+ "doc-type": {
14
+ "type": "string",
15
+ "pattern": "^(overall-spec|plan|phase-spec|single-spec)$",
16
+ "description": "presence: required · home: frontmatter · ref: none"
17
+ },
18
+ "version": {
19
+ "type": "string",
20
+ "pattern": "^v\\d+\\.\\d+$",
21
+ "description": "presence: required · home: frontmatter · ref: version-lineage"
22
+ },
23
+ "date": {
24
+ "type": "string",
25
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
26
+ "description": "presence: required · home: frontmatter · ref: none"
27
+ },
28
+ "spec": {
29
+ "type": "string",
30
+ "pattern": "^.+$",
31
+ "description": "presence: required · home: frontmatter · ref: spec-ref"
32
+ },
33
+ "parent-program": {
34
+ "type": "string",
35
+ "pattern": "^.+$",
36
+ "description": "presence: required · home: frontmatter · ref: parent-program"
37
+ },
38
+ "parent-version": {
39
+ "type": "string",
40
+ "pattern": "^v\\d+\\.\\d+$",
41
+ "description": "presence: optional · home: frontmatter · ref: version-lineage"
42
+ },
43
+ "depends-on": {
44
+ "type": "string",
45
+ "pattern": "^.+$",
46
+ "description": "presence: optional · home: frontmatter · ref: phase-id"
47
+ },
48
+ "base": {
49
+ "type": "string",
50
+ "pattern": "^.+$",
51
+ "description": "presence: optional · home: frontmatter · ref: none"
52
+ },
53
+ "## Constraints": {
54
+ "type": "string",
55
+ "pattern": "^## Constraints$",
56
+ "description": "presence: required · home: section · ref: none"
57
+ },
58
+ "Constraint delta bullet": {
59
+ "type": "string",
60
+ "pattern": "^- ",
61
+ "description": "presence: required · home: section · ref: none"
62
+ },
63
+ "Constraint delta sub-heading": {
64
+ "type": "string",
65
+ "pattern": "^### ",
66
+ "description": "presence: optional · home: section · ref: none"
67
+ },
68
+ "### Task N:": {
69
+ "type": "string",
70
+ "pattern": "^### Task \\d+:( .*)?$",
71
+ "description": "presence: required · home: task-block · ref: none"
72
+ },
73
+ "Task id token": {
74
+ "type": "string",
75
+ "pattern": "^\\d+$",
76
+ "description": "presence: required · home: task-block · ref: task-id"
77
+ },
78
+ "**Objective**": {
79
+ "type": "string",
80
+ "pattern": "^- \\*\\*Objective\\*\\*:",
81
+ "description": "presence: required · home: task-field · ref: none"
82
+ },
83
+ "**Files**": {
84
+ "type": "string",
85
+ "pattern": "^- \\*\\*Files\\*\\*:",
86
+ "description": "presence: required · home: task-field · ref: none"
87
+ },
88
+ "File path token": {
89
+ "type": "string",
90
+ "pattern": "^[\\w./-]+",
91
+ "description": "presence: required · home: task-field · ref: none"
92
+ },
93
+ "**Consumes**": {
94
+ "type": "string",
95
+ "pattern": "^- \\*\\*Consumes\\*\\*:",
96
+ "description": "presence: required · home: task-field · ref: none"
97
+ },
98
+ "**Produces**": {
99
+ "type": "string",
100
+ "pattern": "^- \\*\\*Produces\\*\\*:",
101
+ "description": "presence: required · home: task-field · ref: none"
102
+ },
103
+ "**Steps**": {
104
+ "type": "string",
105
+ "pattern": "^- \\*\\*Steps\\*\\*:",
106
+ "description": "presence: required · home: task-field · ref: none"
107
+ },
108
+ "Step action": {
109
+ "type": "string",
110
+ "pattern": "^- ",
111
+ "description": "presence: required · home: task-step · ref: none"
112
+ },
113
+ "Step checkable": {
114
+ "type": "string",
115
+ "pattern": "—\\s*checkable:\\s*\\S",
116
+ "description": "presence: required · home: task-step · ref: none"
117
+ },
118
+ "**Acceptance**": {
119
+ "type": "string",
120
+ "pattern": "^- \\*\\*Acceptance\\*\\*:",
121
+ "description": "presence: required · home: task-field · ref: none"
122
+ },
123
+ "**DependsOn**": {
124
+ "type": "string",
125
+ "pattern": "^- \\*\\*DependsOn\\*\\*:",
126
+ "description": "presence: required · home: task-field · ref: none"
127
+ },
128
+ "DependsOn none": {
129
+ "type": "string",
130
+ "pattern": "^(none|\\s*)$",
131
+ "description": "presence: optional · home: task-field · ref: none"
132
+ },
133
+ "DependsOn id": {
134
+ "type": "string",
135
+ "pattern": "^[1-9]\\d*$",
136
+ "description": "presence: optional · home: task-field · ref: task-id"
137
+ },
138
+ "Task prose reference": {
139
+ "type": "string",
140
+ "pattern": "\\b(?:Task|T)\\s*([1-9]\\d*)\\b(?!\\.\\d)",
141
+ "description": "presence: optional · home: task-field · ref: task-id"
142
+ },
143
+ "## Change history": {
144
+ "type": "string",
145
+ "pattern": "^## Change history$",
146
+ "description": "presence: required · home: section · ref: none"
147
+ },
148
+ "Change history row": {
149
+ "type": "string",
150
+ "pattern": "^\\|\\s*v\\d+\\.\\d+\\s*\\|",
151
+ "description": "presence: required · home: table · ref: version-lineage"
152
+ },
153
+ "Version token": {
154
+ "type": "string",
155
+ "pattern": "^v\\d+\\.\\d+$",
156
+ "description": "presence: required · home: table · ref: version-lineage"
157
+ },
158
+ "Change history date": {
159
+ "type": "string",
160
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
161
+ "description": "presence: required · home: table · ref: none"
162
+ }
163
+ },
164
+ "required": [
165
+ "title",
166
+ "doc-type",
167
+ "version",
168
+ "date",
169
+ "spec",
170
+ "parent-program",
171
+ "## Constraints",
172
+ "Constraint delta bullet",
173
+ "### Task N:",
174
+ "Task id token",
175
+ "**Objective**",
176
+ "**Files**",
177
+ "File path token",
178
+ "**Consumes**",
179
+ "**Produces**",
180
+ "**Steps**",
181
+ "Step action",
182
+ "Step checkable",
183
+ "**Acceptance**",
184
+ "**DependsOn**",
185
+ "## Change history",
186
+ "Change history row",
187
+ "Version token",
188
+ "Change history date"
189
+ ]
190
+ }