@kontextmind/kxm 0.7.94 → 0.7.96

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 (140) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.kxm/README.md +39 -9
  3. package/CHANGELOG.md +1 -1
  4. package/README.md +147 -257
  5. package/SECURITY.md +21 -12
  6. package/docs/README.md +133 -54
  7. package/docs/adr/ADR-0002-browser-automation-steel-doks.md +24 -18
  8. package/docs/adr/ADR-0003-sqlite-only-store.md +100 -0
  9. package/docs/adr/ADR-0004-edge-identity-authentik.md +99 -0
  10. package/docs/adr/README.md +33 -0
  11. package/docs/concepts/architecture.md +262 -0
  12. package/docs/concepts/data-and-storage.md +194 -0
  13. package/docs/concepts/trust-model.md +152 -0
  14. package/docs/contracts/README.md +22 -14
  15. package/docs/contracts/effects-and-recovery.md +3 -0
  16. package/docs/contracts/migration.md +2 -2
  17. package/docs/contracts/routing.md +6 -5
  18. package/docs/contributing/assignment-runner.md +388 -0
  19. package/docs/contributing/ci-and-release.md +231 -0
  20. package/docs/contributing/development.md +362 -0
  21. package/docs/contributing/harness-routing-internals.md +192 -0
  22. package/docs/{packages.md → contributing/packages.md} +13 -15
  23. package/docs/{skills → contributing}/repo-work-delivery.md +20 -21
  24. package/docs/contributing/test-matrix.md +208 -0
  25. package/docs/{tui-components.md → contributing/tui-components.md} +30 -22
  26. package/docs/contributing/writing-docs.md +340 -0
  27. package/docs/glossary.md +471 -0
  28. package/docs/guides/agent-skills.md +137 -0
  29. package/docs/guides/browser-automation.md +160 -0
  30. package/docs/guides/context-and-memory.md +352 -0
  31. package/docs/guides/continuous-improvement.md +228 -0
  32. package/docs/guides/governed-skills.md +173 -0
  33. package/docs/guides/nous-providers.md +186 -0
  34. package/docs/guides/peer-messaging.md +304 -0
  35. package/docs/guides/pi-workers.md +219 -0
  36. package/docs/guides/provenance-gates.md +313 -0
  37. package/docs/guides/webhook-workflows.md +364 -0
  38. package/docs/kb/how-credentials-retrieved-safely.md +38 -12
  39. package/docs/kb/how-to-capture-and-annotate-section.md +15 -13
  40. package/docs/kb/how-to-connect-playwright-to-steel.md +16 -11
  41. package/docs/kb/how-to-recover-expired-session-or-orphan.md +26 -16
  42. package/docs/kb/how-to-resume-after-mfa.md +19 -11
  43. package/docs/kb/how-to-take-over-session.md +17 -13
  44. package/docs/kb/why-authentication-disappeared.md +22 -14
  45. package/docs/kb/why-automation-opened-different-browser.md +23 -14
  46. package/docs/kb/why-session-viewer-cannot-control.md +13 -12
  47. package/docs/operations/backup-and-restore.md +248 -0
  48. package/docs/operations/deploy.md +307 -0
  49. package/docs/operations/monitoring.md +209 -0
  50. package/docs/operations/runtime-sync.md +192 -0
  51. package/docs/operations/troubleshooting.md +265 -0
  52. package/docs/operations/upgrade.md +124 -0
  53. package/docs/prompts/browser-annotate-feedback.md +7 -7
  54. package/docs/prompts/browser-diagnose-recover.md +11 -10
  55. package/docs/prompts/browser-explore.md +7 -7
  56. package/docs/prompts/browser-repro-fix.md +7 -7
  57. package/docs/prompts/browser-start.md +12 -11
  58. package/docs/prompts/browser-takeover.md +8 -8
  59. package/docs/{cli-reference.md → reference/cli-reference.md} +83 -41
  60. package/docs/{config-reference.md → reference/config-reference.md} +159 -148
  61. package/docs/reference/configuration.md +299 -0
  62. package/docs/reference/harness-routing.md +508 -0
  63. package/docs/reference/http-api.md +203 -0
  64. package/docs/reference/tools.md +370 -0
  65. package/docs/{workflow-guide.md → reference/workflow-catalog.md} +92 -153
  66. package/docs/reference/workflow-definitions.md +286 -0
  67. package/docs/start/first-workflow.md +287 -0
  68. package/docs/start/install.md +146 -0
  69. package/docs/start/quickstart-claude-code.md +405 -0
  70. package/docs/start/quickstart-pi.md +213 -0
  71. package/docs/templates/README.md +78 -73
  72. package/docs/templates/adr.md +13 -13
  73. package/docs/templates/architecture.md +55 -71
  74. package/docs/templates/bug-fix.md +13 -16
  75. package/docs/templates/feature.md +14 -19
  76. package/docs/templates/handoff.md +44 -46
  77. package/docs/templates/postmortem.md +30 -43
  78. package/docs/templates/research.md +15 -20
  79. package/docs/templates/review.md +49 -50
  80. package/docs/templates/runbook.md +38 -30
  81. package/docs/templates/test-plan.md +16 -23
  82. package/docs/templates/test-report.md +14 -17
  83. package/examples/README.md +9 -5
  84. package/examples/provenance-workflow.json +1 -1
  85. package/examples/webhook-workflows/jira-development.json +59 -0
  86. package/examples/webhook-workflows/jira-issue-updated.json +12 -0
  87. package/package.json +2 -2
  88. package/packages/core/tui/README.md +1 -1
  89. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  90. package/plugins/kxm/README.md +31 -32
  91. package/plugins/kxm/dist/cli.js +5 -5
  92. package/plugins/kxm/dist/mcp-server.js +1 -1
  93. package/plugins/kxm/dist/runtime.js +1 -1
  94. package/plugins/kxm/package.json +1 -1
  95. package/plugins/kxm/skills/kxm/references/protocol.md +3 -1
  96. package/plugins/kxm/skills/kxm-browser-auth/SKILL.md +1 -1
  97. package/plugins/kxm/skills/kxm-browser-diagnostics/SKILL.md +5 -5
  98. package/plugins/kxm/skills/kxm-browser-explore/SKILL.md +2 -2
  99. package/plugins/kxm/skills/kxm-browser-session/SKILL.md +10 -13
  100. package/plugins/kxm/skills/kxm-browser-takeover/SKILL.md +1 -1
  101. package/plugins/kxm/skills/kxm-browser-verify/SKILL.md +1 -1
  102. package/plugins/kxm/skills/kxm-context-memory/SKILL.md +13 -4
  103. package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +3 -1
  104. package/plugins/kxm/skills/kxm-mind-setup/SKILL.md +2 -1
  105. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +31 -54
  106. package/plugins/kxm/skills/kxm-projects/SKILL.md +1 -1
  107. package/plugins/kxm/skills/kxm-protocol/SKILL.md +1 -1
  108. package/plugins/kxm/skills/kxm-routing-improve/SKILL.md +15 -7
  109. package/plugins/kxm/skills/kxm-runs/SKILL.md +11 -5
  110. package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
  111. package/plugins/kxm/skills/kxm-tasks/SKILL.md +9 -7
  112. package/plugins/kxm/skills/kxm-workflow/SKILL.md +10 -2
  113. package/plugins/kxm/src/cli/system.ts +1 -1
  114. package/plugins/kxm/src/cli.ts +3 -3
  115. package/plugins/kxm/src/init-guide-setup.ts +1 -1
  116. package/plugins/kxm/src/mcp-server.ts +1 -1
  117. package/plugins/kxm/src/modes.ts +1 -1
  118. package/schemas/README.md +1 -1
  119. package/docs/agent-communication-envelopes-and-gates.md +0 -553
  120. package/docs/agent-skills.md +0 -198
  121. package/docs/architecture.md +0 -245
  122. package/docs/assignment-runner.md +0 -264
  123. package/docs/browser-automation.md +0 -139
  124. package/docs/configuration.md +0 -437
  125. package/docs/continuous-improvement.md +0 -226
  126. package/docs/getting-started.md +0 -277
  127. package/docs/harness-routing.md +0 -616
  128. package/docs/kb/qa-authentik-authentication.md +0 -97
  129. package/docs/kb/qa-extension-install-and-hub-bootstrap.md +0 -85
  130. package/docs/kb/qa-hub-on-a-public-host.md +0 -48
  131. package/docs/kb/qa-sqlite-vs-duckdb.md +0 -35
  132. package/docs/kb/qa-what-the-hub-stores.md +0 -64
  133. package/docs/kxm-handbook.md +0 -1181
  134. package/docs/operations.md +0 -510
  135. package/docs/operator-pi-packages.md +0 -67
  136. package/docs/provenance-gates.md +0 -295
  137. package/docs/skills.md +0 -47
  138. package/docs/test-matrix.md +0 -132
  139. package/docs/troubleshooting.md +0 -293
  140. package/docs/webhook-workflows.md +0 -240
@@ -0,0 +1,192 @@
1
+ # Harness routing internals
2
+
3
+ This page records how the KXM repository applies [harness routing](../reference/harness-routing.md) to its own work: the routes this checkout admits, its writer roster, its price catalog, and the developer roster policy that `just assign` and the dev helper enforce. It is maintainer material. The snapshots were captured on 2026-09-23 on one operator machine, from a source checkout where `node scripts/kxm.mjs` is the same program as `kxm`; they change whenever an admission changes.
4
+
5
+ > [!IMPORTANT]
6
+ > The files are the authority, not this page: `.kxm/routes.yaml`, `.kxm/roles/`, `.kxm/roster.yaml` and `.kxm/prices.yaml`. Product routing decisions are recorded under Tracking → Decided in `plans/implementation-plan.md`.
7
+
8
+ ## This checkout's routes and roster
9
+
10
+ `node scripts/kxm.mjs role get writer`:
11
+
12
+ ```text
13
+ schema: kxm.role.v1
14
+ id: writer
15
+ description: ""
16
+ skills: []
17
+ roster:
18
+ - model: xai/grok-4.6
19
+ effort: medium
20
+ enabled: true
21
+ - model: openrouter/qwen/qwen3-coder-plus
22
+ effort: medium
23
+ enabled: true
24
+ - model: zai-coding-cn/glm-5.3-flash
25
+ effort: medium
26
+ enabled: true
27
+ - model: qwen-token-plan/qwen3.8-flash
28
+ effort: medium
29
+ enabled: true
30
+ - model: google/gemini-3.8-flash-high
31
+ enabled: true
32
+ ```
33
+
34
+ The implementer agent declares `harness: grok`, so of this roster only `xai/grok-4.6` can run under it; the Pi selectors need an agent without `harness:`.
35
+
36
+ `node scripts/kxm.mjs routes list`:
37
+
38
+ ```text
39
+ admitted anthropic/fable
40
+ admitted google/gemini-3.8-flash-high
41
+ admitted google/gemini-3.8-flash-medium
42
+ admitted openai/gpt-5.6-sol
43
+ admitted openrouter/qwen/qwen3-coder-plus
44
+ admitted openrouter/qwen/qwen3.8-flash
45
+ admitted openrouter/z-ai/glm-5.3-flash
46
+ admitted qwen-token-plan/deepseek-v4.1-flash
47
+ admitted qwen-token-plan/qwen3.8-flash
48
+ admitted qwen-token-plan/qwen3.8-max
49
+ admitted xai/grok-4.6
50
+ admitted zai-coding-cn/glm-5.3
51
+ admitted zai-coding-cn/glm-5.3-flash
52
+ ```
53
+
54
+ `routes admit --model openrouter/qwen/qwen3-coder-plus --dry-run` exits 2 with `select a model from the refreshed inventory` even though that selector is already admitted, because the inventory never carries `openrouter/…` selectors. Selectors like these are admitted by a Git-reviewed edit of `.kxm/routes.yaml`.
55
+
56
+ On the capture machine, `kxm harness list` showed `claude` detected but logged out (`dispatch no (not_authenticated)`), `deepseek` not installed, and `grok`, `codex`, `kimi` and `agy` ready.
57
+
58
+ ### Price catalog and inventory
59
+
60
+ `.kxm/prices.yaml` is dated `2026-09-16`, so every current run records `providerMetadata.priceCatalogStale: true` and no list estimate. The list prices below come from `.kxm/models/inventory.yaml`, fetched `2026-09-16T14:54:53Z`, in USD per 1M tokens. The checkout has no routing records yet, so none of the examples has recorded latency; for latency, run a bounded side-by-side experiment and compare p50 and p95 in `kxm routing report`.
61
+
62
+ ## The developer roster (`.kxm/roster.yaml`)
63
+
64
+ The issue-127 runner (`just assign`, see the [assignment runner](assignment-runner.md)) uses its own policy file, [`kxm.developer-roster.v1`](../reference/config-reference.md#kxmrosteryaml-kxmdeveloper-rosterv1). Routes there name the harness, the model and the vendor explicitly:
65
+
66
+ ```yaml
67
+ grok-native:
68
+ harness: grok
69
+ model: grok-4.6
70
+ vendor: xai
71
+ qwen-openrouter-pi:
72
+ harness: pi
73
+ model: openrouter/qwen/qwen3-coder-plus
74
+ vendor: alibaba
75
+ ```
76
+
77
+ The developer roster policy (`scripts/roster-policy.mjs`) applies these rules:
78
+
79
+ - A native route uses a bare model id.
80
+ - A Pi route needs an allowlisted prefix: `openrouter`, `nous-portal` or `antigravity` (`scripts/harness-run.mjs`).
81
+ - An aggregator id needs at least three segments.
82
+ - The vendor segment of an aggregator id must not be a native vendor. `x-ai` counts as `xai` and `moonshotai` counts as `moonshot`.
83
+ - `antigravity` ids must be exactly `antigravity/gemini-…`.
84
+ - The writer and both critics must be three different vendors.
85
+
86
+ Vendor independence has a consequence for Anthropic: the architecture critic is an Anthropic model, so no Anthropic route can be the writer through any harness, and `claude-bridge` stays experiment-only.
87
+
88
+ ### What the developer tools refuse
89
+
90
+ The product layers are in [What the brake refuses](../reference/harness-routing.md#what-the-brake-refuses). The developer tools add two more:
91
+
92
+ | Layer | Where | What it refuses | What you see |
93
+ |---|---|---|---|
94
+ | Dev helper | `scripts/harness-run.mjs` | A braked Pi provider, a Pi provider outside the allowlist, a Pi writer other than `openrouter/qwen/qwen3-coder-plus`, or an aggregator id whose vendor segment is a native vendor | `pi brake: xai has a native harness; refusing Pi impersonation`, or `… refusing to bill it through openrouter` |
95
+ | Developer roster | `scripts/roster-policy.mjs` | An aggregator route whose vendor segment is a native vendor | `Roster policy refused: native vendor cannot use Pi` |
96
+
97
+ The dev helper's allowlist (`openrouter`, `nous-portal`, `antigravity`) is a different list from `PI_ALLOWED_PROVIDERS` in `plugins/kxm/src/harness.ts`, which gates nothing. Which of the two should govern is an open decision (Tracking → Still open). Edit permission exists only in the dev helper, and only for admitted writer or experiment routes. The helper accepts only a ChatGPT login for codex, not an API key.
98
+
99
+ The product brake, the dev helper and the roster policy now agree on the vendor segment: all three refuse `openrouter/x-ai/…` and `openrouter/anthropic/…`. They refuse the other native-vendor ids for different reasons. The product brake names `openai-codex/…`, `kimi-coding/…`, `claude-bridge/…` and `antigravity/claude-…` as a native vendor's own Pi provider; the helper and `validateRosterDocument` refuse them as unsupported Pi routes, because the provider is off the helper allowlist or `antigravity` is given a non-Gemini id (`unsupported Pi provider/model` in the roster policy). The product brake accepts `qwen-token-plan/…` and `zai-coding-cn/…`, which the developer tools do not allowlist.
100
+
101
+ ## Worked examples on this checkout
102
+
103
+ These extend the generic examples on the reference page with this checkout's admissions, developer-roster routes, readiness on the capture machine, and inventory prices.
104
+
105
+ ### Grok 4.6
106
+
107
+ | | Native `grok` | Pi + OpenRouter |
108
+ |---|---|---|
109
+ | Selector | `xai/grok-4.6`: admitted, and first in the writer roster | `openrouter/x-ai/grok-4.6`: not admitted |
110
+ | Developer roster | `grok-native`, the writer route with `edit` | Refused: `native vendor cannot use Pi` |
111
+ | Readiness | `grok` shows auth `yes` | `pi auth check --provider openrouter` returned `not_ready` |
112
+ | Billing | grok.com subscription (OAuth) | $2.00 input, $6.00 output, $0.50 cached input |
113
+ | Context | 500K (Pi's `xai` row; `grok models` does not print one) | 500,000 |
114
+
115
+ Pi's own `xai` provider reported `ready` (OAuth) on the capture machine. When the grok quota runs out, the next writer in the lineup is `qwen-openrouter-pi`, a different vendor.
116
+
117
+ ### GPT-5.6 Sol
118
+
119
+ | | Native `codex` | Pi + OpenRouter |
120
+ |---|---|---|
121
+ | Selector | `openai/gpt-5.6-sol`: admitted, the CLI critic | `openrouter/openai/gpt-5.6-sol`: not admitted |
122
+ | Developer roster | `sol-codex`: `reviewer-cli`, `read-only` | Refused |
123
+ | Billing | ChatGPT subscription | $2.00 input, $10.00 output, $0.20 cached input |
124
+ | Context | Pi's `openai-codex` row, the same ChatGPT backend, lists 272K | 1,050,000 |
125
+
126
+ In the inventory, `openai/gpt-5.6-sol` has sources `openrouter+nous` and carries OpenRouter prices. `pi auth check --provider openai-codex` reported `ready` on the capture machine.
127
+
128
+ ### Claude Fable
129
+
130
+ | | Native `claude` | Pi + OpenRouter |
131
+ |---|---|---|
132
+ | Selector | `anthropic/fable`: admitted, planner and architecture critic | `openrouter/anthropic/claude-fable-5.1`: not admitted |
133
+ | Developer roster | `fable-claude`: `planner` and `reviewer-arch`, `read-only` | Refused |
134
+ | Readiness | Detected `yes`, auth `no`, dispatch `no (not_authenticated)` | `not_ready` |
135
+ | Billing | claude.ai subscription | $10.00 input, $50.00 output, $0.25 cached input |
136
+ | Context | 1M (Pi's `anthropic` row) | 1,000,000 |
137
+
138
+ `claude` was logged out on the capture machine, so the native route failed closed. Pi's `anthropic` provider reported `ready` (OAuth). The `anthropic/fable` row in `prices.yaml` gives a list estimate only when the catalog is dated today.
139
+
140
+ ### Gemini 3.8 Flash
141
+
142
+ | | Native `agy` | `antigravity` Pi provider | Pi + OpenRouter |
143
+ |---|---|---|---|
144
+ | Selector | `google/gemini-3.8-flash-high`: admitted, last in the writer roster | `antigravity/gemini-3.8-flash`: not admitted | `openrouter/google/gemini-3.8-flash`: not admitted |
145
+ | Billing | Google subscription | Google subscription | $0.75 input, $3.75 output, $0.075 cached input |
146
+ | Context | `agy` does not print it; the vendored catalog lists 1,048,576 | 1,048,576 | 1,048,576 |
147
+
148
+ The admitted runtime route today is the `agy` selector.
149
+
150
+ ## Routing decisions for this repository
151
+
152
+ ### Google through `antigravity`
153
+
154
+ The decision is that Google models run through the `antigravity` Pi provider, never through a shell-out to the `agy` CLI; `agy` stays a harness catalog and helper entry, not the admission path. Pi's `google/*` provider stays braked, and an `antigravity` route needs a signed-in `/login antigravity` inside Pi before it can be admitted. The dev helper and the roster policy accept only `antigravity/gemini-…`.
155
+
156
+ The code differs from that decision: `.kxm/routes.yaml` admits `google/gemini-3.8-flash-*`, which can run only through `agy`, and the Runtime's Pi one-shot runs with `--no-extensions`, so it cannot reach `antigravity/…`. Until an antigravity route is admitted, do not add one on your own.
157
+
158
+ ### Vendors with no native harness
159
+
160
+ | Model | Vendor-plan route | OpenRouter route | Notes |
161
+ |---|---|---|---|
162
+ | Qwen3.8 Flash | `qwen-token-plan/qwen3.8-flash`: admitted, in the writer roster; `ready` (`api_key`) | `openrouter/qwen/qwen3.8-flash`: admitted; $0.15 input, $0.47 output | `prices.yaml` gives both routes the same rates. Prefer the plan when it is authenticated. |
163
+ | Qwen3 Coder Plus | none | `openrouter/qwen/qwen3-coder-plus`: $0.65 input, $3.25 output | The only admitted Pi writer: exact model, `edit` permission. |
164
+ | GLM 5.3 and 5.3 Flash | `zai-coding-cn/glm-5.3` and `…/glm-5.3-flash`: admitted as failover critics and writer | `openrouter/z-ai/glm-5.3-flash`: admitted; $0.09 input, $0.30 output | Z.ai has no native harness. |
165
+ | DeepSeek V4.1 Flash | `qwen-token-plan/deepseek-v4.1-flash`: admitted | `deepseek/deepseek-v4.1-flash` in the OpenRouter feed: $0.15 input, $0.60 output | Bills a DeepSeek model through Alibaba's plan, and passes the product brake because it names no vendor segment. An open admission question, not a precedent. |
166
+
167
+ The developer runner is stricter. Its only Pi writer is `openrouter/qwen/qwen3-coder-plus`, and it does not allowlist `qwen-token-plan` or `zai-coding-cn`. Today OpenRouter is the right answer here for Qwen3 Coder Plus, Qwen3.8 Flash and GLM 5.3 Flash.
168
+
169
+ ### Nous
170
+
171
+ `nous-portal/tencent/hy4-preview` is the reviewed experiment example, and it is not a writer. Pi on the capture machine listed `nous-portal/tencent/hy3-preview`, not `hy4-preview`, so check live ids before you use them. The dev helper does not allowlist `nous/…` or `nous-proxy/…`, and the roster policy refuses Portal routes to native vendors, just as it refuses the OpenRouter copies.
172
+
173
+ ## Troubleshooting the developer tools
174
+
175
+ | Symptom | Cause | Fix |
176
+ |---|---|---|
177
+ | `pi brake: xai has a native harness; refusing Pi impersonation` | A dev-helper request routed a native vendor through Pi. | Use the native harness recipe instead: `just impl`, `just plan`, `just review-arch` or `just review-cli`. |
178
+ | `Roster policy refused: native vendor cannot use Pi` | A `.kxm/roster.yaml` Pi route names a native vendor, as in `openrouter/x-ai/…` or `nous-portal/anthropic/…`. | Remove the route. Only a native harness route is valid for that vendor. |
179
+ | The dev helper refuses a codex route. | `codex` is logged in with an API key. | Run `codex login` with the ChatGPT flow. |
180
+
181
+ For example, the native writer recipe:
182
+
183
+ ```bash
184
+ just impl brief.md
185
+ ```
186
+
187
+ ## Related
188
+
189
+ - [Harness routing](../reference/harness-routing.md): the rules, the decision procedure and the generic examples
190
+ - [Assignment runner](assignment-runner.md): the loop that enforces the developer roster
191
+ - [Configuration file reference](../reference/config-reference.md#kxmrosteryaml-kxmdeveloper-rosterv1): the `kxm.developer-roster.v1` fields
192
+ - [Routing and cost telemetry contract](../contracts/routing.md): the routing record, cost basis and dev-helper telemetry
@@ -1,10 +1,9 @@
1
1
  # Packages and workspaces
2
2
 
3
- Audience: maintainers adding or moving code in this repository.
4
-
5
- KXM ships one installable product (`@kontextmind/kxm`, loaded by Pi, the Claude
6
- Code plugin, and the MCP server) but is developed as a workspace, so a reusable
7
- component can be built, tested, and cached on its own.
3
+ KXM ships one installable product, `@kontextmind/kxm`, which Pi, the Claude Code
4
+ plugin and the MCP server all load. It is developed as an npm workspace so that a
5
+ reusable component can be built, tested and cached on its own. This page is for
6
+ maintainers who add or move code between packages.
8
7
 
9
8
  ## Layout
10
9
 
@@ -35,7 +34,7 @@ Current packages:
35
34
 
36
35
  | Package | Role | Consumers |
37
36
  |---|---|---|
38
- | `@kontextmind/tui` (`packages/core/tui`) | Reusable terminal components | `kxm dash`, configuration surfaces, `@kontextmind/kxm/tui` |
37
+ | `@kontextmind/tui` (`packages/core/tui`) | Reusable terminal components | `kxm dash` (its ANSI theme); integrators through `@kontextmind/kxm/tui` |
39
38
 
40
39
  ## Commands
41
40
 
@@ -48,12 +47,10 @@ Current packages:
48
47
  | `npx nx run-many -t build,test` | Every package |
49
48
  | `npm run verify` | The commit gate: tests, checks, and generated-artifact parity |
50
49
 
51
- Bun runs tasks (`bun run build`, `bun x nx ...`) and is the recommended local
52
- runner. Installation and CI still resolve through `npm ci` and Node 22.19.0/24,
53
- because the hub, the CLI, and Pi's extension host are Node runtimes and
54
- `npm ci` is what the current CI legs execute. Moving the installer itself to Bun
55
- is a separate change with its own CI evidence; see
56
- [`plans/implementation-plan.md`](../plans/implementation-plan.md) **Still open**.
50
+ Bun can run tasks locally (`bun run build`, `bun x nx ...`). Installation and CI
51
+ still resolve through `npm ci` on Node 22.19.0 and 24, because the hub, the CLI
52
+ and Pi's extension host are Node runtimes. Moving the installer itself to Bun is
53
+ a separate change that needs its own CI evidence.
57
54
 
58
55
  ## Rules that keep the shape
59
56
 
@@ -86,6 +83,7 @@ These are gates, not preferences:
86
83
 
87
84
  ## Related
88
85
 
89
- - [Terminal components](tui-components.md) — the kit and its surface contract
90
- - [Architecture](architecture.md) — component boundaries
91
- - [Configuration](configuration.md) — what is settings versus shipped code
86
+ - [Terminal components](tui-components.md): the kit and its surface contract
87
+ - [Develop KXM](development.md): the commit gate and generated artifacts
88
+ - [Architecture](../concepts/architecture.md): component boundaries
89
+ - [Configuration](../reference/configuration.md): what is settings versus shipped code
@@ -1,22 +1,23 @@
1
- # Repository Work Delivery Skill
1
+ # Repository work delivery skill
2
2
 
3
- ## Purpose
3
+ `repo-work-delivery` turns an engineering request into an evidence-based,
4
+ executable delivery prompt. It suits repository work that may need discovery,
5
+ official documentation research, phased delivery, validation, pull requests,
6
+ CI and review follow-through, policy-gated merge, and safe cleanup. This page is
7
+ for contributors who use coding agents on this repository.
4
8
 
5
- `repo-work-delivery` is a reusable skill for converting an engineering request into an evidence-based, executable delivery prompt. It is designed for repository work that may need discovery, official documentation research, phased delivery, validation, pull requests, CI/review follow-through, policy-gated merge, and safe cleanup.
9
+ The skill lives at `.agents/skills/repo-work-delivery/SKILL.md`. It is a
10
+ repository-local skill: it is not part of the bundled suite in
11
+ `plugins/kxm/skills/`, and it ships in neither the npm package nor the Claude
12
+ plugin.
6
13
 
7
- The canonical skill is located at:
8
-
9
- ```text
10
- .agents/skills/repo-work-delivery/SKILL.md
11
- ```
12
-
13
- ## What it does
14
+ ## What the skill requires
14
15
 
15
16
  The skill requires the executor to:
16
17
 
17
18
  - Inspect repository instructions, architecture, workflow guidance, CI, package manifests, and existing patterns.
18
19
  - Identify material ambiguity and ask focused questions only when repository evidence cannot safely resolve it.
19
- - Select the workflow recommended by the repository’s workflow guide.
20
+ - Select the workflow recommended by the repository's workflow guide.
20
21
  - Assign explicit delivery roles, even when one agent performs several roles.
21
22
  - Use a one-shot workflow only for genuinely small, low-risk, self-contained changes.
22
23
  - Research fresh official documentation for every materially affected package, framework, SDK, platform, or API.
@@ -29,13 +30,10 @@ The skill requires the executor to:
29
30
 
30
31
  ## Workflow selection
31
32
 
32
- The skill first reads the repository workflow guide. For KXM, that includes:
33
-
34
- ```text
35
- .agents/skills/kxm-workflow/SKILL.md
36
- ```
37
-
38
- It chooses the least complex safe workflow prescribed by that guidance.
33
+ The skill first reads the repository's workflow guidance. For KXM, that
34
+ includes the `kxm-workflow` skill (`.agents/skills/kxm-workflow/SKILL.md`, the
35
+ generated mirror of `plugins/kxm/skills/kxm-workflow/`). It chooses the least
36
+ complex safe workflow that guidance prescribes.
39
37
 
40
38
  ### One-shot work
41
39
 
@@ -74,7 +72,7 @@ The skill asks the user only when unanswered details would materially affect beh
74
72
 
75
73
  ## Documentation standard
76
74
 
77
- For material dependencies, research uses official maintainer or other authoritative primary documentation for the repository’s actual version. The plan or PR records the source, version/date where available, retrieval date, and decision supported.
75
+ For material dependencies, research uses official maintainer or other authoritative primary documentation for the repository's actual version. The plan or PR records the source, version/date where available, retrieval date, and decision supported.
78
76
 
79
77
  ## Merge and cleanup safety
80
78
 
@@ -103,5 +101,6 @@ A prompt produced with this skill includes:
103
101
 
104
102
  ## Related
105
103
 
106
- - [Agent Skills](../agent-skills.md) — bundled command-suite skills
107
- - [Skill candidate lifecycle](../skills.md) — governed `kxm skills` candidates
104
+ - [Agent skills](../guides/agent-skills.md): the bundled command-suite skills
105
+ - [Governed skills](../guides/governed-skills.md): `kxm skills` candidates
106
+ - [Assignment runner](assignment-runner.md): how maintainers accept delegated work
@@ -0,0 +1,208 @@
1
+ # Test matrix
2
+
3
+ This matrix maps each KXM behavior to the automated test that proves it. Use it
4
+ to find where a behavior is covered before you change it, and add a row in the
5
+ same pull request when you add a behavior. Test files are under `test/core/`
6
+ unless a row names another path.
7
+
8
+ Run the whole commit gate with `npm run verify`. What CI runs on a pull request,
9
+ on `main` and nightly is described in [CI and release](ci-and-release.md); how
10
+ to run one file is in [Develop KXM](development.md#run-one-file-or-one-test).
11
+
12
+ ## Hub and messaging
13
+
14
+ | Behavior | Evidence |
15
+ |---|---|
16
+ | Health, readiness, metrics, request IDs and security headers | `hub-api.test.ts` |
17
+ | Shared and per-project authentication, and project isolation | `hub-api.test.ts` |
18
+ | Registration, discovery, presence, stale detection and identity resumption | `hub-api.test.ts`, `hub.test.ts` |
19
+ | SQLite persistence, restart recovery and schema compatibility | `hub-api.test.ts`, `store.test.ts` |
20
+ | Delivery modes, message fields, hop limits and validation | `hub-api.test.ts`, `protocol.test.ts` |
21
+ | Queue, acknowledgement, visibility, reply and authorization | `hub-api.test.ts`, `hub.test.ts` |
22
+ | An unacknowledged (queued) message replays after a recipient restart as the same record | `hub.test.ts`, `extension.test.ts`, `mcp.test.ts` |
23
+ | An `allowOffline` send queues, delivers once on resumption, and expires unread by TTL | `hub-api.test.ts` |
24
+ | TTL expiry, sender cancellation and terminal retention | `hub-api.test.ts` |
25
+ | Exact-retry idempotency, and rejection of a reused key with different content | `hub-api.test.ts` |
26
+ | Fanout to one to three peers: local timeouts, aborts, exact retries, partial errors | `client.test.ts`, `hub-api.test.ts`, `extension.test.ts`, `mcp.test.ts` |
27
+ | Fenced leases: compare-and-set acquire, renew and release; a stale token's shared effect is refused | `hub-api.test.ts`, `store.test.ts`, `external-effects.test.ts` |
28
+ | Rate limiting and retry guidance | `hub-api.test.ts` |
29
+ | Redacted structured logs | `hub-api.test.ts` |
30
+ | Client lifecycle: aborts, timeouts, invalid responses and reconnection | `client.test.ts` |
31
+ | Safe diagnostic classification and redaction | `diagnostics.test.ts`, `extension.test.ts`, `hub-api.test.ts` |
32
+ | Failed MCP inbox notifications stay retryable; delivery deduplicates | `inbox.test.ts` |
33
+
34
+ ## Hub workflows and provenance
35
+
36
+ | Behavior | Evidence |
37
+ |---|---|
38
+ | Signed Jira webhook verification, filtering, dispatch and retry deduplication | `hub-api.test.ts` |
39
+ | Ordered checkpoints, keyed evidence gates, and warning or failure retry | `hub-api.test.ts`, `workflow.test.ts` |
40
+ | Eligible producers fixed at run start; per-requirement message references; unique-producer quorum; replay rejected | `workflow-provenance.test.ts`, `workflow.test.ts`, `hub-api.test.ts`, `client.test.ts`, `store.test.ts` |
41
+ | Admin degradation of the current attempt: configured minimum, audit journal, idempotency, stale approvals refused | `workflow-provenance.test.ts`, `cli.test.ts` |
42
+ | Durable external waits: evidence accumulation, safe settlement, race rejection, signed callbacks, separate secrets | `hub-api.test.ts`, `workflow.test.ts`, `workflow-provenance.test.ts` |
43
+ | Quorum parser boundaries, and a secret-free definition hash that survives credential rotation | `workflow-quorum.test.ts`, `workflow-definition-hash.test.ts` |
44
+ | Durable workflow and journal recovery; atomic transition commit and rollback | `store.test.ts` |
45
+ | Plans, decisions, contradictions, errors, lessons and improvement reports | `hub-api.test.ts`, `workflow.test.ts` |
46
+ | All ten journal categories and `stageId` through `kxm_workflow_record`, with stage provenance end to end | `journal-evolution.test.ts` ("kxm_workflow_record binds stage provenance and the stage's area end to end, and hub-authored entries carry it too") |
47
+ | Ranked, redacted cross-run signals; retrospectives refreshed by late entries and promotions | `journal-evolution.test.ts`, `workflow.test.ts`, `retrospective.test.ts` |
48
+ | Retrospective export: snapshots, metadata-only provenance audit, body allowlist, degradation records | `retrospective.test.ts` |
49
+ | Typed back-edges, transition budgets, bypass protection and restart recovery | `workflow-transitions.test.ts` |
50
+ | GitHub check watch: pagination, conclusions, retries and per-wait delivery generations | `github-watch.test.ts` |
51
+
52
+ ## Local Runtime and engine
53
+
54
+ | Behavior | Evidence |
55
+ |---|---|
56
+ | Event-sourced Runtime: singleton supervisor, append-only per-project stores, idempotent commands, projection rebuild, crash recovery | `runtime.test.ts`, `cli.test.ts`, `package-install.test.ts` |
57
+ | A store the build refuses is reported unreadable, never empty | `runtime.test.ts` ("a project whose store the build refuses is reported as unreadable, never as empty") |
58
+ | Supervisor drive: `202` with a poll link, duplicate drives refused, graceful shutdown waits | `runtime-supervisor.test.ts` |
59
+ | Settlement from a structured result only; prose outcomes and undeclared outcomes end as `outcome_unknown` | `pi-producer.test.ts`, `engine.test.ts` |
60
+ | Routing records carry `workflowId`, `askSha256`, `objectiveSha256` and `stepWrites`, and settle only `blocked` or `failed` | `route-admission.test.ts` |
61
+ | Dispatch context: only committed, pinned memory and hash-verified promoted skills reach an agent; the rest is a `dispatch_context_*` gap | `engine.test.ts` ("dispatch context: agents receive only committed, pinned memory and verified skills; anything else is withheld with a gap and the step still completes") |
62
+ | `kxm run` prints the simulated drive command for the new run | `cli.test.ts` ("kxm run prints the simulated drive command for the created run") |
63
+ | `kxm workflow add --template` writes workflows that validate and plan; an impossible gate outcome is refused | `cli-experience.test.ts` ("workflow add templates validate and plan a run, and a gate outcome the step can never produce is refused") |
64
+ | `default.yaml` and the 13-step `fix.yaml` compile deterministically; back edges need budgets | `engine-compile.test.ts` |
65
+ | Artifact gate: non-empty regular files pass; missing, empty, non-file and escaping paths fail | `artifacts-exist.test.ts` |
66
+ | Vision gate: strict verdicts, admitted routes only, unreadable images fail closed | `vision-gate.test.ts` |
67
+ | Tenant read labels hub projection versus Runtime authority and survives either side being down | `studio-layout.test.ts` |
68
+
69
+ ## Context, memory and learning
70
+
71
+ | Behavior | Evidence |
72
+ |---|---|
73
+ | Packets rank by task relevance, fill the budget first-fit, and deliver every selected item, evidence included | `arbiter.test.ts` ("arbitrate ranks task-relevant candidates first, delivers every selected item in a packet section, orders ties newest first, and reports relevance") |
74
+ | Recall ranks by phrase, then relevance; hub logs carry sizes, not task or query text | `context-surfaces.test.ts`, `arbiter.test.ts` |
75
+ | An agent's state proposal is peer origin, decided by its credential, and capped at evidence | `context-authority.test.ts` ("a state proposal takes its origin from the verified credential, so an agent is peer and capped at evidence") |
76
+ | Promotion needs the configured admin token with no loopback bypass; proposed items never reach a packet | `e5-memory-floor.test.ts` |
77
+ | `kxm memory`: candidates, marker-delimited sync blocks, and one brief across CLI, Pi and the Claude hook | `e5b-harness-agnostic-memory.test.ts` |
78
+ | `kxm improve report` reads Runtime-settled attempts, drops simulated and duplicate ones, and flags only same-ask repeats | `improve.test.ts` ("kxm improve report resolves Runtime-settled attempts from the event log and flags only same-ask cross-run repeats"), `cli.test.ts`, `cli-experience.test.ts`, `commands-policy.test.ts` |
79
+ | Improvement candidates exclude write steps; promotion readiness never authorizes | `improve.test.ts` |
80
+ | Telemetry classification and JSONL recovery | `telemetry.test.ts`, `cli.test.ts` |
81
+
82
+ The context suites in detail:
83
+
84
+ | Suite | Covers |
85
+ |---|---|
86
+ | `context.test.ts` | Context schema round trips, hostile input, cross-project refusal, storage upgrade |
87
+ | `state.test.ts` | Temporal state lifecycle, `asOf` queries, supersession, contradictions, restart durability |
88
+ | `context-authority.test.ts` | Authority floor per origin, reserialization escalation, lineage bounds, control-plane smuggling |
89
+ | `arbiter.test.ts` | Role-aware packets, relevance ranking, first-fit budgets, the evidence section, contradiction routing |
90
+ | `context-surfaces.test.ts` | CLI and Pi tool parity for the context API |
91
+ | `journal-evolution.test.ts` | Journal categories, evidence requirements, governed promotion, stage provenance |
92
+ | `wiki.test.ts` | Wiki compilation determinism, lifecycle preservation, contradiction visibility, lint |
93
+ | `skills.test.ts` | Skill candidate lifecycle, quarantine, immutability, CLI |
94
+ | `routing.test.ts` | Behavioral hash, record parsing, comparisons, `kxm routing report` |
95
+ | `improve.test.ts` | Routing-record sources, event-log outcomes, same-ask candidacy, candidate files, promotion readiness |
96
+
97
+ ## Claude Code plugin and MCP
98
+
99
+ | Behavior | Evidence |
100
+ |---|---|
101
+ | MCP tool catalog, outbound and inbound tools, and channel delivery | `mcp.test.ts` |
102
+ | The MCP server never registers with the persisted admin token | `mcp.test.ts` ("MCP server never registers with the persisted admin token") |
103
+ | Expired disk tokens and invalid `KXM_SESSION_TOKEN` values produce errors that name the user's fix | `mcp.test.ts` |
104
+ | MCP tools, Pi tools and CLI verbs match `AGENT_COMMANDS` exactly, plus the hook-only tools | `commands-drift.test.ts` |
105
+ | The plugin README tool table lists every tool the MCP server publishes | `claude-plugin-docs.test.ts` |
106
+ | `SessionStart` hook: silent outside a project, project-scoped, under 1,500 characters, never prints a session token | `claude-plugin-hooks.test.ts` |
107
+ | Hooks use exec form under `CLAUDE_PLUGIN_ROOT` with bounded timeouts, and run from a copied plugin directory | `claude-plugin-hooks.test.ts` ("plugin hooks use exec form under CLAUDE_PLUGIN_ROOT with bounded timeouts") |
108
+ | Terminal inbound cleanup and next-request activation | `extension.test.ts`, `mcp.test.ts` |
109
+
110
+ ## Pi extension and workers
111
+
112
+ | Behavior | Evidence |
113
+ |---|---|
114
+ | Pi tools, inbound turns, automatic replies and the status command | `extension.test.ts` |
115
+ | Workflow and journal tools, workflow-context sends, and peer-reference checkpoints and waits | `extension.test.ts`, `mcp.test.ts` |
116
+ | Interrupted-worker continue fallback, run-bound recovery and one-turn durable replay | `worker.test.ts`, `recovery.test.ts`, `extension.test.ts` |
117
+ | Hub-owned workflow affinity, pre-acknowledgement routing, one-child session-directory swap, LRU retention | `hub-api.test.ts`, `extension.test.ts`, `worker.test.ts`, `cli.test.ts` |
118
+ | Provider-error retention, retry ordering, bounded fallback, oversized frames and session-preserving restart | `extension.test.ts`, `worker.test.ts`, `diagnostics.test.ts`, `cli.test.ts` |
119
+ | Tool allowlist, watchdog grace, hung-tool recovery and race-safe ownership claims | `worker.test.ts`, `cli.test.ts`, `hub-autostart.test.ts` |
120
+ | Exact extension and skill sets, discovery isolation, path preflight and Windows argument safety | `worker.test.ts` |
121
+ | Workspace defaults and persisted worker logs under isolated temporary workspaces | `worker.test.ts`, `hub-autostart.test.ts` |
122
+ | Opt-in real-Pi smoke contract and its safe skip paths | `smoke-real-pi.test.ts`, `smoke.test.ts` |
123
+
124
+ ## CLI, configuration and trust
125
+
126
+ | Behavior | Evidence |
127
+ |---|---|
128
+ | `init`, `validate`, `export` and `watch` in isolated workspaces | `cli.test.ts`, `github-watch.test.ts` |
129
+ | Every mutating command under `--dry-run` leaves the workspace, state root and hub untouched | `cli-experience.test.ts` ("every mutating command under --dry-run leaves the workspace, state root, and hub untouched") |
130
+ | Hub auto-start reuses a healthy or claimed hub, persists one admin key, and fails closed on bad claims | `hub-autostart.test.ts` |
131
+ | Hub-local session brief from SQLite without message bodies; `hub bind` reports on, off or unknown | `session-work.test.ts`, `cli.test.ts` |
132
+ | Session manifests, fail-closed rosters, worker and result envelopes, hub-owned envelope fields | `session.test.ts`, `cli.test.ts`, `envelope.test.ts`, `envelope-contract.test.ts` |
133
+ | Metadata-only dashboard: ops mode, presence-only fallback, observer filtering, keys, body-free local projection | `tui.test.ts`, `hub-api.test.ts` |
134
+ | Restricted loader, deterministic bundle hash, init classification, atomic creation, three-way repair, crash resumption | `project-config.test.ts`, `cli.test.ts`, `package-install.test.ts` |
135
+ | Legacy `.kxm/config` JSON is refused with `legacy_state_unsupported`; `kxm migrate` is unknown; older stores are refused | `project-config.test.ts`, `cli.test.ts`, `e6-backup-restore-migrations.test.ts` |
136
+ | `kxm backup` and `kxm restore` round-trip the hub store and Runtime stores seeded under `.kxm/runtime/`; tampered or newer backups are refused | `e6-backup-restore-migrations.test.ts` |
137
+ | Permission-diff trust: authority lattice, prose neutrality, Git base shadowing, CLI diff and check | `permission.test.ts`, `cli.test.ts`, `contracts.test.ts`, `package-install.test.ts` |
138
+ | KXM schemas, restricted YAML fixtures, cross-resource semantics and sync-safe rejection | `contracts.test.ts`, `restricted-yaml.test.ts` |
139
+ | Harness detection, auth and dispatch for the built-in catalog, including Windows launch rules | `harness.test.ts` |
140
+ | `kxm update`: `update.yaml` validation, GitHub or npm version checks, install-kind detection, `kxm-<v>.tgz` asset selection | `kxm-update.test.ts`, `kxm-update-cli.test.ts`, `kxm-install-kind.test.ts` |
141
+
142
+ The backup round trip seeds its Runtime stores in a project-local
143
+ `.kxm/runtime/` layout that the Runtime never writes. Production Runtime stores
144
+ live under the user state root, which `kxm backup` does not discover, so no test
145
+ backs up the real Runtime stores.
146
+
147
+ ## Packaging, release and repository gates
148
+
149
+ | Behavior | Evidence |
150
+ |---|---|
151
+ | The packed CLI and hub run from a clean local install and an isolated global `--omit=peer` install | `package-install.test.ts` |
152
+ | Generated bundles and skill mirrors exist, are tracked and match the staged copy; mirror emit refuses symlinks | `generated-artifacts.test.ts`, `scripts/check-generated.mjs` |
153
+ | Every version surface matches; the bumper writes each workspace manifest and patches the lockfile by key | `scripts/check-versions.mjs`, `version-surfaces.test.ts` |
154
+ | Release packs `kxm-<v>.tgz`, uploads to a draft fail-closed, proves the digest and never clobbers | `kxm-release-github.test.ts`, `ci-contract.test.ts` |
155
+ | npm publish requires a published release and a matching asset digest | `kxm-publish-npm.test.ts` |
156
+ | CI required jobs are unconditional; runner selector, coverage floors and release triggers are pinned | `ci-contract.test.ts` |
157
+ | Skill suite: manifest shape, one owner per command, strict YAML frontmatter, no legacy names, mirror parity | `skill-suite.test.ts` ("every bundled SKILL.md frontmatter parses as strict YAML") |
158
+ | The extension and MCP server never import the hub, store or workflow; library bundles stay host-neutral | `import-boundary.test.ts` |
159
+ | Workspace packages keep their layers, required files and by-name imports | `package-layers.test.ts` |
160
+ | Retired product names stay out of the scanned docs | `docs-copy.test.ts` |
161
+ | Headless harness helper: auth probes, refusals before spawn, typed usage and cost, stdio and timeout handling | `harness-run.test.ts` |
162
+ | `justfile` gates: documented `just` verbs exist, runner call sites are pinned, no dotenv auto-load | `harness-run.test.ts` |
163
+ | Developer roster validation: vendors, read-only critics, pinned model-origin evidence | `roster-policy.test.ts` |
164
+
165
+ The `justfile` gates are drift protection, not a sandbox: anyone who can edit
166
+ the file can already do what it does. They run without the `just` binary and
167
+ skip the real-`just` checks, with a visible reason, when it is absent.
168
+
169
+ ## Examples and fixtures
170
+
171
+ | Scenario | Location | Verification |
172
+ |---|---|---|
173
+ | Self-contained planner and reviewer round trip | `examples/roundtrip.ts` | Executed by `examples.test.ts` |
174
+ | Long-running deterministic reviewer | `examples/reviewer-agent.ts` | Type-checked |
175
+ | Command-line requester | `examples/requester.ts` | Type-checked |
176
+ | Signed external result callback | `examples/workflow-signal.ts` | Type-checked; the same signed path runs end to end in `hub-api.test.ts` |
177
+ | Peer provenance with optional degradation | `examples/provenance-workflow.json`, `docs/guides/provenance-gates.md` | Parsed and matched to the guide by `examples.test.ts` |
178
+ | Jira development webhook workflow | `examples/webhook-workflows/jira-development.json` | Not parsed by a test; `hub-api.test.ts` and `workflow.test.ts` exercise an inline definition of the same shape |
179
+ | Project fixture with `default.yaml` and `fix.yaml` | `examples/project/` | Compiled by `engine-compile.test.ts`; schema-checked by `contracts.test.ts` |
180
+ | Plan-then-review, separate ownership, delegation, cancellation, safe retry prompts | `examples/README.md` | Documented agent prompts; not executed |
181
+
182
+ ## Coverage floors
183
+
184
+ | Run | Lines | Branches | Functions |
185
+ |---|---:|---:|---:|
186
+ | `test:coverage:core` (pushes to `main`, releases) | 91% | 80% | 92% |
187
+ | `test:coverage:complete` (nightly) | 93% | 80% | 93% |
188
+
189
+ Coverage measures `plugins/kxm/src/**/*.ts` and `packages/core/*/src/**/*.ts`,
190
+ excluding the spawned entry points `server.ts`, `mcp-server.ts` and
191
+ `runtime-supervisor.ts`. The generated MCP runtime is exercised as a child
192
+ process, and the packed CLI and hub run from a clean consumer install. The
193
+ floors only move up.
194
+
195
+ ## Behavior without automated coverage
196
+
197
+ Some behavior can only be checked by hand, for example how a harness UI renders
198
+ a channel event. List it in the manual checks in
199
+ [CI and release](ci-and-release.md#manual-checks-before-announcing-a-release)
200
+ instead of implying automated coverage here. The developer
201
+ [assignment runner](assignment-runner.md#test-coverage-is-thin) has no
202
+ end-to-end tests.
203
+
204
+ ## Related
205
+
206
+ - [Develop KXM](development.md): test conventions and the commit gate
207
+ - [CI and release](ci-and-release.md): which suites run where
208
+ - [Write KXM documentation](writing-docs.md): doc gates and pinned paths
@@ -1,14 +1,17 @@
1
1
  # KXM terminal components
2
2
 
3
- Audience: maintainers and integrators who draw a KXM surface — the live screens,
4
- a configuration panel, or a host adapter for another harness.
3
+ The terminal kit gives every KXM surface the same keys, colors and failure
4
+ behavior. This page is for maintainers and integrators who draw a KXM surface: a
5
+ live screen, a configuration panel, or a host adapter for another harness.
5
6
 
6
7
  The kit is the workspace package
7
- [`packages/core/tui`](../packages/core/tui) (`@kontextmind/tui`),
8
- also published on the product as `@kontextmind/kxm/tui`. It is one declarative
8
+ [`packages/core/tui`](../../packages/core/tui) (`@kontextmind/tui`), also
9
+ published on the product as `@kontextmind/kxm/tui`. It is one declarative
9
10
  surface model, one renderer, one input decoder, one contribution registry, and
10
- thin host adapters, so every surface keys, colours, and fails the same way. See
11
- [Packages and workspaces](packages.md) for the layout convention it follows.
11
+ thin host adapters. Today `kxm dash` uses only its ANSI theme; the panel,
12
+ registry and adapters are exported for integrators, and no shipped `kxm` command
13
+ draws a panel yet. See [Packages and workspaces](packages.md) for the layout
14
+ convention it follows.
12
15
 
13
16
  ## Package layout
14
17
 
@@ -20,7 +23,7 @@ every control in `tui/` is rendered in a test.
20
23
 
21
24
  ## The surface contract
22
25
 
23
- A surface is **published, not centralised**. An owner (configuration, roster,
26
+ A surface is **published, not centralized**. An owner (configuration, roster,
24
27
  routes, gates, roles, workflow) contributes sections and fields; one renderer
25
28
  draws them all; the owner still performs every write. The panel never becomes a
26
29
  second source of truth for configuration.
@@ -51,11 +54,11 @@ needs selecting and an absent one that needs fetching, without the renderer
51
54
  knowing the difference.
52
55
 
53
56
  Bounds are protocol limits, not suggestions
54
- ([`KXM_TUI_LIMITS`](../packages/core/tui/src/types/surface.ts)). An oversized
57
+ ([`KXM_TUI_LIMITS`](../../packages/core/tui/src/types/surface.ts)). An oversized
55
58
  or malformed published surface is refused with structured issues and drawn with
56
59
  an error notice, so a broken file is still repairable from the panel.
57
60
 
58
- ## Fail-closed behaviour
61
+ ## Fail-closed behavior
59
62
 
60
63
  | Situation | What happens |
61
64
  |---|---|
@@ -65,7 +68,7 @@ an error notice, so a broken file is still repairable from the panel.
65
68
  | A choice is `blocked` | Enter reports `statusText` and sends nothing (an unauthenticated route stays unauthenticated) |
66
69
  | Handler for an unknown action or unknown owner | Refused with a message; never guessed |
67
70
  | A write resolves after the registry was disposed or re-opened | Discarded as stale |
68
- | No TTY, or `NO_COLOR` | One plain frame, exit `0`, no escape codes at all |
71
+ | No TTY, or `NO_COLOR` or `KXM_TUI_NO_COLOR` set | One plain frame, exit `0`, no escape codes at all |
69
72
  | Contract violation in a published surface | Refused with issues; the panel draws the reason instead of hiding it |
70
73
 
71
74
  There is deliberately **no local echo**. A field is pending until its owner
@@ -76,18 +79,23 @@ republishes, so anything on screen is a value that exists on disk.
76
79
  | Key | Action |
77
80
  |---|---|
78
81
  | `↑` `↓` / `k` `j` | move within the focused pane |
79
- | `←` `→` / `Tab` / `h` `l` | switch sections and fields |
82
+ | `←` `→` / `Tab` | switch between the sections pane and the fields pane |
83
+ | `l` | move to the fields pane |
80
84
  | `PgUp` `PgDn` | jump sections |
81
85
  | `enter` | edit a text field, cycle an enum, open a choice list |
82
86
  | type | filter a choice list, or edit a text value |
83
- | `x` | clear the focused value (writes "unset", not a default) |
87
+ | `x` / `d` | clear the focused value (writes "unset", not a default) |
84
88
  | owner keys | any `actions[].key` on the focused field |
85
89
  | `esc` | back out of a pane, list, or draft, then quit |
90
+ | `q` | quit |
86
91
  | `Ctrl+C` | abort a busy field, else quit |
87
- | `h` / `?` | help |
92
+ | `h` / `?` | help; `esc` or `enter` closes it |
93
+
94
+ `h` opens help rather than moving to the sections pane, so use `←` or `Tab` to
95
+ go back.
88
96
 
89
97
  The reducer is pure
90
- ([`reduceKxmTuiInput`](../packages/core/tui/src/tui/panel.ts)) and returns
98
+ ([`reduceKxmTuiInput`](../../packages/core/tui/src/tui/panel.ts)) and returns
91
99
  effects; the component layer runs them. That is the same contract that keeps
92
100
  `kxm dash` navigation testable, and it is why no key handling needs a terminal.
93
101
 
@@ -106,7 +114,7 @@ effects; the component layer runs them. That is the same contract that keeps
106
114
 
107
115
  Selectable values come from reference sources, not from a model's memory: the
108
116
  harness catalog in
109
- [`harness.ts`](../plugins/kxm/src/harness.ts), admitted routes in
117
+ [`harness.ts`](../../plugins/kxm/src/harness.ts), admitted routes in
110
118
  `.kxm/routes.yaml`, the model inventory and price catalog, gate ids in
111
119
  `.kxm/gates.yaml`, role ids in `.kxm/roles/`, and workflow ids in
112
120
  `.kxm/workflows/`.
@@ -119,13 +127,13 @@ harness catalog in
119
127
  definitions stay Git-reviewed changes with a diff and a PR.
120
128
  - It is not a third verification gate. `npm run verify` and CI still decide
121
129
  whether work is green.
122
- - It does not replace `kxm dash`. The dashboard keeps its hub and SSE loop and
123
- shares this kit's palette and layout maths.
130
+ - It does not replace `kxm dash`. The dashboard keeps its own hub and SSE loop
131
+ and takes only this kit's ANSI theme.
124
132
 
125
133
  ## Related
126
134
 
127
- - [Packages and workspaces](packages.md) — the layout convention and its gate
128
- - [Configuration](configuration.md) — the settings a config surface edits
129
- - [Architecture](architecture.md) — component boundaries
130
- - [Test matrix](test-matrix.md) — where a behaviour is proven
131
- - [KXM contracts](contracts/README.md) — schemas behind the reference files
135
+ - [Packages and workspaces](packages.md): the layout convention and its gate
136
+ - [Configuration](../reference/configuration.md): the settings a config surface edits
137
+ - [Architecture](../concepts/architecture.md): component boundaries
138
+ - [Test matrix](test-matrix.md): where a behavior is proven
139
+ - [KXM contracts](../contracts/README.md): schemas behind the reference files