@kontextmind/kxm 0.7.104 → 0.7.105
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/CHANGELOG.md +12 -0
- package/docs/contributing/test-matrix.md +4 -1
- package/docs/reference/cli-reference.md +42 -35
- package/docs/reference/workflow-definitions.md +4 -4
- package/docs/start/first-workflow.md +6 -2
- package/docs/start/quickstart-claude-code.md +10 -0
- package/package.json +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +1361 -709
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/runtime-supervisor.js +1 -1
- package/plugins/kxm/dist/runtime.js +3 -3
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/src/cli/project.ts +66 -18
- package/plugins/kxm/src/cli/system.ts +19 -1
- package/plugins/kxm/src/cli/tasks.ts +55 -31
- package/plugins/kxm/src/cli/workflows.ts +52 -54
- package/plugins/kxm/src/cli.ts +1 -1
- package/plugins/kxm/src/engine.ts +79 -3
- package/plugins/kxm/src/harness.ts +6 -5
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/suggest.ts +132 -79
- package/plugins/kxm/src/workflow-manager.ts +42 -19
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ All notable user-facing changes are documented here. The project follows [Semant
|
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
8
|
|
|
9
|
+
- **Claude-only workflow recommendations now fail honestly when execution is unavailable.**
|
|
10
|
+
`suggest` honors explicit harness constraints, uses flat installable IDs and verified
|
|
11
|
+
capability-appropriate routes, refuses unchecked existing definitions, and never substitutes a
|
|
12
|
+
different writer. `workflow add` validates IDs and runner-compatible YAML before
|
|
13
|
+
writing; picked/imported dry runs leave configuration untouched. `gate validate
|
|
14
|
+
--file` accepts local YAML without changing webhook environment-source validation.
|
|
15
|
+
Run output distinguishes creation from execution and names live prerequisites and
|
|
16
|
+
`runs drive/status/receipt`; incompatible `task run` requests leave tasks unchanged.
|
|
17
|
+
Harness inventory reflects the project default, and initialization explains the
|
|
18
|
+
generic Pi/npm starter settings. Claude's one-shot profile remains read-only; Pi/Grok
|
|
19
|
+
writer recommendations require audited writer admission. See the [CLI reference](docs/reference/cli-reference.md#kxm-suggest).
|
|
20
|
+
|
|
9
21
|
- **`kxm workflow add --template <name>` writes a valid first workflow.**
|
|
10
22
|
`implement-and-verify` (the `implementer` agent, then the project's `test` gate; a
|
|
11
23
|
failing gate sends the work back to `implement` at most twice), `dual-critic-review` (two
|
|
@@ -60,8 +60,11 @@ to run one file is in [Develop KXM](development.md#run-one-file-or-one-test).
|
|
|
60
60
|
| Settlement from a structured result only; prose outcomes and undeclared outcomes end as `outcome_unknown` | `pi-producer.test.ts`, `engine.test.ts` |
|
|
61
61
|
| Routing records carry `workflowId`, `askSha256`, `objectiveSha256` and `stepWrites`, and settle only `blocked` or `failed` | `route-admission.test.ts` |
|
|
62
62
|
| Dispatch context: only committed, pinned memory and hash-verified promoted skills reach an agent; the rest is a `dispatch_context_*` gap | `engine.test.ts` ("dispatch context: agents receive only committed, pinned memory and verified skills; anything else is withheld with a gap and the step still completes") |
|
|
63
|
-
|
|
|
63
|
+
| Run creation reports no execution and concrete live prerequisites; task refusal leaves task/Runtime unchanged; project harness default is honored | `cli.test.ts`, `engine.test.ts`, `harness.test.ts` |
|
|
64
64
|
| `kxm workflow add --template` writes workflows that validate and plan; an impossible gate outcome is refused | `cli-experience.test.ts` ("workflow add templates validate and plan a run, and a gate outcome the step can never produce is refused") |
|
|
65
|
+
| Flat workflow IDs and schema/compiler validation precede mutations; imported/picked local/global dry runs write nothing | `role-and-workflow-manager.test.ts`, `cli-experience.test.ts` |
|
|
66
|
+
| Claude-only suggestions honor detected/authenticated routes, require audited writer profiles, refuse existing unchecked definitions, and quote shell arguments literally | `suggest.test.ts`, `cli-experience.test.ts` |
|
|
67
|
+
| Explicit local YAML validates with runner schema/transitions; webhook environment sources retain JSON/secret checks | `gate-validation.test.ts` |
|
|
65
68
|
| `kxm workflow add` writes a local workflow only where the loader reads it and only if the project still loads; outside a project it refuses | `role-and-workflow-manager.test.ts` ("workflow add writes only what the project loader accepts, at the project root, and loadKxmProject still loads") |
|
|
66
69
|
| `kxm workflow add --pick <global-id>` copies the global definition into the project, not the scaffold, and the loader check refuses one that does not fit | `role-and-workflow-manager.test.ts` ("workflow add --pick <global-id> copies that global definition into the project, and refuses one the project loader rejects") |
|
|
67
70
|
| `default.yaml` and the 13-step `fix.yaml` compile deterministically; back edges need budgets | `engine-compile.test.ts` |
|
|
@@ -91,7 +91,7 @@ kxm -V
|
|
|
91
91
|
- The `command` field is not always the words you typed: `hub stop` and `session stop` report `stop`, `session token` reports `auth token`, `routes admit` and `routes disable` report `routes admitted` and `routes disabled`, `models inventory-refresh` reports `models inventory refresh`, `workflow export` reports `retrospective export`, `gate degrade` reports `workflow degrade`, `gate signal` and `workflow signal` report `signal`, `gate github watch` reports `github watch`, `agent worker` reports `worker`, and `improve report` reports `improve`.
|
|
92
92
|
- A result with `ok: false` is written to stderr in both text and JSON mode; everything else goes to stdout. `runtime status` is the exception: when the supervisor is down it prints `ok: true, running: false` on stdout and exits 1.
|
|
93
93
|
- `peer` subcommands and `workflow checkpoint|record|wait` print the hub's result object as returned, tagged with `schema` but without `ok` or `command`. Their failures print `{"ok":false,"error":"command_failed","detail":"..."}`. Text mode prints the same JSON.
|
|
94
|
-
- Several error paths ignore `--json` and print one plain line on stderr: argument checks in `agent worker`, `session start`, `workflow start`, `gate degrade`, `gate signal`, and `gate github watch`;
|
|
94
|
+
- Several error paths ignore `--json` and print one plain line on stderr: argument checks in `agent worker`, `session start`, `workflow start`, `gate degrade`, `gate signal`, and `gate github watch`; errors from `config`, `role`, `workflow definitions|remove|modify`, `goal`, `task` outside run admission, `memory`, `skills` (other than `skills create --dry-run`), `studio`, and `completion`. `suggest` and `workflow add` failures honor `--json`. Check the exit code before parsing stdout.
|
|
95
95
|
- Every `context` subcommand exits 1 with a Node.js stack trace and no JSON when the hub cannot be reached.
|
|
96
96
|
- Output is redacted. Values of environment variables whose names contain `TOKEN`, `SECRET`, `KEY`, or `PASSWORD` are replaced with `[redacted]`, and 64-character hex strings are replaced unless they appear in a known digest field such as `configRevision` or `sha256`. `session brief` and `auth token` print the session token itself; treat their output as a credential.
|
|
97
97
|
|
|
@@ -173,6 +173,8 @@ kxm init [--name <name>] [--project-id <id>] [--repository <id=absolute-path>]..
|
|
|
173
173
|
|
|
174
174
|
Creates, validates, repairs, resumes, or joins a KXM project at the Git root that contains the current directory. A new project gets a minimal configuration: one coordinator agent, one implementer agent, a `test` command gate, and a `default` plan-implement-verify workflow. An existing project is validated without rewriting. Conflict-free template updates to non-authority fields are applied; authority changes, overlapping edits, and provenance-free or legacy state stay planning-only. `init` does not start a hub or the Runtime.
|
|
175
175
|
|
|
176
|
+
The starter `defaultHarness: pi` and `npm test` gate are generic settings, not repository detection. Creation and create-planning output include `guidance`: for Claude, set `defaultHarness: claude` in `.kxm/project.yaml`, update any explicit `harness` overrides in `.kxm/agents/*.yaml`, and configure compatible agent models; for .NET or other non-npm repositories, set `.kxm/gates.yaml` → `gates.test.argv` to the repository's actual test command. Preflight reports an actionable prerequisite for `npm test` without a readable `package.json` test script; `task run` refuses it before creating a run.
|
|
177
|
+
|
|
176
178
|
| Option | Argument | Default | Description |
|
|
177
179
|
|---|---|---|---|
|
|
178
180
|
| `--name` | `<name>` | Git root directory name | Project display name for a new project |
|
|
@@ -184,7 +186,7 @@ Creates, validates, repairs, resumes, or joins a KXM project at the Git root tha
|
|
|
184
186
|
- Needs a Git repository. Does not need a hub or the Runtime.
|
|
185
187
|
- Writes `.kxm/project.yaml`, `.kxm/agents/coordinator.yaml`, `.kxm/agents/implementer.yaml`, `.kxm/gates.yaml`, `.kxm/repo/repo.yaml`, `.kxm/workflows/default.yaml`, and `.kxm/template-provenance.yaml`, using a `.kxm-init-transaction` directory at the Git root while a create or repair is in flight. Repository bindings are written under the user state root, never into Git. `--dry-run` writes nothing.
|
|
186
188
|
- On an interactive terminal without `--json` or `--dry-run`, a successful create or join offers to install shell completion (suppress with `KXM_SKIP_COMPLETION_PROMPT=1`) and to write workflow-guide agents (suppress with `KXM_SKIP_GUIDE_SETUP_PROMPT=1`). Guided setup keeps a role only when one of its guide candidates is on a fixed map of reviewed harness/model pairs and that harness is authenticated; it writes the agent and workflow files, appends those selectors to `.kxm/routes.yaml`, and skips every other candidate. Google candidates are not on the map and are always skipped, because the Runtime's Pi one-shot cannot reach Google's `antigravity` Pi provider yet (see [Harness routing](harness-routing.md#google-through-the-antigravity-pi-provider)).
|
|
187
|
-
- JSON keys: `action` (`planned`, `created`, `joined`, `repaired`, `resumed`, or `validated`), `mode`, `inspectedFrom`, `projectRoot`, `changesRequired`, `legacyInputs`, `issues`, `configRevision`, `files`, `plannedOnly`, and, when relevant, `localBindingFile`, `bindingsChanged`, `repairPlan`, `resumePending`, `transactionKind`.
|
|
189
|
+
- JSON keys: `action` (`planned`, `created`, `joined`, `repaired`, `resumed`, or `validated`), `mode`, `inspectedFrom`, `projectRoot`, `changesRequired`, `legacyInputs`, `issues`, `configRevision`, `files`, `plannedOnly`, and, when relevant, `guidance`, `localBindingFile`, `bindingsChanged`, `repairPlan`, `resumePending`, `transactionKind`.
|
|
188
190
|
- Exit 0 for every completed action and every dry-run plan. Exit 1 when the result is planning-only (legacy state, blocked repair, partial state without provenance) or for `initialization_failed` (with `issues`) and `initialization_io_failed`. A planning-only text result prints the reason and then one `<file>: <code>: <message>` line per validation issue, for example `.kxm/workflows/first.yaml: gate_outcome_impossible: ...`.
|
|
189
191
|
|
|
190
192
|
Preview what a new project would contain:
|
|
@@ -882,8 +884,9 @@ Probes the built-in harness catalog (`pi`, `claude`, `kimi`, `codex`, `deepseek`
|
|
|
882
884
|
|
|
883
885
|
No command-specific options.
|
|
884
886
|
|
|
885
|
-
- Reads only. No hub needed.
|
|
887
|
+
- Reads only. No hub needed. In a KXM project, `defaultHarness` and the inventory's default marker reflect `.kxm/project.yaml`; outside a project they default to Pi. Invalid project configuration must be repaired before the project default can be resolved.
|
|
886
888
|
- JSON keys: `defaultHarness`, `harnesses` (each with `id`, `label`, `default`, `mode`, `detected`, `authenticated`, `dispatch` (`status`, `supported`, `reason`), `canUpdate` (`self`, `extensions`, `models`), `issues`).
|
|
889
|
+
- Errors: `harness_list_failed` with configuration `issues`, or `harness_list_io_failed` (exit 1); both honor `--json` and write to stderr without claiming a fallback project default.
|
|
887
890
|
- `dispatch` is `yes` only when the harness is detected, has an audited read-only one-shot profile, and is authenticated. Otherwise the first failing check gives the reason: `not_detected`, `no_headless_mode`, `permission_profile_unaudited` (a detected `deepseek`), `not_authenticated`, or the auth issue when login state is unknown (`auth_context_required` for Pi, `auth_unknown`, `auth_unparsed`, or another `auth_*` code).
|
|
888
891
|
|
|
889
892
|
Captured with no harness CLIs on `PATH`:
|
|
@@ -893,7 +896,7 @@ kxm harness list
|
|
|
893
896
|
```
|
|
894
897
|
|
|
895
898
|
```text
|
|
896
|
-
default harness: pi (
|
|
899
|
+
default harness: pi (used when an agent omits harness:)
|
|
897
900
|
enable/disable = Git YAML (.kxm/agents, .kxm/models) or the harness's own plugin CLI
|
|
898
901
|
governed kxm skills are not auto-updated
|
|
899
902
|
id default detected auth dispatch updates
|
|
@@ -1383,12 +1386,12 @@ dry run: resume workflow run wf_dry_run (stage: review)
|
|
|
1383
1386
|
kxm run <workflow> [prompt...]
|
|
1384
1387
|
```
|
|
1385
1388
|
|
|
1386
|
-
Create a KXM run
|
|
1389
|
+
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`.
|
|
1387
1390
|
|
|
1388
1391
|
- 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).
|
|
1389
1392
|
- No command-specific options. Refuses `--workspace` (exit 2).
|
|
1390
1393
|
- 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.
|
|
1391
|
-
- JSON keys: `
|
|
1394
|
+
- 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.
|
|
1392
1395
|
- 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).
|
|
1393
1396
|
- 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`.
|
|
1394
1397
|
|
|
@@ -1416,7 +1419,12 @@ kxm run default "Fix the flaky login test"
|
|
|
1416
1419
|
|
|
1417
1420
|
```text
|
|
1418
1421
|
run created: run_a80e84c98f514299b82f0157f4537ea3 (home rtm_1a42e069…, config sha256:b45f8f51a506…)
|
|
1419
|
-
|
|
1422
|
+
No steps executed. Project default harness: pi; per-agent harness settings take precedence.
|
|
1423
|
+
Live prerequisite (...): ...
|
|
1424
|
+
Live execution uses one-shot harness calls; no hub or Pi worker is required. Check installation/authentication with kxm harness list.
|
|
1425
|
+
Resolve the prerequisites above, then execute: kxm runs drive run_a80e84c98f514299b82f0157f4537ea3 --wait
|
|
1426
|
+
Inspect: kxm runs status run_a80e84c98f514299b82f0157f4537ea3 --json; receipt: kxm runs receipt run_a80e84c98f514299b82f0157f4537ea3 --json; cancel: kxm runs cancel run_a80e84c98f514299b82f0157f4537ea3
|
|
1427
|
+
These are local Runtime runs, not webhook workflows; use kxm runs, not kxm workflow get.
|
|
1420
1428
|
```
|
|
1421
1429
|
|
|
1422
1430
|
## `kxm runs`
|
|
@@ -1965,6 +1973,8 @@ kxm workflow add [workflowId] [--template <name> | --file <path> | --pick [selec
|
|
|
1965
1973
|
|
|
1966
1974
|
Add a workflow definition to global or local configuration. With `--template <name>`, the named built-in template is written under the workflow ID. Without a workflow ID, or with `--pick`, you choose from the built-in templates and, for local scope, existing global definitions; a global definition with a template's ID is not offered. The choice is written under its own ID with its content: the template, or a copy of the global definition's file, with `--description` replacing its description. With `--file`, the YAML file is copied as-is once it passes the local check below. Otherwise a one-step scaffold is written: one `implementer` agent step with write access to `control` that ends the run `completed` on `passed` and `failed` on `failed`.
|
|
1967
1975
|
|
|
1976
|
+
IDs are flat, portable lowercase slugs, at most 64 characters: use `bug-fix`, not `software-engineering/bug-fix`. Paths, traversal, and reserved platform names fail before writing. Imported definitions must use `kxm.workflow.v1`, with `agent` rather than legacy `role` steps and no top-level `id`; installation validates the runner's restricted YAML, schema, and transitions before creating directories or replacing a file. `--pick` copies a selected global definition, honors `--description`, and preserves an explicit destination ID. A global definition is not silently replaced with a scaffold.
|
|
1977
|
+
|
|
1968
1978
|
| Option | Argument | Default | Description |
|
|
1969
1979
|
|---|---|---|---|
|
|
1970
1980
|
| `--file` | `<path>` | none | Path to YAML workflow definition file |
|
|
@@ -1977,8 +1987,8 @@ Add a workflow definition to global or local configuration. With `--template <na
|
|
|
1977
1987
|
- Templates: `implement-and-verify` runs the `implementer` agent, then the project's `test` gate, and a failing gate (`implementation-failure`) sends the work back to `implement` at most twice. `dual-critic-review` adds two review steps between them, both run as the `coordinator` agent with read access; point `review-arch` and `review-cli` at your own agents for independent critics. `spec-and-plan` plans and then reviews the plan, both as `coordinator`, reading the repository only.
|
|
1978
1988
|
- The templates and the scaffold are valid `kxm.workflow.v1` definitions that use only what `kxm init` creates: the `coordinator` and `implementer` agents, the `control` repository, and the `test` gate. Each was checked with `kxm init --json` and `kxm run <id> --dry-run` for this page. A new file under `.kxm/workflows/` is a permission expansion that `kxm trust check` asks you to review before you commit it.
|
|
1979
1989
|
- Writes `<scope dir>/workflows/<id>.yaml`. `kxm run` loads only `.kxm/workflows/`, so a `--scope global` definition is not runnable until it is copied into a project. `--dry-run` plans the write and writes nothing.
|
|
1980
|
-
- Local scope belongs to a KXM project: the file lands in the project root's `.kxm/workflows/` from any subdirectory, and outside a project the command refuses with `project_not_found` and creates nothing. Before writing, the project loader checks the project with the new document in place of any file of that ID, using the parser, schema and bundle rules `kxm run` uses. If the project would not load, the command refuses with `workflow_invalid`, lists each issue and writes nothing, also under `--dry-run`. So `--file` or a picked global definition with a top-level `id` or a `role:` step, the shape `workflow add` wrote through 0.7.92, is refused, and `--overwrite` replaces a file left in that shape. Global
|
|
1981
|
-
- Refusals exit 2 and honor `--json`: `workflow_template_unknown` (the text names the three templates), `workflow_id_required` (no workflow ID), `workflow_add_conflict` (`--template` combined with `--file` or `--pick`), `project_not_found`, and `workflow_invalid` (with `issues`, each `{phase, code, file, message}`).
|
|
1990
|
+
- Local scope belongs to a KXM project: the file lands in the project root's `.kxm/workflows/` from any subdirectory, and outside a project the command refuses with `project_not_found` and creates nothing. Before writing, the project loader checks the project with the new document in place of any file of that ID, using the parser, schema and bundle rules `kxm run` uses. If the project would not load, the command refuses with `workflow_invalid`, lists each issue and writes nothing, also under `--dry-run`. So `--file` or a picked global definition with a top-level `id` or a `role:` step, the shape `workflow add` wrote through 0.7.92, is refused, and `--overwrite` replaces a file left in that shape. Global definitions receive ID, schema and transition checks, but have no project references to validate.
|
|
1991
|
+
- Refusals exit 2 and honor `--json`: `workflow_template_unknown` (the text names the three templates), `workflow_id_required` (no workflow ID), `workflow_add_conflict` (`--template` combined with `--file` or `--pick`), `project_not_found`, and `workflow_invalid` (with `issues`, each `{phase, code, file, message}`). Other input, file and overwrite failures exit 1 with `workflow_add_failed` and `message`. No failure writes the destination, and dry runs do not create missing local, global, or runtime directories.
|
|
1982
1992
|
- JSON keys: `workflowId`, `id`, `filePath`, `scope`.
|
|
1983
1993
|
|
|
1984
1994
|
Start a first workflow from a template:
|
|
@@ -2071,17 +2081,23 @@ Validates workflow definitions and operates evidence gates. The group has exactl
|
|
|
2071
2081
|
kxm gate validate [--file <path>]
|
|
2072
2082
|
```
|
|
2073
2083
|
|
|
2074
|
-
|
|
2084
|
+
Validate workflow definitions without printing secrets. An explicit `--file` accepts a local `kxm.workflow.v1` YAML/JSON mapping or a webhook JSON array. Local mappings use the runner's restricted YAML parser, schema, and transition compiler; use `kxm init --dry-run` to also validate project references. Without `--file`, `KXM_WEBHOOK_WORKFLOWS_FILE` or inline `KXM_WEBHOOK_WORKFLOWS` remain webhook-only JSON sources, exactly as the hub loads them.
|
|
2075
2085
|
|
|
2076
2086
|
| Option | Argument | Default | Description |
|
|
2077
2087
|
|---|---|---|---|
|
|
2078
2088
|
| `--file` | `<path>` | configured source | Workflow definition file |
|
|
2079
2089
|
|
|
2080
|
-
-
|
|
2090
|
+
- For webhook definitions, each `secretEnv` must name a set variable holding at least 16 characters (likewise `signalSecretEnv` when declared); otherwise parsing fails.
|
|
2081
2091
|
- Reads definitions; appends telemetry. No hub needed.
|
|
2082
|
-
- JSON keys: `source`, `file`, `workflows`
|
|
2092
|
+
- JSON keys: `source`, `file`, `workflows`, `warnings`; local entries contain `id` and `schema`, while webhook entries contain `id`, `secretConfigured`, and `signalSecretConfigured`. `outcome` is `warning` when warnings exist.
|
|
2083
2093
|
- Exit 2 for `workflow_source_required` or `ambiguous_workflow_source` (both variables set); exit 1 for `file_not_found` or a parse error.
|
|
2084
2094
|
|
|
2095
|
+
Validate an installed local template:
|
|
2096
|
+
|
|
2097
|
+
```bash
|
|
2098
|
+
kxm gate validate --file .kxm/workflows/bug-fix.yaml
|
|
2099
|
+
```
|
|
2100
|
+
|
|
2085
2101
|
```bash
|
|
2086
2102
|
KXM_WORKFLOW_SECRET="$SECRET" kxm gate validate --file workflows.json
|
|
2087
2103
|
```
|
|
@@ -2523,19 +2539,20 @@ Workflow: default
|
|
|
2523
2539
|
kxm task run <taskId>
|
|
2524
2540
|
```
|
|
2525
2541
|
|
|
2526
|
-
|
|
2542
|
+
Prepare a local run from a task's objective and assigned workflow, or the project's `defaultWorkflow` when none is assigned. Read-only live preflight reports unsupported steps, limits, gates, harnesses, or model routes before creating a run. Unsupported work exits 1 with `run_execution_unavailable`, `defaultHarness`, and `execution.prerequisites`; neither the task nor Runtime is mutated. In particular, Claude-only writer work receives the read-only harness limitation instead of a dead-end created run.
|
|
2527
2543
|
|
|
2528
|
-
-
|
|
2529
|
-
-
|
|
2544
|
+
- On compatible configuration, output is that of [`kxm run`](#kxm-run): creation only, `execution.status: not_started`, and explicit live drive/status/receipt commands. Authentication is checked on dispatch, not certified by creation. Task status is not changed to `in_progress` merely because a run exists.
|
|
2545
|
+
- `--dry-run` applies the same live preflight and plans only the run request, with no task write or process start. JSON includes `taskId`, the unchanged task `status`, `projectRoot`, `workflowId`, `configRevision`, `defaultHarness`, `prerequisites`, `execution`, `dryRun`, and `planned`.
|
|
2546
|
+
|
|
2547
|
+
For a task assigned a configured, supported read-only workflow, a dry-run excerpt is:
|
|
2530
2548
|
|
|
2531
2549
|
```bash
|
|
2532
2550
|
kxm task run task_4f79c0833e41 --dry-run
|
|
2533
2551
|
```
|
|
2534
2552
|
|
|
2535
2553
|
```text
|
|
2536
|
-
dry run:
|
|
2554
|
+
dry run: create workflow architecture-spike for task task_4f79c0833e41; task status stays todo until work actually starts
|
|
2537
2555
|
would request POST kxm-runtime /v1/runs (starts the Runtime supervisor if it is not running)
|
|
2538
|
-
would write /work/proj/.kxm/tasks/task_4f79c0833e41.yaml
|
|
2539
2556
|
```
|
|
2540
2557
|
|
|
2541
2558
|
### `kxm task sync`
|
|
@@ -2617,30 +2634,20 @@ kxm goal list
|
|
|
2617
2634
|
kxm suggest <prompt...>
|
|
2618
2635
|
```
|
|
2619
2636
|
|
|
2620
|
-
Recommends a workflow
|
|
2637
|
+
Recommends a flat workflow ID backed by a shipped template, with category metadata and explicit execution prerequisites. The install command creates a definition only; it does not create or drive a run.
|
|
2621
2638
|
|
|
2622
|
-
-
|
|
2623
|
-
-
|
|
2624
|
-
-
|
|
2625
|
-
-
|
|
2639
|
+
- Explicit `Claude only`, `Claude-only`, or `only Claude Code` constraints exclude other harnesses. A missing, unauthenticated, or unsupported required harness produces `harness_unavailable`; KXM never silently substitutes Grok or Codex.
|
|
2640
|
+
- A write workflow requires an audited writer profile for the selected harness. Only Pi and Grok currently have one; Claude-only bug fixes produce `live_write_unsupported` with direct-Claude implementation guidance, never a Grok substitution. No misleading create/drive command is emitted for an unsupported profile.
|
|
2641
|
+
- For supported work, every suggested agent binding uses the selected detected, authenticated, dispatch-ready harness. Configure its compatible admitted model, install the exact template, validate project configuration, then use the separate create/live-drive/status/receipt commands. Writers also require single-assignment/single-run admission, any configured developer-roster writer approval, and the repository's actual verification gate. An already-present recommended workflow ID produces `workflow_already_exists`; KXM will not assume its agents or permissions match the template.
|
|
2642
|
+
- Arguments: `<prompt...>`; no command-specific options. No hub needed. `--dry-run` skips native authentication probes to avoid their side effects and does not claim verified availability.
|
|
2643
|
+
- JSON keys: `prompt`, `workflowId`, `template`, `area`, `confidence`, `reasons`, `suggestedSkills`, `roles` (an array of `{agent, harness, role}`), `suggestedCommand` (installation only), and `execution`. Supported execution includes `prerequisites`, `shell`, `createCommand`, `driveCommand`, `statusCommand`, and `receiptCommand`; refusal includes `error`, `reason`, and `nextSteps`, sets `ok: false`, and exits 1.
|
|
2626
2644
|
|
|
2627
2645
|
```bash
|
|
2628
|
-
kxm suggest "
|
|
2646
|
+
kxm suggest "Fix a bug in an isolated worktree using Claude only" --json
|
|
2629
2647
|
```
|
|
2630
2648
|
|
|
2631
2649
|
```text
|
|
2632
|
-
|
|
2633
|
-
Confidence: 65%
|
|
2634
|
-
Reasons: Matched keywords: add
|
|
2635
|
-
Suggested Skills: kxm-workflow, kxm-peer, kxm-context-memory
|
|
2636
|
-
Roles:
|
|
2637
|
-
Planner: claude (fable)
|
|
2638
|
-
Writer: grok (grok-4.6)
|
|
2639
|
-
Critics: claude:fable, codex:gpt-5.6-sol
|
|
2640
|
-
Verifier: npm run verify
|
|
2641
|
-
|
|
2642
|
-
Execute with:
|
|
2643
|
-
kxm run software-engineering/feature-implementation "Add retry with backoff to the payment webhook handler"
|
|
2650
|
+
{"ok":false,"workflowId":"bug-fix","template":"implement-and-verify","roles":[],"suggestedCommand":"kxm workflow add bug-fix --template implement-and-verify","error":"live_write_unsupported",...}
|
|
2644
2651
|
```
|
|
2645
2652
|
|
|
2646
2653
|
## `kxm explain`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workflow definition reference
|
|
2
2
|
|
|
3
|
-
KXM has two kinds of workflow definition. A **webhook workflow definition** is JSON that the [hub](../glossary.md#hub) loads; a signed webhook starts a run, and one coordinator agent works through its ordered **stages**. A **Runtime workflow** is a `kxm.workflow.v1` YAML file in your project; `kxm run`
|
|
3
|
+
KXM has two kinds of workflow definition. A **webhook workflow definition** is JSON that the [hub](../glossary.md#hub) loads; a signed webhook starts a run, and one coordinator agent works through its ordered **stages**. A **Runtime workflow** is a `kxm.workflow.v1` YAML file in your project; `kxm run` creates a run, and `kxm runs drive` executes supported **steps**. This page compares the two, documents every field of the JSON format, and summarizes the YAML format with links to its full reference.
|
|
4
4
|
|
|
5
5
|
## Two workflow systems
|
|
6
6
|
|
|
@@ -10,12 +10,12 @@ KXM has two kinds of workflow definition. A **webhook workflow definition** is J
|
|
|
10
10
|
| Location | Any JSON file named by `KXM_WEBHOOK_WORKFLOWS_FILE`, or inline in `KXM_WEBHOOK_WORKFLOWS` | `.kxm/workflows/<id>.yaml`, tracked in Git |
|
|
11
11
|
| Loaded by | The hub, once at start | Every project load (`kxm init`, `kxm run`) |
|
|
12
12
|
| Units | Stages, in order | Steps, connected by typed transitions |
|
|
13
|
-
| Started by | A signed `POST /v1/webhooks/<id>`, or `kxm workflow start` | `kxm run <workflow> [prompt]` |
|
|
13
|
+
| Started by | A signed `POST /v1/webhooks/<id>`, or `kxm workflow start` | Create with `kxm run <workflow> [prompt]`, execute with `kxm runs drive <runId> --wait` |
|
|
14
14
|
| Who does the work | One coordinator agent, prompted with every stage, using the [workflow tools](tools.md#workflow-tools) | The Runtime: agent steps through a model producer, gate steps by running `.kxm/gates.yaml` commands |
|
|
15
15
|
| Evidence | Keyed strings plus verified peer replies | Gate evidence the Runtime records itself |
|
|
16
16
|
| External results | `kxm_workflow_wait`, then a signed signal | Recovery signals only; `wait` steps compile but are not matched yet |
|
|
17
17
|
| Inspect with | `kxm_workflow_get`, `kxm workflow get`, `kxm dash` | `kxm runs status`, `kxm runs list` |
|
|
18
|
-
| Validate with | `kxm gate validate` | `kxm init --dry-run
|
|
18
|
+
| Validate with | `kxm gate validate` | `kxm gate validate --file <yaml>` (schema/transitions), `kxm init --dry-run` (project references), `kxm run --dry-run` (run prerequisites) |
|
|
19
19
|
|
|
20
20
|
Both kinds of run have IDs of the form `run_<32 hex>`. The journal, checkpoints and waits belong to webhook runs only.
|
|
21
21
|
|
|
@@ -274,7 +274,7 @@ A Runtime workflow is a YAML file whose name is its ID. The [configuration file
|
|
|
274
274
|
| Agent steps | The model returns a JSON `outcome` from the step's declared keys; anything else becomes `failed`, so declare `failed` | [Transitions and outcomes](config-reference.md#transitions-and-outcomes) |
|
|
275
275
|
| Not executed yet | Some valid fields make the Runtime hand the run off (`step_unsupported`, `gate_unsupported`, `limit_unsupported`) instead of executing | [Steps the Runtime does not execute yet](config-reference.md#steps-the-runtime-does-not-execute-yet) |
|
|
276
276
|
|
|
277
|
-
`kxm workflow add --template
|
|
277
|
+
`kxm workflow add bug-fix --template implement-and-verify` writes a valid starting file; `dual-critic-review` and `spec-and-plan` are also available. IDs are flat filename-derived slugs, not catalog paths such as `software-engineering/bug-fix`. Installation validates YAML/schema/transitions before writing, including under `--dry-run`. `kxm run <workflow>` creates a run and reports live prerequisites and separate `runs drive/status/receipt` commands. Current live one-shot profiles are read-only, so a writer template can validate but cannot execute live; `task run` refuses incompatible work before creating a run or changing the task. Simulation remains explicitly available and is not proof of implementation. See [`kxm run`](cli-reference.md#kxm-run) and [`kxm runs`](cli-reference.md#kxm-runs).
|
|
278
278
|
|
|
279
279
|
## Related
|
|
280
280
|
|
|
@@ -153,13 +153,17 @@ The hash is the project's configuration revision, the same one `kxm trust diff`
|
|
|
153
153
|
kxm run first "Plan a hello script"
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
Creation output includes:
|
|
157
157
|
|
|
158
158
|
```text
|
|
159
159
|
run created: run_<id> (home rtm_<id>…, config sha256:<revision>…)
|
|
160
|
-
|
|
160
|
+
No steps executed. Project default harness: pi; per-agent harness settings take precedence.
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
+
The remaining output lists live prerequisites and the commands for `runs drive`,
|
|
164
|
+
`runs status`, and `runs receipt`. A created run is not an executed workflow;
|
|
165
|
+
the deliberate simulation below does not require a live authenticated model.
|
|
166
|
+
|
|
163
167
|
`kxm run` starts the Runtime supervisor if it is not running. Check the new run, using the run ID from the output:
|
|
164
168
|
|
|
165
169
|
```bash
|
|
@@ -38,6 +38,16 @@ In an interactive terminal, `kxm init` then offers shell completion and workflow
|
|
|
38
38
|
|
|
39
39
|
> [!TIP]
|
|
40
40
|
> If your tests do not run with `npm test`, change `gates.test.argv` in `.kxm/gates.yaml` now, before you commit.
|
|
41
|
+
>
|
|
42
|
+
> The starter settings are not repository detection. For a Claude project, set
|
|
43
|
+
> `defaultHarness: claude` in `.kxm/project.yaml`, update any explicit `harness` overrides
|
|
44
|
+
> in `.kxm/agents/*.yaml`, and configure compatible agent models;
|
|
45
|
+
> `kxm harness list` reports that project default. Claude's Runtime one-shot profile is
|
|
46
|
+
> read-only: a Claude-only bug-fix suggestion or incompatible `task run`
|
|
47
|
+
> refuses with prerequisites rather than substituting another writer. Implement
|
|
48
|
+
> directly in Claude Code, or use a genuinely read-only Runtime workflow. A local
|
|
49
|
+
> `kxm run` only creates a run; execute supported work with `kxm runs drive <runId>
|
|
50
|
+
> --wait` and inspect it with `kxm runs status`, not `kxm workflow get`.
|
|
41
51
|
|
|
42
52
|
### 2. Ignore runtime state and commit `.kxm/`
|
|
43
53
|
|
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.105",
|
|
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",
|