@kontextmind/kxm 0.7.120 → 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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.kxm/gates.yaml +24 -0
- package/.kxm/workflows/land.yaml +95 -0
- package/CHANGELOG.md +9 -0
- package/docs/contributing/assignment-runner.md +31 -0
- package/docs/reference/cli-reference.md +37 -0
- package/docs/reference/workflow-catalog.md +7 -0
- package/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +147 -99
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/skills/kxm/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-runs/SKILL.md +17 -1
- package/plugins/kxm/src/cli/land.ts +48 -0
- package/plugins/kxm/src/cli.ts +15 -0
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/scripts/pr-land.d.mts +2 -0
- package/scripts/pr-land.mjs +971 -0
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,15 @@ 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
|
+
|
|
9
18
|
- **`kxm lane` keeps one git worktree per unit beside the control checkout.**
|
|
10
19
|
`create`, `list`, `status`, `drop` and `run` store a 0600 record in
|
|
11
20
|
`.kxm/state/lanes.json` keyed by the resolved base sha, and `drop` never
|
|
@@ -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
|
|
@@ -158,6 +158,7 @@ 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) |
|
|
161
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) |
|
|
162
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) |
|
|
163
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) |
|
|
@@ -1433,6 +1434,42 @@ Creates the lane when the record is absent (same rules as `create`), refuses `la
|
|
|
1433
1434
|
|
|
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`.
|
|
1435
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
|
+
|
|
1436
1473
|
## `kxm run`
|
|
1437
1474
|
|
|
1438
1475
|
```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
|
@@ -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.
|
|
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",
|