@kontextmind/kxm 0.7.130 → 0.7.131

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 (54) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.kxm/README.md +4 -1
  3. package/.kxm/agents/coordinator.yaml +1 -0
  4. package/.kxm/agents/critic-arch.yaml +1 -4
  5. package/.kxm/agents/critic-cli.yaml +1 -4
  6. package/.kxm/agents/implementer.yaml +1 -4
  7. package/.kxm/workflows/implement-only.yaml +1 -1
  8. package/.kxm/workflows/review-arch-only.yaml +1 -1
  9. package/.kxm/workflows/review-cli-only.yaml +1 -1
  10. package/CHANGELOG.md +22 -1
  11. package/docs/concepts/architecture.md +1 -1
  12. package/docs/contracts/routing.md +3 -3
  13. package/docs/contributing/assignment-runner.md +14 -15
  14. package/docs/contributing/development.md +19 -5
  15. package/docs/contributing/harness-routing-internals.md +8 -8
  16. package/docs/glossary.md +1 -1
  17. package/docs/guides/agent-skills.md +1 -1
  18. package/docs/operations/backup-and-restore.md +4 -4
  19. package/docs/reference/cli-reference.md +26 -8
  20. package/docs/reference/config-reference.md +76 -153
  21. package/docs/reference/harness-routing.md +29 -21
  22. package/docs/reference/workflow-catalog.md +4 -4
  23. package/docs/start/first-workflow.md +1 -1
  24. package/examples/project/.kxm/agents/coordinator.yaml +1 -2
  25. package/examples/project/.kxm/agents/critic-1.yaml +1 -3
  26. package/examples/project/.kxm/agents/critic-2.yaml +1 -2
  27. package/examples/project/.kxm/agents/critic-3.yaml +2 -3
  28. package/examples/project/.kxm/agents/implementer.yaml +1 -2
  29. package/examples/project/.kxm/agents/planner.yaml +1 -2
  30. package/examples/project/.kxm/agents/reproducer.yaml +1 -2
  31. package/examples/project/.kxm/agents/reviewer.yaml +1 -2
  32. package/examples/project/.kxm/workflows/fix.yaml +0 -12
  33. package/package.json +1 -1
  34. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  35. package/plugins/kxm/dist/cli.js +287 -249
  36. package/plugins/kxm/dist/mcp-server.js +1 -1
  37. package/plugins/kxm/dist/runtime-supervisor.js +222 -242
  38. package/plugins/kxm/dist/runtime.js +224 -244
  39. package/plugins/kxm/package.json +1 -1
  40. package/plugins/kxm/skills/kxm/SKILL.md +1 -1
  41. package/plugins/kxm/skills/kxm-definitions/SKILL.md +8 -0
  42. package/plugins/kxm/src/cli/project.ts +4 -4
  43. package/plugins/kxm/src/engine.ts +168 -163
  44. package/plugins/kxm/src/init-guide-setup.ts +75 -15
  45. package/plugins/kxm/src/mcp-server.ts +1 -1
  46. package/plugins/kxm/src/oneshot-producer.ts +3 -15
  47. package/plugins/kxm/src/project-config.ts +83 -70
  48. package/plugins/kxm/src/routes.ts +26 -18
  49. package/plugins/kxm/src/runtime-supervisor.ts +0 -18
  50. package/plugins/kxm/src/suggest.ts +2 -2
  51. package/plugins/kxm/src/template.ts +2 -14
  52. package/schemas/agent.schema.json +8 -0
  53. package/scripts/roster-policy.d.mts +2 -1
  54. package/scripts/roster-policy.mjs +119 -22
@@ -11,7 +11,7 @@
11
11
  "name": "kxm",
12
12
  "source": "./plugins/kxm",
13
13
  "description": "Durable workflows, peer agents, and kxm tui",
14
- "version": "0.7.130",
14
+ "version": "0.7.131",
15
15
  "category": "development",
16
16
  "tags": ["kxm", "multi-agent", "workflows", "mcp"]
17
17
  }
package/.kxm/README.md CHANGED
@@ -15,7 +15,6 @@ a `default` workflow, `gates.yaml` and `template-provenance.yaml`.
15
15
  | `agents/`, `models/`, `workflows/` | Agents, model profiles and workflows, one YAML file each | Tracked |
16
16
  | `gates.yaml` | The executable gate registry | Tracked |
17
17
  | `roles/`, `routes.yaml`, `prices.yaml` | Role rosters, admitted model routes, dated list prices | Tracked |
18
- | `roster.yaml` | The developer assignment roster for this repository | Tracked, and must be committed |
19
18
  | `template-provenance.yaml` | Hashes of the template `kxm init` used | Tracked |
20
19
  | `models/inventory.yaml` | The discovered model catalog | Generated; track it for a reviewed snapshot |
21
20
  | `config.yaml` | Shared personalization settings | Tracked if the project shares them |
@@ -26,6 +25,10 @@ a `default` workflow, `gates.yaml` and `template-provenance.yaml`.
26
25
  | `state/` | The hub database `kxm.db`, Pi sessions and restart state | Ignored |
27
26
  | `run/` | SSH control sockets from `kxm ssh` | Ignored |
28
27
 
28
+ The role files under `.kxm/roles/` and the model files under `.kxm/models/`
29
+ carry the developer policy. The assignment runner reads them at
30
+ `refs/remotes/origin/main`.
31
+
29
32
  The [configuration reference](../docs/reference/config-reference.md#workspace-layout-tracked-ignored-and-state)
30
33
  describes every file, the ignore rules to add, and the state KXM keeps outside
31
34
  the project.
@@ -1,5 +1,6 @@
1
1
  schema: kxm.agent.v1
2
2
  purpose: Coordinate the pinned workflow and emit schema-validated commands.
3
+ role: planner
3
4
  tools:
4
5
  preset: coordinator
5
6
  defaultRepositoryAccess: read
@@ -1,9 +1,6 @@
1
1
  schema: kxm.agent.v1
2
2
  purpose: Architecture critic for the approved workflow change.
3
- harness: claude
4
- model:
5
- provider: anthropic
6
- model: fable
3
+ role: reviewer-arch
7
4
  tools:
8
5
  preset: read-only
9
6
  defaultRepositoryAccess: read
@@ -1,9 +1,6 @@
1
1
  schema: kxm.agent.v1
2
2
  purpose: CLI and verification critic for the approved workflow change.
3
- harness: codex
4
- model:
5
- provider: openai
6
- model: gpt-5.6-sol
3
+ role: reviewer-cli
7
4
  tools:
8
5
  preset: read-only
9
6
  defaultRepositoryAccess: read
@@ -1,9 +1,6 @@
1
1
  schema: kxm.agent.v1
2
2
  purpose: Implement the approved change within the declared repository scope.
3
- harness: grok
4
- model:
5
- provider: xai
6
- model: grok-4.7
3
+ role: writer
7
4
  tools:
8
5
  preset: workspace-writer
9
6
  defaultRepositoryAccess: none
@@ -1,5 +1,5 @@
1
1
  schema: kxm.workflow.v1
2
- description: One implementer step with a drive receipt. Replaces just impl.
2
+ description: One implementer step with a drive receipt.
3
3
  coordinator: coordinator
4
4
  limits:
5
5
  maxTransitions: 2
@@ -1,5 +1,5 @@
1
1
  schema: kxm.workflow.v1
2
- description: One read-only architecture critic step. Replaces just review-arch.
2
+ description: One read-only architecture critic step.
3
3
  coordinator: coordinator
4
4
  limits:
5
5
  maxTransitions: 2
@@ -1,5 +1,5 @@
1
1
  schema: kxm.workflow.v1
2
- description: One read-only CLI critic step. Replaces just review-cli.
2
+ description: One read-only CLI critic step.
3
3
  coordinator: coordinator
4
4
  limits:
5
5
  maxTransitions: 2
package/CHANGELOG.md CHANGED
@@ -138,6 +138,17 @@ All notable user-facing changes are documented here. The project follows [Semant
138
138
 
139
139
  ### Changed
140
140
 
141
+ - **Dispatch reads role and model files, and agents bind a role.**
142
+ `scripts/roster-policy.mjs` builds the developer policy from
143
+ `.kxm/models/*.yaml` and `.kxm/roles/*.yaml` at `refs/remotes/origin/main`.
144
+ The engine resolves harness, model, and effort from the agent's `role`
145
+ and that role's roster. A step `model` does not override that route.
146
+ `kxm routes` prints `policy` (`admitted`, `disabled`) and `membership`
147
+ from the role files. `.kxm/routes.yaml` keeps admitted and disabled
148
+ selectors. `reviewer-arch` resolves to `fable-claude`. `opus-claude` is
149
+ admitted and named by no roster, so it is absent from `routes` and the
150
+ lineups. `gemini-agy` is in the writer lineup. An agent `tools.preset`
151
+ may only narrow its role preset; that rule is recorded and enforced in P3.
141
152
  - **Role and model files are live `kxm.role.v2` and `kxm.model.v2`.**
142
153
  `schemas/role.schema.json` and `schemas/model.schema.json` are the files
143
154
  `kxm config` validates. Each admitted roster route is a
@@ -153,7 +164,9 @@ All notable user-facing changes are documented here. The project follows [Semant
153
164
  in the developer ceilings or the harness inventory can dispatch them:
154
165
  `zai-coding-cn/glm-5.3-flash`, `qwen-token-plan/qwen3.8-flash`,
155
166
  `qwen-token-plan/qwen3.8-max`, and `zai-coding-cn/glm-5.3`.
156
- Dispatch still reads `.kxm/roster.yaml` until P2.
167
+ Dispatch resolves harness, provider, model, and effort from the role roster.
168
+ A live request with no harness is refused. A roster entry with no effort
169
+ leaves thinking unset.
157
170
 
158
171
  - **Usage errors under `--json` print a `usage_error` envelope and exit 2.**
159
172
  A missing required option, unknown command, or other Commander usage error
@@ -418,6 +431,14 @@ All notable user-facing changes are documented here. The project follows [Semant
418
431
 
419
432
  ### Removed
420
433
 
434
+ - **The developer roster file and the transport just recipes.**
435
+ The single roster document and the `impl`, `plan`, `review-arch`,
436
+ `review-cli`, `impl-bg`, and `dispatch` recipes are gone. One-step
437
+ workflows are the transport: `kxm lane run <unit> --brief <file> --workflow implement-only`,
438
+ and the same command with `review-arch-only` or `review-cli-only`.
439
+ Transfer policy from `.kxm/roster.yaml` to the role and model files and
440
+ delete the retired roster before running KXM. KXM refuses a leftover
441
+ `.kxm/roster.yaml`.
421
442
  - **`.kxm/template-provenance.yaml` was removed from this project, a repository
422
443
  change rather than a product change,** because the installed kxm no longer
423
444
  recognizes its recorded revision and a project without the file validates as
@@ -211,7 +211,7 @@ The package ships a directory of `SKILL.md` suites that Pi and Claude Code both
211
211
  Project behavior lives in Git under `.kxm/`: `project.yaml`, `agents/`, `models/`, `workflows/`, `gates.yaml`, `roles/`, `routes.yaml`, `memory/`, and `skills/`. The project bundle (`project.yaml`, `agents/`, `models/`, `workflows/`, and `gates.yaml`) is restricted YAML checked against a JSON Schema. `routes.yaml`, `roles/`, and the front matter in `memory/` and `skills/` are parsed as ordinary YAML with their own checks, and a live drive re-reads an agent file the same way to resolve its route. Git review is the activation boundary:
212
212
 
213
213
  - Every run pins revision hashes of the project bundle, memory, executor policy, and tool policy. An edit affects only later runs, and a run whose pinned revisions drift is refused.
214
- - `kxm trust diff` prints a structured permission diff against a base revision (default `HEAD`). `kxm trust check` exits non-zero when the change expands permissions. Neither covers `routes.yaml`, `roles/`, `roster.yaml`, or `prices.yaml`, so admitting a route is not flagged.
214
+ - `kxm trust diff` prints a structured permission diff against a base revision (default `HEAD`). `kxm trust check` exits non-zero when the change expands permissions. Neither covers `routes.yaml`, `roles/`, `the role files`, or `prices.yaml`, so admitting a route is not flagged.
215
215
  - Legacy `.kxm/config/*.json` files are refused, never converted.
216
216
 
217
217
  Webhook workflow definitions are separate JSON that the hub loads at start, with secrets named by environment variable. Personal settings merge built-in defaults, then `~/.config/kxm/config.yaml`, then the project's `.kxm/config.yaml`. See the [configuration file reference](../reference/config-reference.md) and [Configuration](../reference/configuration.md).
@@ -130,11 +130,11 @@ just accept /abs/task-dir <commit> /abs/writer-record /abs/arch-review /abs/cli-
130
130
  # optional observed PR/CI (direct script; the five-argument just recipe cannot forward them):
131
131
  # node scripts/assignment-run.mjs accept --task-dir /abs/task --commit <sha> --record-dir /abs/writer --critic /abs/arch --critic /abs/cli [--observed-pr <id>] [--observed-ci <id>]
132
132
 
133
- just plan-current /abs/task-dir /abs/plan.md <sha256> <base-commit> <expected-generation>
133
+ kxm assign plan-current --task-dir /abs/task-dir --plan /abs/plan.md --sha256 <sha256> --base-commit <base-commit> --expected-generation <expected-generation>
134
134
  just change-report /abs/task-dir
135
135
  ```
136
136
 
137
- `just impl|plan|review-arch|review-cli` remain harness transport. They do not
137
+ `kxm lane run` remain harness transport. They do not
138
138
  create assignment identity, witness receipts, or `accepted.json`.
139
139
 
140
140
  Distinctions the report and docs must keep:
@@ -161,7 +161,7 @@ learned policy and not a catalog feed. Phase 9 may use this report to
161
161
  Per-candidate acceptance requires an actual native writer, the fixed witness,
162
162
  and both designated native reviews. PR/CI/merge complete issue 127. This
163
163
  document does not assert those gates have passed. Low-level
164
- `just impl|plan|review-arch|review-cli` recipes remain harness transport.
164
+ `kxm lane run` recipes remain harness transport.
165
165
 
166
166
  ## Implemented: v2 record
167
167
 
@@ -16,24 +16,25 @@ a KXM product feature.
16
16
  ## Before you begin
17
17
 
18
18
  - A clean control checkout of this repository whose `HEAD` is an ancestor of
19
- `origin/main`. The runner loads `.kxm/roster.yaml` only from there.
19
+ `origin/main`. The runner loads `.kxm/roles/*.yaml` and `.kxm/models/*.yaml`
20
+ only from there.
20
21
  - A separate worktree for the writer. `kxm lane create <unit>` creates one from
21
22
  `origin/main`.
22
23
  - The harness CLIs the roster admits, installed and logged in.
23
24
  `node scripts/kxm.mjs harness list` shows which are. The loop below is
24
- `kxm assign`. `just` still runs the transport recipes.
25
+ `kxm assign`. Transport is `kxm lane run <unit> --brief <file> --workflow implement-only`,
26
+ or the same command with `review-arch-only` or `review-cli-only`.
25
27
  - A task directory whose final path segment equals the task ID. Every path you
26
28
  pass to the runner must be absolute.
27
29
 
28
30
  ## Roles and routes
29
31
 
30
- The trusted roster policy in [`.kxm/roster.yaml`](../../.kxm/roster.yaml)
31
- (`kxm.developer-roster.v1`) admits each route for specific roles and
32
- permissions:
32
+ The trusted roster policy in `.kxm/roles/*.yaml` and `.kxm/models/*.yaml`
33
+ admits each route for specific roles and permissions:
33
34
 
34
35
  | Role | Admitted route (harness / model) | Vendor | Permission |
35
36
  |---|---|---|---|
36
- | `writer` | `grok` / `grok-4.7`; relief: `pi` / `openrouter/qwen/qwen3-coder-plus` | `xai`; `alibaba` | `edit` |
37
+ | `writer` | `grok` / `grok-4.7`; relief: `pi` / `openrouter/qwen/qwen3-coder-plus`; `agy` / `gemini-3.8-flash-high` | `xai`; `alibaba`; `google` | `edit` |
37
38
  | `planner` | `claude` / `fable` | `anthropic` | `read-only` |
38
39
  | `reviewer-arch` | `claude` / `fable` | `anthropic` | `read-only` |
39
40
  | `reviewer-cli` | `codex` / `gpt-5.6-sol` | `openai` | `read-only` |
@@ -85,7 +86,7 @@ Use this slim loop for daily work and for docs. The 13-step `fix` workflow in
85
86
  > runner validates anything. The process environment is passed through as it
86
87
  > is. Export any variable you need before the command.
87
88
 
88
- The seven `just` assignment recipes remain available and will be removed after one real unit has been accepted through `kxm assign`; until then both forms are equivalent because both call `scripts/assignment-run.mjs` unchanged.
89
+ Transport is `kxm lane run <unit> --brief <file> --workflow implement-only`, or the same command with `review-arch-only` or `review-cli-only`. The transport recipes are deleted.
89
90
 
90
91
  ### 1. Pin the current plan
91
92
 
@@ -314,17 +315,15 @@ It writes `recording-resolved.json` in the record directory. It never changes
314
315
  ## Transport-only recipes
315
316
 
316
317
  Drive a one-step workflow in a lane. Each command writes a drive receipt and
317
- the checkout fingerprint. `just impl`, `just plan`, `just review-arch`,
318
- `just review-cli`, and `just impl-bg` are retired in favor of these. The
319
- recipes stay in the justfile until one real unit has been driven this way.
318
+ the checkout fingerprint.
320
319
 
321
320
  ```bash
322
- kxm lane run <unit> --workflow implement-only --brief <file>
323
- kxm lane run <unit> --workflow review-arch-only --brief <file>
324
- kxm lane run <unit> --workflow review-cli-only --brief <file>
321
+ kxm lane run <unit> --brief <file> --workflow implement-only
322
+ kxm lane run <unit> --brief <file> --workflow review-arch-only
323
+ kxm lane run <unit> --brief <file> --workflow review-cli-only
325
324
  ```
326
325
 
327
- `just dispatch` still sends one `kxm.harness-request.v1` envelope through
326
+ `scripts/harness-run.mjs` still accepts one `kxm.harness-request.v1` envelope through
328
327
  `scripts/harness-run.mjs` and prints a `kxm.harness-result.v2` envelope. It
329
328
  mints no assignment, witness or acceptance proof, so its output cannot be
330
329
  accepted. The retired recipes did the same.
@@ -430,4 +429,4 @@ gate-only workflows are supported. See the
430
429
  - [Develop KXM](development.md): the commit gate the witness runs
431
430
  - [CI and release](ci-and-release.md): what runs after you push
432
431
  - [Harness routing](../reference/harness-routing.md): harness and model pairing
433
- - [Configuration reference](../reference/config-reference.md#kxmrosteryaml-kxmdeveloper-rosterv1): the roster file
432
+ - [Configuration reference](../reference/config-reference.md#developer-assignment-policy): the developer assignment policy
@@ -13,8 +13,16 @@ extension, the Claude Code plugin, or the bundled skills.
13
13
  - Optional tools, needed only for the matching task:
14
14
  - [Pi](https://pi.dev) to load the extension from source.
15
15
  - The Claude Code CLI to validate the plugin manifests locally.
16
- - [`just`](https://github.com/casey/just) for the
17
- [assignment runner](assignment-runner.md).
16
+ - [`just`](https://github.com/casey/just) for the remaining
17
+ [assignment runner](assignment-runner.md) recipes only:
18
+ `assign`, `witness`, `accept`, `observe-cost`, `attribute`,
19
+ `change-report`, and `plan-current`. Those recipes are harness
20
+ transport for the issue 127 runner. They are not how a unit is
21
+ dispatched. Do not rename or delete them.
22
+ - `kxm lane run` to dispatch a unit. A writer unit uses
23
+ `kxm lane run <unit> --brief <file> --workflow implement-only`.
24
+ The read-only critic workflows on the same command are
25
+ `review-arch-only` and `review-cli-only`.
18
26
  - Docker for the clean-container install smoke.
19
27
 
20
28
  ## Set up a checkout
@@ -116,7 +124,7 @@ excluded from the npm package.
116
124
  ├── .github/ CI, release, issue and PR templates (not shipped)
117
125
  ├── .claude/ Developer harness notes and commands (not shipped)
118
126
  ├── plans/ Internal planning and tracking (not shipped)
119
- ├── justfile Developer recipes for the assignment runner
127
+ ├── justfile Remaining issue 127 recipes (assign, witness, accept, observe-cost, attribute, change-report, plan-current)
120
128
  └── AGENTS.md, CLAUDE.md, GEMINI.md Agent instructions with generated blocks
121
129
  ```
122
130
 
@@ -196,8 +204,14 @@ For what each skill covers, see [Agent skills](../guides/agent-skills.md).
196
204
  8. Push and open a pull request. The template asks for the slice issue and the
197
205
  `npm run verify` result.
198
206
 
199
- Maintainers who delegate work to coding agents use the
200
- [assignment runner](assignment-runner.md) for steps 2 to 7.
207
+ Maintainers who delegate a unit dispatch it with
208
+ `kxm lane run <unit> --brief <file> --workflow implement-only`.
209
+ Read-only critics use the same command with `review-arch-only` or
210
+ `review-cli-only`. The [assignment runner](assignment-runner.md)
211
+ recipes (`assign`, `witness`, `accept`, `observe-cost`, `attribute`,
212
+ `change-report`, `plan-current`) stay on `just`. They are harness
213
+ transport for the issue 127 runner, not the unit transport, and they
214
+ cover steps 2 to 7 after a lane run.
201
215
 
202
216
  ## Generated artifacts
203
217
 
@@ -3,7 +3,7 @@
3
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
4
 
5
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`.
6
+ > The files are the authority, not this page: `.kxm/routes.yaml`, `.kxm/roles/*.yaml`, `.kxm/models/*.yaml`, and `.kxm/prices.yaml`. Product routing decisions are recorded under Tracking → Decided in `plans/implementation-plan.md`.
7
7
 
8
8
  ## This checkout's routes and roster
9
9
 
@@ -59,9 +59,9 @@ On the capture machine, `kxm harness list` showed `claude` detected but logged o
59
59
 
60
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
61
 
62
- ## The developer roster (`.kxm/roster.yaml`)
62
+ ## The developer roster
63
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:
64
+ The issue-127 runner (`kxm assign`, see the [assignment runner](assignment-runner.md)) reads `.kxm/roles/*.yaml` and `.kxm/models/*.yaml` at `refs/remotes/origin/main`. See [Developer assignment policy](../reference/config-reference.md#developer-assignment-policy). Routes there name the harness, the model and the vendor explicitly:
65
65
 
66
66
  ```yaml
67
67
  grok-native:
@@ -100,7 +100,7 @@ The product brake, the dev helper and the roster policy now agree on the vendor
100
100
 
101
101
  ## Worked examples on this checkout
102
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.
103
+ These extend the generic examples on the reference page with this checkout's admissions, developer policy routes, readiness on the capture machine, and inventory prices.
104
104
 
105
105
  ### Grok 4.6
106
106
 
@@ -174,19 +174,19 @@ The developer runner is stricter. Its only Pi writer is `openrouter/qwen/qwen3-c
174
174
 
175
175
  | Symptom | Cause | Fix |
176
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. |
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 through `kxm lane run <unit> --brief <file> --workflow review-arch-only`. |
178
+ | `Roster policy refused: native vendor cannot use Pi` | A Pi route in `.kxm/models/*.yaml` 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
179
  | The dev helper refuses a codex route. | `codex` is logged in with an API key. | Run `codex login` with the ChatGPT flow. |
180
180
 
181
181
  For example, the native writer recipe:
182
182
 
183
183
  ```bash
184
- just impl brief.md
184
+ kxm lane run <unit> --brief <file> --workflow implement-only
185
185
  ```
186
186
 
187
187
  ## Related
188
188
 
189
189
  - [Harness routing](../reference/harness-routing.md): the rules, the decision procedure and the generic examples
190
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
191
+ - [Configuration file reference](../reference/config-reference.md#developer-assignment-policy): the developer assignment policy fields
192
192
  - [Routing and cost telemetry contract](../contracts/routing.md): the routing record, cost basis and dev-helper telemetry
package/docs/glossary.md CHANGED
@@ -423,7 +423,7 @@ A `kxm.role.v2` definition in `.kxm/roles/`, managed with `kxm role`, that descr
423
423
 
424
424
  ### Roster
425
425
 
426
- A list of allowed models. It means either a [role](#role)'s roster, or the developer roster `.kxm/roster.yaml` that the [assignment runner](contributing/assignment-runner.md) trusts to choose writers and critics. Neither one admits a route; see [admission](#admission).
426
+ A list of allowed models. It means either a [role](#role)'s roster, or the developer roster in `.kxm/roles/*.yaml` and `.kxm/models/*.yaml` that the [assignment runner](contributing/assignment-runner.md) trusts to choose writers and critics. Neither one admits a route; see [admission](#admission).
427
427
 
428
428
  ### Route
429
429
 
@@ -1,6 +1,6 @@
1
1
  # Agent skills
2
2
 
3
- KXM ships a suite of Agent Skills that teach a coding agent how to use the `kxm` CLI and the `kxm_*` tools safely: which command owns a task, which verbs exist, and which steps belong to a person. This page is for anyone running KXM from Claude Code, Pi or Codex, and for contributors who edit the skills. Skills document the CLI; they grant no permission, admit no writer and replace no trusted `.kxm/roster.yaml` policy.
3
+ KXM ships a suite of Agent Skills that teach a coding agent how to use the `kxm` CLI and the `kxm_*` tools safely: which command owns a task, which verbs exist, and which steps belong to a person. This page is for anyone running KXM from Claude Code, Pi or Codex, and for contributors who edit the skills. Skills document the CLI; they grant no permission, admit no writer and replace no trusted policy in `.kxm/roles/*.yaml` and `.kxm/models/*.yaml`.
4
4
 
5
5
  Governed skills that your own runs produce are a separate lifecycle; see [Governed skills](governed-skills.md).
6
6
 
@@ -15,7 +15,7 @@ KXM spreads state over six roots. Some of them move with environment variables,
15
15
  ```mermaid
16
16
  flowchart TB
17
17
  subgraph R["$R checkout root: the Git checkout, never moves"]
18
- R1["Project definition: .kxm/project.yaml, config.yaml, agents/, models/, workflows/, gates.yaml, roles/, roles, routes.yaml, roster.yaml, prices.yaml, repo/, project/env.yaml"]
18
+ R1["Project definition: .kxm/project.yaml, config.yaml, agents/, workflows/, gates.yaml, .kxm/roles/, .kxm/models/, routes.yaml, prices.yaml, repo/, project/env.yaml"]
19
19
  R2["Durable records: .kxm/memory/, skills/, goals/, tasks/, candidates/"]
20
20
  end
21
21
  subgraph D["$D workspace: KXM_WORKSPACE_DIR or --workspace, default $R/.kxm"]
@@ -31,7 +31,7 @@ flowchart TB
31
31
  S2["hub-env.json, hub-binding.json, update.yaml, projects/HASH/repository-bindings.json"]
32
32
  end
33
33
  subgraph C["$C user config: KXM_USER_CONFIG_DIR, default ~/.config/kxm"]
34
- C1["config.yaml, roles/, workflows/, roles, session.token"]
34
+ C1["config.yaml, workflows/, session.token. Checkout routing lives in .kxm/roles/ and .kxm/models/"]
35
35
  end
36
36
  subgraph T["$T federated telemetry: XDG_CONFIG_HOME/kxm/telemetry"]
37
37
  T1["model-metrics.jsonl, not written by any command today"]
@@ -71,13 +71,13 @@ The Runtime registry and the other projects' event stores are shared by every pr
71
71
  | `$S/runtime/registry.db` | Runtime registry: projects, their roots and home Runtime, the supervisor identity and claim | Only with `--all-projects` (`registry`) |
72
72
  | `$S/projects/<hash>/repository-bindings.json`, `$S/update.yaml` | Member repository paths; updater settings | No |
73
73
  | `$S/hub-env.json`, `$S/hub-binding.json`, `$C/session.token` | Credentials and the machine's hub binding | No; prefer regenerating secrets to copying them |
74
- | `$R/.kxm/` definition files and durable records | Project, roles, routes, prices, roster, memory, skills, goals, tasks, candidates | No; commit them to Git or copy the checkout |
74
+ | `$R/.kxm/` definition files and durable records | Project, `.kxm/roles/`, `.kxm/models/`, routes, prices, memory, skills, goals, tasks, candidates | No; commit them to Git or copy the checkout |
75
75
  | Each member repository's `.kxm/repo/*.yaml` | Member definition and environment | No; they live in the member's own checkout |
76
76
  | `$W/worker-*.json`, `$W/pi-sessions/` | Worker routing and recovery manifests; Pi model history | No; manifests are required for resumable workers, Pi history is optional |
77
77
  | `$D/assets/`, `$D/logs/` | Retrospectives and evidence; logs and local usage accounting (`telemetry.jsonl`) | No |
78
78
  | `$C` | User-level roles, workflows and settings | No |
79
79
 
80
- A restore without `roster.yaml`, `routes.yaml` or `prices.yaml` comes back healthy but with different admission and cost behavior, so treat them as part of the backup even though they are plain files. `kxm improve report --out-dir` can write candidates outside `$R/.kxm/candidates/`; include that directory if you use it.
80
+ A restore without `.kxm/roles/`, `.kxm/models/`, `routes.yaml`, or `prices.yaml` comes back healthy but with different admission and cost behavior, so treat them as part of the backup even though they are plain files. `kxm improve report --out-dir` can write candidates outside `$R/.kxm/candidates/`; include that directory if you use it.
81
81
 
82
82
  These files are disposable and need no backup: `hub.pid`, `hub.stop`, `worker-*.pid`, `session-brief.json`, `update-check.json`, `runtime/supervisor.token`, `runtime/supervisor.error`.
83
83
 
@@ -177,7 +177,7 @@ kxm init [--name <name>] [--project-id <id>] [--repository <id=absolute-path>]..
177
177
 
178
178
  Creates, validates, repairs, resumes, or joins a KXM project at the Git root that contains the current directory. A new project gets a minimal configuration: one coordinator agent, one implementer agent, a `test` command gate, and a `default` plan-implement-verify workflow. An existing project is validated without rewriting. Conflict-free template updates to non-authority fields are applied; authority changes, overlapping edits, and provenance-free or legacy state stay planning-only. `init` does not start a hub or the Runtime.
179
179
 
180
- The starter `defaultHarness: pi` and `npm test` gate are generic settings, not repository detection. Creation and create-planning output include `guidance`: for Claude, set `defaultHarness: claude` in `.kxm/project.yaml`, update any explicit `harness` overrides in `.kxm/agents/*.yaml`, and configure compatible agent models; for .NET or other non-npm repositories, set `.kxm/gates.yaml` → `gates.test.argv` to the repository's actual test command. Preflight reports an actionable prerequisite for `npm test` without a readable `package.json` test script; `task run` refuses it before creating a run.
180
+ The starter `defaultHarness: pi` and `npm test` gate are generic settings, not repository detection. Initialized agents bind roles. Harness, model, and effort are set in `.kxm/roles/*.yaml` and `.kxm/models/*.yaml`. Creation and create-planning output include `guidance`: for Claude, set `defaultHarness: claude` in `.kxm/project.yaml`; for .NET or other non-npm repositories, set `.kxm/gates.yaml` → `gates.test.argv` to the repository's actual test command. Preflight reports an actionable prerequisite for `npm test` without a readable `package.json` test script; `task run` refuses it before creating a run.
181
181
 
182
182
  | Option | Argument | Default | Description |
183
183
  |---|---|---|---|
@@ -393,7 +393,7 @@ kxm completion install --shell zsh --dry-run
393
393
 
394
394
  Compares the authority-bearing fields of the project configuration against a base Git revision. The base is materialized into a temporary shadow with a sanitized environment; nothing in the project is written. Both subcommands refuse `--workspace` (exit 2) and need no hub.
395
395
 
396
- The comparison covers the loaded bundle only: `project.yaml`, `agents/`, `models/`, `workflows/`, `gates.yaml`, `project/env.yaml`, and each member repository's `repo.yaml` and `env.yaml`. It does not read `routes.yaml`, `roles/`, `roster.yaml`, or `prices.yaml`, so a new route admission, roster entry, developer-roster route, or price change never counts as an expansion. Review those files by hand.
396
+ The comparison covers the loaded bundle only: `project.yaml`, `agents/`, `models/`, `workflows/`, `gates.yaml`, `project/env.yaml`, and each member repository's `repo.yaml` and `env.yaml`. It does not read `routes.yaml`, `roles/`, `the role files`, or `prices.yaml`, so a new route admission, roster entry, developer policy route, or price change never counts as an expansion. Review those files by hand.
397
397
 
398
398
  ### `kxm trust diff`
399
399
 
@@ -1069,14 +1069,32 @@ Lists admitted and disabled routes.
1069
1069
 
1070
1070
  No command-specific options.
1071
1071
 
1072
- - Reads only. JSON keys: `policy` (`schema`, `updatedAt`, `admitted`, `disabled`, `roles`).
1072
+ - Reads only. JSON keys: `policy` (`schema`, `updatedAt`, `admitted`, `disabled`) and `membership` (strings `<role> <route-id>` from `.kxm/roles/*.yaml`). `policy` has no `roles` field. A model file named by no roster, such as `opus-claude`, is absent from `membership`.
1073
1073
 
1074
1074
  ```bash
1075
1075
  kxm routes list
1076
1076
  ```
1077
1077
 
1078
1078
  ```text
1079
- no route decisions
1079
+ admitted anthropic/fable
1080
+ admitted google/gemini-3.8-flash-high
1081
+ admitted google/gemini-3.8-flash-medium
1082
+ admitted openai/gpt-5.6-sol
1083
+ admitted openrouter/qwen/qwen3-coder-plus
1084
+ admitted openrouter/qwen/qwen3.8-flash
1085
+ admitted openrouter/z-ai/glm-5.3-flash
1086
+ admitted qwen-token-plan/deepseek-v4.1-flash
1087
+ admitted qwen-token-plan/qwen3.8-flash
1088
+ admitted qwen-token-plan/qwen3.8-max
1089
+ admitted xai/grok-4.7
1090
+ admitted zai-coding-cn/glm-5.3
1091
+ admitted zai-coding-cn/glm-5.3-flash
1092
+ planner fable-claude
1093
+ reviewer-arch fable-claude
1094
+ reviewer-cli sol-codex
1095
+ writer grok-native
1096
+ writer qwen-openrouter-pi
1097
+ writer gemini-agy
1080
1098
  ```
1081
1099
 
1082
1100
  ```bash
@@ -1084,7 +1102,7 @@ kxm routes list --json
1084
1102
  ```
1085
1103
 
1086
1104
  ```text
1087
- {"schema":"kxm.cli-result.v1","ok":true,"command":"routes list","policy":{"schema":"kxm.routes.v2","updatedAt":"2026-09-23T13:50:08.663Z","admitted":[],"disabled":[],"roles":{}}}
1105
+ {"schema":"kxm.cli-result.v1","ok":true,"command":"routes list","policy":{"schema":"kxm.routes.v2","updatedAt":"2026-09-24T00:00:00.000Z","admitted":["anthropic/fable","google/gemini-3.8-flash-high","google/gemini-3.8-flash-medium","openai/gpt-5.6-sol","openrouter/qwen/qwen3-coder-plus","openrouter/qwen/qwen3.8-flash","openrouter/z-ai/glm-5.3-flash","qwen-token-plan/deepseek-v4.1-flash","qwen-token-plan/qwen3.8-flash","qwen-token-plan/qwen3.8-max","xai/grok-4.7","zai-coding-cn/glm-5.3","zai-coding-cn/glm-5.3-flash"],"disabled":[]},"membership":["planner fable-claude","reviewer-arch fable-claude","reviewer-cli sol-codex","writer grok-native","writer qwen-openrouter-pi","writer gemini-agy"]}
1088
1106
  ```
1089
1107
 
1090
1108
  ### `kxm routes count`
@@ -1217,7 +1235,7 @@ Adds a role definition. Without a role ID, or with `--pick`, local scope offers
1217
1235
 
1218
1236
  - Writes `.kxm/roles/<id>.yaml` in local scope, or `<KXM_USER_CONFIG_DIR>/roles/<id>.yaml` in global scope. `--dry-run` plans the write and writes nothing.
1219
1237
  - Each `--route` is checked the same way as `kxm role modify --add-route`. If `.kxm/models/<route-id>.yaml` is missing, the command exits 1 and writes `kxm: route '<route-id>' is not a file under .kxm/models/` to stderr. It does not write the role file, including under `--dry-run`. `--file` checks every `roster[].route` the same way before writing, in local scope and in global scope.
1220
- - Local scope belongs to a KXM project: the file lands in the project root's `.kxm/roles/` from any subdirectory, and outside a project the command refuses with `project_not_found` and creates nothing. Before writing, the project loader checks the project with the new role in place of any file of that ID. The loader reads only `writer.yaml`, whose roster must name a route whose model is the `implementer` agent's model (see [Roles](config-reference.md#kxmrolesroleyaml-kxmrolev2)). If the project would not load, the command refuses with `role_invalid`, lists each issue and writes nothing, also under `--dry-run`, and `--overwrite` replaces a `writer.yaml` the loader refuses. Global scope is not checked, because no loader reads it.
1238
+ - Local scope belongs to a KXM project: the file lands in the project root's `.kxm/roles/` from any subdirectory, and outside a project the command refuses with `project_not_found` and creates nothing. Before writing, the project loader checks the project with the new role in place of any file of that ID. Validation is the role file schema, and every roster route must exist under `.kxm/models/`. If the project would not load, the command refuses with `role_invalid`, lists each issue and writes nothing, also under `--dry-run`, and `--overwrite` replaces a role file the loader refuses. Global scope is not checked, because no loader reads it.
1221
1239
  - Refusals exit 2 and honor `--json`: `project_not_found` and `role_invalid` (with `issues`, each `{phase, code, file, message}`). A missing `--route` file, and an existing role without `--overwrite`, exit 1 with a plain stderr line, also under `--dry-run` (`kxm: route '<route-id>' is not a file under .kxm/models/`, or `role add failed: role_already_exists: ...`).
1222
1240
  - JSON keys: `roleId`, `id`, `filePath`, `scope`.
1223
1241
 
@@ -1671,7 +1689,7 @@ kxm runs status --dry-run refused: the Runtime supervisor is not running and --d
1671
1689
  kxm runs drive <runId> [--simulated] [--wait] [--timeout-ms <n>] [--lane <unit>]
1672
1690
  ```
1673
1691
 
1674
- Opens a drive of the run. With `--simulated`, a model-free producer reports every agent step as passed. Without `--simulated` the drive runs in live mode: each agent step invokes its harness through a one-shot producer, and the agent's model must be an admitted route (otherwise `producer_route_not_admitted`; there is no fallback model). A read-only step runs with the harness's read-only flags. A step with `write` access runs with an audited writer profile, which only `pi` and `grok` have; it must be a single assignment in a project whose `limits.maxConcurrentRuns` is 1, and, when `.kxm/roster.yaml` exists, its route must be on the roster's writer lineup. Otherwise the drive hands the run off with `step_unsupported`. Around each live attempt the Runtime fingerprints the checkout with `git status` and `git diff`: a write step settles `passed` only when the checkout changed (routing metadata `authored: true`), and a read-only step that changed it settles `failed` (`authoringWitness: readonly_mutated`).
1692
+ Opens a drive of the run. With `--simulated`, a model-free producer reports every agent step as passed. Without `--simulated` the drive runs in live mode: each agent step invokes its harness through a one-shot producer, and the agent's model must be an admitted route (otherwise `producer_route_not_admitted`; there is no fallback model). A read-only step runs with the harness's read-only flags. A step with `write` access runs with an audited writer profile, which only `pi` and `grok` have; it must be a single assignment in a project whose `limits.maxConcurrentRuns` is 1, and its route must be on the writer roster in `.kxm/roles/writer.yaml`. Otherwise the drive hands the run off with `step_unsupported`. Around each live attempt the Runtime fingerprints the checkout with `git status` and `git diff`: a write step settles `passed` only when the checkout changed (routing metadata `authored: true`), and a read-only step that changed it settles `failed` (`authoringWitness: readonly_mutated`).
1675
1693
 
1676
1694
  | Option | Argument | Default | Description |
1677
1695
  |---|---|---|---|
@@ -2843,7 +2861,7 @@ Recommends a flat workflow ID backed by a shipped template, with category metada
2843
2861
 
2844
2862
  - Explicit `Claude only`, `Claude-only`, or `only Claude Code` constraints exclude other harnesses. A missing, unauthenticated, or unsupported required harness produces `harness_unavailable`; KXM never silently substitutes Grok or Codex.
2845
2863
  - A write workflow requires an audited writer profile for the selected harness. Only Pi and Grok currently have one; Claude-only bug fixes produce `live_write_unsupported` with direct-Claude implementation guidance, never a Grok substitution. No misleading create/drive command is emitted for an unsupported profile.
2846
- - For supported work, every suggested agent binding uses the selected detected, authenticated, dispatch-ready harness. Configure its compatible admitted model, install the exact template, validate project configuration, then use the separate create/live-drive/status/receipt commands. Writers also require single-assignment/single-run admission, any configured developer-roster writer approval, and the repository's actual verification gate. An already-present recommended workflow ID produces `workflow_already_exists`; KXM will not assume its agents or permissions match the template.
2864
+ - For supported work, every suggested agent binding uses the selected detected, authenticated, dispatch-ready harness. Configure its compatible admitted model, install the exact template, validate project configuration, then use the separate create/live-drive/status/receipt commands. Writers also require single-assignment/single-run admission, any configured developer policy writer approval, and the repository's actual verification gate. An already-present recommended workflow ID produces `workflow_already_exists`; KXM will not assume its agents or permissions match the template.
2847
2865
  - Arguments: `<prompt...>`; no command-specific options. No hub needed. `--dry-run` skips native authentication probes to avoid their side effects and does not claim verified availability.
2848
2866
  - JSON keys: `prompt`, `workflowId`, `template`, `area`, `confidence`, `reasons`, `suggestedSkills`, `roles` (an array of `{agent, harness, role}`), `suggestedCommand` (installation only), and `execution`. Supported execution includes `prerequisites`, `shell`, `createCommand`, `driveCommand`, `statusCommand`, and `receiptCommand`; refusal includes `error`, `reason`, and `nextSteps`, sets `ok: false`, and exits 1.
2849
2867