@kontextmind/kxm 0.7.121 → 0.7.122

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.
@@ -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.121",
14
+ "version": "0.7.122",
15
15
  "category": "development",
16
16
  "tags": ["kxm", "multi-agent", "workflows", "mcp"]
17
17
  }
package/CHANGELOG.md CHANGED
@@ -14,6 +14,13 @@ All notable user-facing changes are documented here. The project follows [Semant
14
14
  A required review is reported. The `land` workflow in `.kxm/workflows/land.yaml`
15
15
  runs the same gates and may be refused until gate-only workflows are supported.
16
16
  See the [CLI reference](docs/reference/cli-reference.md#kxm-land).
17
+ - **`kxm assign` is the entry to the developer assignment runner.**
18
+ `run`, `witness`, `plan-current`, `attribute`, `observe-cost`, `accept` and
19
+ `change-report` spawn `scripts/assignment-run.mjs` with the same flags as the
20
+ just recipes. The runner still performs every check and writes every file.
21
+ The just recipes stay until one real unit has been accepted through
22
+ `kxm assign`. See the
23
+ [CLI reference](docs/reference/cli-reference.md#kxm-assign).
17
24
 
18
25
  - **`kxm lane` keeps one git worktree per unit beside the control checkout.**
19
26
  `create`, `list`, `status`, `drop` and `run` store a 0600 record in
@@ -19,9 +19,9 @@ a KXM product feature.
19
19
  `origin/main`. The runner loads `.kxm/roster.yaml` only from there.
20
20
  - A separate worktree for the writer. `kxm lane create <unit>` creates one from
21
21
  `origin/main`.
22
- - [`just`](https://github.com/casey/just), plus the harness CLIs the roster
23
- admits, installed and logged in. `node scripts/kxm.mjs harness list` shows
24
- which are.
22
+ - The harness CLIs the roster admits, installed and logged in.
23
+ `node scripts/kxm.mjs harness list` shows which are. The loop below is
24
+ `kxm assign`. `just` still runs the transport recipes.
25
25
  - A task directory whose final path segment equals the task ID. Every path you
26
26
  pass to the runner must be absolute.
27
27
 
@@ -80,10 +80,12 @@ Use this slim loop for daily work and for docs. The 13-step `fix` workflow in
80
80
  `examples/project/` is a product fixture, not the developer loop.
81
81
 
82
82
  > [!NOTE]
83
- > These recipes never load a `.env` file from the working directory. An
83
+ > `kxm assign` never loads a `.env` file from the working directory. An
84
84
  > unreviewed file could otherwise set `NODE_OPTIONS` and run code before the
85
- > runner validates anything. To use one, pass it explicitly:
86
- > `just --dotenv-path /abs/.env assign /abs/manifest.json`.
85
+ > runner validates anything. The process environment is passed through as it
86
+ > is. Export any variable you need before the command.
87
+
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.
87
89
 
88
90
  ### 1. Pin the current plan
89
91
 
@@ -91,7 +93,7 @@ Every writer assignment binds to the current plan. Stamp the pointer, or advance
91
93
  it with a generation check:
92
94
 
93
95
  ```bash
94
- just plan-current /abs/task-dir /abs/plan.md <sha256> <base-commit> <expected-generation>
96
+ kxm assign plan-current --task-dir /abs/task-dir --plan /abs/plan.md --sha256 <sha256> --base-commit <base-commit> --expected-generation <expected-generation>
95
97
  ```
96
98
 
97
99
  The runner writes `plan-current.json` (`kxm.plan-pointer.v1`) in the task
@@ -137,7 +139,7 @@ Optional keys are `rework_of`, `timeout_ms` and `max_turns`. Each `inputs`
137
139
  entry is `{ "path", "sha256" }`, and the runner checks the hash. Dispatch it:
138
140
 
139
141
  ```bash
140
- just assign /abs/tasks/fix-improve-sources/asg-writer-1.json
142
+ kxm assign run --manifest /abs/tasks/fix-improve-sources/asg-writer-1.json
141
143
  ```
142
144
 
143
145
  The runner validates the manifest, the route and the base, writes
@@ -151,7 +153,7 @@ generated files, then run the witness:
151
153
 
152
154
  ```bash
153
155
  git -C /abs/kxm-fix-improve-sources add -A
154
- just witness /abs/tasks/fix-improve-sources/asg-writer-1
156
+ kxm assign witness --record-dir /abs/tasks/fix-improve-sources/asg-writer-1
155
157
  ```
156
158
 
157
159
  The witness refuses with `dirty_baseline` while anything is unstaged or
@@ -185,17 +187,18 @@ witnessed tree: either the staged index (`base.kind: "staged"` with its
185
187
  Commit the exact witnessed tree, then bind the commit and both `PASS` records:
186
188
 
187
189
  ```bash
188
- just accept /abs/tasks/fix-improve-sources <commit-sha> \
189
- /abs/tasks/fix-improve-sources/asg-writer-1 \
190
- /abs/tasks/fix-improve-sources/asg-review-arch-1 \
191
- /abs/tasks/fix-improve-sources/asg-review-cli-1
190
+ kxm assign accept \
191
+ --task-dir /abs/tasks/fix-improve-sources \
192
+ --commit <commit-sha> \
193
+ --record-dir /abs/tasks/fix-improve-sources/asg-writer-1 \
194
+ --critic /abs/tasks/fix-improve-sources/asg-review-arch-1 \
195
+ --critic /abs/tasks/fix-improve-sources/asg-review-cli-1
192
196
  ```
193
197
 
194
- To record an observed pull request or CI run, call the script directly, since
195
- the recipe does not pass those flags:
198
+ To record an observed pull request or CI run, pass the same flags:
196
199
 
197
200
  ```bash
198
- node scripts/assignment-run.mjs accept \
201
+ kxm assign accept \
199
202
  --task-dir /abs/tasks/fix-improve-sources \
200
203
  --commit <commit-sha> \
201
204
  --record-dir /abs/tasks/fix-improve-sources/asg-writer-1 \
@@ -205,7 +208,7 @@ node scripts/assignment-run.mjs accept \
205
208
  --observed-ci <ci-id>
206
209
  ```
207
210
 
208
- `accept` prints JSON and takes no `--json` flag. It checks, in order, that:
211
+ `accept` prints JSON and takes no `--json` flag, and `kxm assign --json` is not passed through. The runner checks, in order, that:
209
212
 
210
213
  1. the trusted roster policy loads and validates, before anything is written;
211
214
  2. the commit exists and its tree equals the witnessed tree;
@@ -226,7 +229,7 @@ You decide, then dispatch:
226
229
  1. Write a new manifest with `"kind": "repair"` and `"rework_of"` set to the
227
230
  assignment ID it reworks. The runner checks that the earlier assignment has a
228
231
  `completion.json` in the same task directory, with the same task ID.
229
- 2. Dispatch it with `just assign`, then run `just witness` on the new record.
232
+ 2. Dispatch it with `kxm assign run`, then run `kxm assign witness` on the new record.
230
233
  3. Dispatch fresh critics against the new tree, and accept.
231
234
 
232
235
  A `BLOCK` stops acceptance only for the tree it judged. A repair that changes
@@ -266,7 +269,7 @@ Record friction or a model regression as a private note, without touching any
266
269
  completion:
267
270
 
268
271
  ```bash
269
- just attribute /abs/task-dir /abs/record-dir <class> /abs/note.txt
272
+ kxm assign attribute --task-dir /abs/task-dir --record-dir /abs/record-dir --class <class> --explanation-file /abs/note.txt
270
273
  ```
271
274
 
272
275
  The class is `orchestration`, `model`, `environment` or `unclassified`. Each
@@ -277,7 +280,7 @@ Import a cost observation for a run whose native telemetry was not captured,
277
280
  such as a subscription session:
278
281
 
279
282
  ```bash
280
- just observe-cost /abs/task-dir /abs/observation.json
283
+ kxm assign observe-cost --task-dir /abs/task-dir --input /abs/observation.json
281
284
  ```
282
285
 
283
286
  The record (`kxm.cost-observation.v1`) is cost-only. It cannot mint witness
@@ -286,7 +289,7 @@ proof or authorize acceptance.
286
289
  Summarize a task's attempts, rework and spend:
287
290
 
288
291
  ```bash
289
- just change-report /abs/task-dir
292
+ kxm assign change-report --task-dir /abs/task-dir
290
293
  ```
291
294
 
292
295
  The report (`kxm.change-report.v1`) keeps provider-reported spend, list-price
@@ -356,7 +359,7 @@ ones:
356
359
  |---|---|---|
357
360
  | `route_invalid` | Route not in the role's lineup, permission above its ceiling, or the roster policy cannot load | Run from a clean control checkout on `origin/main`; check the lineup |
358
361
  | `base_invalid` | `base.commit` is not `HEAD`, the tree is dirty, or a writer targets a staged index | Commit or stash elsewhere; writers need a clean base |
359
- | `plan_ref_invalid` | The plan hash or path does not match `plan-current.json` | Advance the pointer with `just plan-current` |
362
+ | `plan_ref_invalid` | The plan hash or path does not match `plan-current.json` | Advance the pointer with `kxm assign plan-current` |
360
363
  | `rework_invalid` | `rework_of` names no completed assignment in this task | Point it at an existing record directory's assignment ID |
361
364
  | `witness_failed` | The fixed gate exited non-zero | Fix the failures and run a repair |
362
365
  | `dirty_baseline` | Unstaged or untracked changes when the witness starts | Stage the candidate with `git add -A`, then re-witness |
@@ -58,7 +58,7 @@ Every top-level `kxm` command is owned by exactly one skill. A skill can own sev
58
58
  | `kxm-peer` | `peer` | Delegate to, fan out to, await and answer other agents |
59
59
  | `kxm-workflow` | `workflow`, `gate` | Record journal entries, pass checkpoints and wait on signed callbacks |
60
60
  | `kxm-definitions` | `role` | Inspect or edit roles, role hosts and model rosters without granting writer admission |
61
- | `kxm-runs` | `run`, `runs`, `lane` | Create, drive, inspect and cancel runs, manage worktree lanes, or smoke-test a workflow model-free |
61
+ | `kxm-runs` | `run`, `runs`, `lane`, `assign` | Create, drive, inspect and cancel runs, manage worktree lanes, smoke-test a workflow, or call the assignment runner |
62
62
  | `kxm-context-memory` | `context`, `memory`, `explain` | Recall what the project knows, explain a context footprint, record memory candidates |
63
63
  | `kxm-skill-lifecycle` | `skills` | Turn a repeated practice into a governed skill candidate |
64
64
  | `kxm-routing-improve` | `routing`, `improve` | Find what KXM learned and what repeats, and read recorded route spend |
@@ -14,7 +14,7 @@ Output shown under examples was captured from a source checkout, inside a throwa
14
14
  - Setup: [`init`](#kxm-init), [`config`](#kxm-config), [`completion`](#kxm-completion), [`trust`](#kxm-trust)
15
15
  - Hub and sessions: [`hub`](#kxm-hub-view), [`session`](#kxm-session), [`dash`](#kxm-dash), [`studio`](#kxm-studio)
16
16
  - Harnesses, models, and roles: [`harness`](#kxm-harness), [`auth`](#kxm-auth), [`update`](#kxm-update), [`models`](#kxm-models), [`routes`](#kxm-routes), [`role`](#kxm-role)
17
- - Running work: [`lane`](#kxm-lane), [`run`](#kxm-run), [`runs`](#kxm-runs), [`runtime`](#kxm-runtime), [`agent`](#kxm-agent), [`workflow`](#kxm-workflow), [`gate`](#kxm-gate), [`peer`](#kxm-peer), [`task`](#kxm-task), [`goal`](#kxm-goal), [`suggest`](#kxm-suggest), [`explain`](#kxm-explain)
17
+ - Running work: [`lane`](#kxm-lane), [`assign`](#kxm-assign), [`run`](#kxm-run), [`runs`](#kxm-runs), [`runtime`](#kxm-runtime), [`agent`](#kxm-agent), [`workflow`](#kxm-workflow), [`gate`](#kxm-gate), [`peer`](#kxm-peer), [`task`](#kxm-task), [`goal`](#kxm-goal), [`suggest`](#kxm-suggest), [`explain`](#kxm-explain)
18
18
  - Context and learning: [`context`](#kxm-context), [`memory`](#kxm-memory), [`skills`](#kxm-skills), [`improve`](#kxm-improve), [`routing`](#kxm-routing), [`prices`](#kxm-prices)
19
19
  - Operations: [`backup`](#kxm-backup), [`restore`](#kxm-restore), [`tenant`](#kxm-tenant), [`ssh`](#kxm-ssh), [`help`](#kxm-help)
20
20
  - [Known behavior gaps](#known-behavior-gaps)
@@ -159,6 +159,7 @@ Exit 2 covers an unknown command or option, a missing argument or required optio
159
159
  | Create and drive a run | [`kxm run`](#kxm-run), [`kxm runs drive`](#kxm-runs-drive), [`kxm runtime status`](#kxm-runtime-status) |
160
160
  | Work in an isolated checkout | [`kxm lane`](#kxm-lane), [`kxm run --lane`](#kxm-run) |
161
161
  | Land the current branch | [`kxm land`](#kxm-land) |
162
+ | Delegate and accept a developer assignment | [`kxm assign`](#kxm-assign) |
162
163
  | Inspect runs | [`kxm runs list`](#kxm-runs-list), [`kxm runs status`](#kxm-runs-status), [`kxm runs receipt`](#kxm-runs-receipt), [`kxm tenant status`](#kxm-tenant-status), [`kxm workflow list`](#kxm-workflow-list) |
163
164
  | Message peers | [`kxm peer list`](#kxm-peer-list), [`kxm peer send`](#kxm-peer-send), [`kxm peer await`](#kxm-peer-await), [`kxm peer fanout`](#kxm-peer-fanout) |
164
165
  | Operate gates and evidence | [`kxm gate validate`](#kxm-gate-validate), [`kxm gate artifacts-exist`](#kxm-gate-artifacts-exist), [`kxm gate signal`](#kxm-gate-signal), [`kxm workflow checkpoint`](#kxm-workflow-checkpoint) |
@@ -1470,6 +1471,97 @@ Outside a KXM project the command refuses `project_required` (exit 1). Unknown a
1470
1471
 
1471
1472
  Refusals (exit 1): `project_required`, `land_dirty_tree`, `land_verify_failed`, `land_docs_failed`, `land_push_rejected`, `land_pr_body_missing`, `land_conflict_manual`, `land_blocked`, `land_merge_failed`, `land_release_failed`, `land_publish_timeout`, `land_milestone_failed`.
1472
1473
 
1474
+ ## `kxm assign`
1475
+
1476
+ `kxm assign` is the entry to this repository's developer assignment runner. Each verb spawns `node scripts/assignment-run.mjs <verb> ...` from the project root with that argument list, `stdio: "inherit"`, and the process environment unchanged. The command returns the child's exit code. It does not load a `.env` file, resolve paths, or repeat any runner check. Every validation rule, refusal code, and file the runner writes stays in [`scripts/assignment-run.mjs`](../../scripts/assignment-run.mjs). The loop, the records, and those codes are documented in [Assignment runner](../contributing/assignment-runner.md).
1477
+
1478
+ The command does not start the hub or the Runtime supervisor. It writes nothing itself. `--dry-run` prints the argv that would run and exits 0 without spawning. `--json` formats this command's own refusals and that dry-run plan. The runner's usage text documents no `--json` flag, and `accept` already prints JSON, so `--json` is not forwarded.
1479
+
1480
+ Outside a KXM project the command exits 1 with `project_required`. A project that has no `scripts/assignment-run.mjs` exits 1 with `assign_runner_missing`. A missing required flag is a usage error and exits 2. If `node` cannot be started, the command exits 1 with `assign_spawn_failed`.
1481
+
1482
+ ```text
1483
+ kxm assign run --manifest <path>
1484
+ kxm assign witness --record-dir <path>
1485
+ kxm assign plan-current --task-dir <path> --plan <path> --sha256 <hex> --base-commit <sha> --expected-generation <n>
1486
+ kxm assign attribute --task-dir <path> --record-dir <path> --class <class> --explanation-file <path>
1487
+ kxm assign observe-cost --task-dir <path> --input <path>
1488
+ kxm assign accept --task-dir <path> --commit <sha> --record-dir <path> --critic <path> --critic <path> [--observed-pr <id>] [--observed-ci <id>]
1489
+ kxm assign change-report --task-dir <path>
1490
+ ```
1491
+
1492
+ ```bash
1493
+ kxm assign run --manifest /abs/tasks/fix-improve-sources/asg-writer-1.json
1494
+ ```
1495
+
1496
+ ### `kxm assign run`
1497
+
1498
+ Dispatches one closed manifest. The runner validates the route, the base, and the plan pointer, then writes the assignment record.
1499
+
1500
+ | Option | Argument | Description |
1501
+ |---|---|---|
1502
+ | `--manifest` | `<path>` | Absolute path to the `kxm.assignment.v1` manifest. Passed through as given |
1503
+
1504
+ ### `kxm assign witness`
1505
+
1506
+ Runs the fixed witness named in the manifest against the staged tree.
1507
+
1508
+ | Option | Argument | Description |
1509
+ |---|---|---|
1510
+ | `--record-dir` | `<path>` | Absolute path to the assignment record directory |
1511
+
1512
+ ### `kxm assign plan-current`
1513
+
1514
+ Stamps or advances `plan-current.json` in the task directory.
1515
+
1516
+ | Option | Argument | Description |
1517
+ |---|---|---|
1518
+ | `--task-dir` | `<path>` | Absolute path to the task directory |
1519
+ | `--plan` | `<path>` | Absolute path to the plan file |
1520
+ | `--sha256` | `<hex>` | SHA-256 the runner expects for that file |
1521
+ | `--base-commit` | `<sha>` | Commit the pointer records |
1522
+ | `--expected-generation` | `<n>` | Generation the pointer must currently have |
1523
+
1524
+ ### `kxm assign attribute`
1525
+
1526
+ Attaches one private note under the record's `attribution/` directory. The note is not proof.
1527
+
1528
+ | Option | Argument | Description |
1529
+ |---|---|---|
1530
+ | `--task-dir` | `<path>` | Absolute path to the task directory |
1531
+ | `--record-dir` | `<path>` | Absolute path to the assignment record directory |
1532
+ | `--class` | `<class>` | `orchestration`, `model`, `environment`, or `unclassified` |
1533
+ | `--explanation-file` | `<path>` | Absolute path to the note file |
1534
+
1535
+ ### `kxm assign observe-cost`
1536
+
1537
+ Imports one cost observation. The record is cost-only and cannot authorize acceptance.
1538
+
1539
+ | Option | Argument | Description |
1540
+ |---|---|---|
1541
+ | `--task-dir` | `<path>` | Absolute path to the task directory |
1542
+ | `--input` | `<path>` | Absolute path to the observation file |
1543
+
1544
+ ### `kxm assign accept`
1545
+
1546
+ Binds the witnessed commit and two critic records. Optional observation ids are forwarded when present. `accept` prints JSON and takes no `--json` flag.
1547
+
1548
+ | Option | Argument | Description |
1549
+ |---|---|---|
1550
+ | `--task-dir` | `<path>` | Absolute path to the task directory |
1551
+ | `--commit` | `<sha>` | Commit whose tree must equal the witnessed tree |
1552
+ | `--record-dir` | `<path>` | Absolute path to the writer record directory |
1553
+ | `--critic` | `<path>` | Absolute path to a critic record directory. Pass it twice |
1554
+ | `--observed-pr` | `<id>` | Observed pull request id. Omitted unless set |
1555
+ | `--observed-ci` | `<id>` | Observed CI run id. Omitted unless set |
1556
+
1557
+ ### `kxm assign change-report`
1558
+
1559
+ Prints the task's attempts, rework, and spend. The runner keeps provider-reported, list, unmetered, and unknown cost apart.
1560
+
1561
+ | Option | Argument | Description |
1562
+ |---|---|---|
1563
+ | `--task-dir` | `<path>` | Absolute path to the task directory |
1564
+
1473
1565
  ## `kxm run`
1474
1566
 
1475
1567
  ```text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextmind/kxm",
3
- "version": "0.7.121",
3
+ "version": "0.7.122",
4
4
  "description": "KXM local-first multi-agent orchestration and operator dashboard",
5
5
  "type": "module",
6
6
  "author": "KontextMind",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
3
  "name": "kxm",
4
4
  "displayName": "KXM",
5
- "version": "0.7.121",
5
+ "version": "0.7.122",
6
6
  "description": "Headless multi-agent orchestration, durable workflows, and a live operator dashboard for Pi and Claude Code",
7
7
  "author": {
8
8
  "name": "KontextMind",