@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.
- package/.claude-plugin/marketplace.json +19 -0
- package/.kxm/README.md +14 -0
- package/.kxm/assets/README.md +5 -0
- package/.kxm/assets/retrospectives/README.md +5 -0
- package/.kxm/config/README.md +5 -0
- package/.kxm/config/agents.json +43 -0
- package/.kxm/config/env.example +56 -0
- package/.kxm/config/update.example.yaml +9 -0
- package/.kxm/config/workflows/fix.json +160 -0
- package/.kxm/config/workflows/jira-development.json +116 -0
- package/.kxm/config/workflows/provenance-quorum.json +150 -0
- package/.kxm/config/workflows/v04-dogfood.json +72 -0
- package/CHANGELOG.md +465 -0
- package/LICENSE +21 -0
- package/README.md +306 -0
- package/SECURITY.md +72 -0
- package/docs/README.md +48 -0
- package/docs/agent-communication-envelopes-and-gates.md +553 -0
- package/docs/architecture.md +242 -0
- package/docs/assignment-runner.md +241 -0
- package/docs/configuration.md +361 -0
- package/docs/continuous-improvement.md +114 -0
- package/docs/getting-started.md +253 -0
- package/docs/kxm-handbook.md +1090 -0
- package/docs/operations.md +205 -0
- package/docs/provenance-gates.md +291 -0
- package/docs/skills.md +45 -0
- package/docs/templates/README.md +95 -0
- package/docs/templates/adr.md +88 -0
- package/docs/templates/architecture.md +120 -0
- package/docs/templates/bug-fix.md +109 -0
- package/docs/templates/feature.md +108 -0
- package/docs/templates/handoff.md +72 -0
- package/docs/templates/postmortem.md +77 -0
- package/docs/templates/research.md +100 -0
- package/docs/templates/review.md +85 -0
- package/docs/templates/runbook.md +73 -0
- package/docs/templates/test-plan.md +87 -0
- package/docs/templates/test-report.md +72 -0
- package/docs/test-matrix.md +121 -0
- package/docs/troubleshooting.md +249 -0
- package/docs/vnext/README.md +62 -0
- package/docs/vnext/architecture.md +185 -0
- package/docs/vnext/effects-and-recovery.md +172 -0
- package/docs/vnext/lifecycles.md +235 -0
- package/docs/vnext/migration.md +220 -0
- package/docs/vnext/routing.md +184 -0
- package/docs/vnext/synchronization.md +172 -0
- package/docs/vnext/terminology.md +240 -0
- package/docs/vnext/validation.md +335 -0
- package/docs/webhook-workflows.md +240 -0
- package/docs/workflow-guide.md +1150 -0
- package/examples/README.md +102 -0
- package/examples/provenance-workflow.json +40 -0
- package/examples/requester.ts +30 -0
- package/examples/reviewer-agent.ts +29 -0
- package/examples/roundtrip.ts +46 -0
- package/examples/vnext/.kxm/agents/coordinator.yaml +16 -0
- package/examples/vnext/.kxm/agents/critic-1.yaml +16 -0
- package/examples/vnext/.kxm/agents/critic-2.yaml +15 -0
- package/examples/vnext/.kxm/agents/critic-3.yaml +15 -0
- package/examples/vnext/.kxm/agents/implementer.yaml +15 -0
- package/examples/vnext/.kxm/agents/planner.yaml +13 -0
- package/examples/vnext/.kxm/agents/reproducer.yaml +15 -0
- package/examples/vnext/.kxm/agents/reviewer.yaml +15 -0
- package/examples/vnext/.kxm/gates.yaml +8 -0
- package/examples/vnext/.kxm/models/critic-claude.yaml +11 -0
- package/examples/vnext/.kxm/models/critic-gemini.yaml +11 -0
- package/examples/vnext/.kxm/models/critic-grok.yaml +12 -0
- package/examples/vnext/.kxm/models/implementation.yaml +14 -0
- package/examples/vnext/.kxm/models/primary.yaml +17 -0
- package/examples/vnext/.kxm/prices.yaml +111 -0
- package/examples/vnext/.kxm/project/env.yaml +7 -0
- package/examples/vnext/.kxm/project.yaml +32 -0
- package/examples/vnext/.kxm/repo/repo.yaml +8 -0
- package/examples/vnext/.kxm/workflows/default.yaml +92 -0
- package/examples/vnext/.kxm/workflows/fix.yaml +376 -0
- package/examples/vnext/.kxm/workflows/improve.yaml +57 -0
- package/examples/vnext/README.md +53 -0
- package/examples/vnext/records/assignment-result-recorded.json +63 -0
- package/examples/vnext/records/assignment-result.json +46 -0
- package/examples/vnext/records/context-candidate.json +42 -0
- package/examples/vnext/records/delivery-manifest.json +66 -0
- package/examples/vnext/records/effect-uncertainty-resolved-sync.json +67 -0
- package/examples/vnext/records/effect-uncertainty-resolved.json +62 -0
- package/examples/vnext/records/run-created.json +54 -0
- package/examples/vnext/records/sync-event.json +65 -0
- package/examples/vnext/repositories/api/.kxm/repo/env.yaml +7 -0
- package/examples/vnext/repositories/api/.kxm/repo/repo.yaml +8 -0
- package/examples/vnext/repositories/web/.kxm/repo/repo.yaml +8 -0
- package/examples/workflow-signal.ts +63 -0
- package/package.json +129 -0
- package/plugins/kxm/.claude-plugin/plugin.json +73 -0
- package/plugins/kxm/.mcp.json +19 -0
- package/plugins/kxm/README.md +93 -0
- package/plugins/kxm/dist/cli.js +42853 -0
- package/plugins/kxm/dist/client.js +416 -0
- package/plugins/kxm/dist/core.js +1823 -0
- package/plugins/kxm/dist/extension.js +3797 -0
- package/plugins/kxm/dist/mcp-server.js +17104 -0
- package/plugins/kxm/dist/runtime.js +23361 -0
- package/plugins/kxm/dist/server.js +13640 -0
- package/plugins/kxm/dist/vnext-runtime-supervisor.js +21109 -0
- package/plugins/kxm/package.json +12 -0
- package/plugins/kxm/skills/kxm/SKILL.md +97 -0
- package/plugins/kxm/skills/kxm/references/protocol.md +103 -0
- package/plugins/kxm/skills/kxm-session/SKILL.md +53 -0
- package/plugins/kxm/src/arbiter.ts +355 -0
- package/plugins/kxm/src/artifacts-exist.ts +62 -0
- package/plugins/kxm/src/autocomplete.ts +236 -0
- package/plugins/kxm/src/cli.ts +3707 -0
- package/plugins/kxm/src/client.ts +614 -0
- package/plugins/kxm/src/commands.ts +1063 -0
- package/plugins/kxm/src/config.ts +290 -0
- package/plugins/kxm/src/context/providers.ts +101 -0
- package/plugins/kxm/src/context-packet.ts +332 -0
- package/plugins/kxm/src/context.ts +499 -0
- package/plugins/kxm/src/core.ts +6 -0
- package/plugins/kxm/src/database.ts +563 -0
- package/plugins/kxm/src/diagnostics.ts +184 -0
- package/plugins/kxm/src/envelope.ts +118 -0
- package/plugins/kxm/src/extension.ts +895 -0
- package/plugins/kxm/src/external-effects.ts +299 -0
- package/plugins/kxm/src/github-watch.ts +255 -0
- package/plugins/kxm/src/hub-binding.ts +160 -0
- package/plugins/kxm/src/hub.ts +2502 -0
- package/plugins/kxm/src/improve.ts +383 -0
- package/plugins/kxm/src/inbox.ts +10 -0
- package/plugins/kxm/src/kxm-install-kind.ts +113 -0
- package/plugins/kxm/src/kxm-update-config.ts +39 -0
- package/plugins/kxm/src/kxm-update.ts +238 -0
- package/plugins/kxm/src/local-snapshot.ts +406 -0
- package/plugins/kxm/src/logger.ts +198 -0
- package/plugins/kxm/src/mcp-server.ts +143 -0
- package/plugins/kxm/src/memory.ts +385 -0
- package/plugins/kxm/src/nous-pi.ts +287 -0
- package/plugins/kxm/src/nous-provider.ts +729 -0
- package/plugins/kxm/src/price-calc.ts +87 -0
- package/plugins/kxm/src/prices.ts +121 -0
- package/plugins/kxm/src/protocol.ts +172 -0
- package/plugins/kxm/src/recovery.ts +211 -0
- package/plugins/kxm/src/redact.ts +26 -0
- package/plugins/kxm/src/retrospective.ts +400 -0
- package/plugins/kxm/src/routing.ts +830 -0
- package/plugins/kxm/src/runtime.ts +9 -0
- package/plugins/kxm/src/server.ts +117 -0
- package/plugins/kxm/src/session-work.ts +571 -0
- package/plugins/kxm/src/session.ts +184 -0
- package/plugins/kxm/src/skills.ts +535 -0
- package/plugins/kxm/src/state.ts +326 -0
- package/plugins/kxm/src/store.ts +637 -0
- package/plugins/kxm/src/studio-layout.ts +268 -0
- package/plugins/kxm/src/suggest.ts +162 -0
- package/plugins/kxm/src/task-manager.ts +244 -0
- package/plugins/kxm/src/telemetry.ts +116 -0
- package/plugins/kxm/src/tui.ts +1046 -0
- package/plugins/kxm/src/vnext-bindings.ts +403 -0
- package/plugins/kxm/src/vnext-config.ts +1646 -0
- package/plugins/kxm/src/vnext-engine-artifacts.ts +86 -0
- package/plugins/kxm/src/vnext-engine-command.ts +533 -0
- package/plugins/kxm/src/vnext-engine-compile.ts +722 -0
- package/plugins/kxm/src/vnext-engine-evidence.ts +273 -0
- package/plugins/kxm/src/vnext-engine-fold.ts +1400 -0
- package/plugins/kxm/src/vnext-engine-gate-records.ts +583 -0
- package/plugins/kxm/src/vnext-engine-plan.ts +717 -0
- package/plugins/kxm/src/vnext-engine.ts +2458 -0
- package/plugins/kxm/src/vnext-gate-hash.ts +10 -0
- package/plugins/kxm/src/vnext-harness.ts +1142 -0
- package/plugins/kxm/src/vnext-init.ts +430 -0
- package/plugins/kxm/src/vnext-migrate.ts +1848 -0
- package/plugins/kxm/src/vnext-oneshot-producer.ts +424 -0
- package/plugins/kxm/src/vnext-permission.ts +936 -0
- package/plugins/kxm/src/vnext-pi-producer.ts +628 -0
- package/plugins/kxm/src/vnext-repair.ts +1094 -0
- package/plugins/kxm/src/vnext-runtime-owner.ts +320 -0
- package/plugins/kxm/src/vnext-runtime-store.ts +1560 -0
- package/plugins/kxm/src/vnext-runtime-supervisor.ts +586 -0
- package/plugins/kxm/src/vnext-runtime.ts +663 -0
- package/plugins/kxm/src/vnext-template.ts +247 -0
- package/plugins/kxm/src/wiki.ts +313 -0
- package/plugins/kxm/src/workflow.ts +1548 -0
- package/schemas/vnext/README.md +46 -0
- package/schemas/vnext/agent.schema.json +40 -0
- package/schemas/vnext/assignment-result.schema.json +66 -0
- package/schemas/vnext/backup-manifest.schema.json +89 -0
- package/schemas/vnext/candidate.schema.json +109 -0
- package/schemas/vnext/common.schema.json +422 -0
- package/schemas/vnext/context-candidate.schema.json +76 -0
- package/schemas/vnext/context-packet.schema.json +192 -0
- package/schemas/vnext/delivery-manifest.schema.json +159 -0
- package/schemas/vnext/environment.schema.json +66 -0
- package/schemas/vnext/gate-registry.schema.json +109 -0
- package/schemas/vnext/handoff-manifest.schema.json +146 -0
- package/schemas/vnext/init-operation.schema.json +61 -0
- package/schemas/vnext/local-repository-bindings.schema.json +30 -0
- package/schemas/vnext/memory-record.schema.json +45 -0
- package/schemas/vnext/migration-decision.schema.json +26 -0
- package/schemas/vnext/migration-plan.schema.json +123 -0
- package/schemas/vnext/migration-receipt.schema.json +52 -0
- package/schemas/vnext/model.schema.json +42 -0
- package/schemas/vnext/permission-diff.schema.json +57 -0
- package/schemas/vnext/prices.schema.json +115 -0
- package/schemas/vnext/project.schema.json +85 -0
- package/schemas/vnext/repository.schema.json +24 -0
- package/schemas/vnext/run-event.schema.json +460 -0
- package/schemas/vnext/session-brief.schema.json +153 -0
- package/schemas/vnext/sync-event.schema.json +234 -0
- package/schemas/vnext/template-provenance.schema.json +38 -0
- package/schemas/vnext/workflow.schema.json +248 -0
- package/scripts/assignment-run.d.mts +354 -0
- package/scripts/assignment-run.mjs +4451 -0
- package/scripts/build-runtime.mjs +56 -0
- package/scripts/check-generated.mjs +77 -0
- package/scripts/check-versions.mjs +34 -0
- package/scripts/emit-codex-artifacts.d.mts +9 -0
- package/scripts/emit-codex-artifacts.mjs +91 -0
- package/scripts/harness-run.d.mts +83 -0
- package/scripts/harness-run.mjs +2095 -0
- package/scripts/kxm-hub.mjs +105 -0
- package/scripts/kxm-publish-npm.mjs +327 -0
- package/scripts/kxm-release-github.mjs +472 -0
- package/scripts/kxm-runtime-supervisor.mjs +7 -0
- package/scripts/kxm-worker.mjs +1127 -0
- package/scripts/kxm.mjs +27 -0
- package/scripts/roster-policy.d.mts +20 -0
- package/scripts/roster-policy.mjs +161 -0
- package/scripts/smoke-multi-pi.mjs +479 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kxm.dev/vnext/sync-event.schema.json",
|
|
4
|
+
"title": "KXM sync-safe run event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"schema",
|
|
8
|
+
"sourceEventId",
|
|
9
|
+
"eventType",
|
|
10
|
+
"projectId",
|
|
11
|
+
"runId",
|
|
12
|
+
"homeRuntimeId",
|
|
13
|
+
"sequence",
|
|
14
|
+
"occurredAt",
|
|
15
|
+
"configRevision",
|
|
16
|
+
"memoryRevision",
|
|
17
|
+
"executorPolicyRevision",
|
|
18
|
+
"toolPolicyRevision",
|
|
19
|
+
"syncPolicyRevision",
|
|
20
|
+
"redaction",
|
|
21
|
+
"payload"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"schema": { "const": "kxm.sync-event.v1" },
|
|
25
|
+
"sourceEventId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
26
|
+
"eventType": { "$ref": "common.schema.json#/$defs/runEventType" },
|
|
27
|
+
"projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
28
|
+
"runId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
29
|
+
"homeRuntimeId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
30
|
+
"sequence": { "type": "integer", "minimum": 1 },
|
|
31
|
+
"occurredAt": { "$ref": "common.schema.json#/$defs/timestamp" },
|
|
32
|
+
"configRevision": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
33
|
+
"memoryRevision": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
34
|
+
"executorPolicyRevision": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
35
|
+
"toolPolicyRevision": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
36
|
+
"syncPolicyRevision": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
37
|
+
"redaction": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": ["version", "fieldsOmitted", "valuesReplaced"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"version": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
42
|
+
"fieldsOmitted": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
45
|
+
"uniqueItems": true,
|
|
46
|
+
"maxItems": 128
|
|
47
|
+
},
|
|
48
|
+
"valuesReplaced": { "type": "integer", "minimum": 0, "maximum": 100000 }
|
|
49
|
+
},
|
|
50
|
+
"additionalProperties": false
|
|
51
|
+
},
|
|
52
|
+
"payload": { "$ref": "#/$defs/payload" }
|
|
53
|
+
},
|
|
54
|
+
"allOf": [
|
|
55
|
+
{
|
|
56
|
+
"if": {
|
|
57
|
+
"properties": {
|
|
58
|
+
"eventType": {
|
|
59
|
+
"enum": [
|
|
60
|
+
"effect.intent_recorded",
|
|
61
|
+
"effect.dispatched",
|
|
62
|
+
"effect.observed",
|
|
63
|
+
"effect.receipt_recorded",
|
|
64
|
+
"effect.settled",
|
|
65
|
+
"effect.blocked_uncertain",
|
|
66
|
+
"effect.uncertainty_resolved"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["eventType"]
|
|
71
|
+
},
|
|
72
|
+
"then": {
|
|
73
|
+
"properties": {
|
|
74
|
+
"payload": { "type": "object", "required": ["effect"] }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"if": {
|
|
80
|
+
"properties": {
|
|
81
|
+
"eventType": { "enum": ["effect.intent_recorded", "effect.dispatched"] },
|
|
82
|
+
"payload": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"properties": {
|
|
85
|
+
"effect": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"policy": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"properties": { "sharedMutable": { "const": true } },
|
|
91
|
+
"required": ["sharedMutable"]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"required": ["policy"]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": ["effect"]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": ["eventType", "payload"]
|
|
101
|
+
},
|
|
102
|
+
"then": {
|
|
103
|
+
"properties": {
|
|
104
|
+
"payload": { "type": "object", "required": ["lease"] }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"if": { "properties": { "eventType": { "const": "effect.uncertainty_resolved" } }, "required": ["eventType"] },
|
|
110
|
+
"then": {
|
|
111
|
+
"properties": {
|
|
112
|
+
"payload": { "type": "object", "required": ["effect", "resolvedBy", "resolutionAction", "reason", "suppliedRefs"] }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"if": { "properties": { "eventType": { "enum": ["lease.acquired", "lease.released", "lease.lost"] } }, "required": ["eventType"] },
|
|
118
|
+
"then": {
|
|
119
|
+
"properties": {
|
|
120
|
+
"payload": { "type": "object", "required": ["lease"] }
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"if": { "properties": { "eventType": { "const": "approval.recorded" } }, "required": ["eventType"] },
|
|
126
|
+
"then": {
|
|
127
|
+
"properties": {
|
|
128
|
+
"payload": { "type": "object", "required": ["actor", "outcome", "suppliedRefs"] }
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"additionalProperties": false,
|
|
134
|
+
"$defs": {
|
|
135
|
+
"safeReceipt": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"required": ["provider", "kind", "id"],
|
|
138
|
+
"properties": {
|
|
139
|
+
"provider": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
140
|
+
"kind": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
141
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
142
|
+
"hash": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
143
|
+
"observedAt": { "$ref": "common.schema.json#/$defs/timestamp" }
|
|
144
|
+
},
|
|
145
|
+
"additionalProperties": false
|
|
146
|
+
},
|
|
147
|
+
"candidateSummary": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["id", "type", "summary", "confidence", "status"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"id": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
152
|
+
"type": { "enum": ["knowledge", "skill", "workflow", "agent", "model", "environment", "template", "temporal-state"] },
|
|
153
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 1000 },
|
|
154
|
+
"confidence": { "enum": ["verified", "probable", "uncertain"] },
|
|
155
|
+
"status": { "enum": ["proposed", "evaluating", "review-required", "promoted", "rejected", "quarantined"] }
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
},
|
|
159
|
+
"payload": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"minProperties": 1,
|
|
162
|
+
"properties": {
|
|
163
|
+
"workflowId": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
164
|
+
"displayTitle": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
165
|
+
"promptHash": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
166
|
+
"status": { "$ref": "common.schema.json#/$defs/lifecycleStatus" },
|
|
167
|
+
"previousStatus": { "$ref": "common.schema.json#/$defs/lifecycleStatus" },
|
|
168
|
+
"outcome": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
169
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 1000 },
|
|
170
|
+
"stepId": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
171
|
+
"stepAttempt": { "type": "integer", "minimum": 1 },
|
|
172
|
+
"fromStepId": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
173
|
+
"toStepId": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
174
|
+
"assignmentId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
175
|
+
"attemptId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
176
|
+
"agentId": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
177
|
+
"instanceNo": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
178
|
+
"scopeEpoch": { "type": "integer", "minimum": 1 },
|
|
179
|
+
"executor": { "$ref": "common.schema.json#/$defs/executorResolution" },
|
|
180
|
+
"model": { "$ref": "common.schema.json#/$defs/modelResolution" },
|
|
181
|
+
"timing": { "$ref": "common.schema.json#/$defs/timing" },
|
|
182
|
+
"usage": { "$ref": "common.schema.json#/$defs/usage" },
|
|
183
|
+
"fileChanges": {
|
|
184
|
+
"type": "array",
|
|
185
|
+
"items": { "$ref": "common.schema.json#/$defs/fileChanges" },
|
|
186
|
+
"maxItems": 64
|
|
187
|
+
},
|
|
188
|
+
"evidenceRefs": {
|
|
189
|
+
"type": "array",
|
|
190
|
+
"items": { "$ref": "common.schema.json#/$defs/evidenceRef" },
|
|
191
|
+
"maxItems": 64
|
|
192
|
+
},
|
|
193
|
+
"artifacts": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": { "$ref": "common.schema.json#/$defs/artifactRef" },
|
|
196
|
+
"maxItems": 64
|
|
197
|
+
},
|
|
198
|
+
"receipts": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"items": { "$ref": "#/$defs/safeReceipt" },
|
|
201
|
+
"maxItems": 64
|
|
202
|
+
},
|
|
203
|
+
"environment": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"items": { "$ref": "common.schema.json#/$defs/environmentResolution" },
|
|
206
|
+
"maxItems": 256
|
|
207
|
+
},
|
|
208
|
+
"error": { "$ref": "common.schema.json#/$defs/errorSummary" },
|
|
209
|
+
"effect": { "$ref": "run-event.schema.json#/$defs/effect" },
|
|
210
|
+
"lease": { "$ref": "common.schema.json#/$defs/lease" },
|
|
211
|
+
"actor": { "$ref": "common.schema.json#/$defs/actor" },
|
|
212
|
+
"resolvedBy": { "$ref": "common.schema.json#/$defs/actor" },
|
|
213
|
+
"resolutionAction": {
|
|
214
|
+
"enum": ["mark-completed", "confirm-absent-and-retry", "compensate-and-retry", "mark-failed", "cancel"]
|
|
215
|
+
},
|
|
216
|
+
"reason": { "type": "string", "minLength": 1, "maxLength": 1000 },
|
|
217
|
+
"suppliedRefs": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": { "$ref": "common.schema.json#/$defs/evidenceRef" },
|
|
220
|
+
"maxItems": 64
|
|
221
|
+
},
|
|
222
|
+
"candidate": { "$ref": "#/$defs/candidateSummary" },
|
|
223
|
+
"counts": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"propertyNames": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
226
|
+
"additionalProperties": { "type": "integer", "minimum": 0 },
|
|
227
|
+
"maxProperties": 32
|
|
228
|
+
},
|
|
229
|
+
"degraded": { "type": "boolean" }
|
|
230
|
+
},
|
|
231
|
+
"additionalProperties": false
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kxm.dev/vnext/template-provenance.schema.json",
|
|
4
|
+
"title": "KXM managed-template provenance v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema", "templateId", "templateRevision", "inputs", "files"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "kxm.template-provenance.v1" },
|
|
10
|
+
"templateId": { "const": "builtin-minimal" },
|
|
11
|
+
"templateRevision": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
12
|
+
"inputs": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": ["projectId", "projectName"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"projectId": { "$ref": "common.schema.json#/$defs/opaqueId" },
|
|
18
|
+
"projectName": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\u0000\\r\\n]+$" }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"minItems": 1,
|
|
24
|
+
"maxItems": 128,
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["path", "sha256", "authoritySha256", "bytes"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"path": { "$ref": "common.schema.json#/$defs/relativePath" },
|
|
31
|
+
"sha256": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
32
|
+
"authoritySha256": { "$ref": "common.schema.json#/$defs/sha256" },
|
|
33
|
+
"bytes": { "type": "integer", "minimum": 1, "maximum": 262144 }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kxm.dev/vnext/workflow.schema.json",
|
|
4
|
+
"title": "KXM ordered workflow definition",
|
|
5
|
+
"description": "The filename determines the workflow identity.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schema", "steps"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "kxm.workflow.v1" },
|
|
10
|
+
"description": { "type": "string", "maxLength": 4000 },
|
|
11
|
+
"coordinator": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
12
|
+
"limits": { "$ref": "#/$defs/workflowLimits" },
|
|
13
|
+
"reproOracle": { "$ref": "#/$defs/oracle" },
|
|
14
|
+
"planHash": { "$ref": "#/$defs/oracle" },
|
|
15
|
+
"requirePlanHash": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
18
|
+
"uniqueItems": true,
|
|
19
|
+
"maxItems": 128
|
|
20
|
+
},
|
|
21
|
+
"steps": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"minItems": 1,
|
|
24
|
+
"maxItems": 128,
|
|
25
|
+
"items": { "$ref": "#/$defs/step" }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"$defs": {
|
|
30
|
+
"workflowLimits": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"maxTransitions": { "type": "integer", "minimum": 1, "maximum": 1000 },
|
|
34
|
+
"maxRunDurationMs": { "$ref": "common.schema.json#/$defs/durationMs" },
|
|
35
|
+
"maxAgentTimeMs": { "$ref": "common.schema.json#/$defs/durationMs" },
|
|
36
|
+
"maxModelCost": { "type": "number", "exclusiveMinimum": 0 },
|
|
37
|
+
"currency": { "type": "string", "pattern": "^[A-Z]{3}$" }
|
|
38
|
+
},
|
|
39
|
+
"additionalProperties": false
|
|
40
|
+
},
|
|
41
|
+
"assignmentPolicy": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"allowedAgents": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"items": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
47
|
+
"uniqueItems": true,
|
|
48
|
+
"minItems": 1,
|
|
49
|
+
"maxItems": 32
|
|
50
|
+
},
|
|
51
|
+
"minimum": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
52
|
+
"target": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
53
|
+
"maximum": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
54
|
+
"maxParallel": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
55
|
+
"maxAttemptsPerAssignment": { "type": "integer", "minimum": 1, "maximum": 20, "default": 1 },
|
|
56
|
+
"maxWriteRepositories": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
57
|
+
"distinctBy": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": { "enum": ["provider", "model", "profile"] },
|
|
60
|
+
"uniqueItems": true,
|
|
61
|
+
"maxItems": 3
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
},
|
|
66
|
+
"joinPolicy": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"required": ["strategy"],
|
|
69
|
+
"properties": {
|
|
70
|
+
"strategy": { "enum": ["all", "all-settled", "quorum", "first-success"] },
|
|
71
|
+
"minimumPassed": { "type": "integer", "minimum": 1, "maximum": 64 },
|
|
72
|
+
"cancelRemaining": { "type": "boolean" }
|
|
73
|
+
},
|
|
74
|
+
"allOf": [
|
|
75
|
+
{
|
|
76
|
+
"if": { "properties": { "strategy": { "const": "quorum" } }, "required": ["strategy"] },
|
|
77
|
+
"then": { "required": ["minimumPassed"] }
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"additionalProperties": false
|
|
81
|
+
},
|
|
82
|
+
"oracle": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["stageId", "evidenceKey"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"stageId": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
87
|
+
"evidenceKey": { "$ref": "common.schema.json#/$defs/identifier" }
|
|
88
|
+
},
|
|
89
|
+
"additionalProperties": false
|
|
90
|
+
},
|
|
91
|
+
"producerPolicy": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"required": ["minimumProducers", "eligibleAgents", "acceptedStatuses"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"minimumProducers": { "type": "integer", "minimum": 1, "maximum": 16 },
|
|
96
|
+
"eligibleAgents": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"items": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
99
|
+
"uniqueItems": true,
|
|
100
|
+
"minItems": 1,
|
|
101
|
+
"maxItems": 32
|
|
102
|
+
},
|
|
103
|
+
"acceptedStatuses": {
|
|
104
|
+
"type": "array",
|
|
105
|
+
"items": { "const": "passed" },
|
|
106
|
+
"minItems": 1,
|
|
107
|
+
"maxItems": 1
|
|
108
|
+
},
|
|
109
|
+
"degradation": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"required": ["minimumProducers"],
|
|
112
|
+
"properties": {
|
|
113
|
+
"minimumProducers": { "type": "integer", "minimum": 1, "maximum": 15 }
|
|
114
|
+
},
|
|
115
|
+
"additionalProperties": false
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
},
|
|
120
|
+
"evidenceRequirement": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"required": ["key", "kind"],
|
|
123
|
+
"properties": {
|
|
124
|
+
"key": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
125
|
+
"kind": { "enum": ["assignment-result", "gate", "receipt", "approval", "artifact"] },
|
|
126
|
+
"minimum": { "type": "integer", "minimum": 1, "maximum": 16 },
|
|
127
|
+
"producerPolicy": { "$ref": "#/$defs/producerPolicy" },
|
|
128
|
+
"reusableAcrossAttempts": { "type": "boolean", "default": false }
|
|
129
|
+
},
|
|
130
|
+
"allOf": [
|
|
131
|
+
{
|
|
132
|
+
"if": { "required": ["producerPolicy"] },
|
|
133
|
+
"then": { "properties": { "kind": { "const": "assignment-result" } } }
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"additionalProperties": false
|
|
137
|
+
},
|
|
138
|
+
"transitionTarget": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"pattern": "^(?:\\$terminal|[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*)$",
|
|
141
|
+
"maxLength": 64
|
|
142
|
+
},
|
|
143
|
+
"transition": {
|
|
144
|
+
"oneOf": [
|
|
145
|
+
{ "$ref": "common.schema.json#/$defs/identifier" },
|
|
146
|
+
{
|
|
147
|
+
"type": "object",
|
|
148
|
+
"required": ["target"],
|
|
149
|
+
"properties": {
|
|
150
|
+
"target": { "$ref": "#/$defs/transitionTarget" },
|
|
151
|
+
"maxTransitions": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
152
|
+
"terminalStatus": { "enum": ["completed", "failed", "cancelled"] }
|
|
153
|
+
},
|
|
154
|
+
"allOf": [
|
|
155
|
+
{
|
|
156
|
+
"if": {
|
|
157
|
+
"properties": { "target": { "const": "$terminal" } },
|
|
158
|
+
"required": ["target"]
|
|
159
|
+
},
|
|
160
|
+
"then": { "required": ["terminalStatus"] },
|
|
161
|
+
"else": { "not": { "required": ["terminalStatus"] } }
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"additionalProperties": false
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"step": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"required": ["id", "kind"],
|
|
171
|
+
"properties": {
|
|
172
|
+
"id": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
173
|
+
"kind": { "enum": ["agent", "moa", "gate", "approval", "wait"] },
|
|
174
|
+
"description": { "type": "string", "maxLength": 2000 },
|
|
175
|
+
"maxAttempts": { "type": "integer", "minimum": 1, "maximum": 20, "default": 1 },
|
|
176
|
+
"instructions": { "type": "string", "maxLength": 16000 },
|
|
177
|
+
"agent": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
178
|
+
"gate": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
179
|
+
"expect": { "enum": ["pass", "fail"], "default": "pass" },
|
|
180
|
+
"signal": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
181
|
+
"model": { "$ref": "common.schema.json#/$defs/modelSelector" },
|
|
182
|
+
"repositories": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"propertyNames": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
185
|
+
"additionalProperties": { "$ref": "common.schema.json#/$defs/repositoryAccess" },
|
|
186
|
+
"maxProperties": 64
|
|
187
|
+
},
|
|
188
|
+
"tools": { "$ref": "common.schema.json#/$defs/toolPolicy" },
|
|
189
|
+
"secrets": {
|
|
190
|
+
"type": "array",
|
|
191
|
+
"items": { "$ref": "common.schema.json#/$defs/secretGrant" },
|
|
192
|
+
"maxItems": 64
|
|
193
|
+
},
|
|
194
|
+
"assignments": { "$ref": "#/$defs/assignmentPolicy" },
|
|
195
|
+
"join": { "$ref": "#/$defs/joinPolicy" },
|
|
196
|
+
"requiredEvidence": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": { "$ref": "#/$defs/evidenceRequirement" },
|
|
199
|
+
"maxItems": 64
|
|
200
|
+
},
|
|
201
|
+
"timeoutMs": { "$ref": "common.schema.json#/$defs/durationMs" },
|
|
202
|
+
"safeSpeculation": { "type": "boolean", "default": false },
|
|
203
|
+
"on": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"propertyNames": { "$ref": "common.schema.json#/$defs/identifier" },
|
|
206
|
+
"additionalProperties": { "$ref": "#/$defs/transition" },
|
|
207
|
+
"minProperties": 1,
|
|
208
|
+
"maxProperties": 32
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"allOf": [
|
|
212
|
+
{
|
|
213
|
+
"if": { "required": ["expect"] },
|
|
214
|
+
"then": { "properties": { "kind": { "const": "gate" } } }
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"if": { "properties": { "kind": { "enum": ["agent", "moa"] } }, "required": ["kind"] },
|
|
218
|
+
"then": { "required": ["agent"] }
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"if": { "properties": { "kind": { "const": "gate" } }, "required": ["kind"] },
|
|
222
|
+
"then": { "required": ["gate"] }
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"if": { "properties": { "kind": { "const": "wait" } }, "required": ["kind"] },
|
|
226
|
+
"then": { "required": ["signal"] }
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"if": {
|
|
230
|
+
"properties": {
|
|
231
|
+
"join": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"properties": { "strategy": { "const": "first-success" } },
|
|
234
|
+
"required": ["strategy"]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"required": ["join"]
|
|
238
|
+
},
|
|
239
|
+
"then": {
|
|
240
|
+
"properties": { "safeSpeculation": { "const": true } },
|
|
241
|
+
"required": ["safeSpeculation"]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"additionalProperties": false
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|