@kontextmind/kxm 0.7.120 → 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.120",
14
+ "version": "0.7.122",
15
15
  "category": "development",
16
16
  "tags": ["kxm", "multi-agent", "workflows", "mcp"]
17
17
  }
package/.kxm/gates.yaml CHANGED
@@ -6,3 +6,27 @@ gates:
6
6
  - npm
7
7
  - test
8
8
  timeoutMs: 3600000
9
+ land-verify:
10
+ kind: command
11
+ argv: [node, scripts/pr-land.mjs, --stage, verify, --json]
12
+ timeoutMs: 3900000
13
+ land-docs:
14
+ kind: command
15
+ argv: [node, scripts/pr-land.mjs, --stage, docs, --json]
16
+ timeoutMs: 900000
17
+ land-rebase:
18
+ kind: command
19
+ argv: [node, scripts/pr-land.mjs, --stage, rebase, --json]
20
+ timeoutMs: 18600000
21
+ land-merge:
22
+ kind: command
23
+ argv: [node, scripts/pr-land.mjs, --stage, merge, --json]
24
+ timeoutMs: 1500000
25
+ land-release:
26
+ kind: command
27
+ argv: [node, scripts/pr-land.mjs, --stage, release, --json]
28
+ timeoutMs: 3300000
29
+ land-milestone:
30
+ kind: command
31
+ argv: [node, scripts/pr-land.mjs, --stage, milestone, --json]
32
+ timeoutMs: 120000
@@ -0,0 +1,95 @@
1
+ # This workflow may be refused by `kxm run` prerequisites until gate-only
2
+ # workflows are supported. Record the dry run with
3
+ # `kxm run land --dry-run --json`.
4
+ schema: kxm.workflow.v1
5
+ description: Land the current branch through verify, docs, rebase, merge, release, and milestone gates.
6
+ coordinator: coordinator
7
+ limits:
8
+ maxTransitions: 24
9
+ steps:
10
+ - id: land-verify
11
+ kind: gate
12
+ gate: land-verify
13
+ expect: pass
14
+ repositories:
15
+ control: write
16
+ on:
17
+ passed: land-docs
18
+ failed:
19
+ target: $terminal
20
+ terminalStatus: failed
21
+ implementation-failure:
22
+ target: $terminal
23
+ terminalStatus: failed
24
+ - id: land-docs
25
+ kind: gate
26
+ gate: land-docs
27
+ expect: pass
28
+ repositories:
29
+ control: write
30
+ on:
31
+ passed: land-rebase
32
+ failed:
33
+ target: $terminal
34
+ terminalStatus: failed
35
+ implementation-failure:
36
+ target: $terminal
37
+ terminalStatus: failed
38
+ - id: land-rebase
39
+ kind: gate
40
+ gate: land-rebase
41
+ expect: pass
42
+ repositories:
43
+ control: write
44
+ on:
45
+ passed: land-merge
46
+ failed:
47
+ target: $terminal
48
+ terminalStatus: failed
49
+ implementation-failure:
50
+ target: $terminal
51
+ terminalStatus: failed
52
+ - id: land-merge
53
+ kind: gate
54
+ gate: land-merge
55
+ expect: pass
56
+ repositories:
57
+ control: write
58
+ on:
59
+ passed: land-release
60
+ failed:
61
+ target: land-rebase
62
+ maxTransitions: 3
63
+ implementation-failure:
64
+ target: land-rebase
65
+ maxTransitions: 3
66
+ - id: land-release
67
+ kind: gate
68
+ gate: land-release
69
+ expect: pass
70
+ repositories:
71
+ control: write
72
+ on:
73
+ passed: land-milestone
74
+ failed:
75
+ target: $terminal
76
+ terminalStatus: failed
77
+ implementation-failure:
78
+ target: $terminal
79
+ terminalStatus: failed
80
+ - id: land-milestone
81
+ kind: gate
82
+ gate: land-milestone
83
+ expect: pass
84
+ repositories:
85
+ control: write
86
+ on:
87
+ passed:
88
+ target: $terminal
89
+ terminalStatus: completed
90
+ failed:
91
+ target: $terminal
92
+ terminalStatus: failed
93
+ implementation-failure:
94
+ target: $terminal
95
+ terminalStatus: failed
package/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ All notable user-facing changes are documented here. The project follows [Semant
6
6
 
7
7
  ### Added
8
8
 
9
+ - **`kxm land` verifies, regenerates docs, and squash-merges the current branch.**
10
+ The stages are `verify`, `docs`, `push`, `pr`, `rebase`, `unblock`, `merge`,
11
+ `release`, and `milestone`. `npm run verify` is the first stage and is not
12
+ replaced. Rebase resolves only the dist rebuild, the CHANGELOG Unreleased
13
+ union, and the tracker "Landed in this tree" union, for at most five rounds.
14
+ A required review is reported. The `land` workflow in `.kxm/workflows/land.yaml`
15
+ runs the same gates and may be refused until gate-only workflows are supported.
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).
24
+
9
25
  - **`kxm lane` keeps one git worktree per unit beside the control checkout.**
10
26
  `create`, `list`, `status`, `drop` and `run` store a 0600 record in
11
27
  `.kxm/state/lanes.json` keyed by the resolved base sha, and `drop` never
@@ -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 |
@@ -380,6 +383,37 @@ No test runs `run`, `witness` or `accept` end to end. Treat changes to
380
383
  `scripts/assignment-run.mjs` as high risk, and check them by running a real
381
384
  unit through the loop.
382
385
 
386
+ ## Landing
387
+
388
+ `kxm land` is the entry point after a candidate is ready to merge. It runs
389
+ `npm run verify` first. That gate is not replaced. On a green verify it
390
+ regenerates documentation (`docs`), then runs the GitHub stages: `push`,
391
+ `pr`, `rebase`, `unblock`, `merge`, `release`, and `milestone`.
392
+
393
+ | Stage | Role |
394
+ |---|---|
395
+ | `verify` | Clean tree, then `npm run verify`, skipped when a receipt for this tree is younger than 30 minutes |
396
+ | `docs` | Regenerate the roadmap after verify and before the merge. Absent generator: pass, skipped |
397
+ | `push` | `git push -u origin <branch>`, with `--force-with-lease` after a rebase in this run |
398
+ | `pr` | Reuse the open pull request, or create one from `--body-file` |
399
+ | `rebase` | Up to five rounds onto `origin/main`. Only the dist rebuild, the CHANGELOG Unreleased union, and the tracker "Landed in this tree" union are resolved automatically |
400
+ | `unblock` | Rerun one failed check. A required review is reported |
401
+ | `merge` | Squash only. Poll until `MERGED`, up to 20 minutes |
402
+ | `release` | Auto-release tag, Release workflow, then npm for 10 minutes. Prints `PUBLISHED <version>` |
403
+ | `milestone` | Report `deep_review_required` when a phase completes or the body has a `Milestone:` line. Does not run the review |
404
+
405
+ Refusals (exit 1): `land_dirty_tree`, `land_verify_failed`, `land_docs_failed`,
406
+ `land_push_rejected`, `land_pr_body_missing`, `land_conflict_manual`,
407
+ `land_blocked`, `land_merge_failed`, `land_release_failed`,
408
+ `land_publish_timeout`, `land_milestone_failed`. Usage errors exit 2.
409
+ `--stage <name>` runs one stage. `--dry-run` prints the plan and does not mutate.
410
+
411
+ The same stages are command gates in `.kxm/gates.yaml` (`land-verify`,
412
+ `land-docs`, `land-rebase`, `land-merge`, `land-release`, `land-milestone`)
413
+ and steps in `.kxm/workflows/land.yaml`. `kxm run land` may be refused until
414
+ gate-only workflows are supported. See the
415
+ [CLI reference](../reference/cli-reference.md#kxm-land).
416
+
383
417
  ## Related
384
418
 
385
419
  - [Develop KXM](development.md): the commit gate the witness runs
@@ -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)
@@ -158,6 +158,8 @@ Exit 2 covers an unknown command or option, a missing argument or required optio
158
158
  | Check harness installs and authentication | [`kxm harness list`](#kxm-harness-list), [`kxm update --dry-run`](#kxm-update) |
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
+ | Land the current branch | [`kxm land`](#kxm-land) |
162
+ | Delegate and accept a developer assignment | [`kxm assign`](#kxm-assign) |
161
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) |
162
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) |
163
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) |
@@ -1433,6 +1435,133 @@ Creates the lane when the record is absent (same rules as `create`), refuses `la
1433
1435
 
1434
1436
  Refusals (exit 1): `brief_unreadable`, `lane_unit_invalid`, `lane_exists`, `lane_base_unresolved`, `lane_run_open`, `lane_git_failed`, `lane_not_project`, `lanes_unreadable`.
1435
1437
 
1438
+ ## `kxm land`
1439
+
1440
+ Land the current branch. `npm run verify` is the first stage and is not replaced. The command spawns `scripts/pr-land.mjs` from the project root and streams one JSON line per stage. With no `--stage`, the stages run in order and stop at the first refusal. `--dry-run` prints each stage's plan and does not mutate. Squash is the only merge. A required review is reported and not bypassed.
1441
+
1442
+ ```text
1443
+ kxm land [--pr <n>] [--stage <name>] [--body-file <path>]
1444
+ ```
1445
+
1446
+ ```bash
1447
+ kxm land --stage verify --dry-run
1448
+ ```
1449
+
1450
+ | Option | Argument | Default | Description |
1451
+ |---|---|---|---|
1452
+ | `--pr` | `<n>` | the open pull request for this branch | Pull request number to reuse |
1453
+ | `--stage` | `<name>` | all stages | One of `verify`, `docs`, `push`, `pr`, `rebase`, `unblock`, `merge`, `release`, `milestone` |
1454
+ | `--body-file` | `<path>` | none | Body file for `gh pr create`. Required when creating a pull request |
1455
+
1456
+ Outside a KXM project the command refuses `project_required` (exit 1). Unknown arguments and an unknown stage exit 2.
1457
+
1458
+ ### Stages
1459
+
1460
+ | Stage | What it does |
1461
+ |---|---|
1462
+ | `verify` | Refuses `land_dirty_tree` unless `git status --porcelain` is empty. Skips when `.kxm/logs/land-verify-<tree>.json` for `HEAD^{tree}` is younger than 30 minutes. Otherwise runs `npm run verify` and writes that receipt. |
1463
+ | `docs` | Runs `plans/kxm-roadmap/update-dashboard.mjs` when that file exists. Commits changes under `docs/roadmap/`, `plans/kxm-roadmap/`, or `docs/architecture/` as `docs(roadmap): regenerate after verify`. Any other path, including `state.json`, is `land_docs_failed`. When the generator is absent the stage passes with `docs: skipped (generator absent)`. |
1464
+ | `push` | `git push -u origin <branch>`. After a rebase in this run, the push uses `--force-with-lease`. |
1465
+ | `pr` | Reuses the branch's open pull request, or creates one with `gh pr create --body-file`. |
1466
+ | `rebase` | When `mergeStateStatus` is `BEHIND` or `DIRTY`: fetch, rebase onto `origin/main`, and resolve only three conflicts (take `plugins/kxm/dist` from main and rebuild; union CHANGELOG Unreleased bullets, ours first; union the tracker "Landed in this tree" list, newest first). Runs `docs` again when the tree changed, re-verifies unless `git merge-tree --write-tree origin/main HEAD` was clean, and pushes with the lease. Five rounds, then `land_conflict_manual`. |
1467
+ | `unblock` | Reads `statusCheckRollup` and `reviewDecision`. Reruns one failed check with `gh run rerun --failed`. A second failure or `REVIEW_REQUIRED` is `land_blocked`. |
1468
+ | `merge` | Enables auto-merge with `enablePullRequestAutoMerge` and `mergeMethod: SQUASH`. When the response contains "clean status", squash-merges with `PUT /repos/{owner}/{repo}/pulls/{n}/merge` and commit title `<title> (#n)`. Polls `gh pr view --json state` every 30 seconds for up to 20 minutes. |
1469
+ | `release` | Records the newest `v*` tag before the merge, waits for the Auto-Release run whose title contains the pull request title, requires a newer tag from `git ls-remote --tags origin`, waits for the Release run created after the merge, then polls `npm view @kontextmind/kxm@<version> version` every 30 seconds for 10 minutes. The success detail is `PUBLISHED <version>`. |
1470
+ | `milestone` | Compares `plans/kxm-roadmap/state.json` from before and after `docs`. When a phase goes from an open task to all tasks `done`, or the pull request body contains a `Milestone:` line, prints `deep_review_required: true` and exits 0. The review is the `/reanalyze-roadmap` skill, not this command. An absent state file passes with skipped. |
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`.
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
+
1436
1565
  ## `kxm run`
1437
1566
 
1438
1567
  ```text
@@ -14,6 +14,7 @@ This catalog names common multi-agent workflows by area and lists, for each role
14
14
  8. [Research & Strategy](#research--strategy)
15
15
  9. [Business Operations](#business-operations)
16
16
  10. [Security & Reliability](#security--reliability)
17
+ 11. [Repository workflow: land](#repository-workflow-land)
17
18
 
18
19
  ---
19
20
 
@@ -1083,6 +1084,12 @@ This cross-reference points each software and security workflow at the KXM pages
1083
1084
 
1084
1085
  ---
1085
1086
 
1087
+ ## Repository workflow: land
1088
+
1089
+ `.kxm/workflows/land.yaml` is a project workflow, not a catalog slug. It runs six command gates in order: `land-verify`, `land-docs`, `land-rebase`, `land-merge`, `land-release`, `land-milestone`. Each gate calls `node scripts/pr-land.mjs --stage <name> --json`. A failed merge returns to `land-rebase` at most three times, then the run fails. `npm run verify` remains the first stage of `kxm land` and is not replaced by this workflow.
1090
+
1091
+ `kxm run land --dry-run --json` may be refused by live prerequisites until gate-only workflows are supported. The command `kxm land` runs the same stages without a run receipt.
1092
+
1086
1093
  ## Related
1087
1094
 
1088
1095
  - [Workflow definitions](workflow-definitions.md): write a webhook or Runtime workflow for these stages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextmind/kxm",
3
- "version": "0.7.120",
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.120",
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",