@kontextmind/kxm 0.7.119 → 0.7.121

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.119",
14
+ "version": "0.7.121",
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,28 @@ 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
+
18
+ - **`kxm lane` keeps one git worktree per unit beside the control checkout.**
19
+ `create`, `list`, `status`, `drop` and `run` store a 0600 record in
20
+ `.kxm/state/lanes.json` keyed by the resolved base sha, and `drop` never
21
+ deletes the branch. `kxm run --brief <file>` and `--lane <unit>` start that
22
+ work, and `--lane` is also accepted by `kxm runs status`, `drive`, `receipt`
23
+ and `cancel`. The `just worktree` and `just worktree-drop` recipes now call
24
+ those verbs. The refusals a user can see are `lane_exists`, `lane_missing`,
25
+ `lane_base_unresolved`, `lane_dirty`, `lane_run_open`, `brief_unreadable` and
26
+ `brief_and_prompt`. A live writer step through `kxm lane run` is still
27
+ bounded by the Runtime's 120 second one-shot timeout until the configurable
28
+ limit lands. See the
29
+ [CLI reference](docs/reference/cli-reference.md#kxm-lane).
30
+
9
31
  - **Claude-only workflow recommendations now fail honestly when execution is unavailable.**
10
32
  `suggest` honors explicit harness constraints, uses flat installable IDs and verified
11
33
  capability-appropriate routes, refuses unchecked existing definitions, and never substitutes a
@@ -337,6 +359,13 @@ All notable user-facing changes are documented here. The project follows [Semant
337
359
  persisting a projection write, so a read cannot mutate run state or surface a
338
360
  false `run_projection_divergent`.
339
361
 
362
+ ### Removed
363
+
364
+ - **`.kxm/template-provenance.yaml` was removed from this project, a repository
365
+ change rather than a product change,** because the installed kxm no longer
366
+ recognizes its recorded revision and a project without the file validates as
367
+ ready.
368
+
340
369
  ### Fixed
341
370
 
342
371
  - **A local `kxm workflow add` writes only what the project loader accepts, where it reads
@@ -17,7 +17,7 @@ a KXM product feature.
17
17
 
18
18
  - A clean control checkout of this repository whose `HEAD` is an ancestor of
19
19
  `origin/main`. The runner loads `.kxm/roster.yaml` only from there.
20
- - A separate worktree for the writer. `just worktree <unit>` creates one from
20
+ - A separate worktree for the writer. `kxm lane create <unit>` creates one from
21
21
  `origin/main`.
22
22
  - [`just`](https://github.com/casey/just), plus the harness CLIs the roster
23
23
  admits, installed and logged in. `node scripts/kxm.mjs harness list` shows
@@ -380,6 +380,37 @@ No test runs `run`, `witness` or `accept` end to end. Treat changes to
380
380
  `scripts/assignment-run.mjs` as high risk, and check them by running a real
381
381
  unit through the loop.
382
382
 
383
+ ## Landing
384
+
385
+ `kxm land` is the entry point after a candidate is ready to merge. It runs
386
+ `npm run verify` first. That gate is not replaced. On a green verify it
387
+ regenerates documentation (`docs`), then runs the GitHub stages: `push`,
388
+ `pr`, `rebase`, `unblock`, `merge`, `release`, and `milestone`.
389
+
390
+ | Stage | Role |
391
+ |---|---|
392
+ | `verify` | Clean tree, then `npm run verify`, skipped when a receipt for this tree is younger than 30 minutes |
393
+ | `docs` | Regenerate the roadmap after verify and before the merge. Absent generator: pass, skipped |
394
+ | `push` | `git push -u origin <branch>`, with `--force-with-lease` after a rebase in this run |
395
+ | `pr` | Reuse the open pull request, or create one from `--body-file` |
396
+ | `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 |
397
+ | `unblock` | Rerun one failed check. A required review is reported |
398
+ | `merge` | Squash only. Poll until `MERGED`, up to 20 minutes |
399
+ | `release` | Auto-release tag, Release workflow, then npm for 10 minutes. Prints `PUBLISHED <version>` |
400
+ | `milestone` | Report `deep_review_required` when a phase completes or the body has a `Milestone:` line. Does not run the review |
401
+
402
+ Refusals (exit 1): `land_dirty_tree`, `land_verify_failed`, `land_docs_failed`,
403
+ `land_push_rejected`, `land_pr_body_missing`, `land_conflict_manual`,
404
+ `land_blocked`, `land_merge_failed`, `land_release_failed`,
405
+ `land_publish_timeout`, `land_milestone_failed`. Usage errors exit 2.
406
+ `--stage <name>` runs one stage. `--dry-run` prints the plan and does not mutate.
407
+
408
+ The same stages are command gates in `.kxm/gates.yaml` (`land-verify`,
409
+ `land-docs`, `land-rebase`, `land-merge`, `land-release`, `land-milestone`)
410
+ and steps in `.kxm/workflows/land.yaml`. `kxm run land` may be refused until
411
+ gate-only workflows are supported. See the
412
+ [CLI reference](../reference/cli-reference.md#kxm-land).
413
+
383
414
  ## Related
384
415
 
385
416
  - [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` | Create, drive, inspect and cancel runs, or smoke-test a workflow model-free |
61
+ | `kxm-runs` | `run`, `runs`, `lane` | Create, drive, inspect and cancel runs, manage worktree lanes, or smoke-test a workflow model-free |
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: [`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), [`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)
@@ -143,7 +143,7 @@ Exit 2 covers an unknown command or option, a missing argument or required optio
143
143
  |---|---|---|
144
144
  | Project files under `<project>/.kxm/` (reviewed in Git) | `project.yaml`, `agents/`, `workflows/`, `gates.yaml`, `repo/`, `template-provenance.yaml`, `routes.yaml`, `models/inventory.yaml`, `roles/`, `role-hosts.yaml`, `modes.yaml`, `prices.yaml` | `init`, `trust`, `run`, `models`, `routes`, `role`, `workflow definitions\|add\|remove\|modify`, `explain`, `studio` |
145
145
  | Local project records under `<project>/.kxm/` | `config.yaml` (project scope), `goals/`, `tasks/`, `memory/`, `skills/`, `candidates/`, `backups/`, `run/ssh-sockets/` | `config`, `goal`, `task`, `memory`, `skills`, `improve`, `backup`, `ssh` |
146
- | Workspace directories (`.kxm/state`, `.kxm/logs`, `.kxm/assets`, `.kxm/config`; moved by `--workspace` or `KXM_*_DIR`) | hub SQLite store `state/kxm.db` (or `KXM_DATA_PATH`), `state/hub.pid`, `state/session-brief.json`, `logs/telemetry.jsonl`, `logs/kxm-hub.jsonl`, `assets/sessions/`, `assets/workflows/`, `assets/improvements/`, `assets/retrospectives/`, legacy `config/agents.json` and `config/gates.json` | `hub`, `session`, `dash`, `agent worker`, `workflow list\|get\|export`, `gate`, `improve`, `routing report` |
146
+ | Workspace directories (`.kxm/state`, `.kxm/logs`, `.kxm/assets`, `.kxm/config`; moved by `--workspace` or `KXM_*_DIR`) | hub SQLite store `state/kxm.db` (or `KXM_DATA_PATH`), `state/hub.pid`, `state/session-brief.json`, `state/lanes.json` (mode 0600 lane records), `logs/telemetry.jsonl`, `logs/kxm-hub.jsonl`, `assets/sessions/`, `assets/workflows/`, `assets/improvements/`, `assets/retrospectives/`, legacy `config/agents.json` and `config/gates.json` | `hub`, `session`, `dash`, `lane`, `agent worker`, `workflow list\|get\|export`, `gate`, `improve`, `routing report` |
147
147
  | User config directory (`KXM_USER_CONFIG_DIR`, default `~/.config/kxm`) | `config.yaml` (user scope), `session.token`, global `roles/` and `workflows/`, `role-hosts.yaml`, `completions/` | `config --scope user`, `auth token`, `session brief\|token`, `role`/`workflow` with `--scope global`, `studio serve`, `completion install` |
148
148
  | User state root (`KXM_STATE_HOME`; macOS `~/Library/Application Support/KXM`; Linux `$XDG_STATE_HOME/kxm` or `~/.local/state/kxm`; Windows `%LOCALAPPDATA%\KXM`) | `hub-env.json` (persisted hub credentials), `hub-binding.json`, `runtime/` (Runtime supervisor registry and per-project run stores), `update.yaml`, repository bindings | `hub start\|bind\|unbind`, every hub client, `run`, `runs`, `runtime`, `tenant status`, `update`, `init --repository`, and (read-only, the project's run store) `improve` and `routing report` |
149
149
 
@@ -157,6 +157,8 @@ Exit 2 covers an unknown command or option, a missing argument or required optio
157
157
  | Start or bind a hub | [`kxm hub start`](#kxm-hub-start), [`kxm hub bind`](#kxm-hub-bind), [`kxm hub view`](#kxm-hub-view) |
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
+ | Work in an isolated checkout | [`kxm lane`](#kxm-lane), [`kxm run --lane`](#kxm-run) |
161
+ | Land the current branch | [`kxm land`](#kxm-land) |
160
162
  | 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) |
161
163
  | 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) |
162
164
  | 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) |
@@ -1382,19 +1384,107 @@ dry run: resume workflow run wf_dry_run (stage: review)
1382
1384
  would write /work/proj/.kxm/state/kxm.db (workflow_runs wf_dry_run, one workflow_journal decision)
1383
1385
  ```
1384
1386
 
1387
+ ## `kxm lane`
1388
+
1389
+ One lane is one git worktree, one branch named the unit, and one recorded base sha. The record lives in the control checkout's state directory, `.kxm/state/lanes.json` (`kxm.lanes.v1`, mode 0600). The worktree path is `../<control-dir-basename>-<unit>`, next to the control checkout. Creating a lane resolves the base ref to a sha and does not fetch. There is no push, merge, pull request, or branch delete. Selecting a lane sets the discovery cwd to that lane's path and rebuilds workspace directories from it; `KXM_WORKDIR` still selects the workspace root when it is set, so the lane path is the workspace root only when `KXM_WORKDIR` is unset.
1390
+
1391
+ ```text
1392
+ kxm lane create <unit> [--base <ref>]
1393
+ kxm lane list
1394
+ kxm lane status <unit>
1395
+ kxm lane drop <unit> [--force]
1396
+ kxm lane run <unit> --brief <file> [--workflow <id>] [--base <ref>] [--wait] [--timeout-ms <n>]
1397
+ ```
1398
+
1399
+ ```bash
1400
+ kxm lane run omp-align-p1 --brief .kxm/briefs/omp-align-p1.md --wait
1401
+ ```
1402
+
1403
+ ### `kxm lane create`
1404
+
1405
+ Resolves `<ref>` (default `origin/main`) with `git rev-parse --verify <ref>^{commit}` in the control checkout, then `git worktree add -b <unit> <path> <sha>`. The new worktree must contain `.kxm/project.yaml`. Writes the record and prints it.
1406
+
1407
+ | Option | Argument | Default | Description |
1408
+ |---|---|---|---|
1409
+ | `--base` | `<ref>` | `origin/main` | Ref to resolve before adding the worktree |
1410
+
1411
+ Refusals (exit 1): `lane_unit_invalid`, `lane_exists` (record, path, or branch already present), `lane_base_unresolved` (the text names `git fetch origin`), `lane_not_project` (worktree removed again), `lane_git_failed`, `lanes_unreadable`.
1412
+
1413
+ ### `kxm lane list`
1414
+
1415
+ Prints one line per lane: unit, branch, base sha, `dirty` (porcelain line count), `ahead` and `behind` against the recorded base sha, and `exists`. JSON key: `lanes`.
1416
+
1417
+ ### `kxm lane status`
1418
+
1419
+ The list row for one unit, plus `status` of `lastRunId` when the Runtime supervisor is already running and answers. Otherwise `status=unknown`. `kxm lane status` never starts the Runtime supervisor.
1420
+
1421
+ Refusals (exit 1): `lane_missing`, `lane_unit_invalid`, `lanes_unreadable`.
1422
+
1423
+ ### `kxm lane drop`
1424
+
1425
+ Removes the worktree and the record. Refuses `lane_dirty` when porcelain is nonempty, and `lane_run_open` when `lastRunId` is set and that run is not `completed`, `failed`, or `cancelled`. `--force` overrides both. `git worktree remove --force` is used only with `--force`. The branch is not deleted; the text says so (`branchDeleted: false`). Unless `--force` is set, drop may start the Runtime supervisor to check whether the lane's last run is still open; `--dry-run` only attaches to a supervisor that is already running. `kxm lane status` never starts the supervisor.
1426
+
1427
+ Refusals (exit 1): `lane_missing`, `lane_dirty`, `lane_run_open`, `lane_git_failed`.
1428
+
1429
+ ### `kxm lane run`
1430
+
1431
+ Creates the lane when the record is absent (same rules as `create`), refuses `lane_run_open` when the last run is not settled, then runs the same path as `kxm run --lane <unit> --brief <file>` and `kxm runs drive <runId> --lane <unit>`. `--wait` and `--timeout-ms` are passed through. The run id is stored on the record. Prints the run envelope and the drive result. That open-run check may start the Runtime supervisor; `--dry-run` only attaches to a supervisor that is already running. `kxm lane status` never starts the supervisor.
1432
+
1433
+ `--brief` is required. `--workflow` defaults to the lane project's `defaultWorkflow`. `--base` applies only when the lane is created. A live writer step through this verb is subject to the Runtime's one-shot process timeout, which is 120 seconds until `limits.agentStepTimeoutMs` lands, so long implementation briefs should use `just impl-bg` until then (see section 4 of `plans/plan-lane-cli.md`).
1434
+
1435
+ Refusals (exit 1): `brief_unreadable`, `lane_unit_invalid`, `lane_exists`, `lane_base_unresolved`, `lane_run_open`, `lane_git_failed`, `lane_not_project`, `lanes_unreadable`.
1436
+
1437
+ ## `kxm land`
1438
+
1439
+ 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.
1440
+
1441
+ ```text
1442
+ kxm land [--pr <n>] [--stage <name>] [--body-file <path>]
1443
+ ```
1444
+
1445
+ ```bash
1446
+ kxm land --stage verify --dry-run
1447
+ ```
1448
+
1449
+ | Option | Argument | Default | Description |
1450
+ |---|---|---|---|
1451
+ | `--pr` | `<n>` | the open pull request for this branch | Pull request number to reuse |
1452
+ | `--stage` | `<name>` | all stages | One of `verify`, `docs`, `push`, `pr`, `rebase`, `unblock`, `merge`, `release`, `milestone` |
1453
+ | `--body-file` | `<path>` | none | Body file for `gh pr create`. Required when creating a pull request |
1454
+
1455
+ Outside a KXM project the command refuses `project_required` (exit 1). Unknown arguments and an unknown stage exit 2.
1456
+
1457
+ ### Stages
1458
+
1459
+ | Stage | What it does |
1460
+ |---|---|
1461
+ | `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. |
1462
+ | `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)`. |
1463
+ | `push` | `git push -u origin <branch>`. After a rebase in this run, the push uses `--force-with-lease`. |
1464
+ | `pr` | Reuses the branch's open pull request, or creates one with `gh pr create --body-file`. |
1465
+ | `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`. |
1466
+ | `unblock` | Reads `statusCheckRollup` and `reviewDecision`. Reruns one failed check with `gh run rerun --failed`. A second failure or `REVIEW_REQUIRED` is `land_blocked`. |
1467
+ | `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. |
1468
+ | `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>`. |
1469
+ | `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. |
1470
+
1471
+ 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
+
1385
1473
  ## `kxm run`
1386
1474
 
1387
1475
  ```text
1388
- kxm run <workflow> [prompt...]
1476
+ kxm run <workflow> [--brief <file>] [--lane <unit>] [prompt...]
1389
1477
  ```
1390
1478
 
1391
1479
  Create a KXM run without executing steps. The run pins the project's `homeRuntimeId`, config revision, and executor and tool policy revisions. Events store the prompt's SHA-256; its full text is kept in a local mode-0600 sidecar, `run-events.db.run-prompts.json`, and dispatch refuses a hash mismatch (`run_prompt_mismatch`). The Runtime supervisor starts if needed. Output explicitly reports no execution, live prerequisites, and separate drive/status/receipt commands. Use `kxm runs drive <runId> --wait` for supported live one-shot calls; no hub or Pi worker is required. `--simulated` is a model-free experiment, not evidence that implementation ran. Local runs are inspected with `kxm runs`, not the webhook-only `kxm workflow get`.
1392
1480
 
1393
1481
  - Arguments: `<workflow>`, Workflow id to run (a file under `.kxm/workflows/`); `[prompt...]`, Run prompt (events keep its hash; the full text is kept in a local 0600 sidecar file).
1394
- - No command-specific options. Refuses `--workspace` (exit 2).
1482
+ - `--brief <file>` reads that file from the invocation directory, trims it, and uses the text as the prompt. The JSON envelope includes `brief` set to the path as given. `--brief` together with a positional prompt is `brief_and_prompt`. A file that cannot be read is `brief_unreadable`.
1483
+ - `--lane <unit>` selects the recorded worktree before project discovery. A missing lane is `lane_missing`. A last run that is not settled is `lane_run_open`.
1484
+ - Refuses `--workspace` (exit 2, `workspace_option_unsupported`).
1395
1485
  - Needs a KXM project. Starts and uses the Runtime; no hub needed. Honors `--dry-run`, which validates the project and prints the plan without starting the supervisor.
1396
1486
  - JSON keys: `idempotent`, `run` (`runId`, `homeRuntimeId`, `status`, `configRevision`), `supervisor` (`runtimeId`, `port`, `started`), and `execution` (`status: not_started`, `mode: live`, `defaultHarness`, `authentication: not_checked`, `prerequisites`, `nextSteps`). Dry run: `projectRoot`, `workflowId`, `configRevision`, `defaultHarness`, `prerequisites`. The obsolete `phase: pre-3a` field is no longer returned.
1397
- - Errors: `workflow_required` (exit 2), `project_required`, `run_workflow_unknown`, `run_failed` with `issues` (any invalid file in the project fails the load, for example `gate_outcome_impossible`), `run_io_failed` (exit 1).
1487
+ - Errors: `workflow_required` (exit 2), `project_required`, `run_workflow_unknown`, `brief_and_prompt`, `brief_unreadable`, `lane_missing`, `lane_run_open`, `run_failed` with `issues` (any invalid file in the project fails the load, for example `gate_outcome_impossible`), `run_io_failed` (exit 1).
1398
1488
  - The `default` workflow that `kxm init` writes does not set `limits.maxAgentTimeMs`, so it can be driven. A workflow that sets that limit is created, but `kxm runs drive` refuses it with `run_handoff_required` (`limit_unsupported`); projects from older `kxm init` templates carry it on `default`.
1399
1489
 
1400
1490
  ```bash
@@ -1436,12 +1526,12 @@ Reads and drives runs through the Runtime supervisor. Every subcommand needs a K
1436
1526
  ### `kxm runs status`
1437
1527
 
1438
1528
  ```text
1439
- kxm runs status <runId>
1529
+ kxm runs status <runId> [--lane <unit>]
1440
1530
  ```
1441
1531
 
1442
1532
  Show the projected status of a run, including durable drive receipt state (open / receipt verified / unsettled / orphaned).
1443
1533
 
1444
- - Arguments: `<runId>`, Run id. No command-specific options. Reads run state, but starts the supervisor if needed (not under `--dry-run`).
1534
+ - Arguments: `<runId>`, Run id. `--lane <unit>` discovers the project from that lane's worktree (`lane_missing` when the record or path is absent, `lane_unit_invalid` when the unit is not a KXM identifier, `lanes_unreadable` when the record cannot be read). Reads run state, but starts the supervisor if needed (not under `--dry-run`).
1445
1535
  - Text: `run <id>: <status> (workflow <id>, updated <time>)`, plus a drive line such as `drive <id>: open`, `completed (receipt verified)`, `unsettled <reason>`, `handoff`, `cancelled (<reason>)`, or `no receipt (orphaned)`.
1446
1536
  - JSON keys: `run` (`runId`, `status`, `workflowId`, `configRevision`, `updatedAt`, ...), `drive` (`driveId`, `mode`, `openedAt`, `receipt`, `verified`, `divergence`).
1447
1537
  - Errors: `project_required`, `run_status_failed`, `run_status_io_failed` (exit 1).
@@ -1467,7 +1557,7 @@ kxm runs status --dry-run refused: the Runtime supervisor is not running and --d
1467
1557
  ### `kxm runs drive`
1468
1558
 
1469
1559
  ```text
1470
- kxm runs drive <runId> [--simulated] [--wait] [--timeout-ms <n>]
1560
+ kxm runs drive <runId> [--simulated] [--wait] [--timeout-ms <n>] [--lane <unit>]
1471
1561
  ```
1472
1562
 
1473
1563
  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`).
@@ -1477,8 +1567,9 @@ Opens a drive of the run. With `--simulated`, a model-free producer reports ever
1477
1567
  | `--simulated` | none | off | Use the model-free simulation producer |
1478
1568
  | `--wait` | none | off | Wait until a drive receipt is recorded; exits 0 only for a VERIFIED COMPLETED settlement |
1479
1569
  | `--timeout-ms` | `<n>` | `60000` | Wait timeout in milliseconds (default 60000, max 600000) |
1570
+ | `--lane` | `<unit>` | none | Discover the project from this lane's worktree |
1480
1571
 
1481
- - Arguments: `<runId>`, Run id.
1572
+ - Arguments: `<runId>`, Run id. `--lane` refuses `lane_missing` when the record or path is absent, and also `lane_unit_invalid` and `lanes_unreadable`.
1482
1573
  - `--timeout-ms` applies only with `--wait` and must be an integer from 1 to 600000 (`run_drive_timeout_invalid`, exit 1).
1483
1574
  - Mutates run state. Honors `--dry-run`.
1484
1575
  - JSON keys without `--wait`: `runId`, `driveId`, `poll`, `mode`, `status` (`accepted`). With `--wait`: `receipt`, `verified`; a timeout prints `error: "timeout"`.
@@ -1511,7 +1602,7 @@ Not run: starts the Runtime and writes run events.
1511
1602
  ### `kxm runs receipt`
1512
1603
 
1513
1604
  ```text
1514
- kxm runs receipt <runId> [--all]
1605
+ kxm runs receipt <runId> [--all] [--lane <unit>]
1515
1606
  ```
1516
1607
 
1517
1608
  Print the newest drive receipt for a run.
@@ -1519,8 +1610,9 @@ Print the newest drive receipt for a run.
1519
1610
  | Option | Argument | Default | Description |
1520
1611
  |---|---|---|---|
1521
1612
  | `--all` | none | off | Print the capped receipt list for the run |
1613
+ | `--lane` | `<unit>` | none | Discover the project from this lane's worktree |
1522
1614
 
1523
- - Arguments: `<runId>`, Run id. Text mode prints the newest receipt's settlement as JSON; `--all` prints the list. Starts the supervisor if needed (not under `--dry-run`).
1615
+ - Arguments: `<runId>`, Run id. Text mode prints the newest receipt's settlement as JSON; `--all` prints the list. Starts the supervisor if needed (not under `--dry-run`). `--lane` refuses `lane_missing` when the record or path is absent, and also `lane_unit_invalid` and `lanes_unreadable`.
1524
1616
  - JSON keys: `receipt`, or `receipts` with `--all`. Exit 1 with `no_receipts` when the run was never driven.
1525
1617
 
1526
1618
  ```bash
@@ -1532,12 +1624,12 @@ Not run: starts the Runtime supervisor.
1532
1624
  ### `kxm runs cancel`
1533
1625
 
1534
1626
  ```text
1535
- kxm runs cancel <runId>
1627
+ kxm runs cancel <runId> [--lane <unit>]
1536
1628
  ```
1537
1629
 
1538
1630
  Durably request cancellation of a run: records `run.cancel_requested` then `run.status_changed`. Cancelling a terminal run is an idempotent no-op.
1539
1631
 
1540
- - Arguments: `<runId>`, Run id. No command-specific options.
1632
+ - Arguments: `<runId>`, Run id. `--lane <unit>` discovers the project from that lane's worktree (`lane_missing` when the record or path is absent, `lane_unit_invalid` when the unit is not a KXM identifier, `lanes_unreadable` when the record cannot be read).
1541
1633
  - Mutates run state. Honors `--dry-run`.
1542
1634
  - JSON keys: `idempotent`, `run` (`runId`, `status`).
1543
1635
 
@@ -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.119",
3
+ "version": "0.7.121",
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.119",
5
+ "version": "0.7.121",
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",