@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,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/init-operation.schema.json",
4
+ "title": "KXM Runtime-local initialization operation v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema",
9
+ "operationId",
10
+ "kind",
11
+ "phase",
12
+ "projectRoot",
13
+ "projectId",
14
+ "projectName",
15
+ "templateId",
16
+ "sourceTemplateRevision",
17
+ "targetTemplateRevision",
18
+ "planSha256",
19
+ "files"
20
+ ],
21
+ "properties": {
22
+ "schema": { "const": "kxm.init-operation.v1" },
23
+ "operationId": { "type": "string", "pattern": "^op_[a-f0-9]{32}$" },
24
+ "kind": { "enum": ["create", "repair"] },
25
+ "phase": { "enum": ["preparing", "prepared", "applying", "verified"] },
26
+ "projectRoot": { "type": "string", "minLength": 1, "maxLength": 32768, "pattern": "^(?:[A-Za-z]:[\\\\/]|\\\\\\\\|/)" },
27
+ "projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
28
+ "projectName": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\u0000\\r\\n]+$" },
29
+ "templateId": { "const": "builtin-minimal" },
30
+ "sourceTemplateRevision": {
31
+ "oneOf": [
32
+ { "type": "null" },
33
+ { "$ref": "common.schema.json#/$defs/sha256" }
34
+ ]
35
+ },
36
+ "targetTemplateRevision": { "$ref": "common.schema.json#/$defs/sha256" },
37
+ "planSha256": { "$ref": "common.schema.json#/$defs/sha256" },
38
+ "files": {
39
+ "type": "array",
40
+ "minItems": 1,
41
+ "maxItems": 128,
42
+ "items": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["path", "observedSha256", "targetSha256", "classification", "action"],
46
+ "properties": {
47
+ "path": { "$ref": "common.schema.json#/$defs/relativePath" },
48
+ "observedSha256": {
49
+ "oneOf": [
50
+ { "type": "null" },
51
+ { "$ref": "common.schema.json#/$defs/sha256" }
52
+ ]
53
+ },
54
+ "targetSha256": { "$ref": "common.schema.json#/$defs/sha256" },
55
+ "classification": { "enum": ["template-only", "converged"] },
56
+ "action": { "enum": ["create", "replace", "none"] }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/local-repository-bindings.schema.json",
4
+ "title": "KXM Runtime-local repository bindings",
5
+ "type": "object",
6
+ "required": ["schema", "projectId", "projectRoot", "repositories"],
7
+ "properties": {
8
+ "schema": { "const": "kxm.local-repository-bindings.v1" },
9
+ "projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
10
+ "projectRoot": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 32768,
14
+ "pattern": "^(?:[A-Za-z]:[\\\\/]|\\\\\\\\|/)"
15
+ },
16
+ "repositories": {
17
+ "type": "object",
18
+ "minProperties": 1,
19
+ "maxProperties": 64,
20
+ "propertyNames": { "$ref": "common.schema.json#/$defs/identifier" },
21
+ "additionalProperties": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 32768,
25
+ "pattern": "^(?:[A-Za-z]:[\\\\/]|\\\\\\\\|/)"
26
+ }
27
+ }
28
+ },
29
+ "additionalProperties": false
30
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/memory-record.schema.json",
4
+ "title": "KXM harness-agnostic memory record",
5
+ "type": "object",
6
+ "required": [
7
+ "schema",
8
+ "id",
9
+ "scope",
10
+ "kind",
11
+ "summary",
12
+ "provenance",
13
+ "authority",
14
+ "confidence",
15
+ "lifecycle",
16
+ "evidenceRefs"
17
+ ],
18
+ "properties": {
19
+ "schema": { "const": "kxm.memory.v1" },
20
+ "id": { "$ref": "common.schema.json#/$defs/identifier" },
21
+ "scope": { "enum": ["agent", "project", "run", "operator"] },
22
+ "kind": { "$ref": "common.schema.json#/$defs/identifier" },
23
+ "summary": { "type": "string", "minLength": 1, "maxLength": 2000 },
24
+ "provenance": {
25
+ "type": "object",
26
+ "required": ["sourceType"],
27
+ "properties": {
28
+ "sourceType": { "type": "string", "minLength": 1, "maxLength": 64 },
29
+ "sourceRef": { "type": "string", "maxLength": 256 },
30
+ "runId": { "$ref": "common.schema.json#/$defs/opaqueId" },
31
+ "timestamp": { "$ref": "common.schema.json#/$defs/timestamp" }
32
+ },
33
+ "additionalProperties": false
34
+ },
35
+ "authority": { "enum": ["instruction", "evidence", "promoted"] },
36
+ "confidence": { "enum": ["verified", "probable", "uncertain"] },
37
+ "lifecycle": { "enum": ["active", "deprecated", "superseded"] },
38
+ "evidenceRefs": {
39
+ "type": "array",
40
+ "items": { "$ref": "common.schema.json#/$defs/evidenceRef" },
41
+ "maxItems": 64
42
+ }
43
+ },
44
+ "additionalProperties": false
45
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/migration-decision.schema.json",
4
+ "title": "KXM reviewed legacy configuration migration decisions",
5
+ "type": "object",
6
+ "required": ["schema", "projectId", "projectName", "sourceDigest", "resolutions"],
7
+ "properties": {
8
+ "schema": { "const": "kxm.migration-decision.v1" },
9
+ "projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
10
+ "projectName": { "type": "string", "minLength": 1, "maxLength": 120 },
11
+ "sourceDigest": { "$ref": "common.schema.json#/$defs/sha256" },
12
+ "resolutions": {
13
+ "type": "object",
14
+ "propertyNames": { "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,511}$" },
15
+ "additionalProperties": {
16
+ "oneOf": [
17
+ { "type": "string", "minLength": 1, "maxLength": 256 },
18
+ { "type": "integer", "minimum": 1, "maximum": 1000 },
19
+ { "type": "boolean" }
20
+ ]
21
+ },
22
+ "maxProperties": 1024
23
+ }
24
+ },
25
+ "additionalProperties": false
26
+ }
@@ -0,0 +1,123 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/migration-plan.schema.json",
4
+ "title": "KXM legacy configuration migration plan",
5
+ "type": "object",
6
+ "required": [
7
+ "schema",
8
+ "projectId",
9
+ "projectName",
10
+ "sourceDigest",
11
+ "sources",
12
+ "resources",
13
+ "ambiguities",
14
+ "unmapped",
15
+ "renames",
16
+ "permissionChanges",
17
+ "canApply"
18
+ ],
19
+ "properties": {
20
+ "schema": { "const": "kxm.migration-plan.v1" },
21
+ "projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
22
+ "projectName": { "type": "string", "minLength": 1, "maxLength": 120 },
23
+ "sourceDigest": { "$ref": "common.schema.json#/$defs/sha256" },
24
+ "sources": {
25
+ "type": "array",
26
+ "items": { "$ref": "#/$defs/fileRecord" },
27
+ "minItems": 1,
28
+ "maxItems": 256
29
+ },
30
+ "resources": {
31
+ "type": "array",
32
+ "items": { "$ref": "#/$defs/fileRecord" },
33
+ "minItems": 2,
34
+ "maxItems": 512
35
+ },
36
+ "ambiguities": {
37
+ "type": "array",
38
+ "items": { "$ref": "#/$defs/ambiguity" },
39
+ "maxItems": 1024
40
+ },
41
+ "unmapped": {
42
+ "type": "array",
43
+ "items": { "$ref": "#/$defs/unmapped" },
44
+ "maxItems": 2048
45
+ },
46
+ "renames": {
47
+ "type": "array",
48
+ "items": { "$ref": "#/$defs/rename" },
49
+ "maxItems": 1024
50
+ },
51
+ "permissionChanges": {
52
+ "type": "array",
53
+ "items": { "$ref": "#/$defs/permissionChange" },
54
+ "maxItems": 512
55
+ },
56
+ "canApply": { "type": "boolean" }
57
+ },
58
+ "additionalProperties": false,
59
+ "$defs": {
60
+ "fileRecord": {
61
+ "type": "object",
62
+ "required": ["path", "sha256", "bytes"],
63
+ "properties": {
64
+ "path": { "$ref": "common.schema.json#/$defs/relativePath" },
65
+ "sha256": { "$ref": "common.schema.json#/$defs/sha256" },
66
+ "bytes": { "type": "integer", "minimum": 0, "maximum": 268435456 }
67
+ },
68
+ "additionalProperties": false
69
+ },
70
+ "ambiguity": {
71
+ "type": "object",
72
+ "required": ["key", "category", "sourcePath", "message", "allowedValues"],
73
+ "properties": {
74
+ "key": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,511}$" },
75
+ "category": {
76
+ "enum": ["unsupported", "identity", "step-kind", "terminal-status", "transition-budget", "evidence-policy", "permission", "secret-reference"]
77
+ },
78
+ "sourcePath": { "$ref": "common.schema.json#/$defs/relativePath" },
79
+ "message": { "type": "string", "minLength": 1, "maxLength": 2000 },
80
+ "allowedValues": {
81
+ "type": "array",
82
+ "items": { "oneOf": [{ "type": "string", "maxLength": 256 }, { "type": "integer", "minimum": 1, "maximum": 100 }] },
83
+ "minItems": 1,
84
+ "maxItems": 64
85
+ }
86
+ },
87
+ "additionalProperties": false
88
+ },
89
+ "unmapped": {
90
+ "type": "object",
91
+ "required": ["sourcePath", "jsonPointer", "valueSha256", "sensitive"],
92
+ "properties": {
93
+ "sourcePath": { "$ref": "common.schema.json#/$defs/relativePath" },
94
+ "jsonPointer": { "type": "string", "pattern": "^/", "maxLength": 1024 },
95
+ "valueSha256": { "$ref": "common.schema.json#/$defs/sha256" },
96
+ "sensitive": { "type": "boolean" }
97
+ },
98
+ "additionalProperties": false
99
+ },
100
+ "rename": {
101
+ "type": "object",
102
+ "required": ["from", "to", "kind"],
103
+ "properties": {
104
+ "from": { "type": "string", "minLength": 1, "maxLength": 128 },
105
+ "to": { "$ref": "common.schema.json#/$defs/identifier" },
106
+ "kind": { "enum": ["agent", "model", "workflow", "step", "evidence", "outcome"] }
107
+ },
108
+ "additionalProperties": false
109
+ },
110
+ "permissionChange": {
111
+ "type": "object",
112
+ "required": ["sourcePath", "targetPath", "direction", "summary", "decisionKey"],
113
+ "properties": {
114
+ "sourcePath": { "$ref": "common.schema.json#/$defs/relativePath" },
115
+ "targetPath": { "$ref": "common.schema.json#/$defs/relativePath" },
116
+ "direction": { "enum": ["narrowing", "expansion", "unknown"] },
117
+ "summary": { "type": "string", "minLength": 1, "maxLength": 2000 },
118
+ "decisionKey": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,511}$" }
119
+ },
120
+ "additionalProperties": false
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/migration-receipt.schema.json",
4
+ "title": "KXM verified legacy configuration migration receipt",
5
+ "type": "object",
6
+ "required": [
7
+ "schema",
8
+ "migrationId",
9
+ "projectId",
10
+ "sourceDigest",
11
+ "decisionDigest",
12
+ "configRevision",
13
+ "sources",
14
+ "resources",
15
+ "receiptSha256"
16
+ ],
17
+ "properties": {
18
+ "schema": { "const": "kxm.migration-receipt.v1" },
19
+ "migrationId": { "$ref": "common.schema.json#/$defs/opaqueId" },
20
+ "projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
21
+ "sourceDigest": { "$ref": "common.schema.json#/$defs/sha256" },
22
+ "decisionDigest": { "$ref": "common.schema.json#/$defs/sha256" },
23
+ "configRevision": { "$ref": "common.schema.json#/$defs/sha256" },
24
+ "sources": {
25
+ "type": "array",
26
+ "items": { "$ref": "#/$defs/fileRecord" },
27
+ "minItems": 1,
28
+ "maxItems": 256
29
+ },
30
+ "resources": {
31
+ "type": "array",
32
+ "items": { "$ref": "#/$defs/fileRecord" },
33
+ "minItems": 2,
34
+ "maxItems": 512
35
+ },
36
+ "previousReceiptSha256": { "$ref": "common.schema.json#/$defs/sha256" },
37
+ "receiptSha256": { "$ref": "common.schema.json#/$defs/sha256" }
38
+ },
39
+ "additionalProperties": false,
40
+ "$defs": {
41
+ "fileRecord": {
42
+ "type": "object",
43
+ "required": ["path", "sha256", "bytes"],
44
+ "properties": {
45
+ "path": { "$ref": "common.schema.json#/$defs/relativePath" },
46
+ "sha256": { "$ref": "common.schema.json#/$defs/sha256" },
47
+ "bytes": { "type": "integer", "minimum": 0, "maximum": 268435456 }
48
+ },
49
+ "additionalProperties": false
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/model.schema.json",
4
+ "title": "KXM model profile",
5
+ "description": "The filename determines the profile identity.",
6
+ "type": "object",
7
+ "required": ["schema", "provider", "model"],
8
+ "properties": {
9
+ "schema": { "const": "kxm.model.v1" },
10
+ "provider": { "$ref": "common.schema.json#/$defs/identifier" },
11
+ "model": { "type": "string", "minLength": 1, "maxLength": 200 },
12
+ "thinking": { "type": "string", "minLength": 1, "maxLength": 64 },
13
+ "tags": {
14
+ "type": "array",
15
+ "items": { "$ref": "common.schema.json#/$defs/identifier" },
16
+ "uniqueItems": true,
17
+ "maxItems": 32
18
+ },
19
+ "capabilities": {
20
+ "type": "array",
21
+ "items": { "$ref": "common.schema.json#/$defs/identifier" },
22
+ "uniqueItems": true,
23
+ "maxItems": 32
24
+ },
25
+ "priority": { "type": "integer", "minimum": -10000, "maximum": 10000 },
26
+ "fallbacks": {
27
+ "type": "array",
28
+ "items": { "$ref": "common.schema.json#/$defs/modelSelector" },
29
+ "maxItems": 8
30
+ },
31
+ "limits": {
32
+ "type": "object",
33
+ "properties": {
34
+ "contextTokens": { "type": "integer", "minimum": 1 },
35
+ "outputTokens": { "type": "integer", "minimum": 1 },
36
+ "timeoutMs": { "$ref": "common.schema.json#/$defs/durationMs" }
37
+ },
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "additionalProperties": false
42
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/permission-diff.schema.json",
4
+ "title": "KXM permission-diff trust report",
5
+ "description": "Structured, deterministic diff of authority-bearing fields between a trusted base bundle and a candidate bundle.",
6
+ "type": "object",
7
+ "required": ["schema", "baseRevision", "candidateRevision", "changes", "expansions", "narrowings", "neutralChanges", "requiresReview"],
8
+ "properties": {
9
+ "schema": { "const": "kxm.permission-diff.v1" },
10
+ "baseRevision": { "$ref": "common.schema.json#/$defs/sha256" },
11
+ "candidateRevision": { "$ref": "common.schema.json#/$defs/sha256" },
12
+ "changes": {
13
+ "type": "array",
14
+ "items": { "$ref": "#/$defs/change" },
15
+ "maxItems": 4096
16
+ },
17
+ "expansions": { "type": "array", "items": { "$ref": "#/$defs/change" }, "maxItems": 4096 },
18
+ "narrowings": { "type": "array", "items": { "$ref": "#/$defs/change" }, "maxItems": 4096 },
19
+ "neutralChanges": { "type": "array", "items": { "$ref": "#/$defs/change" }, "maxItems": 4096 },
20
+ "requiresReview": { "type": "boolean" }
21
+ },
22
+ "additionalProperties": false,
23
+ "$defs": {
24
+ "change": {
25
+ "type": "object",
26
+ "required": ["resource", "path", "field", "direction", "summary"],
27
+ "properties": {
28
+ "resource": { "$ref": "common.schema.json#/$defs/relativePath" },
29
+ "path": { "type": "string", "pattern": "^/", "maxLength": 1024 },
30
+ "field": {
31
+ "enum": [
32
+ "repository-access",
33
+ "tools",
34
+ "secrets",
35
+ "executor",
36
+ "network",
37
+ "model",
38
+ "sync-policy",
39
+ "snapshot-policy",
40
+ "evidence-quorum",
41
+ "transition",
42
+ "budget",
43
+ "resource-shape",
44
+ "environment",
45
+ "gate",
46
+ "delivery"
47
+ ]
48
+ },
49
+ "direction": { "enum": ["expansion", "narrowing", "neutral"] },
50
+ "summary": { "type": "string", "minLength": 1, "maxLength": 2000 },
51
+ "baseValueSha256": { "$ref": "common.schema.json#/$defs/sha256" },
52
+ "candidateValueSha256": { "$ref": "common.schema.json#/$defs/sha256" }
53
+ },
54
+ "additionalProperties": false
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/prices.schema.json",
4
+ "title": "KXM price catalog",
5
+ "type": "object",
6
+ "required": [
7
+ "schema",
8
+ "date",
9
+ "sha256",
10
+ "models"
11
+ ],
12
+ "properties": {
13
+ "schema": {
14
+ "const": "kxm.prices.v1"
15
+ },
16
+ "date": {
17
+ "type": "string",
18
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
19
+ },
20
+ "sha256": {
21
+ "type": "string",
22
+ "pattern": "^(?:sha256:)?[a-f0-9]{64}$"
23
+ },
24
+ "currency": {
25
+ "type": "string",
26
+ "pattern": "^[A-Z]{3}$"
27
+ },
28
+ "models": {
29
+ "type": "array",
30
+ "minItems": 1,
31
+ "maxItems": 256,
32
+ "items": {
33
+ "type": "object",
34
+ "required": [
35
+ "id",
36
+ "provider",
37
+ "model",
38
+ "tiers"
39
+ ],
40
+ "properties": {
41
+ "id": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "maxLength": 128
45
+ },
46
+ "provider": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "maxLength": 64
50
+ },
51
+ "model": {
52
+ "type": "string",
53
+ "minLength": 1,
54
+ "maxLength": 128
55
+ },
56
+ "aliases": {
57
+ "type": "array",
58
+ "maxItems": 32,
59
+ "items": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "maxLength": 128
63
+ }
64
+ },
65
+ "tiers": {
66
+ "type": "array",
67
+ "minItems": 1,
68
+ "maxItems": 32,
69
+ "items": {
70
+ "type": "object",
71
+ "required": [
72
+ "inputPerMillion",
73
+ "outputPerMillion"
74
+ ],
75
+ "properties": {
76
+ "upToContextTokens": {
77
+ "type": [
78
+ "integer",
79
+ "null"
80
+ ],
81
+ "minimum": 1
82
+ },
83
+ "inputPerMillion": {
84
+ "type": "number",
85
+ "minimum": 0
86
+ },
87
+ "outputPerMillion": {
88
+ "type": "number",
89
+ "minimum": 0
90
+ },
91
+ "cacheReadPerMillion": {
92
+ "type": [
93
+ "number",
94
+ "null"
95
+ ],
96
+ "minimum": 0
97
+ },
98
+ "cacheWritePerMillion": {
99
+ "type": [
100
+ "number",
101
+ "null"
102
+ ],
103
+ "minimum": 0
104
+ }
105
+ },
106
+ "additionalProperties": false
107
+ }
108
+ }
109
+ },
110
+ "additionalProperties": false
111
+ }
112
+ }
113
+ },
114
+ "additionalProperties": false
115
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kxm.dev/vnext/project.schema.json",
4
+ "title": "KXM project definition",
5
+ "type": "object",
6
+ "required": ["schema", "id", "name", "repositories"],
7
+ "properties": {
8
+ "schema": { "const": "kxm.project.v1" },
9
+ "id": { "$ref": "common.schema.json#/$defs/opaqueId" },
10
+ "name": { "type": "string", "minLength": 1, "maxLength": 120 },
11
+ "description": { "type": "string", "maxLength": 2000 },
12
+ "defaultWorkflow": { "$ref": "common.schema.json#/$defs/identifier" },
13
+ "defaultExecutor": { "$ref": "common.schema.json#/$defs/identifier" },
14
+ "defaultHarness": { "$ref": "common.schema.json#/$defs/identifier" },
15
+ "repositories": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "maxItems": 64,
19
+ "items": {
20
+ "type": "object",
21
+ "required": ["id", "role"],
22
+ "properties": {
23
+ "id": { "$ref": "common.schema.json#/$defs/identifier" },
24
+ "role": { "enum": ["control", "member"] },
25
+ "required": { "type": "boolean", "default": true },
26
+ "remoteIdentity": { "type": "string", "minLength": 1, "maxLength": 2048 },
27
+ "defaultBranch": { "type": "string", "minLength": 1, "maxLength": 255 },
28
+ "pathHint": { "$ref": "common.schema.json#/$defs/relativePath" }
29
+ },
30
+ "additionalProperties": false
31
+ }
32
+ },
33
+ "workspace": {
34
+ "type": "object",
35
+ "properties": {
36
+ "dirtySnapshot": {
37
+ "type": "object",
38
+ "properties": {
39
+ "untracked": { "enum": ["bounded", "tracked-only", "ask"] },
40
+ "maxUntrackedFileBytes": { "type": "integer", "minimum": 1, "maximum": 1073741824 },
41
+ "maxUntrackedTotalBytes": { "type": "integer", "minimum": 1, "maximum": 10737418240 },
42
+ "dirtySubmodules": { "const": "fail" }
43
+ },
44
+ "allOf": [
45
+ {
46
+ "if": {
47
+ "properties": { "untracked": { "const": "bounded" } },
48
+ "required": ["untracked"]
49
+ },
50
+ "then": {
51
+ "required": ["maxUntrackedFileBytes", "maxUntrackedTotalBytes"]
52
+ }
53
+ }
54
+ ],
55
+ "additionalProperties": false
56
+ }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ "sync": {
61
+ "type": "object",
62
+ "properties": {
63
+ "prompts": { "const": "title-only" },
64
+ "results": { "const": "bounded-summary" },
65
+ "evidence": { "const": "references" },
66
+ "artifacts": { "const": "metadata" },
67
+ "fileChanges": { "const": "paths-only" },
68
+ "rawLogs": { "const": false },
69
+ "diffs": { "const": false },
70
+ "environmentValues": { "const": false }
71
+ },
72
+ "additionalProperties": false
73
+ },
74
+ "limits": {
75
+ "type": "object",
76
+ "properties": {
77
+ "maxConcurrentRuns": { "type": "integer", "minimum": 1, "maximum": 128 },
78
+ "maxRunDurationMs": { "$ref": "common.schema.json#/$defs/durationMs" },
79
+ "maxAgentTimeMs": { "$ref": "common.schema.json#/$defs/durationMs" }
80
+ },
81
+ "additionalProperties": false
82
+ }
83
+ },
84
+ "additionalProperties": false
85
+ }