@deksden-com/dd-flow-cli 0.9.0-beta.151 → 0.9.0-beta.155

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 (227) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/build-info.json +8 -8
  3. package/dist/cli/command-inputs.js +33 -3
  4. package/dist/cli/command-metadata.js +73 -2
  5. package/dist/cli/delivery.js +108 -0
  6. package/dist/cli/diagnostic-invocation.js +23 -7
  7. package/dist/cli/diagnostic.js +14 -3
  8. package/dist/cli/help.js +117 -1
  9. package/dist/cli/hook-ingress.js +36 -49
  10. package/dist/cli/interactive-invocation.js +33 -0
  11. package/dist/cli/interactive.js +114 -0
  12. package/dist/cli/memory-fix-invocation.js +52 -0
  13. package/dist/cli/memory-fix.js +100 -0
  14. package/dist/cli/memory-flow-admission.js +7 -3
  15. package/dist/cli/memory-init.js +5 -4
  16. package/dist/cli/native-hook-ingress.js +5 -1
  17. package/dist/cli/native-hook-preparation.js +31 -4
  18. package/dist/cli/run-cli.js +273 -19
  19. package/dist/cli.js +17 -3
  20. package/dist/domain/delivery-flows.js +8 -0
  21. package/dist/domain/distill-flow.js +20 -0
  22. package/dist/domain/interactive-flow.js +1 -0
  23. package/dist/domain/memory-fix-flow.js +2 -0
  24. package/dist/domain/review-fix-flow.js +2 -0
  25. package/dist/domain/source-snapshot-flows.js +4 -0
  26. package/dist/harness-runtime/bin/dd-agy.mjs +18 -3
  27. package/dist/harness-runtime/bin/dd-grok.mjs +15 -5
  28. package/dist/harness-runtime/bin/dd-zcode.mjs +15 -7
  29. package/dist/harness-runtime/lib/agy-error-boundary.mjs +18 -10
  30. package/dist/harness-runtime/lib/agy-native-inspection.mjs +12 -3
  31. package/dist/harness-runtime/lib/agy-native-inventory.mjs +19 -0
  32. package/dist/harness-runtime/lib/agy-terminal-envelope.mjs +13 -6
  33. package/dist/harness-runtime/lib/agy-transcript-stream.mjs +54 -0
  34. package/dist/harness-runtime/lib/daemon-observation.d.mts +1 -0
  35. package/dist/harness-runtime/lib/daemon-observation.mjs +12 -4
  36. package/dist/harness-runtime/lib/daemon-operations.mjs +20 -5
  37. package/dist/harness-runtime/lib/dd-agy-daemon.d.mts +1 -0
  38. package/dist/harness-runtime/lib/dd-agy-daemon.mjs +371 -114
  39. package/dist/harness-runtime/lib/dd-codex-daemon.mjs +43 -3
  40. package/dist/harness-runtime/lib/dd-codex.mjs +36 -4
  41. package/dist/harness-runtime/lib/dd-droid-daemon.mjs +25 -11
  42. package/dist/harness-runtime/lib/dd-droid.mjs +124 -11
  43. package/dist/harness-runtime/lib/dd-grok-daemon.d.mts +1 -0
  44. package/dist/harness-runtime/lib/dd-grok-daemon.mjs +137 -25
  45. package/dist/harness-runtime/lib/dd-grok.mjs +4 -2
  46. package/dist/harness-runtime/lib/dd-opencode-daemon.mjs +170 -25
  47. package/dist/harness-runtime/lib/dd-opencode.mjs +40 -19
  48. package/dist/harness-runtime/lib/dd-zcode-daemon.d.mts +1 -0
  49. package/dist/harness-runtime/lib/dd-zcode-daemon.mjs +115 -22
  50. package/dist/harness-runtime/lib/dd-zcode.mjs +75 -36
  51. package/dist/harness-runtime/lib/delegation-instructions.d.mts +1 -0
  52. package/dist/harness-runtime/lib/delegation-instructions.mjs +10 -3
  53. package/dist/harness-runtime/lib/delivery-command.mjs +84 -0
  54. package/dist/harness-runtime/lib/driver-recovery.mjs +0 -19
  55. package/dist/harness-runtime/lib/droid-observation.mjs +9 -5
  56. package/dist/harness-runtime/lib/lifecycle-contract.d.mts +1 -0
  57. package/dist/harness-runtime/lib/lifecycle-contract.mjs +2 -1
  58. package/dist/harness-runtime/lib/native-hook-command.d.mts +3 -2
  59. package/dist/harness-runtime/lib/native-hook-command.mjs +63 -8
  60. package/dist/harness-runtime/lib/native-streams.mjs +3 -10
  61. package/dist/harness-runtime/lib/opencode-plugin.mjs +36 -9
  62. package/dist/harness-runtime/lib/operation-errors.mjs +13 -0
  63. package/dist/harness-runtime/lib/operation-progress.mjs +6 -2
  64. package/dist/harness-runtime/lib/process-json.mjs +4 -5
  65. package/dist/harness-runtime/lib/tool-observations.mjs +20 -10
  66. package/dist/harness-runtime/lib/zcode-native-hook-ownership.mjs +109 -0
  67. package/dist/schemas/code-work-result.schema.json +2 -1
  68. package/dist/schemas/delivery-stage-result.schema.json +286 -0
  69. package/dist/schemas/distill-stage-result.schema.json +667 -0
  70. package/dist/schemas/distill-work-result.schema.json +428 -0
  71. package/dist/schemas/execution-bundle.schema.json +6 -2
  72. package/dist/schemas/interactive-stage-result.schema.json +47 -0
  73. package/dist/schemas/interactive-work-result.schema.json +63 -0
  74. package/dist/schemas/mb-fix-stage-result.schema.json +93 -0
  75. package/dist/schemas/project-flow-pack-manifest.schema.json +2 -2
  76. package/dist/schemas/review-fix-stage-result.schema.json +210 -0
  77. package/dist/schemas/run-control-receipt.schema.json +1 -0
  78. package/dist/services/assigned-lifecycle.js +382 -0
  79. package/dist/services/check-runner-evidence.js +77 -10
  80. package/dist/services/check-runner-proof.js +69 -1
  81. package/dist/services/cli-operation-classifier.js +6 -1
  82. package/dist/services/code-checks.js +56 -23
  83. package/dist/services/codex-hook-delivery.js +11 -2
  84. package/dist/services/controller-execution.js +4 -1
  85. package/dist/services/controller-fanout.js +9 -4
  86. package/dist/services/controller-memory-worker.js +6 -4
  87. package/dist/services/controller-result-authority.js +122 -0
  88. package/dist/services/dashboard.js +4 -2
  89. package/dist/services/delivery-access.js +123 -0
  90. package/dist/services/delivery-approval.js +68 -0
  91. package/dist/services/delivery-artifact.js +86 -0
  92. package/dist/services/delivery-checks.js +178 -0
  93. package/dist/services/delivery-execution.js +181 -0
  94. package/dist/services/delivery-intents.js +212 -0
  95. package/dist/services/delivery-operation.js +81 -0
  96. package/dist/services/delivery-policy.js +91 -0
  97. package/dist/services/delivery-procedures.js +43 -0
  98. package/dist/services/delivery-request.js +99 -0
  99. package/dist/services/delivery-result.js +144 -0
  100. package/dist/services/delivery-stage-commands.js +26 -0
  101. package/dist/services/delivery-stage-entry.js +56 -0
  102. package/dist/services/delivery-stage-handlers.js +135 -0
  103. package/dist/services/delivery-stage-results.js +94 -0
  104. package/dist/services/descriptor-coordinator-session.js +3 -1
  105. package/dist/services/descriptor-run-start.js +24 -4
  106. package/dist/services/descriptor-stage-coordinator.js +78 -10
  107. package/dist/services/descriptor-stage-settlement.js +59 -14
  108. package/dist/services/diagnostic-repair-intake.js +123 -0
  109. package/dist/services/diagnostic-repair-source-intake.js +102 -0
  110. package/dist/services/diagnostic-report.js +30 -0
  111. package/dist/services/diagnostic-run-bundle.js +48 -9
  112. package/dist/services/diagnostic-snapshot.js +2 -2
  113. package/dist/services/diagnostic-stage-handlers.js +3 -2
  114. package/dist/services/diagnostic-stage-results.js +26 -0
  115. package/dist/services/diagnostic-start.js +56 -6
  116. package/dist/services/diagnostic-work-collection.js +3 -3
  117. package/dist/services/distill-document-publication.js +280 -0
  118. package/dist/services/distill-promotion.js +197 -0
  119. package/dist/services/distill-publication-custody.js +162 -0
  120. package/dist/services/distill-stage-handlers.js +249 -0
  121. package/dist/services/distill-stage-results.js +105 -0
  122. package/dist/services/distill-user-inputs.js +4 -0
  123. package/dist/services/distill-work-batch.js +42 -0
  124. package/dist/services/distill-work-collection.js +74 -0
  125. package/dist/services/distill-work-registration.js +93 -0
  126. package/dist/services/distill-work-results.js +98 -0
  127. package/dist/services/eval-snapshots.js +17 -7
  128. package/dist/services/external-work-launch.js +8 -2
  129. package/dist/services/flow-catalog.js +24 -0
  130. package/dist/services/frozen-engine.js +19 -2
  131. package/dist/services/generic-execution.js +4 -3
  132. package/dist/services/harness-adapter.js +2 -14
  133. package/dist/services/hook-memory-routing.js +1 -1
  134. package/dist/services/hooks.js +31 -6
  135. package/dist/services/hybrid-contracts.js +6 -1
  136. package/dist/services/installed-flow-source.js +37 -2
  137. package/dist/services/interactive-attached-session.js +215 -0
  138. package/dist/services/interactive-baseline-custody.js +54 -0
  139. package/dist/services/interactive-before-versions.js +148 -0
  140. package/dist/services/interactive-bundle-data.js +85 -0
  141. package/dist/services/interactive-checks.js +179 -0
  142. package/dist/services/interactive-execution.js +33 -0
  143. package/dist/services/interactive-finish-integration.js +236 -0
  144. package/dist/services/interactive-git-baseline.js +230 -0
  145. package/dist/services/interactive-git-dispatch.js +278 -0
  146. package/dist/services/interactive-input-delivery.js +82 -0
  147. package/dist/services/interactive-mutation-scope.js +231 -0
  148. package/dist/services/interactive-request.js +287 -0
  149. package/dist/services/interactive-run-bundle.js +109 -0
  150. package/dist/services/interactive-stage-entry.js +41 -0
  151. package/dist/services/interactive-stage-handlers.js +289 -0
  152. package/dist/services/interactive-stage-observation.js +136 -0
  153. package/dist/services/interactive-stage-results.js +111 -0
  154. package/dist/services/interactive-user-inputs.js +142 -0
  155. package/dist/services/interactive-work-batch.js +43 -0
  156. package/dist/services/interactive-work-collection.js +119 -0
  157. package/dist/services/interactive-work-completion.js +180 -0
  158. package/dist/services/interactive-work-context.js +249 -0
  159. package/dist/services/interactive-work-history.js +112 -0
  160. package/dist/services/interactive-work-registration.js +124 -0
  161. package/dist/services/interactive-work-results.js +115 -0
  162. package/dist/services/interactive-work-start.js +155 -0
  163. package/dist/services/lifecycle-invocations.js +214 -24
  164. package/dist/services/managed-daemon-binding.js +52 -1
  165. package/dist/services/memory-compose-handler.js +2 -22
  166. package/dist/services/memory-finish-integration.js +58 -17
  167. package/dist/services/memory-fix-finish-integration.js +129 -0
  168. package/dist/services/memory-fix-git-dispatch.js +139 -0
  169. package/dist/services/memory-fix-intake-custody.js +11 -0
  170. package/dist/services/memory-fix-intake-settlement.js +127 -0
  171. package/dist/services/memory-fix-publication.js +196 -0
  172. package/dist/services/memory-fix-repair-admission.js +116 -0
  173. package/dist/services/memory-fix-request.js +141 -0
  174. package/dist/services/memory-fix-run-bundle.js +83 -0
  175. package/dist/services/memory-fix-scope.js +78 -0
  176. package/dist/services/memory-fix-sources.js +85 -0
  177. package/dist/services/memory-fix-stage-entry.js +24 -0
  178. package/dist/services/memory-fix-stage-handlers.js +282 -0
  179. package/dist/services/memory-fix-stage-results.js +106 -0
  180. package/dist/services/memory-fix-workspace.js +127 -0
  181. package/dist/services/memory-flow-user-inputs.js +88 -0
  182. package/dist/services/memory-init-contexts.js +55 -5
  183. package/dist/services/memory-init-controller-start.js +20 -4
  184. package/dist/services/memory-layer.js +7 -3
  185. package/dist/services/memory-native-review-copy.js +27 -3
  186. package/dist/services/memory-repair-document-delta.js +1 -0
  187. package/dist/services/project-flow-source.js +195 -0
  188. package/dist/services/project-git-integration.js +92 -0
  189. package/dist/services/repair-intents.js +2 -4
  190. package/dist/services/retained-native-hook.js +245 -0
  191. package/dist/services/review-fix-handoff.js +82 -0
  192. package/dist/services/review-fix-intake-custody.js +17 -0
  193. package/dist/services/review-fix-stage-entry.js +43 -0
  194. package/dist/services/review-fix-stage-handlers.js +176 -0
  195. package/dist/services/review-fix-stage-results.js +86 -0
  196. package/dist/services/run-control-worker.js +42 -1
  197. package/dist/services/run-control.js +40 -5
  198. package/dist/services/run-controller-adapter.js +37 -3
  199. package/dist/services/run-controller-process.js +12 -4
  200. package/dist/services/run-controller-recovery.js +46 -6
  201. package/dist/services/run-controller-state.js +3 -2
  202. package/dist/services/run-controller.js +209 -43
  203. package/dist/services/run-recovery.js +31 -2
  204. package/dist/services/run-timeline.js +59 -0
  205. package/dist/services/runs.js +18 -31
  206. package/dist/services/sessions.js +2 -1
  207. package/dist/services/stage-handlers.js +55 -3
  208. package/dist/services/stage-lifecycle.js +4 -3
  209. package/dist/services/stage-pause.js +26 -9
  210. package/dist/services/stage-report-renderer.js +2 -6
  211. package/dist/services/technical-notes.js +31 -0
  212. package/dist/services/verification-matrix.js +1 -1
  213. package/dist/services/version-status.js +1 -1
  214. package/dist/services/vnext-code-review.js +74 -5
  215. package/dist/services/vnext-code.js +9 -32
  216. package/dist/services/vnext-fanout.js +53 -8
  217. package/dist/services/vnext-merge.js +10 -5
  218. package/dist/services/vnext-plan-review.js +1 -1
  219. package/dist/services/vnext-plan.js +1 -1
  220. package/dist/services/vnext-protocolize.js +1 -1
  221. package/dist/services/vnext-specify.js +10 -5
  222. package/dist/services/work-registry.js +252 -66
  223. package/dist/services/worktrees.js +7 -4
  224. package/dist/storage/database.js +2 -1
  225. package/dist/verification-components.json +82 -0
  226. package/package.json +4 -3
  227. package/tools/verification-jobs.mjs +342 -0
@@ -0,0 +1,428 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "dd-flow/distill-work-result@1",
4
+ "title": "Read-only practice extraction or independent distillation criticism",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_id",
9
+ "flow_id",
10
+ "run_id",
11
+ "work_id",
12
+ "stage",
13
+ "aspect_id",
14
+ "summary",
15
+ "baseline_summary",
16
+ "checked",
17
+ "candidates",
18
+ "decisions",
19
+ "external_research",
20
+ "limitations"
21
+ ],
22
+ "properties": {
23
+ "schema_id": {
24
+ "const": "dd-flow/distill-work-result@1"
25
+ },
26
+ "flow_id": {
27
+ "const": "mb-distill"
28
+ },
29
+ "run_id": {
30
+ "type": "string",
31
+ "pattern": "^RUN-[0-9]+-[a-z0-9-]+$"
32
+ },
33
+ "work_id": {
34
+ "type": "string",
35
+ "pattern": "^WRK-[0-9]+-[a-z0-9-]+$"
36
+ },
37
+ "stage": {
38
+ "enum": [
39
+ "extract",
40
+ "review"
41
+ ]
42
+ },
43
+ "aspect_id": {
44
+ "type": "string",
45
+ "minLength": 1,
46
+ "maxLength": 16000
47
+ },
48
+ "summary": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 16000
52
+ },
53
+ "baseline_summary": {
54
+ "type": "string",
55
+ "minLength": 1,
56
+ "maxLength": 16000
57
+ },
58
+ "checked": {
59
+ "type": "string",
60
+ "minLength": 1,
61
+ "maxLength": 16000
62
+ },
63
+ "candidates": {
64
+ "type": "array",
65
+ "minItems": 0,
66
+ "maxItems": 1000,
67
+ "items": {
68
+ "$ref": "#/$defs/candidate"
69
+ }
70
+ },
71
+ "decisions": {
72
+ "type": "array",
73
+ "minItems": 0,
74
+ "maxItems": 2000,
75
+ "items": {
76
+ "$ref": "#/$defs/decision"
77
+ }
78
+ },
79
+ "external_research": {
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "used",
84
+ "reason",
85
+ "questions",
86
+ "sources",
87
+ "signal",
88
+ "effect"
89
+ ],
90
+ "properties": {
91
+ "used": {
92
+ "type": "boolean"
93
+ },
94
+ "reason": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 16000
98
+ },
99
+ "questions": {
100
+ "type": "array",
101
+ "minItems": 0,
102
+ "maxItems": 5,
103
+ "items": {
104
+ "type": "string",
105
+ "minLength": 1,
106
+ "maxLength": 16000
107
+ }
108
+ },
109
+ "sources": {
110
+ "type": "array",
111
+ "minItems": 0,
112
+ "maxItems": 64,
113
+ "items": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": [
117
+ "url",
118
+ "summary"
119
+ ],
120
+ "properties": {
121
+ "url": {
122
+ "type": "string",
123
+ "pattern": "^https?://",
124
+ "maxLength": 4096
125
+ },
126
+ "summary": {
127
+ "type": "string",
128
+ "minLength": 1,
129
+ "maxLength": 16000
130
+ }
131
+ }
132
+ }
133
+ },
134
+ "signal": {
135
+ "enum": [
136
+ "strong",
137
+ "medium",
138
+ "weak",
139
+ "none"
140
+ ]
141
+ },
142
+ "effect": {
143
+ "enum": [
144
+ "strengthens",
145
+ "weakens",
146
+ "neutral"
147
+ ]
148
+ }
149
+ }
150
+ },
151
+ "limitations": {
152
+ "type": "array",
153
+ "minItems": 0,
154
+ "maxItems": 256,
155
+ "items": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 16000
159
+ }
160
+ }
161
+ },
162
+ "allOf": [
163
+ {
164
+ "if": {
165
+ "properties": {
166
+ "stage": {
167
+ "const": "review"
168
+ }
169
+ },
170
+ "required": [
171
+ "stage"
172
+ ],
173
+ "type": "object"
174
+ },
175
+ "then": {
176
+ "properties": {
177
+ "candidates": {
178
+ "maxItems": 0,
179
+ "type": "array"
180
+ }
181
+ },
182
+ "type": "object"
183
+ },
184
+ "else": {
185
+ "properties": {
186
+ "decisions": {
187
+ "maxItems": 0,
188
+ "type": "array"
189
+ }
190
+ },
191
+ "type": "object"
192
+ }
193
+ }
194
+ ],
195
+ "$defs": {
196
+ "source": {
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "required": [
200
+ "path",
201
+ "sha256"
202
+ ],
203
+ "properties": {
204
+ "path": {
205
+ "type": "string",
206
+ "minLength": 1,
207
+ "maxLength": 4096
208
+ },
209
+ "sha256": {
210
+ "type": "string",
211
+ "pattern": "^[a-f0-9]{64}$"
212
+ }
213
+ }
214
+ },
215
+ "candidate": {
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": [
219
+ "id",
220
+ "aspect_id",
221
+ "practice",
222
+ "source_refs",
223
+ "usage_refs",
224
+ "baseline_refs",
225
+ "delta",
226
+ "problem_solved",
227
+ "applicability",
228
+ "canon_fit",
229
+ "agent_leverage",
230
+ "evidence_strength",
231
+ "adoption_effort",
232
+ "complexity_risk",
233
+ "disposition",
234
+ "value",
235
+ "suggested_location",
236
+ "suggested_form",
237
+ "suggested_wording",
238
+ "risks",
239
+ "open_questions"
240
+ ],
241
+ "properties": {
242
+ "id": {
243
+ "type": "string",
244
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,99}$"
245
+ },
246
+ "aspect_id": {
247
+ "type": "string",
248
+ "minLength": 1,
249
+ "maxLength": 16000
250
+ },
251
+ "practice": {
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "maxLength": 16000
255
+ },
256
+ "source_refs": {
257
+ "type": "array",
258
+ "minItems": 1,
259
+ "maxItems": 64,
260
+ "items": {
261
+ "$ref": "#/$defs/source"
262
+ }
263
+ },
264
+ "usage_refs": {
265
+ "type": "array",
266
+ "minItems": 0,
267
+ "maxItems": 64,
268
+ "items": {
269
+ "$ref": "#/$defs/source"
270
+ }
271
+ },
272
+ "baseline_refs": {
273
+ "type": "array",
274
+ "minItems": 1,
275
+ "maxItems": 64,
276
+ "items": {
277
+ "$ref": "#/$defs/source"
278
+ }
279
+ },
280
+ "delta": {
281
+ "type": "string",
282
+ "minLength": 1,
283
+ "maxLength": 16000
284
+ },
285
+ "problem_solved": {
286
+ "type": "string",
287
+ "minLength": 1,
288
+ "maxLength": 16000
289
+ },
290
+ "applicability": {
291
+ "type": "string",
292
+ "minLength": 1,
293
+ "maxLength": 16000
294
+ },
295
+ "canon_fit": {
296
+ "type": "string",
297
+ "minLength": 1,
298
+ "maxLength": 16000
299
+ },
300
+ "agent_leverage": {
301
+ "type": "string",
302
+ "minLength": 1,
303
+ "maxLength": 16000
304
+ },
305
+ "evidence_strength": {
306
+ "enum": [
307
+ "strong",
308
+ "medium",
309
+ "weak"
310
+ ]
311
+ },
312
+ "adoption_effort": {
313
+ "type": "string",
314
+ "minLength": 1,
315
+ "maxLength": 16000
316
+ },
317
+ "complexity_risk": {
318
+ "type": "string",
319
+ "minLength": 1,
320
+ "maxLength": 16000
321
+ },
322
+ "disposition": {
323
+ "enum": [
324
+ "adopt",
325
+ "adapt",
326
+ "observe",
327
+ "duplicate",
328
+ "reject"
329
+ ]
330
+ },
331
+ "value": {
332
+ "enum": [
333
+ "high",
334
+ "medium",
335
+ "low"
336
+ ]
337
+ },
338
+ "suggested_location": {
339
+ "type": "string",
340
+ "minLength": 1,
341
+ "maxLength": 16000
342
+ },
343
+ "suggested_form": {
344
+ "enum": [
345
+ "rule",
346
+ "guide",
347
+ "template",
348
+ "prompt",
349
+ "example"
350
+ ]
351
+ },
352
+ "suggested_wording": {
353
+ "type": "string",
354
+ "minLength": 1,
355
+ "maxLength": 16000
356
+ },
357
+ "risks": {
358
+ "type": "array",
359
+ "minItems": 0,
360
+ "maxItems": 256,
361
+ "items": {
362
+ "type": "string",
363
+ "minLength": 1,
364
+ "maxLength": 16000
365
+ }
366
+ },
367
+ "open_questions": {
368
+ "type": "array",
369
+ "minItems": 0,
370
+ "maxItems": 256,
371
+ "items": {
372
+ "type": "string",
373
+ "minLength": 1,
374
+ "maxLength": 16000
375
+ }
376
+ }
377
+ }
378
+ },
379
+ "decision": {
380
+ "type": "object",
381
+ "additionalProperties": false,
382
+ "required": [
383
+ "candidate_id",
384
+ "disposition",
385
+ "reason",
386
+ "source_refs",
387
+ "baseline_refs"
388
+ ],
389
+ "properties": {
390
+ "candidate_id": {
391
+ "type": "string",
392
+ "minLength": 1,
393
+ "maxLength": 16000
394
+ },
395
+ "disposition": {
396
+ "enum": [
397
+ "adopt",
398
+ "adapt",
399
+ "observe",
400
+ "duplicate",
401
+ "reject"
402
+ ]
403
+ },
404
+ "reason": {
405
+ "type": "string",
406
+ "minLength": 1,
407
+ "maxLength": 16000
408
+ },
409
+ "source_refs": {
410
+ "type": "array",
411
+ "minItems": 0,
412
+ "maxItems": 64,
413
+ "items": {
414
+ "$ref": "#/$defs/source"
415
+ }
416
+ },
417
+ "baseline_refs": {
418
+ "type": "array",
419
+ "minItems": 0,
420
+ "maxItems": 64,
421
+ "items": {
422
+ "$ref": "#/$defs/source"
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
@@ -4,9 +4,12 @@
4
4
  "type": "object",
5
5
  "additionalProperties": false,
6
6
  "allOf": [{
7
- "if": { "properties": { "flow_id": { "enum": ["mb-audit", "project-review"] } }, "required": ["flow_id"] },
7
+ "if": { "properties": { "flow_id": { "enum": ["mb-audit", "project-review", "mb-distill", "mb-fix", "review-fix", "release", "deploy", "publish"] } }, "required": ["flow_id"] },
8
8
  "then": { "properties": { "project_pack": { "type": "null" } } },
9
9
  "else": { "properties": { "project_pack": { "type": "object" } } }
10
+ }, {
11
+ "if": { "properties": { "flow_id": { "const": "interactive" } }, "required": ["flow_id"] },
12
+ "else": { "properties": { "canon": { "type": "object", "properties": { "archive_sha256": { "type": "string" } } } } }
10
13
  }],
11
14
  "required": [
12
15
  "schema_id",
@@ -128,7 +131,8 @@
128
131
  "pattern": "^[a-f0-9]{40}$"
129
132
  },
130
133
  "archive_sha256": {
131
- "type": "string",
134
+ "description": "Selected canonical archive identity. Null only for project-local interactive instructions: canon version/commit are their declared base, while project_pack identifies the actual executable data.",
135
+ "type": ["string", "null"],
132
136
  "pattern": "^[a-f0-9]{64}$"
133
137
  }
134
138
  }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "dd-flow/interactive-stage-result@1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schema_id", "flow_id", "run_id", "stage", "input_sha256", "baseline_sha256", "user_inputs_sha256", "scope_revision", "file_changes_sha256", "work_collection_sha256", "summary", "predecessors", "details"],
7
+ "properties": {
8
+ "schema_id": { "const": "dd-flow/interactive-stage-result@1" },
9
+ "flow_id": { "const": "interactive" },
10
+ "run_id": { "type": "string", "pattern": "^RUN-[0-9]+-[a-z0-9-]+$" },
11
+ "stage": { "enum": ["preflight", "interactive", "consolidation", "hardening", "review", "integration"] },
12
+ "input_sha256": { "$ref": "#/$defs/digest" },
13
+ "baseline_sha256": { "$ref": "#/$defs/digest" },
14
+ "user_inputs_sha256": { "$ref": "#/$defs/digest" },
15
+ "scope_revision": { "$ref": "#/$defs/digest" },
16
+ "file_changes_sha256": { "$ref": "#/$defs/digest" },
17
+ "work_collection_sha256": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/digest" }] },
18
+ "summary": { "$ref": "#/$defs/text" },
19
+ "predecessors": {
20
+ "type": "array", "maxItems": 1,
21
+ "items": {
22
+ "type": "object", "additionalProperties": false, "required": ["stage", "path", "sha256"],
23
+ "properties": {
24
+ "stage": { "enum": ["preflight", "interactive", "consolidation", "hardening", "review"] },
25
+ "path": { "type": "string", "minLength": 1, "maxLength": 4096, "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\\\u0000]+$" },
26
+ "sha256": { "$ref": "#/$defs/digest" }
27
+ }
28
+ }
29
+ },
30
+ "details": {
31
+ "type": "object", "additionalProperties": false, "required": ["change_summary", "review", "limitations"],
32
+ "properties": {
33
+ "change_summary": { "$ref": "#/$defs/text" },
34
+ "review": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/review" }] },
35
+ "limitations": { "type": "array", "maxItems": 4096, "uniqueItems": true, "items": { "$ref": "#/$defs/text" } }
36
+ }
37
+ }
38
+ },
39
+ "$defs": {
40
+ "digest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
41
+ "text": { "type": "string", "minLength": 1, "maxLength": 16384, "pattern": "^[^\\u0000]+$" },
42
+ "review": {
43
+ "type": "object", "additionalProperties": false, "required": ["verdict", "summary"],
44
+ "properties": { "verdict": { "enum": ["accept", "revise"] }, "summary": { "$ref": "#/$defs/text" } }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "dd-flow/interactive-work-result@1",
4
+ "type": "object", "additionalProperties": false,
5
+ "required": ["schema_id", "run_id", "work_id", "stage", "packet_sha256", "verdict", "summary", "changes", "checks", "issues", "limitations"],
6
+ "properties": {
7
+ "schema_id": { "const": "dd-flow/interactive-work-result@1" },
8
+ "run_id": { "type": "string", "pattern": "^RUN-[0-9]+-[a-z0-9-]+$" },
9
+ "work_id": { "type": "string", "minLength": 1, "maxLength": 200 },
10
+ "stage": { "enum": ["hardening", "review"] },
11
+ "packet_sha256": { "$ref": "#/$defs/digest" },
12
+ "verdict": { "enum": ["ready", "needs_work", "blocked"] },
13
+ "summary": { "$ref": "#/$defs/text" },
14
+ "changes": {
15
+ "type": "array", "maxItems": 20000,
16
+ "items": {
17
+ "type": "object", "additionalProperties": false, "required": ["path", "before_sha256", "after_sha256"],
18
+ "dependentRequired": { "before_mode": ["after_mode"], "after_mode": ["before_mode"] },
19
+ "properties": { "path": { "$ref": "#/$defs/path" }, "before_sha256": { "$ref": "#/$defs/nullable_digest" }, "after_sha256": { "$ref": "#/$defs/nullable_digest" },
20
+ "before_mode": { "$ref": "#/$defs/mode" }, "after_mode": { "$ref": "#/$defs/mode" } }
21
+ }
22
+ },
23
+ "checks": { "type": "array", "maxItems": 4096, "items": { "$ref": "#/$defs/run_reference" } },
24
+ "issues": {
25
+ "type": "array", "maxItems": 4096,
26
+ "items": {
27
+ "type": "object", "additionalProperties": false, "required": ["id", "severity", "summary", "evidence"],
28
+ "properties": {
29
+ "id": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\u0000]+$" },
30
+ "severity": { "enum": ["critical", "major", "minor"] },
31
+ "summary": { "$ref": "#/$defs/text" },
32
+ "evidence": { "type": "array", "minItems": 1, "maxItems": 4096, "items": { "$ref": "#/$defs/reference" } }
33
+ }
34
+ }
35
+ },
36
+ "issue_decisions": {
37
+ "type": "array", "maxItems": 4096,
38
+ "items": {
39
+ "type": "object", "additionalProperties": false, "required": ["work_id", "issue_id", "outcome", "summary", "evidence"],
40
+ "properties": {
41
+ "work_id": { "type": "string", "minLength": 1, "maxLength": 200 },
42
+ "issue_id": { "type": ["string", "null"], "minLength": 1, "maxLength": 200, "pattern": "^[^\\u0000]+$" },
43
+ "outcome": { "enum": ["resolved", "still_open", "not_applicable"] },
44
+ "summary": { "$ref": "#/$defs/text" },
45
+ "evidence": { "type": "array", "minItems": 1, "maxItems": 4096, "items": { "$ref": "#/$defs/reference" } }
46
+ }
47
+ }
48
+ },
49
+ "limitations": { "type": "array", "maxItems": 4096, "uniqueItems": true, "items": { "$ref": "#/$defs/text" } }
50
+ },
51
+ "$defs": {
52
+ "mode": { "type": ["integer", "null"], "minimum": 0, "maximum": 4095 },
53
+ "digest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
54
+ "nullable_digest": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/digest" }] },
55
+ "text": { "type": "string", "minLength": 1, "maxLength": 16384, "pattern": "^[^\\u0000]+$" },
56
+ "path": { "type": "string", "minLength": 1, "maxLength": 4096, "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\\\u0000]+$" },
57
+ "reference": {
58
+ "type": "object", "additionalProperties": false, "required": ["root", "path", "sha256"],
59
+ "properties": { "root": { "enum": ["run", "workspace"] }, "path": { "$ref": "#/$defs/path" }, "sha256": { "$ref": "#/$defs/digest" } }
60
+ },
61
+ "run_reference": { "allOf": [{ "$ref": "#/$defs/reference" }, { "type": "object", "properties": { "root": { "const": "run" } } }] }
62
+ }
63
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "dd-flow/mb-fix-stage-result@1",
4
+ "title": "Selected Memory Bank repair result; claims require independent CLI custody",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_id", "flow_id", "run_id", "stage", "input_sha256", "intake_sha256", "source_observation_sha256", "summary", "predecessors", "details"],
8
+ "properties": {
9
+ "schema_id": {"const": "dd-flow/mb-fix-stage-result@1"},
10
+ "flow_id": {"const": "mb-fix"},
11
+ "run_id": {"type": "string", "pattern": "^RUN-[0-9]+-[a-z0-9-]+$"},
12
+ "stage": {"enum": ["intake", "repair", "verify", "review", "finish"]},
13
+ "input_sha256": {"$ref": "#/$defs/hash"},
14
+ "intake_sha256": {"$ref": "#/$defs/hash"},
15
+ "source_observation_sha256": {"$ref": "#/$defs/hash"},
16
+ "summary": {"$ref": "#/$defs/text"},
17
+ "predecessors": {
18
+ "type": "array", "maxItems": 1,
19
+ "items": {
20
+ "type": "object", "additionalProperties": false,
21
+ "required": ["stage", "path", "sha256"],
22
+ "properties": {"stage": {"type": "string", "minLength": 1}, "path": {"$ref": "#/$defs/path"}, "sha256": {"$ref": "#/$defs/hash"}}
23
+ }
24
+ },
25
+ "details": {
26
+ "type": "object", "additionalProperties": false,
27
+ "required": ["routing", "write_scope", "repair_receipt", "verification", "review", "limitations"],
28
+ "properties": {
29
+ "routing": {
30
+ "type": "array", "minItems": 1, "maxItems": 4096,
31
+ "items": {
32
+ "type": "object", "additionalProperties": false,
33
+ "required": ["finding_id", "route", "reason", "write_paths"],
34
+ "properties": {
35
+ "finding_id": {"type": "string", "minLength": 1, "maxLength": 256},
36
+ "route": {"enum": ["memory_repair", "review_fix", "upgrade", "defer"]},
37
+ "reason": {"$ref": "#/$defs/text"},
38
+ "write_paths": {"type": "array", "maxItems": 512, "uniqueItems": true, "items": {"$ref": "#/$defs/path"}}
39
+ }
40
+ }
41
+ },
42
+ "write_scope": {
43
+ "oneOf": [{"type": "null"}, {
44
+ "type": "object", "additionalProperties": false,
45
+ "required": ["finding_ids", "paths", "approval_source", "user_inputs_sha256"],
46
+ "properties": {
47
+ "finding_ids": {"type": "array", "minItems": 1, "maxItems": 4096, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
48
+ "paths": {"type": "array", "minItems": 1, "maxItems": 512, "uniqueItems": true, "items": {"$ref": "#/$defs/path"}},
49
+ "approval_source": {"$ref": "#/$defs/artifact"},
50
+ "user_inputs_sha256": {"$ref": "#/$defs/hash"}
51
+ }
52
+ }]
53
+ },
54
+ "repair_receipt": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/artifact"}]},
55
+ "verification": {
56
+ "type": "array", "maxItems": 4096,
57
+ "items": {
58
+ "type": "object", "additionalProperties": false,
59
+ "required": ["finding_id", "verdict", "summary", "evidence"],
60
+ "properties": {"finding_id": {"type": "string", "minLength": 1}, "verdict": {"enum": ["resolved", "unresolved"]},
61
+ "summary": {"$ref": "#/$defs/text"}, "evidence": {"$ref": "#/$defs/evidence"}}
62
+ }
63
+ },
64
+ "review": {
65
+ "type": "array", "maxItems": 4096,
66
+ "items": {
67
+ "type": "object", "additionalProperties": false,
68
+ "required": ["finding_id", "disposition", "summary", "evidence"],
69
+ "properties": {"finding_id": {"type": "string", "minLength": 1}, "disposition": {"enum": ["accept", "reopen"]},
70
+ "summary": {"$ref": "#/$defs/text"}, "evidence": {"$ref": "#/$defs/evidence"}}
71
+ }
72
+ },
73
+ "limitations": {"type": "array", "maxItems": 4096, "items": {"$ref": "#/$defs/text"}}
74
+ }
75
+ }
76
+ },
77
+ "$defs": {
78
+ "hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
79
+ "path": {"type": "string", "minLength": 1, "maxLength": 4096},
80
+ "text": {"type": "string", "minLength": 1, "maxLength": 16000},
81
+ "artifact": {
82
+ "type": "object", "additionalProperties": false, "required": ["root", "path", "sha256"],
83
+ "properties": {"root": {"const": "run"}, "path": {"$ref": "#/$defs/path"}, "sha256": {"$ref": "#/$defs/hash"}}
84
+ },
85
+ "evidence": {
86
+ "type": "array", "maxItems": 512,
87
+ "items": {
88
+ "type": "object", "additionalProperties": false, "required": ["root", "path", "sha256"],
89
+ "properties": {"root": {"enum": ["project", "run"]}, "path": {"$ref": "#/$defs/path"}, "sha256": {"$ref": "#/$defs/hash"}}
90
+ }
91
+ }
92
+ }
93
+ }
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "dd-flow/project-flow-pack-manifest@2",
4
4
  "title": "Project flow pack manifest",
5
- "description": "Manifest for the curated project-local dd-flow pack installed under .memory-bank/dd-flow/.",
5
+ "description": "Manifest shape for current and retained historical project-local packs. The current producer separately enforces canonical-only exclusions; obsolete included paths remain readable for safe upgrade and preservation.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": [
@@ -81,7 +81,7 @@
81
81
  "uniqueItems": true,
82
82
  "items": {
83
83
  "type": "string",
84
- "enum": ["mb-init.md", "mb-upgrade.md", "mb-distill.md", "mb-audit.md", "review.md"]
84
+ "enum": ["mb-init.md", "mb-upgrade.md", "mb-distill.md", "mb-audit.md", "mb-fix.md", "review.md", "review-fix.md", "release.md", "deploy.md", "publish.md"]
85
85
  }
86
86
  },
87
87
  "generated_allow_patterns": {