@kontextmind/kxm 0.6.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 (227) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.kxm/README.md +14 -0
  3. package/.kxm/assets/README.md +5 -0
  4. package/.kxm/assets/retrospectives/README.md +5 -0
  5. package/.kxm/config/README.md +5 -0
  6. package/.kxm/config/agents.json +43 -0
  7. package/.kxm/config/env.example +56 -0
  8. package/.kxm/config/update.example.yaml +9 -0
  9. package/.kxm/config/workflows/fix.json +160 -0
  10. package/.kxm/config/workflows/jira-development.json +116 -0
  11. package/.kxm/config/workflows/provenance-quorum.json +150 -0
  12. package/.kxm/config/workflows/v04-dogfood.json +72 -0
  13. package/CHANGELOG.md +465 -0
  14. package/LICENSE +21 -0
  15. package/README.md +306 -0
  16. package/SECURITY.md +72 -0
  17. package/docs/README.md +48 -0
  18. package/docs/agent-communication-envelopes-and-gates.md +553 -0
  19. package/docs/architecture.md +242 -0
  20. package/docs/assignment-runner.md +241 -0
  21. package/docs/configuration.md +361 -0
  22. package/docs/continuous-improvement.md +114 -0
  23. package/docs/getting-started.md +253 -0
  24. package/docs/kxm-handbook.md +1090 -0
  25. package/docs/operations.md +205 -0
  26. package/docs/provenance-gates.md +291 -0
  27. package/docs/skills.md +45 -0
  28. package/docs/templates/README.md +95 -0
  29. package/docs/templates/adr.md +88 -0
  30. package/docs/templates/architecture.md +120 -0
  31. package/docs/templates/bug-fix.md +109 -0
  32. package/docs/templates/feature.md +108 -0
  33. package/docs/templates/handoff.md +72 -0
  34. package/docs/templates/postmortem.md +77 -0
  35. package/docs/templates/research.md +100 -0
  36. package/docs/templates/review.md +85 -0
  37. package/docs/templates/runbook.md +73 -0
  38. package/docs/templates/test-plan.md +87 -0
  39. package/docs/templates/test-report.md +72 -0
  40. package/docs/test-matrix.md +121 -0
  41. package/docs/troubleshooting.md +249 -0
  42. package/docs/vnext/README.md +62 -0
  43. package/docs/vnext/architecture.md +185 -0
  44. package/docs/vnext/effects-and-recovery.md +172 -0
  45. package/docs/vnext/lifecycles.md +235 -0
  46. package/docs/vnext/migration.md +220 -0
  47. package/docs/vnext/routing.md +184 -0
  48. package/docs/vnext/synchronization.md +172 -0
  49. package/docs/vnext/terminology.md +240 -0
  50. package/docs/vnext/validation.md +335 -0
  51. package/docs/webhook-workflows.md +240 -0
  52. package/docs/workflow-guide.md +1150 -0
  53. package/examples/README.md +102 -0
  54. package/examples/provenance-workflow.json +40 -0
  55. package/examples/requester.ts +30 -0
  56. package/examples/reviewer-agent.ts +29 -0
  57. package/examples/roundtrip.ts +46 -0
  58. package/examples/vnext/.kxm/agents/coordinator.yaml +16 -0
  59. package/examples/vnext/.kxm/agents/critic-1.yaml +16 -0
  60. package/examples/vnext/.kxm/agents/critic-2.yaml +15 -0
  61. package/examples/vnext/.kxm/agents/critic-3.yaml +15 -0
  62. package/examples/vnext/.kxm/agents/implementer.yaml +15 -0
  63. package/examples/vnext/.kxm/agents/planner.yaml +13 -0
  64. package/examples/vnext/.kxm/agents/reproducer.yaml +15 -0
  65. package/examples/vnext/.kxm/agents/reviewer.yaml +15 -0
  66. package/examples/vnext/.kxm/gates.yaml +8 -0
  67. package/examples/vnext/.kxm/models/critic-claude.yaml +11 -0
  68. package/examples/vnext/.kxm/models/critic-gemini.yaml +11 -0
  69. package/examples/vnext/.kxm/models/critic-grok.yaml +12 -0
  70. package/examples/vnext/.kxm/models/implementation.yaml +14 -0
  71. package/examples/vnext/.kxm/models/primary.yaml +17 -0
  72. package/examples/vnext/.kxm/prices.yaml +111 -0
  73. package/examples/vnext/.kxm/project/env.yaml +7 -0
  74. package/examples/vnext/.kxm/project.yaml +32 -0
  75. package/examples/vnext/.kxm/repo/repo.yaml +8 -0
  76. package/examples/vnext/.kxm/workflows/default.yaml +92 -0
  77. package/examples/vnext/.kxm/workflows/fix.yaml +376 -0
  78. package/examples/vnext/.kxm/workflows/improve.yaml +57 -0
  79. package/examples/vnext/README.md +53 -0
  80. package/examples/vnext/records/assignment-result-recorded.json +63 -0
  81. package/examples/vnext/records/assignment-result.json +46 -0
  82. package/examples/vnext/records/context-candidate.json +42 -0
  83. package/examples/vnext/records/delivery-manifest.json +66 -0
  84. package/examples/vnext/records/effect-uncertainty-resolved-sync.json +67 -0
  85. package/examples/vnext/records/effect-uncertainty-resolved.json +62 -0
  86. package/examples/vnext/records/run-created.json +54 -0
  87. package/examples/vnext/records/sync-event.json +65 -0
  88. package/examples/vnext/repositories/api/.kxm/repo/env.yaml +7 -0
  89. package/examples/vnext/repositories/api/.kxm/repo/repo.yaml +8 -0
  90. package/examples/vnext/repositories/web/.kxm/repo/repo.yaml +8 -0
  91. package/examples/workflow-signal.ts +63 -0
  92. package/package.json +129 -0
  93. package/plugins/kxm/.claude-plugin/plugin.json +73 -0
  94. package/plugins/kxm/.mcp.json +19 -0
  95. package/plugins/kxm/README.md +93 -0
  96. package/plugins/kxm/dist/cli.js +42853 -0
  97. package/plugins/kxm/dist/client.js +416 -0
  98. package/plugins/kxm/dist/core.js +1823 -0
  99. package/plugins/kxm/dist/extension.js +3797 -0
  100. package/plugins/kxm/dist/mcp-server.js +17104 -0
  101. package/plugins/kxm/dist/runtime.js +23361 -0
  102. package/plugins/kxm/dist/server.js +13640 -0
  103. package/plugins/kxm/dist/vnext-runtime-supervisor.js +21109 -0
  104. package/plugins/kxm/package.json +12 -0
  105. package/plugins/kxm/skills/kxm/SKILL.md +97 -0
  106. package/plugins/kxm/skills/kxm/references/protocol.md +103 -0
  107. package/plugins/kxm/skills/kxm-session/SKILL.md +53 -0
  108. package/plugins/kxm/src/arbiter.ts +355 -0
  109. package/plugins/kxm/src/artifacts-exist.ts +62 -0
  110. package/plugins/kxm/src/autocomplete.ts +236 -0
  111. package/plugins/kxm/src/cli.ts +3707 -0
  112. package/plugins/kxm/src/client.ts +614 -0
  113. package/plugins/kxm/src/commands.ts +1063 -0
  114. package/plugins/kxm/src/config.ts +290 -0
  115. package/plugins/kxm/src/context/providers.ts +101 -0
  116. package/plugins/kxm/src/context-packet.ts +332 -0
  117. package/plugins/kxm/src/context.ts +499 -0
  118. package/plugins/kxm/src/core.ts +6 -0
  119. package/plugins/kxm/src/database.ts +563 -0
  120. package/plugins/kxm/src/diagnostics.ts +184 -0
  121. package/plugins/kxm/src/envelope.ts +118 -0
  122. package/plugins/kxm/src/extension.ts +895 -0
  123. package/plugins/kxm/src/external-effects.ts +299 -0
  124. package/plugins/kxm/src/github-watch.ts +255 -0
  125. package/plugins/kxm/src/hub-binding.ts +160 -0
  126. package/plugins/kxm/src/hub.ts +2502 -0
  127. package/plugins/kxm/src/improve.ts +383 -0
  128. package/plugins/kxm/src/inbox.ts +10 -0
  129. package/plugins/kxm/src/kxm-install-kind.ts +113 -0
  130. package/plugins/kxm/src/kxm-update-config.ts +39 -0
  131. package/plugins/kxm/src/kxm-update.ts +238 -0
  132. package/plugins/kxm/src/local-snapshot.ts +406 -0
  133. package/plugins/kxm/src/logger.ts +198 -0
  134. package/plugins/kxm/src/mcp-server.ts +143 -0
  135. package/plugins/kxm/src/memory.ts +385 -0
  136. package/plugins/kxm/src/nous-pi.ts +287 -0
  137. package/plugins/kxm/src/nous-provider.ts +729 -0
  138. package/plugins/kxm/src/price-calc.ts +87 -0
  139. package/plugins/kxm/src/prices.ts +121 -0
  140. package/plugins/kxm/src/protocol.ts +172 -0
  141. package/plugins/kxm/src/recovery.ts +211 -0
  142. package/plugins/kxm/src/redact.ts +26 -0
  143. package/plugins/kxm/src/retrospective.ts +400 -0
  144. package/plugins/kxm/src/routing.ts +830 -0
  145. package/plugins/kxm/src/runtime.ts +9 -0
  146. package/plugins/kxm/src/server.ts +117 -0
  147. package/plugins/kxm/src/session-work.ts +571 -0
  148. package/plugins/kxm/src/session.ts +184 -0
  149. package/plugins/kxm/src/skills.ts +535 -0
  150. package/plugins/kxm/src/state.ts +326 -0
  151. package/plugins/kxm/src/store.ts +637 -0
  152. package/plugins/kxm/src/studio-layout.ts +268 -0
  153. package/plugins/kxm/src/suggest.ts +162 -0
  154. package/plugins/kxm/src/task-manager.ts +244 -0
  155. package/plugins/kxm/src/telemetry.ts +116 -0
  156. package/plugins/kxm/src/tui.ts +1046 -0
  157. package/plugins/kxm/src/vnext-bindings.ts +403 -0
  158. package/plugins/kxm/src/vnext-config.ts +1646 -0
  159. package/plugins/kxm/src/vnext-engine-artifacts.ts +86 -0
  160. package/plugins/kxm/src/vnext-engine-command.ts +533 -0
  161. package/plugins/kxm/src/vnext-engine-compile.ts +722 -0
  162. package/plugins/kxm/src/vnext-engine-evidence.ts +273 -0
  163. package/plugins/kxm/src/vnext-engine-fold.ts +1400 -0
  164. package/plugins/kxm/src/vnext-engine-gate-records.ts +583 -0
  165. package/plugins/kxm/src/vnext-engine-plan.ts +717 -0
  166. package/plugins/kxm/src/vnext-engine.ts +2458 -0
  167. package/plugins/kxm/src/vnext-gate-hash.ts +10 -0
  168. package/plugins/kxm/src/vnext-harness.ts +1142 -0
  169. package/plugins/kxm/src/vnext-init.ts +430 -0
  170. package/plugins/kxm/src/vnext-migrate.ts +1848 -0
  171. package/plugins/kxm/src/vnext-oneshot-producer.ts +424 -0
  172. package/plugins/kxm/src/vnext-permission.ts +936 -0
  173. package/plugins/kxm/src/vnext-pi-producer.ts +628 -0
  174. package/plugins/kxm/src/vnext-repair.ts +1094 -0
  175. package/plugins/kxm/src/vnext-runtime-owner.ts +320 -0
  176. package/plugins/kxm/src/vnext-runtime-store.ts +1560 -0
  177. package/plugins/kxm/src/vnext-runtime-supervisor.ts +586 -0
  178. package/plugins/kxm/src/vnext-runtime.ts +663 -0
  179. package/plugins/kxm/src/vnext-template.ts +247 -0
  180. package/plugins/kxm/src/wiki.ts +313 -0
  181. package/plugins/kxm/src/workflow.ts +1548 -0
  182. package/schemas/vnext/README.md +46 -0
  183. package/schemas/vnext/agent.schema.json +40 -0
  184. package/schemas/vnext/assignment-result.schema.json +66 -0
  185. package/schemas/vnext/backup-manifest.schema.json +89 -0
  186. package/schemas/vnext/candidate.schema.json +109 -0
  187. package/schemas/vnext/common.schema.json +422 -0
  188. package/schemas/vnext/context-candidate.schema.json +76 -0
  189. package/schemas/vnext/context-packet.schema.json +192 -0
  190. package/schemas/vnext/delivery-manifest.schema.json +159 -0
  191. package/schemas/vnext/environment.schema.json +66 -0
  192. package/schemas/vnext/gate-registry.schema.json +109 -0
  193. package/schemas/vnext/handoff-manifest.schema.json +146 -0
  194. package/schemas/vnext/init-operation.schema.json +61 -0
  195. package/schemas/vnext/local-repository-bindings.schema.json +30 -0
  196. package/schemas/vnext/memory-record.schema.json +45 -0
  197. package/schemas/vnext/migration-decision.schema.json +26 -0
  198. package/schemas/vnext/migration-plan.schema.json +123 -0
  199. package/schemas/vnext/migration-receipt.schema.json +52 -0
  200. package/schemas/vnext/model.schema.json +42 -0
  201. package/schemas/vnext/permission-diff.schema.json +57 -0
  202. package/schemas/vnext/prices.schema.json +115 -0
  203. package/schemas/vnext/project.schema.json +85 -0
  204. package/schemas/vnext/repository.schema.json +24 -0
  205. package/schemas/vnext/run-event.schema.json +460 -0
  206. package/schemas/vnext/session-brief.schema.json +153 -0
  207. package/schemas/vnext/sync-event.schema.json +234 -0
  208. package/schemas/vnext/template-provenance.schema.json +38 -0
  209. package/schemas/vnext/workflow.schema.json +248 -0
  210. package/scripts/assignment-run.d.mts +354 -0
  211. package/scripts/assignment-run.mjs +4451 -0
  212. package/scripts/build-runtime.mjs +56 -0
  213. package/scripts/check-generated.mjs +77 -0
  214. package/scripts/check-versions.mjs +34 -0
  215. package/scripts/emit-codex-artifacts.d.mts +9 -0
  216. package/scripts/emit-codex-artifacts.mjs +91 -0
  217. package/scripts/harness-run.d.mts +83 -0
  218. package/scripts/harness-run.mjs +2095 -0
  219. package/scripts/kxm-hub.mjs +105 -0
  220. package/scripts/kxm-publish-npm.mjs +327 -0
  221. package/scripts/kxm-release-github.mjs +472 -0
  222. package/scripts/kxm-runtime-supervisor.mjs +7 -0
  223. package/scripts/kxm-worker.mjs +1127 -0
  224. package/scripts/kxm.mjs +27 -0
  225. package/scripts/roster-policy.d.mts +20 -0
  226. package/scripts/roster-policy.mjs +161 -0
  227. package/scripts/smoke-multi-pi.mjs +479 -0
@@ -0,0 +1,92 @@
1
+ schema: kxm.workflow.v1
2
+ description: Minimal local plan, implement, verify, and summarize workflow.
3
+ coordinator: coordinator
4
+ limits:
5
+ maxTransitions: 8
6
+ maxRunDurationMs: 14400000
7
+ maxAgentTimeMs: 21600000
8
+ steps:
9
+ - id: plan
10
+ kind: agent
11
+ agent: planner
12
+ maxAttempts: 2
13
+ repositories:
14
+ control: read
15
+ api: read
16
+ web: read
17
+ requiredEvidence:
18
+ - key: plan
19
+ kind: artifact
20
+ timeoutMs: 1200000
21
+ on:
22
+ passed: implement
23
+ blocked:
24
+ target: $terminal
25
+ terminalStatus: failed
26
+
27
+ - id: implement
28
+ kind: agent
29
+ agent: implementer
30
+ maxAttempts: 3
31
+ repositories:
32
+ control: read
33
+ api: write
34
+ web: write
35
+ assignments:
36
+ allowedAgents:
37
+ - implementer
38
+ minimum: 1
39
+ target: 1
40
+ maximum: 2
41
+ maxParallel: 1
42
+ maxAttemptsPerAssignment: 2
43
+ maxWriteRepositories: 1
44
+ requiredEvidence:
45
+ - key: implementation-diff
46
+ kind: artifact
47
+ timeoutMs: 3600000
48
+ on:
49
+ passed: verify
50
+ failed:
51
+ target: $terminal
52
+ terminalStatus: failed
53
+
54
+ - id: verify
55
+ kind: gate
56
+ gate: test
57
+ maxAttempts: 3
58
+ repositories:
59
+ api: write
60
+ web: write
61
+ requiredEvidence:
62
+ - key: local-gates
63
+ kind: gate
64
+ timeoutMs: 3600000
65
+ on:
66
+ passed: ready
67
+ implementation-failure:
68
+ target: implement
69
+ maxTransitions: 3
70
+ failed:
71
+ target: $terminal
72
+ terminalStatus: failed
73
+
74
+ - id: ready
75
+ kind: agent
76
+ agent: planner
77
+ maxAttempts: 2
78
+ repositories:
79
+ control: read
80
+ api: read
81
+ web: read
82
+ requiredEvidence:
83
+ - key: summary
84
+ kind: assignment-result
85
+ timeoutMs: 900000
86
+ on:
87
+ passed:
88
+ target: $terminal
89
+ terminalStatus: completed
90
+ blocked:
91
+ target: $terminal
92
+ terminalStatus: failed
@@ -0,0 +1,376 @@
1
+ schema: kxm.workflow.v1
2
+ description: Prove, plan, implement, independently review, verify, and prepare a local fix delivery.
3
+ coordinator: coordinator
4
+ limits:
5
+ maxTransitions: 28
6
+ maxRunDurationMs: 43200000
7
+ maxAgentTimeMs: 86400000
8
+ maxModelCost: 40
9
+ currency: USD
10
+ reproOracle:
11
+ stageId: repro-review
12
+ evidenceKey: repro
13
+ planHash:
14
+ stageId: final-plan
15
+ evidenceKey: plan
16
+ requirePlanHash:
17
+ - implement
18
+ - local-verify
19
+ - delivery
20
+ steps:
21
+ - id: intake
22
+ kind: agent
23
+ agent: planner
24
+ maxAttempts: 2
25
+ description: Classify expected and actual behavior, affected surfaces, and reproduction hints.
26
+ repositories:
27
+ control: read
28
+ api: read
29
+ web: read
30
+ requiredEvidence:
31
+ - key: classification
32
+ kind: assignment-result
33
+ timeoutMs: 900000
34
+ on:
35
+ passed: repro-explore
36
+ blocked:
37
+ target: $terminal
38
+ terminalStatus: failed
39
+
40
+ - id: repro-explore
41
+ kind: agent
42
+ agent: planner
43
+ maxAttempts: 3
44
+ description: Identify the reporter-path production callable and design a production-coupled reproduction.
45
+ repositories:
46
+ control: read
47
+ api: read
48
+ web: read
49
+ requiredEvidence:
50
+ - key: diagnosis
51
+ kind: assignment-result
52
+ timeoutMs: 1800000
53
+ on:
54
+ passed: repro-write
55
+ blocked:
56
+ target: $terminal
57
+ terminalStatus: failed
58
+
59
+ - id: repro-write
60
+ kind: agent
61
+ agent: reproducer
62
+ maxAttempts: 3
63
+ description: Write a failing test against the diagnosis-named production seam; production files remain unchanged.
64
+ repositories:
65
+ control: read
66
+ api: write
67
+ web: write
68
+ assignments:
69
+ allowedAgents:
70
+ - reproducer
71
+ minimum: 1
72
+ target: 1
73
+ maximum: 1
74
+ maxParallel: 1
75
+ maxAttemptsPerAssignment: 2
76
+ maxWriteRepositories: 1
77
+ requiredEvidence:
78
+ - key: repro
79
+ kind: artifact
80
+ timeoutMs: 3600000
81
+ on:
82
+ passed: repro-review
83
+ failed:
84
+ target: repro-write
85
+ maxTransitions: 2
86
+ blocked:
87
+ target: $terminal
88
+ terminalStatus: failed
89
+
90
+ - id: repro-review
91
+ kind: moa
92
+ agent: critic-1
93
+ maxAttempts: 3
94
+ description: Verify reporter-path coupling, failure causality, expected behavior, and absence of production edits.
95
+ model:
96
+ tag: critic
97
+ capabilities:
98
+ - structured-output
99
+ repositories:
100
+ control: read
101
+ api: read
102
+ web: read
103
+ assignments:
104
+ allowedAgents:
105
+ - critic-1
106
+ - critic-2
107
+ - critic-3
108
+ minimum: 2
109
+ target: 3
110
+ maximum: 3
111
+ maxParallel: 3
112
+ maxAttemptsPerAssignment: 2
113
+ distinctBy:
114
+ - provider
115
+ join:
116
+ strategy: all-settled
117
+ minimumPassed: 2
118
+ cancelRemaining: false
119
+ requiredEvidence:
120
+ - key: repro
121
+ kind: artifact
122
+ - key: review
123
+ kind: assignment-result
124
+ producerPolicy:
125
+ minimumProducers: 2
126
+ eligibleAgents:
127
+ - critic-1
128
+ - critic-2
129
+ acceptedStatuses:
130
+ - passed
131
+ timeoutMs: 1800000
132
+ on:
133
+ passed: plan
134
+ repro_invalidated:
135
+ target: repro-write
136
+ maxTransitions: 3
137
+ quorum-not-met:
138
+ target: $terminal
139
+ terminalStatus: failed
140
+ blocked:
141
+ target: $terminal
142
+ terminalStatus: failed
143
+
144
+ - id: plan
145
+ kind: agent
146
+ agent: planner
147
+ maxAttempts: 3
148
+ description: Plan the smallest change that makes the immutable reproduction pass.
149
+ repositories:
150
+ control: read
151
+ api: read
152
+ web: read
153
+ requiredEvidence:
154
+ - key: plan
155
+ kind: artifact
156
+ timeoutMs: 1800000
157
+ on:
158
+ passed: critics
159
+ blocked:
160
+ target: $terminal
161
+ terminalStatus: failed
162
+
163
+ - id: critics
164
+ kind: moa
165
+ agent: critic-1
166
+ maxAttempts: 3
167
+ description: Independently review the plan for correctness, scope, security, and regression risk.
168
+ model:
169
+ tag: critic
170
+ capabilities:
171
+ - structured-output
172
+ repositories:
173
+ control: read
174
+ api: read
175
+ web: read
176
+ assignments:
177
+ allowedAgents:
178
+ - critic-1
179
+ - critic-2
180
+ - critic-3
181
+ minimum: 2
182
+ target: 3
183
+ maximum: 3
184
+ maxParallel: 3
185
+ maxAttemptsPerAssignment: 2
186
+ distinctBy:
187
+ - provider
188
+ join:
189
+ strategy: all-settled
190
+ minimumPassed: 2
191
+ cancelRemaining: false
192
+ requiredEvidence:
193
+ - key: critique
194
+ kind: assignment-result
195
+ producerPolicy:
196
+ minimumProducers: 2
197
+ eligibleAgents:
198
+ - critic-1
199
+ - critic-2
200
+ acceptedStatuses:
201
+ - passed
202
+ timeoutMs: 1800000
203
+ on:
204
+ passed: final-plan
205
+ plan_invalidated:
206
+ target: plan
207
+ maxTransitions: 3
208
+ quorum-not-met:
209
+ target: $terminal
210
+ terminalStatus: failed
211
+ blocked:
212
+ target: $terminal
213
+ terminalStatus: failed
214
+
215
+ - id: final-plan
216
+ kind: agent
217
+ agent: planner
218
+ maxAttempts: 2
219
+ description: Incorporate critique and capture the final immutable plan hash.
220
+ repositories:
221
+ control: read
222
+ api: read
223
+ web: read
224
+ requiredEvidence:
225
+ - key: plan
226
+ kind: artifact
227
+ timeoutMs: 1200000
228
+ on:
229
+ passed: approval
230
+ plan_invalidated:
231
+ target: plan
232
+ maxTransitions: 2
233
+ blocked:
234
+ target: $terminal
235
+ terminalStatus: failed
236
+
237
+ - id: approval
238
+ kind: approval
239
+ maxAttempts: 8
240
+ description: A human approves the hashed plan before implementation.
241
+ requiredEvidence:
242
+ - key: signoff
243
+ kind: approval
244
+ timeoutMs: 86400000
245
+ on:
246
+ passed: implement
247
+ rejected:
248
+ target: plan
249
+ maxTransitions: 3
250
+ cancelled:
251
+ target: $terminal
252
+ terminalStatus: cancelled
253
+ blocked:
254
+ target: $terminal
255
+ terminalStatus: failed
256
+
257
+ - id: implement
258
+ kind: agent
259
+ agent: implementer
260
+ maxAttempts: 4
261
+ description: Implement only the approved plan while preserving the reproduction oracle.
262
+ repositories:
263
+ control: read
264
+ api: write
265
+ web: write
266
+ assignments:
267
+ allowedAgents:
268
+ - implementer
269
+ minimum: 1
270
+ target: 1
271
+ maximum: 2
272
+ maxParallel: 1
273
+ maxAttemptsPerAssignment: 2
274
+ maxWriteRepositories: 1
275
+ requiredEvidence:
276
+ - key: diff
277
+ kind: artifact
278
+ - key: repro
279
+ kind: artifact
280
+ reusableAcrossAttempts: true
281
+ timeoutMs: 3600000
282
+ on:
283
+ passed: local-verify
284
+ blocked:
285
+ target: $terminal
286
+ terminalStatus: failed
287
+
288
+ - id: local-verify
289
+ kind: gate
290
+ gate: test
291
+ maxAttempts: 4
292
+ description: Run repository-defined gates and the unchanged reproduction oracle.
293
+ repositories:
294
+ api: write
295
+ web: write
296
+ requiredEvidence:
297
+ - key: gates
298
+ kind: gate
299
+ - key: repro
300
+ kind: artifact
301
+ reusableAcrossAttempts: true
302
+ timeoutMs: 3600000
303
+ on:
304
+ passed: delivery
305
+ implementation-failure:
306
+ target: implement
307
+ maxTransitions: 4
308
+ plan_invalidated:
309
+ target: plan
310
+ maxTransitions: 2
311
+ blocked:
312
+ target: $terminal
313
+ terminalStatus: failed
314
+
315
+ - id: delivery
316
+ kind: gate
317
+ gate: scm-delivery
318
+ maxAttempts: 2
319
+ description: Create a unique run branch and pull request plus the non-atomic repository delivery manifest; never merge automatically.
320
+ repositories:
321
+ control: read
322
+ api: write
323
+ web: write
324
+ requiredEvidence:
325
+ - key: delivery-manifest
326
+ kind: artifact
327
+ - key: mr
328
+ kind: receipt
329
+ timeoutMs: 1800000
330
+ on:
331
+ passed: ci-watch
332
+ failed:
333
+ target: $terminal
334
+ terminalStatus: failed
335
+ blocked:
336
+ target: $terminal
337
+ terminalStatus: failed
338
+
339
+ - id: ci-watch
340
+ kind: wait
341
+ signal: ci-review
342
+ maxAttempts: 6
343
+ description: Wait for required CI and review state using a receipt-queryable adapter.
344
+ requiredEvidence:
345
+ - key: ci
346
+ kind: receipt
347
+ timeoutMs: 86400000
348
+ on:
349
+ passed: ready-for-human-acceptance
350
+ failure:
351
+ target: implement
352
+ maxTransitions: 4
353
+ blocked:
354
+ target: $terminal
355
+ terminalStatus: failed
356
+
357
+ - id: ready-for-human-acceptance
358
+ kind: agent
359
+ agent: planner
360
+ maxAttempts: 2
361
+ description: Summarize the oracle, approved plan hash, diff, gates, CI, and delivery receipts for final human acceptance.
362
+ repositories:
363
+ control: read
364
+ api: read
365
+ web: read
366
+ requiredEvidence:
367
+ - key: summary
368
+ kind: assignment-result
369
+ timeoutMs: 900000
370
+ on:
371
+ passed:
372
+ target: $terminal
373
+ terminalStatus: completed
374
+ blocked:
375
+ target: $terminal
376
+ terminalStatus: failed
@@ -0,0 +1,57 @@
1
+ schema: kxm.workflow.v1
2
+ description: Propose improvements from telemetry routing records and create candidates.
3
+ coordinator: coordinator
4
+ limits:
5
+ maxTransitions: 8
6
+ maxRunDurationMs: 14400000
7
+ maxAgentTimeMs: 21600000
8
+ steps:
9
+ - id: report
10
+ kind: agent
11
+ agent: planner
12
+ maxAttempts: 2
13
+ repositories:
14
+ control: read
15
+ requiredEvidence:
16
+ - key: candidate
17
+ kind: artifact
18
+ timeoutMs: 1200000
19
+ on:
20
+ passed: delivery
21
+ blocked:
22
+ target: $terminal
23
+ terminalStatus: failed
24
+
25
+ - id: delivery
26
+ kind: gate
27
+ gate: scm-delivery
28
+ maxAttempts: 2
29
+ repositories:
30
+ api: write
31
+ requiredEvidence:
32
+ - key: delivery-manifest
33
+ kind: artifact
34
+ timeoutMs: 1800000
35
+ on:
36
+ passed: ready
37
+ failed:
38
+ target: $terminal
39
+ terminalStatus: failed
40
+
41
+ - id: ready
42
+ kind: agent
43
+ agent: planner
44
+ maxAttempts: 2
45
+ repositories:
46
+ control: read
47
+ requiredEvidence:
48
+ - key: summary
49
+ kind: assignment-result
50
+ timeoutMs: 900000
51
+ on:
52
+ passed:
53
+ target: $terminal
54
+ terminalStatus: completed
55
+ blocked:
56
+ target: $terminal
57
+ terminalStatus: failed
@@ -0,0 +1,53 @@
1
+ # KXM vNext complete project example
2
+
3
+ > This is a planned-contract fixture used by configuration loader tests, not a
4
+ > workflow activated or executed by the current v0.5 Runtime.
5
+
6
+ The fixture demonstrates one authoritative project root, two member
7
+ repositories, minimal individual resources, bounded dirty snapshots,
8
+ provider-tagged models, an ordered workflow with typed back-edges, MOA join
9
+ rules, and representative durable records.
10
+
11
+ ```text
12
+ examples/vnext/
13
+ ├── .kxm/
14
+ │ ├── project.yaml
15
+ │ ├── agents/
16
+ │ ├── models/
17
+ │ ├── workflows/default.yaml
18
+ │ ├── workflows/fix.yaml
19
+ │ └── project/env.yaml
20
+ ├── repositories/
21
+ │ ├── api/.kxm/repo/
22
+ │ └── web/.kxm/repo/
23
+ └── records/
24
+ ```
25
+
26
+ Identity for agents, models, and workflows comes from the filename. For
27
+ example, `.kxm/agents/reviewer.yaml` defines agent `reviewer`.
28
+
29
+ The workflow is sequential at the top level:
30
+
31
+ ```text
32
+ intake → repro-explore → repro-write → repro-review (MOA)
33
+ ▲ │
34
+ └── invalid ───┘
35
+ → plan → critics (MOA) → final-plan → approval
36
+ ▲ │ │
37
+ └─ invalid ─┘ ▼
38
+ → implement → local-verify → delivery → CI/review wait → ready
39
+ ▲ │ │
40
+ └── failure ───┴─────────────────────────────┘
41
+ ```
42
+
43
+ `default.yaml` is the no-MOA, local-only initial workflow. `fix.yaml` preserves
44
+ the current `/fix` controls: an immutable reproduction oracle, approved-plan
45
+ hash, required plan hash for mutation/delivery stages, bounded back-edges,
46
+ producer policies, delivery receipt, and CI/review wait. The Runtime, not the
47
+ coordinator, enforces transition, assignment, provider diversity, timeout, and
48
+ join bounds.
49
+
50
+ `test/contracts-vnext.test.ts` parses every YAML file and validates it plus the
51
+ JSON records against `schemas/vnext`. Production loader tests copy the fixture
52
+ to temporary control and member Git worktrees because committed fixtures cannot
53
+ contain nested `.git` metadata.
@@ -0,0 +1,63 @@
1
+ {
2
+ "schema": "kxm.run-event.v1",
3
+ "eventId": "evt_01JRESULT00000000000000000",
4
+ "eventType": "assignment.result_recorded",
5
+ "projectId": "prj_01JPROJECT00000000000000000",
6
+ "runId": "run_01JRUN00000000000000000000",
7
+ "homeRuntimeId": "runtime_01JRUNTIME000000000000000",
8
+ "sequence": 24,
9
+ "commandId": "cmd_01JRESULTCOMMAND0000000000",
10
+ "occurredAt": "2026-09-01T22:12:10.000Z",
11
+ "recordedAt": "2026-09-01T22:12:10.003Z",
12
+ "monotonicNs": "6112234000000",
13
+ "configRevision": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
14
+ "memoryRevision": "ctxrev_01JMEMORY0000000000000000",
15
+ "executorPolicyRevision": "sha256:8888888888888888888888888888888888888888888888888888888888888888",
16
+ "toolPolicyRevision": "sha256:9999999999999999999999999999999999999999999999999999999999999999",
17
+ "payload": {
18
+ "workflowId": "fix",
19
+ "status": "result_recorded",
20
+ "outcome": "implemented",
21
+ "resultClass": "outcome",
22
+ "summary": "Added single-flight token refresh and regression coverage.",
23
+ "stepId": "implement",
24
+ "stepAttempt": 1,
25
+ "assignmentId": "assignment_01JASSIGNMENT00000000000",
26
+ "attemptId": "attempt_01JATTEMPT0000000000000",
27
+ "agentId": "implementer",
28
+ "instanceNo": 1,
29
+ "scopeEpoch": 1,
30
+ "executor": {
31
+ "id": "local",
32
+ "kind": "local",
33
+ "executorVersion": "1.0.0",
34
+ "harness": "pi",
35
+ "harnessVersion": "0.84.4"
36
+ },
37
+ "model": {
38
+ "profile": "implementation",
39
+ "provider": "anthropic",
40
+ "model": "claude-sonnet-4-6",
41
+ "tags": ["implementation"]
42
+ },
43
+ "evidenceRefs": [
44
+ {
45
+ "id": "evidence_01JEVIDENCE000000000000",
46
+ "kind": "test-result",
47
+ "hash": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
48
+ "status": "passed"
49
+ }
50
+ ],
51
+ "timing": {
52
+ "durationMs": 730000,
53
+ "agentMs": 730000
54
+ },
55
+ "usage": {
56
+ "inputTokens": 18200,
57
+ "outputTokens": 3400,
58
+ "cost": 1.42,
59
+ "currency": "USD",
60
+ "costKind": "estimated"
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "schema": "kxm.assignment-result.v1",
3
+ "projectId": "prj_01JPROJECT00000000000000000",
4
+ "runId": "run_01JRUN00000000000000000000",
5
+ "stepId": "implement",
6
+ "stepAttempt": 1,
7
+ "assignmentId": "assignment_01JASSIGNMENT00000000000",
8
+ "attemptId": "attempt_01JATTEMPT0000000000000",
9
+ "status": "passed",
10
+ "outcome": "implemented",
11
+ "summary": "Added single-flight token refresh and production-coupled regression coverage.",
12
+ "evidenceRefs": [
13
+ {
14
+ "id": "evidence_01JEVIDENCE000000000000",
15
+ "kind": "test-result",
16
+ "hash": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
17
+ "status": "passed"
18
+ }
19
+ ],
20
+ "repositoryOutputs": [
21
+ {
22
+ "repositoryId": "api",
23
+ "baseCommit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
24
+ "contentSnapshotHash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
25
+ "outputCommit": "cccccccccccccccccccccccccccccccccccccccc",
26
+ "changes": {
27
+ "repositoryId": "api",
28
+ "added": ["test/Auth/RefreshConcurrencyTest.cs"],
29
+ "modified": ["src/Auth/RefreshService.cs"]
30
+ }
31
+ }
32
+ ],
33
+ "timing": {
34
+ "startedAt": "2026-09-01T22:00:00.000Z",
35
+ "finishedAt": "2026-09-01T22:12:10.000Z",
36
+ "durationMs": 730000,
37
+ "agentMs": 730000
38
+ },
39
+ "usage": {
40
+ "inputTokens": 18200,
41
+ "outputTokens": 3400,
42
+ "cost": 1.42,
43
+ "currency": "USD",
44
+ "costKind": "estimated"
45
+ }
46
+ }