@a5c-ai/krate 5.0.1-staging.04a3db697

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 (246) hide show
  1. package/Dockerfile +31 -0
  2. package/README.md +183 -0
  3. package/bin/krate-demo.mjs +23 -0
  4. package/bin/krate-server.mjs +14 -0
  5. package/dist/krate-controller-ui.json +3067 -0
  6. package/dist/krate-lifecycle.json +201 -0
  7. package/dist/krate-runtime-snapshot.json +2955 -0
  8. package/dist/krate-summary.json +722 -0
  9. package/docs/README.md +61 -0
  10. package/docs/agents/README.md +83 -0
  11. package/docs/agents/acceptance-test-matrix.md +193 -0
  12. package/docs/agents/agent-mux-adapter-contract.md +167 -0
  13. package/docs/agents/agent-mux-source-map.md +310 -0
  14. package/docs/agents/agent-run-memory-import-spec.md +256 -0
  15. package/docs/agents/agent-stack-management-spec.md +421 -0
  16. package/docs/agents/api-contract-spec.md +309 -0
  17. package/docs/agents/artifacts-writeback-spec.md +145 -0
  18. package/docs/agents/chart-packaging-spec.md +128 -0
  19. package/docs/agents/ci-orchestration-spec.md +140 -0
  20. package/docs/agents/context-assembly-spec.md +219 -0
  21. package/docs/agents/controller-reconciliation-spec.md +255 -0
  22. package/docs/agents/crd-schema-spec.md +315 -0
  23. package/docs/agents/decision-log-open-questions.md +169 -0
  24. package/docs/agents/developer-implementation-checklist.md +329 -0
  25. package/docs/agents/dispatching-design.md +262 -0
  26. package/docs/agents/gaps-agent-mux-to-krate-crds.md +298 -0
  27. package/docs/agents/glossary.md +66 -0
  28. package/docs/agents/implementation-blueprint.md +324 -0
  29. package/docs/agents/implementation-rollout-slices.md +251 -0
  30. package/docs/agents/memory-context-integration-spec.md +194 -0
  31. package/docs/agents/memory-ontology-schema-spec.md +253 -0
  32. package/docs/agents/memory-operations-runbook.md +121 -0
  33. package/docs/agents/mvp-vertical-slice-spec.md +146 -0
  34. package/docs/agents/observability-audit-spec.md +265 -0
  35. package/docs/agents/operator-runbook.md +174 -0
  36. package/docs/agents/org-memory-api-payload-examples.md +333 -0
  37. package/docs/agents/org-memory-controller-sequence-spec.md +181 -0
  38. package/docs/agents/org-memory-e2e-fixture-plan.md +161 -0
  39. package/docs/agents/org-memory-ui-implementation-map.md +114 -0
  40. package/docs/agents/org-memory-vertical-slice-spec.md +168 -0
  41. package/docs/agents/org-resource-model-delta-spec.md +111 -0
  42. package/docs/agents/org-route-resource-model-spec.md +183 -0
  43. package/docs/agents/org-scoping-namespace-spec.md +114 -0
  44. package/docs/agents/rbac-secrets-management-spec.md +406 -0
  45. package/docs/agents/repository-page-integration-spec.md +255 -0
  46. package/docs/agents/resource-contract-examples.md +808 -0
  47. package/docs/agents/resource-relationship-map.md +190 -0
  48. package/docs/agents/security-threat-model.md +188 -0
  49. package/docs/agents/shared-memory-company-brain-spec.md +358 -0
  50. package/docs/agents/storage-migration-spec.md +168 -0
  51. package/docs/agents/subagent-orchestration-spec.md +152 -0
  52. package/docs/agents/system-overview.md +88 -0
  53. package/docs/agents/tools-mcp-skills-spec.md +189 -0
  54. package/docs/agents/traceability-matrix.md +79 -0
  55. package/docs/agents/ui-flow-spec.md +211 -0
  56. package/docs/agents/ui-ux-system-spec.md +426 -0
  57. package/docs/agents/workspace-lifecycle-spec.md +166 -0
  58. package/docs/architecture-spec.md +78 -0
  59. package/docs/components/control-plane.md +78 -0
  60. package/docs/components/data-plane.md +69 -0
  61. package/docs/components/hooks-events.md +67 -0
  62. package/docs/components/identity-rbac-policy.md +73 -0
  63. package/docs/components/kubevela-oam.md +70 -0
  64. package/docs/components/operations-publishing.md +81 -0
  65. package/docs/components/runners-ci.md +66 -0
  66. package/docs/components/web-ui.md +94 -0
  67. package/docs/external/README.md +47 -0
  68. package/docs/external/bidirectional-sync-design.md +134 -0
  69. package/docs/external/cicd-interface.md +64 -0
  70. package/docs/external/external-backend-controllers.md +170 -0
  71. package/docs/external/external-backend-crds.md +234 -0
  72. package/docs/external/external-backend-ui-spec.md +151 -0
  73. package/docs/external/external-backend-ux-flows.md +115 -0
  74. package/docs/external/external-object-mapping.md +125 -0
  75. package/docs/external/git-forge-interface.md +68 -0
  76. package/docs/external/github-integration-design.md +151 -0
  77. package/docs/external/issue-tracking-interface.md +66 -0
  78. package/docs/external/provider-capability-manifests.md +204 -0
  79. package/docs/external/provider-catalog.md +139 -0
  80. package/docs/external/provider-rollout-testing.md +78 -0
  81. package/docs/external/research-results.md +48 -0
  82. package/docs/external/security-auth-permissions.md +81 -0
  83. package/docs/external/sync-state-machines.md +108 -0
  84. package/docs/external/unified-external-backend-model.md +107 -0
  85. package/docs/external/user-facing-changes.md +67 -0
  86. package/docs/gaps.md +161 -0
  87. package/docs/install.md +94 -0
  88. package/docs/krate-design.md +334 -0
  89. package/docs/local-minikube.md +55 -0
  90. package/docs/ontology/README.md +32 -0
  91. package/docs/ontology/bounded-contexts.md +29 -0
  92. package/docs/ontology/events-and-hooks.md +32 -0
  93. package/docs/ontology/oam-kubevela.md +32 -0
  94. package/docs/ontology/operations-and-release.md +25 -0
  95. package/docs/ontology/personas-and-actors.md +32 -0
  96. package/docs/ontology/policies-and-invariants.md +33 -0
  97. package/docs/ontology/problem-space.md +30 -0
  98. package/docs/ontology/resource-contracts.md +40 -0
  99. package/docs/ontology/resource-taxonomy.md +42 -0
  100. package/docs/ontology/runners-and-ci.md +29 -0
  101. package/docs/ontology/solution-space.md +24 -0
  102. package/docs/ontology/storage-and-data-boundaries.md +29 -0
  103. package/docs/ontology/validation-matrix.md +24 -0
  104. package/docs/ontology/web-ui-excellent-flows.md +32 -0
  105. package/docs/ontology/workflows.md +39 -0
  106. package/docs/ontology/world.md +35 -0
  107. package/docs/product-requirements.md +62 -0
  108. package/docs/roadmap-mvp.md +87 -0
  109. package/docs/system-requirements.md +90 -0
  110. package/docs/tests/README.md +53 -0
  111. package/docs/tests/agent-qa-plan.md +63 -0
  112. package/docs/tests/browser-ui-tests.md +62 -0
  113. package/docs/tests/ci-quality-gates.md +48 -0
  114. package/docs/tests/coverage-model.md +64 -0
  115. package/docs/tests/e2e-scenario-tests.md +53 -0
  116. package/docs/tests/fixtures-test-data.md +63 -0
  117. package/docs/tests/observability-reliability-tests.md +54 -0
  118. package/docs/tests/product-test-matrix.md +145 -0
  119. package/docs/tests/qa-adoption-roadmap.md +130 -0
  120. package/docs/tests/qa-automation-plan.md +101 -0
  121. package/docs/tests/security-compliance-tests.md +57 -0
  122. package/docs/tests/test-framework-tools.md +88 -0
  123. package/docs/tests/test-suite-layout.md +121 -0
  124. package/docs/tests/unit-integration-tests.md +48 -0
  125. package/docs/todo-kyverno +714 -0
  126. package/docs/todos.md +4 -0
  127. package/docs/user-stories.md +78 -0
  128. package/examples/minikube-demo.yaml +190 -0
  129. package/examples/oam-application.yaml +23 -0
  130. package/examples/policy-kyverno-pr-title.yaml +18 -0
  131. package/package.json +63 -0
  132. package/scripts/build.mjs +29 -0
  133. package/scripts/setup-minikube.mjs +65 -0
  134. package/scripts/smoke.mjs +37 -0
  135. package/scripts/validate-doc-coverage.mjs +152 -0
  136. package/scripts/validate-package.mjs +93 -0
  137. package/scripts/validate-ui.mjs +236 -0
  138. package/src/agent-adapter-controller.js +169 -0
  139. package/src/agent-approval-controller.js +170 -0
  140. package/src/agent-context-bundles.js +242 -0
  141. package/src/agent-dispatch-controller.js +209 -0
  142. package/src/agent-gateway-config-controller.js +147 -0
  143. package/src/agent-memory-controller.js +357 -0
  144. package/src/agent-memory-import.js +327 -0
  145. package/src/agent-memory-query.js +292 -0
  146. package/src/agent-memory-repository-source-controller.js +255 -0
  147. package/src/agent-mux-client.js +280 -0
  148. package/src/agent-permission-review.js +250 -0
  149. package/src/agent-project-controller.js +117 -0
  150. package/src/agent-provider-config-controller.js +150 -0
  151. package/src/agent-secret-config-grant-controller.js +282 -0
  152. package/src/agent-session-transcript-controller.js +189 -0
  153. package/src/agent-stack-controller.js +347 -0
  154. package/src/agent-subagent-controller.js +160 -0
  155. package/src/agent-transport-binding-controller.js +121 -0
  156. package/src/agent-trigger-controller.js +321 -0
  157. package/src/agent-workspace-controller.js +447 -0
  158. package/src/agent-writeback-controller.js +302 -0
  159. package/src/api-controller.js +541 -0
  160. package/src/argocd-gitops.js +43 -0
  161. package/src/async-controller.js +207 -0
  162. package/src/audit-controller.js +191 -0
  163. package/src/auth.js +307 -0
  164. package/src/component-catalog.js +41 -0
  165. package/src/control-plane.js +136 -0
  166. package/src/controller-client.js +50 -0
  167. package/src/controller-ui.js +551 -0
  168. package/src/data-plane.js +178 -0
  169. package/src/event-bus.js +61 -0
  170. package/src/external/conflict-controller.js +225 -0
  171. package/src/external/github/auth.js +96 -0
  172. package/src/external/github/cicd.js +180 -0
  173. package/src/external/github/git-forge.js +240 -0
  174. package/src/external/github/index.js +144 -0
  175. package/src/external/github/issue-tracking.js +163 -0
  176. package/src/external/provider-adapter.js +161 -0
  177. package/src/external/provider-resource-factory.js +161 -0
  178. package/src/external/sync-controller.js +235 -0
  179. package/src/external/webhook-controller.js +144 -0
  180. package/src/external/write-controller.js +283 -0
  181. package/src/gitea-backend.js +95 -0
  182. package/src/gitea-service.js +173 -0
  183. package/src/handoff.js +98 -0
  184. package/src/hooks-events.js +63 -0
  185. package/src/http-server.js +377 -0
  186. package/src/identity-policy.js +86 -0
  187. package/src/index.js +55 -0
  188. package/src/kubernetes-controller-async.js +511 -0
  189. package/src/kubernetes-controller.js +878 -0
  190. package/src/kubernetes-resource-gateway.js +48 -0
  191. package/src/operations.js +112 -0
  192. package/src/org-scoping.js +5 -0
  193. package/src/resource-model.js +221 -0
  194. package/src/runners-ci.js +48 -0
  195. package/src/runtime.js +196 -0
  196. package/src/snapshot-cache.js +157 -0
  197. package/src/web-ui.js +40 -0
  198. package/tests/agent-adapter-controller.test.js +361 -0
  199. package/tests/agent-approval-controller.test.js +173 -0
  200. package/tests/agent-context-bundles.test.js +278 -0
  201. package/tests/agent-dispatch-controller.test.js +315 -0
  202. package/tests/agent-gateway-config-controller.test.js +386 -0
  203. package/tests/agent-memory-controller.test.js +308 -0
  204. package/tests/agent-memory-import-snapshot.test.js +477 -0
  205. package/tests/agent-memory-query.test.js +404 -0
  206. package/tests/agent-memory-repository-source.test.js +514 -0
  207. package/tests/agent-mux-client.test.js +204 -0
  208. package/tests/agent-permission-review-v2.test.js +317 -0
  209. package/tests/agent-permission-review.test.js +209 -0
  210. package/tests/agent-project-controller.test.js +302 -0
  211. package/tests/agent-provider-config-controller.test.js +376 -0
  212. package/tests/agent-resources.test.js +228 -0
  213. package/tests/agent-secret-config-grant.test.js +231 -0
  214. package/tests/agent-session-transcript-controller.test.js +499 -0
  215. package/tests/agent-stack-controller.test.js +221 -0
  216. package/tests/agent-subagent-controller.test.js +201 -0
  217. package/tests/agent-transport-binding-controller.test.js +294 -0
  218. package/tests/agent-trigger-controller.test.js +211 -0
  219. package/tests/agent-trigger-routes.test.js +190 -0
  220. package/tests/agent-trigger-sources.test.js +245 -0
  221. package/tests/agent-workspace-controller.test.js +181 -0
  222. package/tests/agent-writeback.test.js +292 -0
  223. package/tests/approval-persistence.test.js +171 -0
  224. package/tests/async-controller.test.js +252 -0
  225. package/tests/audit-controller.test.js +227 -0
  226. package/tests/deployment.test.js +396 -0
  227. package/tests/e2e/lifecycle.test.js +117 -0
  228. package/tests/external-github-forge.test.js +560 -0
  229. package/tests/external-github-issues-cicd.test.js +520 -0
  230. package/tests/external-integration.test.js +470 -0
  231. package/tests/external-persistence.test.js +340 -0
  232. package/tests/external-provider-adapter.test.js +365 -0
  233. package/tests/external-resource-model.test.js +215 -0
  234. package/tests/external-webhook-sync.test.js +287 -0
  235. package/tests/external-write-conflict.test.js +353 -0
  236. package/tests/gitea-service.test.js +253 -0
  237. package/tests/health-check-real.test.js +165 -0
  238. package/tests/integration/full-flow.test.js +266 -0
  239. package/tests/krate.test.js +727 -0
  240. package/tests/memory-search-wiring.test.js +270 -0
  241. package/tests/org-scoping.test.js +687 -0
  242. package/tests/session-cookie-hmac.test.js +151 -0
  243. package/tests/snapshot-performance.test.js +247 -0
  244. package/tests/sse-events.test.js +107 -0
  245. package/tests/workspace-volumes.test.js +312 -0
  246. package/tests/writeback-persistence.test.js +207 -0
@@ -0,0 +1,298 @@
1
+ # Gaps: Agent Mux Experiences → Krate CRDs & UI
2
+
3
+ Status: Draft for review
4
+ Date: 2026-05-11
5
+
6
+ This document maps proven agent-mux UI/webui/core patterns to krate CRDs and UI experiences. Each section identifies what exists in agent-mux, what krate already has, and what's missing.
7
+
8
+ ---
9
+
10
+ ## 1. Transport & Adapter Layer
11
+
12
+ ### What agent-mux has
13
+ Three adapter types form a discriminated union:
14
+ - **SubprocessAdapter** — spawn CLI processes (Claude Code, Codex, Gemini CLI, etc.)
15
+ - **RemoteAdapter** — HTTP/WebSocket/Unix socket connections to remote backends
16
+ - **ProgrammaticAdapter** — direct SDK integration via async iterables
17
+
18
+ Each adapter declares capabilities (resume, fork, streaming, thinking, tools) and supports different connection types (HttpConnection, WebSocketConnection).
19
+
20
+ ### What krate has
21
+ - `AgentStack.spec.adapter` — string field (adapter ID)
22
+ - `AgentStack.spec.baseAgent` — enum of known agents
23
+ - `agent-mux-client.js` — thin stub with `isAvailable()`, `launchSession()`
24
+
25
+ ### Gaps → New CRDs
26
+
27
+ | CRD | Purpose | Fields |
28
+ |-----|---------|--------|
29
+ | **AgentAdapter** | First-class adapter definition with transport type and capabilities | `spec.adapterType` (subprocess/remote/programmatic), `spec.transport` (http/websocket/unix/stdio), `spec.capabilities` (resume, fork, streaming, thinking, tools, models), `spec.authType` (token/oauth/none), `spec.installationMethod` (npm/binary/docker/remote), `spec.healthEndpoint` |
30
+ | **AgentTransportBinding** | Connection configuration for a specific adapter instance | `spec.adapterRef`, `spec.endpoint`, `spec.protocol` (http/ws/grpc/unix), `spec.authSecretRef`, `spec.healthCheck` (interval, timeout), `spec.reconnectPolicy` (backoff, maxRetries), `status.connected`, `status.lastHealthCheck` |
31
+ | **AgentProviderConfig** | Model provider configuration (Anthropic, OpenAI, Bedrock, etc.) | `spec.provider`, `spec.apiBase`, `spec.authType`, `spec.defaultModel`, `spec.modelTranslations` (canonical → provider-specific), `spec.rateLimits`, `spec.secretRef` |
32
+
33
+ ### UI impact
34
+ Stack builder should let users pick adapter type, configure transport, test connectivity, and select models — not just type an adapter string.
35
+
36
+ ---
37
+
38
+ ## 2. Session & Chat Experience
39
+
40
+ ### What agent-mux has
41
+ - **SessionWorkspaceShell** — 4-panel resizable layout (workspace, chat, execution trace, runtime)
42
+ - **SessionConversationSurface** — chat-like interface with human/agent turns
43
+ - **SessionFlowView** — 3-mode visualization (flow lanes, transcript, files)
44
+ - **Multi-lane agent flow** — parallel runs visualized as swimlanes
45
+ - **File-attention tracking** — which files each run reads/writes/touches
46
+ - **Cost tracking** — per-session USD with token breakdown
47
+ - **Session forking** — branch conversation to different agent mid-flight
48
+ - **Transcript pagination** — load last 60 messages, paginate further
49
+ - **Keyboard shortcuts** — Shift+W/C/X/D to toggle panels
50
+ - **Attachments** — drag-drop files into compose box
51
+ - **Model picker** — inline model switching in compose
52
+ - **Agent picker** — switch agents creating forked session
53
+ - **Approval mode toggle** — yolo/prompt/deny per session
54
+
55
+ ### What krate has
56
+ - `AgentSession` resource (metadata only — mux session ID, dispatch run ref)
57
+ - Basic `/agents/runs` list page (table of dispatch runs)
58
+ - No chat interface, no session detail, no flow visualization
59
+
60
+ ### Gaps → New CRDs + UI
61
+
62
+ | CRD | Purpose |
63
+ |-----|---------|
64
+ | **AgentSessionTranscript** (aggregated) | Durable transcript with message nodes (user/assistant/tool/thinking/error), pagination support, cost per turn |
65
+ | **AgentSessionAttachment** (aggregated) | File attached to a session message — source (file/url/base64), mimeType, digest, redaction status |
66
+
67
+ | UI Route | Experience |
68
+ |----------|------------|
69
+ | `/agents/sessions/:id` | Full session detail: 4-panel layout adapted from SessionWorkspaceShell (workspace files, chat transcript, execution flow, runtime details) |
70
+ | `/agents/sessions/:id/flow` | Multi-lane flow visualization showing parallel runs as swimlanes |
71
+ | `/agents/sessions/:id/files` | File-attention view showing which files were read/written/touched |
72
+ | Chat compose in session detail | Input bar with agent picker, model picker, approval mode toggle, attachment drag-drop |
73
+
74
+ ---
75
+
76
+ ## 3. Kanban & Issue Tracking
77
+
78
+ ### What agent-mux has
79
+ - **BacklogOverview** (240KB) — full kanban board with swimlanes, workflow columns, WIP limits
80
+ - **KanbanIssue** — issues with status (backlog/ready/in-progress/blocked/review/done), priority, assignees, dependencies, acceptance criteria
81
+ - **KanbanBoardCard** — cards with repo integration, PR links, blocked state
82
+ - **Issue-to-workspace linking** — issues linked to workspaces and sessions
83
+ - **Repository integration** — link to GitHub/Azure/GitLab/Bitbucket
84
+ - **Dispatch context labels** — instruction fragments attached to issues for agent context
85
+ - **Task tags** — custom categorization
86
+
87
+ ### What krate has
88
+ - `Issue` and `PullRequest` resources (aggregated, basic spec)
89
+ - `WorkItemSessionLink` and `WorkItemWorkspaceLink` — associations
90
+ - No kanban UI, no board view
91
+
92
+ ### Gaps → New CRDs + UI
93
+
94
+ | CRD | Purpose |
95
+ |-----|---------|
96
+ | **AgentWorkflow** (config) | Workflow definition with states (todo/in-progress/review/done), transitions, WIP limits per state |
97
+ | **AgentProject** (config) | Project grouping issues with board config, default workflow, team refs |
98
+ | **AgentIssueDispatchContext** (config) | Reviewed dispatch instructions attached to an issue — prompt fragment, scope, allowed stacks |
99
+
100
+ | UI Route | Experience |
101
+ |----------|------------|
102
+ | `/agents/projects` | Project list with health cards |
103
+ | `/agents/projects/:id/board` | Kanban board with drag-drop, swimlanes, workflow columns |
104
+ | `/agents/projects/:id/issues/:id` | Issue detail with linked sessions, workspaces, PRs, acceptance criteria |
105
+
106
+ ---
107
+
108
+ ## 4. Workspace Lifecycle
109
+
110
+ ### What agent-mux has
111
+ - **WorkspaceService** — create/archive/cleanup/recover workspaces
112
+ - **Git worktree lifecycle** — branch creation, commit tracking, rebase support
113
+ - **Workspace runtime surfaces** — preview URL, terminal, dev server, rebase status
114
+ - **WorkspaceDetailShell** — file explorer, console output, environment variables
115
+ - **WorkspaceProvisioningPage** — git repo + environment setup flow
116
+ - **Session binding** — workspaces bound to sessions with status tracking
117
+
118
+ ### What krate has
119
+ - `AgentWorkspace` resource (basic spec: repository, workspacePath, ownership)
120
+ - `AgentWorkspacePolicy` (config: mode, retention)
121
+ - No workspace UI beyond the list page
122
+
123
+ ### Gaps → New CRDs + UI
124
+
125
+ | CRD | Purpose |
126
+ |-----|---------|
127
+ | **AgentWorkspaceRuntime** (aggregated) | Runtime surface state — cwd, env vars, process status, preview URL, terminal streams |
128
+ | **AgentWorkspaceRepo** (aggregated) | Git metadata per repo in workspace — branch, head commit, remote, dirty state |
129
+
130
+ | UI Route | Experience |
131
+ |----------|------------|
132
+ | `/agents/workspaces/:id` | Workspace detail: file explorer tree, console output stream, env vars, git status |
133
+ | `/agents/workspaces/new` | Provisioning flow: select repo, branch, workspace policy, launch |
134
+
135
+ ---
136
+
137
+ ## 5. Approval & Hook Inbox
138
+
139
+ ### What agent-mux has
140
+ - **HookInboxScreen** — approval inbox with pending requests
141
+ - **HookApprovalPrompt** — countdown timer, tool preview, allow/deny actions
142
+ - **BreakpointPanel** — pulsing indicator, attached file preview
143
+ - **FilePreview** — syntax-highlighted context files in breakpoint
144
+
145
+ ### What krate has
146
+ - `AgentApproval` resource (basic spec: dispatchRun, action, requestedBy)
147
+ - `/agents/approvals` list in the agent view
148
+ - No approval inbox UI, no interactive approval flow
149
+
150
+ ### Gaps → UI
151
+
152
+ | UI Route | Experience |
153
+ |----------|------------|
154
+ | `/agents/approvals` (enhanced) | Interactive inbox: pending approvals with countdown, tool preview, context files, allow/deny/delegate actions |
155
+ | Approval detail in session | Inline approval UI in session view when breakpoint/hook fires |
156
+
157
+ ---
158
+
159
+ ## 6. Automations & Triggers
160
+
161
+ ### What agent-mux has
162
+ - **AutomationsPage** — rules with timer (cron) and webhook triggers
163
+ - **Templates** — issue/task templates for automated creation
164
+ - **Execution history** — per-rule run history
165
+
166
+ ### What krate has
167
+ - `AgentTriggerRule` resource (sources, agentStack, taskKind)
168
+ - `AgentTriggerExecution` (evaluation record)
169
+ - No automation UI beyond the rules list
170
+
171
+ ### Gaps → UI
172
+
173
+ | UI Route | Experience |
174
+ |----------|------------|
175
+ | `/agents/rules/:name` | Rule detail: trigger config, execution history, delivery status, dry-run testing |
176
+ | `/agents/rules/new` | Rule builder: source picker (CI/webhook/comment/label/schedule/manual), stack selection, condition editor |
177
+
178
+ ---
179
+
180
+ ## 7. Execution Observability
181
+
182
+ ### What agent-mux has
183
+ - **TaskDetailPanel** — multi-tab inspector (Agent/Timing/Logs/Data/Breakpoint tabs)
184
+ - **PipelineView** — DAG visualization of task flow
185
+ - **LogViewer** — streaming console with search and scroll-lock
186
+ - **JsonTree** — recursive JSON explorer with categorization
187
+ - **ParallelGroup** — grouped parallel tasks with timing heuristics
188
+ - **VirtualizedRunList** — efficient rendering for 100s of runs
189
+ - **CostMeter** — per-session and per-run USD display
190
+ - **TimingPanel** — duration metrics, critical path analysis
191
+
192
+ ### What krate has
193
+ - `/agents/runs` basic table with name, stack, status
194
+ - No task detail, no logs, no execution flow
195
+
196
+ ### Gaps → UI
197
+
198
+ | UI Route | Experience |
199
+ |----------|------------|
200
+ | `/agents/runs/:id` | Run detail: task execution flow (DAG), timing, cost, linked session, context bundle, permission snapshot |
201
+ | `/agents/runs/:id/tasks/:effectId` | Task inspector: agent prompt, timing, logs (streaming), data (JSON tree), breakpoint approval |
202
+
203
+ ---
204
+
205
+ ## 8. Configuration & Settings
206
+
207
+ ### What agent-mux has
208
+ - **SettingsModal** — theme, gateway config
209
+ - **Gateway configuration** — URL, auth token, auto-reconnect
210
+ - **Agent registry** — capabilities matrix per agent
211
+
212
+ ### What krate has
213
+ - Helm `values.yaml` with `agents.enabled` and `agents.agentMux.gateway`
214
+ - No runtime settings UI
215
+
216
+ ### Gaps → New CRDs
217
+
218
+ | CRD | Purpose |
219
+ |-----|---------|
220
+ | **AgentGatewayConfig** (config) | Runtime Agent Mux gateway connection settings — URL, auth, reconnect policy, feature flags |
221
+
222
+ ---
223
+
224
+ ## 9. Event Streaming Infrastructure
225
+
226
+ ### What agent-mux has
227
+ - **WebSocket** client with reconnect, subscription fan-out, backpressure
228
+ - **SSE** (Server-Sent Events) with batched updates and debouncing
229
+ - **Smart polling** with backoff (shorter when fresh, longer when stale)
230
+ - **EventBuffer** — sorted sequence numbers for correct replay on reconnect
231
+ - **67 structured event types** across 18 categories
232
+
233
+ ### What krate has
234
+ - `/api/watch/orgs/:org/*` — SSE endpoint (existing, non-agent)
235
+ - No agent-specific event streaming
236
+
237
+ ### Gaps → Infrastructure
238
+
239
+ | Component | Purpose |
240
+ |-----------|---------|
241
+ | Agent event SSE channel | Extend existing watch endpoint with agent event types (dispatch status, session events, approval requests) |
242
+ | Event replay on reconnect | Buffer agent events with sequence numbers for catch-up |
243
+
244
+ ---
245
+
246
+ ## 10. Tool Rendering & Extensibility
247
+
248
+ ### What agent-mux has
249
+ - **Extensible tool renderer registry** — `registerToolCallRenderer()` + `resolveToolCallRenderer()`
250
+ - **Built-in renderers** for 8 tools (bash, read, write, edit, glob, grep, web-fetch, web-search)
251
+ - **3 display modes** per renderer: compact, expanded, approvalPreview
252
+ - **MCP tool rendering** — separate card type for MCP-originated tools
253
+
254
+ ### What krate has
255
+ - Nothing — no tool rendering
256
+
257
+ ### Gaps → UI Infrastructure
258
+
259
+ The krate web console will need a tool rendering system when session detail views are built. This can import from `@a5c-ai/agent-mux-ui` or replicate the registry pattern.
260
+
261
+ ---
262
+
263
+ ## Summary: New CRDs to Add
264
+
265
+ ### CONFIG_KINDS (etcd) — 5 new
266
+ 1. **AgentAdapter** — adapter definition with transport and capabilities
267
+ 2. **AgentTransportBinding** — connection config for adapter instance
268
+ 3. **AgentProviderConfig** — model provider (Anthropic, OpenAI, etc.)
269
+ 4. **AgentProject** — project grouping with board config
270
+ 5. **AgentGatewayConfig** — runtime Agent Mux gateway settings
271
+
272
+ ### AGGREGATED_KINDS (postgres) — 3 new
273
+ 6. **AgentSessionTranscript** — durable chat transcript with pagination
274
+ 7. **AgentSessionAttachment** — files attached to session messages
275
+ 8. **AgentWorkspaceRuntime** — workspace runtime surface state
276
+
277
+ ### CONFIG_KINDS (existing, to enrich)
278
+ - **AgentStack** — expand with adapter ref (instead of string), provider config ref, transport binding ref
279
+ - **AgentTriggerRule** — add cron schedule support, webhook template
280
+
281
+ ---
282
+
283
+ ## Summary: UI Experiences to Build
284
+
285
+ ### Phase 1 (next implementation)
286
+ 1. Session detail with chat transcript (core experience)
287
+ 2. Run detail with task flow visualization
288
+ 3. Enhanced approval inbox
289
+
290
+ ### Phase 2
291
+ 4. Kanban board for issues/projects
292
+ 5. Workspace detail with file explorer
293
+ 6. Rule builder with trigger source picker
294
+
295
+ ### Phase 3
296
+ 7. Multi-lane flow visualization
297
+ 8. Tool rendering registry
298
+ 9. Settings/gateway configuration UI
@@ -0,0 +1,66 @@
1
+ # Agent glossary
2
+
3
+ ## Purpose
4
+
5
+ This glossary standardizes terms used across the agent orchestration docs.
6
+
7
+ ## Terms
8
+
9
+ | Term | Meaning |
10
+ | --- | --- |
11
+ | Agent stack | Reusable definition of an agent, model, prompt, tools, MCP servers, skills, subagents, permissions, runner, workspace, and write-back policy. |
12
+ | Agent Mux | External/embedded execution layer that owns adapter-specific run/session/chat/runtime behavior. |
13
+ | AgentDispatchRun | Logical CI-like agent run visible in Krate. |
14
+ | AgentDispatchAttempt | Concrete execution attempt for a run, including retry/resume/fork attempts. |
15
+ | AgentSession | Krate projection of an Agent Mux chat/session linked to a dispatch attempt. |
16
+ | AgentContextBundle | Durable, redacted, digest-addressed prompt/context snapshot for a dispatch. |
17
+ | Context label | Reviewed prompt fragment with provenance and source restrictions. |
18
+ | Capability requirement | Computed dependency from a stack/tool/MCP/skill/subagent to roles, secrets, configs, or adapter capabilities. |
19
+ | Runtime identity | Agent ServiceAccount used by an attempt. |
20
+ | Runner identity | ServiceAccount used by runner pod/execution host. |
21
+ | Permission review | Server-side decision that checks stack, actor, ServiceAccounts, RBAC, Secret grants, ConfigMap grants, source, trust tier, and approvals. |
22
+ | AgentSecretGrant | Explicit permission to use selected Secret keys for a specific subject/purpose/source scope. |
23
+ | AgentConfigGrant | Explicit permission to use selected ConfigMap keys for a specific subject/purpose/source scope. |
24
+ | Write-back | Any mutation to PRs, issues, branches, checks, reviews, releases, deployments, or repository state. |
25
+ | Approval | Human/policy gate for privileged tool use, secret use, write-back, network, release, or workspace operation. |
26
+ | Artifact | Durable agent output such as diagnosis, patch, review, test report, release report, or subagent output. |
27
+ | Workspace | Git worktree/runtime surface associated with an issue, PR, run, session, or repository. |
28
+ | Work item link | Association between issue/work item and session/workspace. |
29
+ | Trigger execution | Durable record of a trigger rule evaluation and its created/coalesced/rejected decision. |
30
+ | Dedupe key | Stable key used to coalesce repeated events into an existing run. |
31
+ | Trust tier | Source/execution trust classification such as trusted branch or untrusted fork. |
32
+ | Permission snapshot | Immutable digest of roles/grants/identity decisions used for an attempt. |
33
+ | Context digest | Immutable digest of assembled/redacted context bundle. |
34
+ | Adapter capability | Agent Mux-reported support for sessions, tools, MCP, skills, subagents, approvals, actions, and streaming. |
35
+ | Native RBAC | Kubernetes ServiceAccounts, Roles, ClusterRoles, RoleBindings, ClusterRoleBindings, and access reviews. |
36
+
37
+ ## Naming conventions
38
+
39
+ - Resource kind names use `Agent*` when they are agent-specific.
40
+ - `spec` describes desired state or immutable execution request.
41
+ - `status` describes observed/reconciled state.
42
+ - Condition types use stable machine-readable enums.
43
+ - Secret/config references include namespace/name/key metadata only, never values.
44
+ - Agent Mux IDs are stored in status, not treated as Krate resource names.
45
+
46
+ ## Avoid these terms
47
+
48
+ | Avoid | Use instead | Reason |
49
+ | --- | --- | --- |
50
+ | bot permission | ServiceAccount/RBAC/grant | Keep native Kubernetes model clear. |
51
+ | prompt tag | context label | Labels are reviewed prompt fragments with provenance. |
52
+ | run log | event timeline/transcript/artifact | Distinguish structured events from chat transcript and output. |
53
+ | agent job | AgentDispatchRun/Attempt | Align with CI-like run model. |
54
+ | secret access in prompt | AgentSecretGrant | Permissions cannot be prompt-injected. |
55
+
56
+ ## Company brain
57
+
58
+ Org-level Git-backed shared agent memory managed by Krate. It contains Atlas-style graph YAML records, Markdown records with YAML frontmatter, ontology files, and free-form Markdown notes searchable with grep. Dispatches consume it through `AgentMemorySnapshot` and `AgentMemoryQuery` so memory is pinned, cited, redacted, and auditable.
59
+
60
+ ## Memory snapshot
61
+
62
+ Immutable dispatch-time record of the company brain repository ref, resolved commit, ontology/index digests, query manifest, and selected records/excerpts. Retries reuse the snapshot unless explicitly refreshed.
63
+
64
+ ## Memory update
65
+
66
+ Reviewable proposed change to the company brain, usually produced by an agent run and routed through validation, approval, and a PR or managed merge flow.