|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "title": "MusicalSequence", |
| 4 | + "description": "Canonical MusicalSequence JSON Schema used for orchestration sequences and registry projections.", |
| 5 | + "type": "object", |
| 6 | + "additionalProperties": true, |
| 7 | + "required": ["domainId", "id", "name", "movements", "userStory"], |
| 8 | + "properties": { |
| 9 | + "domainId": { |
| 10 | + "type": "string", |
| 11 | + "description": "Domain identifier for the sequence (e.g., 'cdp-safe', 'renderx-canvas')" |
| 12 | + }, |
| 13 | + "id": { |
| 14 | + "type": "string", |
| 15 | + "description": "Unique sequence identifier" |
| 16 | + }, |
| 17 | + "name": { |
| 18 | + "type": "string", |
| 19 | + "description": "Human-readable sequence name" |
| 20 | + }, |
| 21 | + "sequenceId": { |
| 22 | + "type": "string", |
| 23 | + "description": "Alias / duplicate identifier field used by some sequences" |
| 24 | + }, |
| 25 | + "title": { |
| 26 | + "type": "string", |
| 27 | + "description": "Display title for UI / docs" |
| 28 | + }, |
| 29 | + "description": { |
| 30 | + "type": "string", |
| 31 | + "description": "Purpose and behavior description" |
| 32 | + }, |
| 33 | + "purpose": { |
| 34 | + "type": "string", |
| 35 | + "description": "Business or technical purpose statement" |
| 36 | + }, |
| 37 | + "trigger": { |
| 38 | + "type": "string", |
| 39 | + "description": "Triggering condition for orchestration start" |
| 40 | + }, |
| 41 | + "packageName": { |
| 42 | + "type": "string", |
| 43 | + "description": "Owning NPM package or module name" |
| 44 | + }, |
| 45 | + "kind": { |
| 46 | + "type": "string", |
| 47 | + "description": "Sequence kind/classification (plugin, orchestration, etc.)" |
| 48 | + }, |
| 49 | + "status": { |
| 50 | + "type": "string", |
| 51 | + "description": "Lifecycle status (active, experimental, deprecated, available)" |
| 52 | + }, |
| 53 | + "key": { |
| 54 | + "type": "string", |
| 55 | + "description": "Musical key or organizational key" |
| 56 | + }, |
| 57 | + "tempo": { |
| 58 | + "type": "number", |
| 59 | + "description": "Beats per minute (BPM)" |
| 60 | + }, |
| 61 | + "timeSignature": { |
| 62 | + "type": "string", |
| 63 | + "description": "Time signature (organizational)" |
| 64 | + }, |
| 65 | + "category": { |
| 66 | + "type": "string", |
| 67 | + "description": "Sequence category (see SequenceCategory in SequenceTypes.ts)" |
| 68 | + }, |
| 69 | + "beats": { |
| 70 | + "type": "integer", |
| 71 | + "minimum": 0, |
| 72 | + "description": "Total beat count (flattened) if pre-computed" |
| 73 | + }, |
| 74 | + "governance": { |
| 75 | + "type": "object", |
| 76 | + "description": "Governance policies and metrics for orchestration", |
| 77 | + "additionalProperties": true, |
| 78 | + "properties": { |
| 79 | + "policies": { |
| 80 | + "type": "array", |
| 81 | + "items": { "type": "string" } |
| 82 | + }, |
| 83 | + "metrics": { |
| 84 | + "type": "array", |
| 85 | + "items": { "type": "string" } |
| 86 | + } |
| 87 | + } |
| 88 | + }, |
| 89 | + "events": { |
| 90 | + "type": "array", |
| 91 | + "description": "Declared event names emitted by sequence", |
| 92 | + "items": { "type": "string" } |
| 93 | + }, |
| 94 | + "userStory": { |
| 95 | + "type": "object", |
| 96 | + "description": "Beat-level user story", |
| 97 | + "additionalProperties": false, |
| 98 | + "properties": { |
| 99 | + "persona": { |
| 100 | + "type": "string", |
| 101 | + "description": "Persona for the user story (who)" |
| 102 | + }, |
| 103 | + "goal": { |
| 104 | + "type": "string", |
| 105 | + "description": "What the user wants to achieve" |
| 106 | + }, |
| 107 | + "benefit": { |
| 108 | + "type": "string", |
| 109 | + "description": "The benefit or value derived from achieving the goal" |
| 110 | + } |
| 111 | + } |
| 112 | + }, |
| 113 | + "persona": { |
| 114 | + "type": "string", |
| 115 | + "description": "Primary persona served" |
| 116 | + }, |
| 117 | + "businessValue": { |
| 118 | + "type": "string", |
| 119 | + "description": "Business value articulation" |
| 120 | + }, |
| 121 | + "metadata": { |
| 122 | + "type": "object", |
| 123 | + "description": "Optional metadata for the sequence", |
| 124 | + "additionalProperties": true, |
| 125 | + "properties": { |
| 126 | + "version": { "type": "string" }, |
| 127 | + "author": { "type": "string" }, |
| 128 | + "created": { "type": "string" }, |
| 129 | + "tags": { |
| 130 | + "type": "array", |
| 131 | + "items": { "type": "string" } |
| 132 | + } |
| 133 | + } |
| 134 | + }, |
| 135 | + "movements": { |
| 136 | + "type": "array", |
| 137 | + "description": "Array of movements in this sequence", |
| 138 | + "items": { "$ref": "#/definitions/SequenceMovement" } |
| 139 | + } |
| 140 | + }, |
| 141 | + "definitions": { |
| 142 | + "SequenceMovement": { |
| 143 | + "type": "object", |
| 144 | + "additionalProperties": true, |
| 145 | + "required": ["name", "beats", "userStory"], |
| 146 | + "properties": { |
| 147 | + "id": { |
| 148 | + "type": "string", |
| 149 | + "description": "Unique movement identifier" |
| 150 | + }, |
| 151 | + "name": { |
| 152 | + "type": "string", |
| 153 | + "description": "Movement name" |
| 154 | + }, |
| 155 | + "description": { |
| 156 | + "type": "string", |
| 157 | + "description": "Movement description" |
| 158 | + }, |
| 159 | + "number": { |
| 160 | + "type": "integer", |
| 161 | + "minimum": 1, |
| 162 | + "description": "Ordinal movement number" |
| 163 | + }, |
| 164 | + "tempo": { |
| 165 | + "type": "number", |
| 166 | + "description": "Optional BPM override for this movement" |
| 167 | + }, |
| 168 | + "errorHandling": { |
| 169 | + "type": "string", |
| 170 | + "enum": [ "continue", "abort-sequence" ], |
| 171 | + "description": "Movement-level error handling strategy" |
| 172 | + }, |
| 173 | + "userStory": { |
| 174 | + "type": "object", |
| 175 | + "description": "Beat-level user story", |
| 176 | + "additionalProperties": false, |
| 177 | + "properties": { |
| 178 | + "persona": { |
| 179 | + "type": "string", |
| 180 | + "description": "Persona for the user story (who)" |
| 181 | + }, |
| 182 | + "goal": { |
| 183 | + "type": "string", |
| 184 | + "description": "What the user wants to achieve" |
| 185 | + }, |
| 186 | + "benefit": { |
| 187 | + "type": "string", |
| 188 | + "description": "The benefit or value derived from achieving the goal" |
| 189 | + } |
| 190 | + } |
| 191 | + }, |
| 192 | + "persona": { |
| 193 | + "type": "string", |
| 194 | + "description": "Movement-level persona" |
| 195 | + }, |
| 196 | + "businessValue": { |
| 197 | + "type": "string", |
| 198 | + "description": "Movement-level business value" |
| 199 | + }, |
| 200 | + "status": { |
| 201 | + "type": "string", |
| 202 | + "description": "Movement lifecycle status" |
| 203 | + }, |
| 204 | + "beats": { |
| 205 | + "type": "array", |
| 206 | + "description": "Beats within this movement", |
| 207 | + "items": { "$ref": "#/definitions/SequenceBeat" } |
| 208 | + } |
| 209 | + } |
| 210 | + }, |
| 211 | + "SequenceBeat": { |
| 212 | + "type": "object", |
| 213 | + "additionalProperties": true, |
| 214 | + "required": ["event", "userStory", "acceptanceCriteria", "testFile"], |
| 215 | + "properties": { |
| 216 | + "name": { |
| 217 | + "type": "string", |
| 218 | + "description": "Beat name (human readable)" |
| 219 | + }, |
| 220 | + "beat": { |
| 221 | + "type": "integer", |
| 222 | + "minimum": 1, |
| 223 | + "description": "Beat number (1-based index)" |
| 224 | + }, |
| 225 | + "number": { |
| 226 | + "type": "integer", |
| 227 | + "minimum": 1, |
| 228 | + "description": "Alternate beat number field used by some orchestration sequences" |
| 229 | + }, |
| 230 | + "event": { |
| 231 | + "type": "string", |
| 232 | + "description": "Event type emitted at this beat" |
| 233 | + }, |
| 234 | + "title": { |
| 235 | + "type": "string", |
| 236 | + "description": "Short human-readable title for the beat" |
| 237 | + }, |
| 238 | + "description": { |
| 239 | + "type": "string", |
| 240 | + "description": "Detailed description of what this beat does" |
| 241 | + }, |
| 242 | + "dynamics": { |
| 243 | + "type": "string", |
| 244 | + "description": "Volume/priority level (pp, p, mp, mf, f, ff)" |
| 245 | + }, |
| 246 | + "timing": { |
| 247 | + "type": "string", |
| 248 | + "description": "Timing semantics for when this beat executes" |
| 249 | + }, |
| 250 | + "data": { |
| 251 | + "type": "object", |
| 252 | + "description": "Arbitrary data payload for the event" |
| 253 | + }, |
| 254 | + "dependencies": { |
| 255 | + "type": "array", |
| 256 | + "items": { "type": "string" }, |
| 257 | + "description": "IDs of events this beat depends on" |
| 258 | + }, |
| 259 | + "errorHandling": { |
| 260 | + "type": "string", |
| 261 | + "enum": ["continue", "abort-sequence", "retry", "abort"], |
| 262 | + "description": "Error handling strategy for this beat" |
| 263 | + }, |
| 264 | + "handler": { |
| 265 | + "description": "Handler definition (string shorthand or object with name/scope/kind)", |
| 266 | + "oneOf": [ |
| 267 | + { "type": "string" }, |
| 268 | + { "$ref": "#/definitions/HandlerRef" } |
| 269 | + ] |
| 270 | + }, |
| 271 | + "kind": { |
| 272 | + "type": "string", |
| 273 | + "description": "Handler kind (validation, orchestration, reporting, etc.)" |
| 274 | + }, |
| 275 | + "reference": { |
| 276 | + "type": "string", |
| 277 | + "description": "Free-form reference or note field" |
| 278 | + }, |
| 279 | + "handlerDef": { |
| 280 | + "type": "object", |
| 281 | + "description": "Handler identity including scope/kind metadata", |
| 282 | + "additionalProperties": true, |
| 283 | + "properties": { |
| 284 | + "id": { "type": "string" }, |
| 285 | + "scope": { "type": "string" }, |
| 286 | + "kind": { "type": "string" } |
| 287 | + } |
| 288 | + }, |
| 289 | + "scenario": { "type": "string", "description": "Scenario / test narrative for beat" }, |
| 290 | + "testFile": { "type": "string", "description": "Linked test file path" }, |
| 291 | + "testCase": { "type": "string", "description": "Linked test case description" }, |
| 292 | + "userStory": { |
| 293 | + "type": "object", |
| 294 | + "description": "Beat-level user story", |
| 295 | + "additionalProperties": false, |
| 296 | + "properties": { |
| 297 | + "persona": { |
| 298 | + "type": "string", |
| 299 | + "description": "Persona for the user story (who)" |
| 300 | + }, |
| 301 | + "goal": { |
| 302 | + "type": "string", |
| 303 | + "description": "What the user wants to achieve" |
| 304 | + }, |
| 305 | + "benefit": { |
| 306 | + "type": "string", |
| 307 | + "description": "The benefit or value derived from achieving the goal" |
| 308 | + } |
| 309 | + } |
| 310 | + }, |
| 311 | + "persona": { "type": "string", "description": "Beat-level persona" }, |
| 312 | + "businessValue": { "type": "string", "description": "Beat-level business value articulation" }, |
| 313 | + "acceptanceCriteria": { |
| 314 | + "type": "array", |
| 315 | + "description": "Structured acceptance criteria grouped into Given/When/Then/And clauses", |
| 316 | + "items": { |
| 317 | + "type": "object", |
| 318 | + "additionalProperties": false, |
| 319 | + "properties": { |
| 320 | + "given": { "type": "array", "items": { "type": "string" } }, |
| 321 | + "when": { "type": "array", "items": { "type": "string" } }, |
| 322 | + "then": { "type": "array", "items": { "type": "string" } }, |
| 323 | + "and": { "type": "array", "items": { "type": "string" } } |
| 324 | + } |
| 325 | + } |
| 326 | + }, |
| 327 | + "notes": { |
| 328 | + "type": "array", |
| 329 | + "description": "Supplemental notes for the beat", |
| 330 | + "items": { "type": "string" } |
| 331 | + } |
| 332 | + } |
| 333 | + }, |
| 334 | + "HandlerRef": { |
| 335 | + "type": "object", |
| 336 | + "additionalProperties": true, |
| 337 | + "required": ["name", "sourcePath"], |
| 338 | + "properties": { |
| 339 | + "name": { "type": "string", "description": "Handler function reference (module#export)" }, |
| 340 | + "scope": { |
| 341 | + "type": "string", |
| 342 | + "enum": ["plugin", "orchestration", "system", "policy"], |
| 343 | + "description": "Handler scope (plugin, orchestration, system, policy)" |
| 344 | + }, |
| 345 | + "kind": { |
| 346 | + "type": "string", |
| 347 | + "enum": ["validation", "orchestration", "reporting", "policy-enforcement", "metrics", "automation"], |
| 348 | + "description": "Handler kind classification" |
| 349 | + }, |
| 350 | + "sourcePath": { |
| 351 | + "type": "string", |
| 352 | + "description": "Filesystem or package path to the handler source code (e.g., 'packages/cdp-handlers/src/build/trunk-based-development.ts')" |
| 353 | + }, |
| 354 | + "handlerCapabilities": { |
| 355 | + "type": "array", |
| 356 | + "description": "Capabilities this handler supports - determines which lifecycle methods are implemented", |
| 357 | + "items": { |
| 358 | + "type": "string", |
| 359 | + "enum": ["audit", "build", "deploy", "report", "validate", "measure", "learn", "rollback"] |
| 360 | + } |
| 361 | + } |
| 362 | + } |
| 363 | + } |
| 364 | + } |
| 365 | +} |
| 366 | + |
0 commit comments