@kontextmind/kxm 0.7.94 → 0.7.96
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/README.md +39 -9
- package/CHANGELOG.md +1 -1
- package/README.md +147 -257
- package/SECURITY.md +21 -12
- package/docs/README.md +133 -54
- package/docs/adr/ADR-0002-browser-automation-steel-doks.md +24 -18
- package/docs/adr/ADR-0003-sqlite-only-store.md +100 -0
- package/docs/adr/ADR-0004-edge-identity-authentik.md +99 -0
- package/docs/adr/README.md +33 -0
- package/docs/concepts/architecture.md +262 -0
- package/docs/concepts/data-and-storage.md +194 -0
- package/docs/concepts/trust-model.md +152 -0
- package/docs/contracts/README.md +22 -14
- package/docs/contracts/effects-and-recovery.md +3 -0
- package/docs/contracts/migration.md +2 -2
- package/docs/contracts/routing.md +6 -5
- package/docs/contributing/assignment-runner.md +388 -0
- package/docs/contributing/ci-and-release.md +231 -0
- package/docs/contributing/development.md +362 -0
- package/docs/contributing/harness-routing-internals.md +192 -0
- package/docs/{packages.md → contributing/packages.md} +13 -15
- package/docs/{skills → contributing}/repo-work-delivery.md +20 -21
- package/docs/contributing/test-matrix.md +208 -0
- package/docs/{tui-components.md → contributing/tui-components.md} +30 -22
- package/docs/contributing/writing-docs.md +340 -0
- package/docs/glossary.md +471 -0
- package/docs/guides/agent-skills.md +137 -0
- package/docs/guides/browser-automation.md +160 -0
- package/docs/guides/context-and-memory.md +352 -0
- package/docs/guides/continuous-improvement.md +228 -0
- package/docs/guides/governed-skills.md +173 -0
- package/docs/guides/nous-providers.md +186 -0
- package/docs/guides/peer-messaging.md +304 -0
- package/docs/guides/pi-workers.md +219 -0
- package/docs/guides/provenance-gates.md +313 -0
- package/docs/guides/webhook-workflows.md +364 -0
- package/docs/kb/how-credentials-retrieved-safely.md +38 -12
- package/docs/kb/how-to-capture-and-annotate-section.md +15 -13
- package/docs/kb/how-to-connect-playwright-to-steel.md +16 -11
- package/docs/kb/how-to-recover-expired-session-or-orphan.md +26 -16
- package/docs/kb/how-to-resume-after-mfa.md +19 -11
- package/docs/kb/how-to-take-over-session.md +17 -13
- package/docs/kb/why-authentication-disappeared.md +22 -14
- package/docs/kb/why-automation-opened-different-browser.md +23 -14
- package/docs/kb/why-session-viewer-cannot-control.md +13 -12
- package/docs/operations/backup-and-restore.md +248 -0
- package/docs/operations/deploy.md +307 -0
- package/docs/operations/monitoring.md +209 -0
- package/docs/operations/runtime-sync.md +192 -0
- package/docs/operations/troubleshooting.md +265 -0
- package/docs/operations/upgrade.md +124 -0
- package/docs/prompts/browser-annotate-feedback.md +7 -7
- package/docs/prompts/browser-diagnose-recover.md +11 -10
- package/docs/prompts/browser-explore.md +7 -7
- package/docs/prompts/browser-repro-fix.md +7 -7
- package/docs/prompts/browser-start.md +12 -11
- package/docs/prompts/browser-takeover.md +8 -8
- package/docs/{cli-reference.md → reference/cli-reference.md} +83 -41
- package/docs/{config-reference.md → reference/config-reference.md} +159 -148
- package/docs/reference/configuration.md +299 -0
- package/docs/reference/harness-routing.md +508 -0
- package/docs/reference/http-api.md +203 -0
- package/docs/reference/tools.md +370 -0
- package/docs/{workflow-guide.md → reference/workflow-catalog.md} +92 -153
- package/docs/reference/workflow-definitions.md +286 -0
- package/docs/start/first-workflow.md +287 -0
- package/docs/start/install.md +146 -0
- package/docs/start/quickstart-claude-code.md +405 -0
- package/docs/start/quickstart-pi.md +213 -0
- package/docs/templates/README.md +78 -73
- package/docs/templates/adr.md +13 -13
- package/docs/templates/architecture.md +55 -71
- package/docs/templates/bug-fix.md +13 -16
- package/docs/templates/feature.md +14 -19
- package/docs/templates/handoff.md +44 -46
- package/docs/templates/postmortem.md +30 -43
- package/docs/templates/research.md +15 -20
- package/docs/templates/review.md +49 -50
- package/docs/templates/runbook.md +38 -30
- package/docs/templates/test-plan.md +16 -23
- package/docs/templates/test-report.md +14 -17
- package/examples/README.md +9 -5
- package/examples/provenance-workflow.json +1 -1
- package/examples/webhook-workflows/jira-development.json +59 -0
- package/examples/webhook-workflows/jira-issue-updated.json +12 -0
- package/package.json +2 -2
- package/packages/core/tui/README.md +1 -1
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/README.md +31 -32
- package/plugins/kxm/dist/cli.js +5 -5
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/runtime.js +1 -1
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/skills/kxm/references/protocol.md +3 -1
- package/plugins/kxm/skills/kxm-browser-auth/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-browser-diagnostics/SKILL.md +5 -5
- package/plugins/kxm/skills/kxm-browser-explore/SKILL.md +2 -2
- package/plugins/kxm/skills/kxm-browser-session/SKILL.md +10 -13
- package/plugins/kxm/skills/kxm-browser-takeover/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-browser-verify/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-context-memory/SKILL.md +13 -4
- package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +3 -1
- package/plugins/kxm/skills/kxm-mind-setup/SKILL.md +2 -1
- package/plugins/kxm/skills/kxm-project-setup/SKILL.md +31 -54
- package/plugins/kxm/skills/kxm-projects/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-protocol/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-routing-improve/SKILL.md +15 -7
- package/plugins/kxm/skills/kxm-runs/SKILL.md +11 -5
- package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-tasks/SKILL.md +9 -7
- package/plugins/kxm/skills/kxm-workflow/SKILL.md +10 -2
- package/plugins/kxm/src/cli/system.ts +1 -1
- package/plugins/kxm/src/cli.ts +3 -3
- package/plugins/kxm/src/init-guide-setup.ts +1 -1
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/modes.ts +1 -1
- package/schemas/README.md +1 -1
- package/docs/agent-communication-envelopes-and-gates.md +0 -553
- package/docs/agent-skills.md +0 -198
- package/docs/architecture.md +0 -245
- package/docs/assignment-runner.md +0 -264
- package/docs/browser-automation.md +0 -139
- package/docs/configuration.md +0 -437
- package/docs/continuous-improvement.md +0 -226
- package/docs/getting-started.md +0 -277
- package/docs/harness-routing.md +0 -616
- package/docs/kb/qa-authentik-authentication.md +0 -97
- package/docs/kb/qa-extension-install-and-hub-bootstrap.md +0 -85
- package/docs/kb/qa-hub-on-a-public-host.md +0 -48
- package/docs/kb/qa-sqlite-vs-duckdb.md +0 -35
- package/docs/kb/qa-what-the-hub-stores.md +0 -64
- package/docs/kxm-handbook.md +0 -1181
- package/docs/operations.md +0 -510
- package/docs/operator-pi-packages.md +0 -67
- package/docs/provenance-gates.md +0 -295
- package/docs/skills.md +0 -47
- package/docs/test-matrix.md +0 -132
- package/docs/troubleshooting.md +0 -293
- package/docs/webhook-workflows.md +0 -240
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Browser automation
|
|
2
|
+
|
|
3
|
+
Give agents a real browser without giving them your desktop: KXM's browser skills drive a remote [Steel](https://github.com/steel-dev/steel-browser) browser that you host, explore pages with `agent-browser`, verify fixes with Playwright, and hand control to a person for login, MFA or consent. This page is for developers and operators. The `browser` mode names this page as its context file (`kxm explain --mode browser` counts it), so it stays short and procedure-first.
|
|
4
|
+
|
|
5
|
+
## Before you begin
|
|
6
|
+
|
|
7
|
+
- A Steel deployment you operate, reachable over HTTPS, and its API key. [ADR-0002](../adr/ADR-0002-browser-automation-steel-doks.md) describes the reference deployment on Kubernetes.
|
|
8
|
+
- `curl` and `jq`. Optionally `agent-browser` for exploration and Playwright for tests.
|
|
9
|
+
- A secret manager for the API key. The bundled skills use `pass-cli`.
|
|
10
|
+
- The `kxm-browser-*` skills from the plugin or Pi package. See [Agent skills](agent-skills.md#browser-automation-skills).
|
|
11
|
+
|
|
12
|
+
## Components
|
|
13
|
+
|
|
14
|
+
| Component | Role |
|
|
15
|
+
|---|---|
|
|
16
|
+
| Steel | Runs isolated Chromium sessions and exposes a REST API, a CDP WebSocket and a session viewer |
|
|
17
|
+
| `agent-browser` | Fast, token-efficient exploration: accessibility snapshots, navigation, DOM inspection |
|
|
18
|
+
| Playwright | Assertions, bug reproductions, visual proof and permanent regression tests |
|
|
19
|
+
| Secret manager | The only place the Steel API key and site credentials live |
|
|
20
|
+
| Human operator | Completes MFA, CAPTCHA, SSO or consent in the session viewer |
|
|
21
|
+
|
|
22
|
+
## Configure the Steel endpoint
|
|
23
|
+
|
|
24
|
+
The KXM browser library reads these variables, and the shell procedure below uses the same names so both agree.
|
|
25
|
+
|
|
26
|
+
| Variable | Default | Effect |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `STEEL_API_URL` | A KontextMind-operated deployment | Base URL of your Steel API. Always set it |
|
|
29
|
+
| `STEEL_UI_URL` | `$STEEL_API_URL/ui` | Base URL of the session viewer |
|
|
30
|
+
| `STEEL_API_KEY` | A `pass-cli` lookup | The API key. When unset, the library runs a `pass-cli` lookup of a fixed KontextMind vault item |
|
|
31
|
+
| `USE_PASS_CLI` | enabled | Set to `false` to disable that `pass-cli` fallback |
|
|
32
|
+
|
|
33
|
+
> [!WARNING]
|
|
34
|
+
> Set `STEEL_API_URL` and `STEEL_API_KEY` explicitly. Without them the library falls back to KontextMind's own deployment and vault item, which are not yours to use.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export STEEL_API_URL="https://steel.example.com"
|
|
38
|
+
# Read the key from your secret manager; <vault> and <item> are yours.
|
|
39
|
+
export STEEL_API_KEY="$(pass-cli item view --vault-name '<vault>' --item-title '<item>' --field STEEL_API_KEY)"
|
|
40
|
+
export USE_PASS_CLI=false
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Endpoint | Purpose |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `POST /v1/sessions` | Create a session; body `{"timeout": <ms>}` |
|
|
46
|
+
| `GET /v1/sessions/<id>` | Inspect one session; `GET /v1/sessions` lists them all |
|
|
47
|
+
| `POST /v1/sessions/<id>/release` | Release a session |
|
|
48
|
+
| `POST /v1/scrape`, `POST /v1/screenshot` | One-shot page fetch or screenshot without a session |
|
|
49
|
+
| `wss://<steel-host>/v1/devtools?sessionId=<id>&apiKey=<key>` | CDP endpoint for `agent-browser` and Playwright |
|
|
50
|
+
| `$STEEL_UI_URL?sessionId=<id>` | Session viewer for human takeover |
|
|
51
|
+
|
|
52
|
+
The CDP URL carries the API key in its query string. Treat it as a secret: never paste it into chat, a prompt, an issue or a log.
|
|
53
|
+
|
|
54
|
+
## Run a browser task
|
|
55
|
+
|
|
56
|
+
1. Define a helper that sends the key as a header read from standard input, so it never appears in a process list:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
steel() { # usage: steel METHOD PATH [JSON-BODY]
|
|
60
|
+
local args=(-sS -X "$1" "$STEEL_API_URL$2" -H @- -H 'Content-Type: application/json')
|
|
61
|
+
if [ -n "${3:-}" ]; then args+=(-d "$3"); fi
|
|
62
|
+
printf 'x-steel-api-key: %s\n' "$STEEL_API_KEY" | curl "${args[@]}"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. Create a session. Use one session per task; 300,000 ms (5 minutes) is the default. Your Steel deployment sets the maximum; the skills assume 30 minutes.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
SESSION_ID=$(steel POST /v1/sessions '{"timeout": 300000}' | jq -r .id)
|
|
70
|
+
echo "Session: $SESSION_ID"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
3. Attach one automation client over CDP: `chromium.connectOverCDP(<cdp-url>)` in Playwright, or `agent-browser --cdp "<cdp-url>"`. Check the session's state with `steel GET "/v1/sessions/$SESSION_ID"`.
|
|
74
|
+
4. For a quick fetch that needs no session, scrape instead:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
steel POST /v1/scrape '{"url": "https://example.com"}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
5. Release the session when the task ends, even when it failed. Disconnecting a client does not release the session; it stays open for a human until it is released or times out.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
steel POST "/v1/sessions/$SESSION_ID/release"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
<details><summary>PowerShell</summary>
|
|
87
|
+
|
|
88
|
+
```powershell
|
|
89
|
+
$headers = @{ "x-steel-api-key" = $env:STEEL_API_KEY }
|
|
90
|
+
$session = Invoke-RestMethod -Method Post -Uri "$env:STEEL_API_URL/v1/sessions" -Headers $headers -ContentType "application/json" -Body '{"timeout": 300000}'
|
|
91
|
+
Invoke-RestMethod -Method Post -Uri "$env:STEEL_API_URL/v1/sessions/$($session.id)/release" -Headers $headers
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
## Hand control to a human
|
|
97
|
+
|
|
98
|
+
When a site asks for MFA, a CAPTCHA, SSO or sensitive consent, the agent stops and a person takes over. The diagram shows who controls the session in each state.
|
|
99
|
+
|
|
100
|
+
```mermaid
|
|
101
|
+
stateDiagram-v2
|
|
102
|
+
[*] --> AGENT_CONTROL: session created
|
|
103
|
+
AGENT_CONTROL --> HUMAN_CONTROL: login, MFA, CAPTCHA or consent needed
|
|
104
|
+
HUMAN_CONTROL --> VERIFY_AUTHENTICATION: operator confirms completion
|
|
105
|
+
VERIFY_AUTHENTICATION --> AGENT_CONTROL: agent confirms signed-in state
|
|
106
|
+
AGENT_CONTROL --> RELEASED: task done
|
|
107
|
+
HUMAN_CONTROL --> RELEASED: operator abandons
|
|
108
|
+
RELEASED --> [*]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
1. **Pause.** The agent stops all automated input and says why it needs a person.
|
|
112
|
+
2. **Share the viewer link.** It gives the operator `$STEEL_UI_URL?sessionId=<id>`, never the CDP URL.
|
|
113
|
+
3. **Operator acts.** The operator opens the viewer, completes the step, and confirms in the terminal, for example `auth complete`.
|
|
114
|
+
4. **Verify, then resume.** The agent inspects the page, confirms the signed-in state, refreshes its DOM snapshot, and only then continues.
|
|
115
|
+
|
|
116
|
+
The KXM browser library tracks these states in the process that owns the session. Steel itself does not know them; in a shell-driven task they are a protocol the agent announces. Only one controller, agent or human, acts at a time.
|
|
117
|
+
|
|
118
|
+
## Control cost and resources
|
|
119
|
+
|
|
120
|
+
- **Timeouts.** Sessions end on their own when the timeout expires. Set a longer timeout at creation when a person will need time for a login step.
|
|
121
|
+
- **Orphan sweeps.** List sessions with `steel GET /v1/sessions` and release any you do not track. The library flags untracked sessions older than 10 minutes, and tracked ones idle that long unless a human holds them.
|
|
122
|
+
- **Shared memory.** Give Chromium a large `/dev/shm`, or tabs crash. On Kubernetes, mount a memory-backed `emptyDir` there; the reference deployment uses 2 GiB.
|
|
123
|
+
- **No shared profiles.** Concurrent sessions must not write to the same browser profile.
|
|
124
|
+
|
|
125
|
+
## Troubleshooting
|
|
126
|
+
|
|
127
|
+
| Symptom | Cause | Fix |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `401` or `403` from Steel | Missing or wrong API key | Re-export `STEEL_API_KEY` from your secret manager |
|
|
130
|
+
| Requests go to an unexpected host | `STEEL_API_URL` is unset | Export it before starting the agent |
|
|
131
|
+
| Playwright opens a local browser | The client did not attach over CDP | Use `connectOverCDP` with the session's CDP URL |
|
|
132
|
+
| Signed-in state is gone | The session expired or was released | Create a new session and repeat the takeover |
|
|
133
|
+
| The viewer shows the page but clicks do nothing | The viewer is a screencast, and some capture modes do not forward clicks | Use the DevTools inspector at `$STEEL_API_URL/v1/devtools/inspector.html`, with the agent paused |
|
|
134
|
+
|
|
135
|
+
## Knowledge base
|
|
136
|
+
|
|
137
|
+
- [How are credentials retrieved without exposing them to the model?](../kb/how-credentials-retrieved-safely.md)
|
|
138
|
+
- [How do I capture a UI section and annotate changes for an agent?](../kb/how-to-capture-and-annotate-section.md)
|
|
139
|
+
- [How do I connect Playwright to the existing Steel session?](../kb/how-to-connect-playwright-to-steel.md)
|
|
140
|
+
- [How do I recover an expired session or remove an orphaned browser?](../kb/how-to-recover-expired-session-or-orphan.md)
|
|
141
|
+
- [How does an agent resume after MFA?](../kb/how-to-resume-after-mfa.md)
|
|
142
|
+
- [How do I take over a browser session to log in?](../kb/how-to-take-over-session.md)
|
|
143
|
+
- [Why did authentication disappear?](../kb/why-authentication-disappeared.md)
|
|
144
|
+
- [Why did automation open a different browser?](../kb/why-automation-opened-different-browser.md)
|
|
145
|
+
- [Why can I view a session but not control it?](../kb/why-session-viewer-cannot-control.md)
|
|
146
|
+
|
|
147
|
+
## Prompt templates
|
|
148
|
+
|
|
149
|
+
- [Starting browser work](../prompts/browser-start.md)
|
|
150
|
+
- [Exploring an application](../prompts/browser-explore.md)
|
|
151
|
+
- [Requesting human takeover](../prompts/browser-takeover.md)
|
|
152
|
+
- [Diagnosing and recovering a failed session](../prompts/browser-diagnose-recover.md)
|
|
153
|
+
- [Reproducing a UI bug and writing a Playwright test](../prompts/browser-repro-fix.md)
|
|
154
|
+
- [Capturing UI section annotations](../prompts/browser-annotate-feedback.md)
|
|
155
|
+
|
|
156
|
+
## Next steps
|
|
157
|
+
|
|
158
|
+
- The seven browser skills: [Agent skills](agent-skills.md#browser-automation-skills)
|
|
159
|
+
- Why Steel, and the reference deployment: [ADR-0002](../adr/ADR-0002-browser-automation-steel-doks.md)
|
|
160
|
+
- Estimate the `browser` mode's prompt footprint: [`kxm explain`](../reference/cli-reference.md#kxm-explain)
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# Context and memory
|
|
2
|
+
|
|
3
|
+
KXM gives every agent the same deterministic answer to "what does this project know?": a token-budgeted context packet assembled from durable records, temporal state that only changes through evidence-bound promotion, and memory authored in Git. This page is for operators and agent authors. After reading it you can assemble and inspect packets, promote state, write memory, and predict exactly what a Runtime agent receives.
|
|
4
|
+
|
|
5
|
+
What sets this apart:
|
|
6
|
+
|
|
7
|
+
- **Deterministic.** No model, clock or randomness takes part in selection, so the same records and request always give the same packet.
|
|
8
|
+
- **Provenance-bound.** Every item records where it came from, and its origin caps its authority. Summarizing an item never raises that authority.
|
|
9
|
+
- **Isolated.** A packet never mixes projects' stored records. A foreign item in the pool is refused, not filtered. One exception: a hub that serves several projects attaches its own checkout's authored memory and promoted skills to every project that asks; see [Limits and known issues](#limits-and-known-issues).
|
|
10
|
+
- **Logged without leaking.** The hub log records ids, counts, scores and the size of the task, never task text or item bodies. The `audit` returned to the caller echoes the caller's own request, task included.
|
|
11
|
+
- **Git is the authority for memory.** Agents propose memory and state; people promote them.
|
|
12
|
+
|
|
13
|
+
## Before you begin
|
|
14
|
+
|
|
15
|
+
- The `kxm` CLI. See [Install](../start/install.md).
|
|
16
|
+
- A running [hub](../glossary.md#hub) for the `kxm context` commands. `kxm memory` and `kxm skills` need no hub.
|
|
17
|
+
- The hub admin token in `KXM_AUTH_TOKEN`. `kxm context` authenticates as the control plane. Agents use their own project credentials through tools instead, never the admin token.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Load the admin token from your secret manager; never commit it.
|
|
21
|
+
export KXM_AUTH_TOKEN="replace-with-admin-token"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
<details><summary>PowerShell</summary>
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
$env:KXM_AUTH_TOKEN = "replace-with-admin-token"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
## Where context comes from
|
|
33
|
+
|
|
34
|
+
| Source | Stored in | Written by | Becomes |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| Temporal state | Hub SQLite | Agents propose; operators promote | `state` items |
|
|
37
|
+
| Workflow [journal](../glossary.md#journal) | Hub SQLite | Coordinators and the hub | `knowledge`, `evidence` or `skill` items |
|
|
38
|
+
| Authored memory | `.kxm/memory/*.md` in Git | People, through a reviewed PR | `knowledge` items |
|
|
39
|
+
| Promoted skills | `.kxm/skills/promoted/` in Git | `kxm skills promote`, then a PR | `skill` items |
|
|
40
|
+
|
|
41
|
+
The journal only exists for hub workflow runs. Runs started with `kxm run` have no journal; see [Continuous improvement](continuous-improvement.md).
|
|
42
|
+
|
|
43
|
+
## Context items
|
|
44
|
+
|
|
45
|
+
A context item is one record in the pool. It has a `kind` (`evidence`, `state`, `episode`, `knowledge` or `skill`), a project, a summary of at most 4,000 characters with secrets redacted, immutable provenance, an authority, a confidence (`verified`, `probable` or `uncertain`) and optional lifecycle fields: `status`, `stateKey` and a validity window.
|
|
46
|
+
|
|
47
|
+
Authority is ordered `policy` > `instruction` > `evidence` > `hypothesis`. The origin in `provenance.sourceType` sets the ceiling. An item that claims more authority than its origin allows is refused with `context_authority_violation`. An item that carries a control-plane field such as `permissions`, `tools`, `token` or `apiKey` is refused the same way: context informs agents, it never grants them anything.
|
|
48
|
+
|
|
49
|
+
Journal entries enter the pool as items with evidence authority and `probable` confidence:
|
|
50
|
+
|
|
51
|
+
| Journal category | Item kind |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `plan`, `decision`, `lesson` | `knowledge` |
|
|
54
|
+
| `skill-candidate` | `skill`, status `proposed`, never selected |
|
|
55
|
+
| All other categories | `evidence` |
|
|
56
|
+
|
|
57
|
+
Limits: 256 items per packet, a task of at most 2,000 characters, a budget of 512 to 200,000 tokens, and a derivation lineage of at most 64 ancestors.
|
|
58
|
+
|
|
59
|
+
## Role policies
|
|
60
|
+
|
|
61
|
+
The requesting role decides which kinds a packet prefers and its default budget.
|
|
62
|
+
|
|
63
|
+
| Role | Kinds, in priority order | Journal categories read | Default budget |
|
|
64
|
+
|---|---|---|---:|
|
|
65
|
+
| `repro` | episode, knowledge, evidence | error, lesson, observation, contradiction | 8,000 |
|
|
66
|
+
| `planner` | state, knowledge, evidence | plan, decision, contradiction, observation, hypothesis, experiment | 16,000 |
|
|
67
|
+
| `critic` | knowledge, evidence, episode | contradiction, error, lesson, experiment | 12,000 |
|
|
68
|
+
| `implementer` | knowledge, state, skill, episode, evidence | plan, decision, lesson, state-change | 16,000 |
|
|
69
|
+
| `verifier` | evidence, knowledge, episode | plan, error, lesson, contradiction | 8,000 |
|
|
70
|
+
| Any other name | knowledge, evidence | lesson, observation | 32,000 |
|
|
71
|
+
|
|
72
|
+
Only `implementer` asks for the `skill` kind, so only that role receives promoted skills unless a request passes `--kinds` or `includeKinds`.
|
|
73
|
+
|
|
74
|
+
## Assemble a context packet
|
|
75
|
+
|
|
76
|
+
Operators use `kxm context get`. Agents call the `kxm_context` tool, which fills in their project from their credentials.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
kxm context get demo --role planner --task "Which branch do we release from?" --json \
|
|
80
|
+
| jq -c '{state: [.packet.currentState[].summary], gaps: .packet.unresolvedGaps, relevance: .audit.relevance}'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Expected output:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
{"state":["Releases are cut from the main branch"],"gaps":[],"relevance":{"taskTokens":2,"matchedCandidates":1,"selected":[0.791]}}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The flowchart shows how the hub turns the pool into a packet.
|
|
90
|
+
|
|
91
|
+
```mermaid
|
|
92
|
+
flowchart TD
|
|
93
|
+
POOL[("Pool: state, journal items,<br/>authored memory, hash-verified skills")] --> ISO{"Every item in this<br/>project or _shared?"}
|
|
94
|
+
ISO -- no --> REFUSE["Refuse:<br/>context_isolation_violation"]
|
|
95
|
+
ISO -- yes --> LIVE["Drop superseded<br/>and rejected items"]
|
|
96
|
+
LIVE --> ELIG["Keep open contradictions and<br/>requested kinds; drop inert proposals"]
|
|
97
|
+
ELIG --> RANK[Rank by nine keys]
|
|
98
|
+
RANK --> FIT[Fill the budget first-fit]
|
|
99
|
+
FIT --> PACKET[Packet sections]
|
|
100
|
+
FIT --> GAPS[unresolvedGaps]
|
|
101
|
+
FIT --> AUDIT[audit and audit.relevance]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### How candidates are ranked
|
|
105
|
+
|
|
106
|
+
An item is eligible when it is an open contradiction, or when it is a requested kind and not an inert proposal. Non-current state and proposed skills are inert, so proposals never consume budget. Eligible items are ordered by these keys, in order:
|
|
107
|
+
|
|
108
|
+
1. Open contradictions first.
|
|
109
|
+
2. The requested project before `_shared` defaults (operator-scope memory).
|
|
110
|
+
3. Task-matched items (sharing at least one word with the task) before unmatched ones.
|
|
111
|
+
4. The role's kind priority.
|
|
112
|
+
5. BM25 relevance of the item's summary and state key to the task. Tokens are lowercased and Unicode-normalized, a fixed English stopword list is dropped, and plurals are folded.
|
|
113
|
+
6. Confidence.
|
|
114
|
+
7. Authority.
|
|
115
|
+
8. Recency, newest first, from the item's own timestamps.
|
|
116
|
+
9. Id, by code unit.
|
|
117
|
+
|
|
118
|
+
### Budget and gaps
|
|
119
|
+
|
|
120
|
+
The budget is filled first-fit: an item that does not fit is skipped, and smaller items keep filling the space. Tokens are estimated at four characters each over the summary, id, kind and source reference. That estimate enforces the budget; it is not billing. `unresolvedGaps` reports what was left out:
|
|
121
|
+
|
|
122
|
+
| Gap | Meaning |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `budget of <n> tokens reached; <m> candidates deferred` | Some eligible items did not fit |
|
|
125
|
+
| `budget of <n> tokens cannot fit any selected context` | Nothing fit |
|
|
126
|
+
| `context item limit reached; refine the task or kinds` | 256 items were selected |
|
|
127
|
+
| `no context records exist for this project yet` | The pool is empty |
|
|
128
|
+
|
|
129
|
+
### Packet sections and audit
|
|
130
|
+
|
|
131
|
+
Every selected item lands in exactly one section: `currentState`, `knowledge`, `evidence`, `episodes`, `skills` or `contradictions`. The `evidence` section holds journal errors, observations, hypotheses, experiments and state changes. The packet also carries `workingState`, `provenanceSummary` (counts by origin) and `estimatedTokens`.
|
|
132
|
+
|
|
133
|
+
The `audit` object lists `selectedIds`, `candidateCount`, `excludedSuperseded`, the budget and the gaps. `audit.relevance` holds numbers only: `taskTokens` (distinct task words), `matchedCandidates` (eligible items sharing a task word) and `selected` (each selected item's rounded score, in `selectedIds` order). `audit.request` echoes your request, including the task text; the hub log records only the task's size.
|
|
134
|
+
|
|
135
|
+
## Recall records
|
|
136
|
+
|
|
137
|
+
Recall searches the live pool and returns metadata, never summaries. Operators use `kxm context recall`; agents call `kxm_recall`.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
kxm context recall demo --query "release branch" --json | jq -c '.items[] | {kind, status, origin: .sourceType, relevance}'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Expected output:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
{"kind":"state","status":"current","origin":"peer","relevance":0.791}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Items whose summary or state key contains the whole query, ignoring case, come first. Items that share a word with the query follow, by BM25 relevance, then id. Items with neither are left out, and an empty query returns every item in id order. The default limit is 25 and the maximum is 100.
|
|
150
|
+
|
|
151
|
+
## Manage temporal state
|
|
152
|
+
|
|
153
|
+
Temporal state holds one authoritative value per key, such as `release.branch`, with its full history. Agents propose a value with the `kxm_promote` tool; despite its name, the tool only proposes. An operator promotes the proposal with evidence.
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{"key": "release.branch", "summary": "Releases are cut from the main branch", "authority": "evidence", "confidence": "verified", "evidenceRefs": ["pr:12"]}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The hub answers with a `proposalId`. Review the evidence, then promote it:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
kxm context promote demo <proposal-id> --evidence review:pr-12 --json \
|
|
163
|
+
| jq -c '.state | {status, authority, origin: .provenance.sourceType, evidenceRefs}'
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Expected output:
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
{"status":"current","authority":"evidence","origin":"peer","evidenceRefs":["pr:12","review:pr-12"]}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Read the value now, or as it was at an earlier time:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
kxm context state demo release.branch --json | jq -c '.state | {summary, status, authority}'
|
|
176
|
+
kxm context state demo release.branch --as-of 2026-09-01T00:00:00Z --json
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The state diagram shows the lifecycle, and the flowchart shows the highest authority each origin can grant.
|
|
180
|
+
|
|
181
|
+
```mermaid
|
|
182
|
+
stateDiagram-v2
|
|
183
|
+
[*] --> proposed: propose with 1 to 32 evidence refs
|
|
184
|
+
proposed --> current: promote with evidence<br/>(admin token, promoter is not the author)
|
|
185
|
+
proposed --> rejected: proposal record closed by promotion
|
|
186
|
+
current --> superseded: a later promotion of the same key
|
|
187
|
+
superseded --> [*]: purged 7 days after validUntil
|
|
188
|
+
note right of current: promotion mints a new current item<br/>and sets validUntil on the old one
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
```mermaid
|
|
192
|
+
flowchart LR
|
|
193
|
+
HUMAN[human] -- at most --> POLICY[policy]
|
|
194
|
+
WORKFLOW[workflow] -- at most --> POLICY
|
|
195
|
+
GIT[git] -- at most --> INSTRUCTION[instruction]
|
|
196
|
+
PEER[peer: agent proposals] -- at most --> EVIDENCE[evidence]
|
|
197
|
+
TOOL[tool] -- at most --> EVIDENCE
|
|
198
|
+
EXTERNAL[external] -- at most --> EVIDENCE
|
|
199
|
+
DERIVED[derived] -- at most --> EVIDENCE
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The rules the hub enforces:
|
|
203
|
+
|
|
204
|
+
- **Origin follows the credential, never a name.** A proposal made with an agent key is `peer` origin and capped at `evidence`; claiming `instruction` or `policy` is refused with `context_authority_violation`. A proposal made with the admin token is `human` origin, which can claim up to `policy`, and needs a configured admin token.
|
|
205
|
+
- **`proposedBy` must name the caller**, or the hub refuses with `state_proposer_mismatch` and logs a security alert.
|
|
206
|
+
- **Promotion is control plane only.** It needs a configured `KXM_AUTH_TOKEN` with no loopback bypass; without one the hub answers 503 `admin_auth_not_configured`.
|
|
207
|
+
- **The author cannot promote.** `state_promotion_invalid` refuses it. `kxm context promote` promotes as `kxm-admin`, which is also the author of any proposal made with the admin token; the check separates agents from operators, not one operator from another.
|
|
208
|
+
- **Promotion keeps the origin.** A promoted agent proposal stays `peer` origin at `evidence` authority.
|
|
209
|
+
- **Contradictions stay visible.** Competing proposals for one key are open contradictions and appear in every packet's `contradictions` section. Two current values for one key make `kxm context state` answer 409 `state_contradiction`.
|
|
210
|
+
|
|
211
|
+
## Read episodes and explain an item
|
|
212
|
+
|
|
213
|
+
`kxm context episode <project>` (tool `kxm_episode`) returns journal errors, lessons, observations and experiments for the project's retained runs as full items, oldest first, at most 50. Add `--run <run-id>` to limit it to one run.
|
|
214
|
+
|
|
215
|
+
`kxm context explain <project> <item-id>` returns whether the item exists, its derivation lineage, its evidence references and the source of each ancestor. It is an operator query; there is no `kxm_explain` tool. `kxm explain` (without `context`) is a different command: it estimates a mode's prompt footprint.
|
|
216
|
+
|
|
217
|
+
## Compile the knowledge wiki
|
|
218
|
+
|
|
219
|
+
The wiki is a reviewable Markdown view of the pool, never the authoritative store.
|
|
220
|
+
|
|
221
|
+
> [!IMPORTANT]
|
|
222
|
+
> The wiki commands ship, but the wiki is not a selected feature: the project's release policy defers it, so do not build a process on it. Its section pages also list pending state proposals and unreviewed journal entries under the heading "compiled from reviewed records".
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Preview the pages, then write them under the repository root.
|
|
226
|
+
kxm context wiki-compile demo
|
|
227
|
+
kxm context wiki-compile demo --out .
|
|
228
|
+
kxm context wiki-lint demo
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Pages land under `.kxm/knowledge/wiki/`: one page per section (`architecture`, `decisions`, `incidents`, `patterns`), a temporal-state page that keeps superseded values visible, a contradictions page, a superseded-history page and `index.md`. Every claim links its record id and source. Compilation never resolves a contradiction. Output is deterministic except the timestamp in `index.md`, so diffs stay small. `wiki-lint` checks for broken references, orphan pages, stale state links and hidden contradictions, and exits 1 on an error.
|
|
232
|
+
|
|
233
|
+
## Author Git memory
|
|
234
|
+
|
|
235
|
+
Git memory is the durable, reviewed layer: facts a person has approved, versioned with the code. Each fact is a Markdown file with `kxm.memory.v1` front matter.
|
|
236
|
+
|
|
237
|
+
`.kxm/memory/test-runner.md`:
|
|
238
|
+
|
|
239
|
+
```yaml
|
|
240
|
+
---
|
|
241
|
+
schema: kxm.memory.v1
|
|
242
|
+
id: test-runner
|
|
243
|
+
scope: project # agent, project, run or operator
|
|
244
|
+
kind: convention # free-form label
|
|
245
|
+
summary: Run the test suite with npm test before every commit
|
|
246
|
+
provenance:
|
|
247
|
+
sourceType: git
|
|
248
|
+
sourceRef: docs/testing.md
|
|
249
|
+
authority: instruction # instruction, evidence or promoted
|
|
250
|
+
confidence: verified
|
|
251
|
+
lifecycle: active # only active facts are loaded
|
|
252
|
+
evidenceRefs: []
|
|
253
|
+
---
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`instruction` and `promoted` authority become `instruction` in packets; `evidence` stays `evidence`. Operator-scope facts become `_shared` defaults. Control-plane fields are refused, and summaries are redacted. One malformed file stops the whole load, so validate before you commit.
|
|
257
|
+
|
|
258
|
+
The workflow:
|
|
259
|
+
|
|
260
|
+
1. Record a candidate. It lands in `.kxm/memory/candidates/cand_<scope>_<hex>.md` at `evidence` authority and is never loaded from there.
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
kxm memory note "Use pnpm, not npm, in this repository" --kind convention
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
2. Promote it by pull request: move the file into `.kxm/memory/`, give it a stable id and the authority reviewers agree on, and merge.
|
|
267
|
+
3. Check what agents will see, then refresh the projection blocks:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
kxm memory brief
|
|
271
|
+
kxm memory sync --dry-run
|
|
272
|
+
kxm memory sync
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
`kxm memory sync` writes only the project's memory block, the active facts from `.kxm/memory/`, between `<!-- kxm:memory:start -->` and `<!-- kxm:memory:end -->`. It updates whichever of `AGENTS.md`, `CLAUDE.md` and `GEMINI.md` already exist, appends the block to a file that has no markers, and changes nothing outside them. It never creates one of these files or copies KXM's own instructions into it, and it exits 1 when none of the three exists. Create the file your harness reads yourself.
|
|
276
|
+
|
|
277
|
+
Sync also refuses malformed markers rather than guess which text is yours. Each file must hold exactly one start marker followed by one end marker, or neither. For an orphan marker, an end before its start or a second block, sync names the file and the problem, exits 1 and writes no file at all. Keep one pair, or delete both so sync appends a fresh block.
|
|
278
|
+
|
|
279
|
+
| Where memory reaches agents | How |
|
|
280
|
+
|---|---|
|
|
281
|
+
| Any harness that reads `AGENTS.md`, `CLAUDE.md` or `GEMINI.md` | The projection block, after `kxm memory sync` and a commit |
|
|
282
|
+
| Claude Code with the KXM plugin | The SessionStart hook adds the same text `kxm memory brief` prints |
|
|
283
|
+
| Pi with the KXM extension | `/kxm memory` shows the brief |
|
|
284
|
+
| Runtime agent steps | Dispatch context, below |
|
|
285
|
+
|
|
286
|
+
## Context for Runtime agents
|
|
287
|
+
|
|
288
|
+
When `kxm run` dispatches an agent step, the Runtime adds project memory and promoted skills to the agent's prompt. It reads only local Git and the project tree, never the hub, so dispatch works with the hub down.
|
|
289
|
+
|
|
290
|
+
- **Sources.** Active `.kxm/memory/*.md` facts with `project` or `operator` scope, and promoted skills whose content hash verifies. Candidates are never read. `agent` and `run` scopes are skipped because nothing binds them to one agent or run.
|
|
291
|
+
- **Committed content only.** The memory and promoted-skill files must be tracked and clean at `HEAD`, and the memory revision (a hash over those files) must match the one the run pinned when it was created.
|
|
292
|
+
- **Selection.** The same arbiter picks items, with the step instructions and prompt as the task and a budget of 4,000 tokens. The role comes from the agent id: an exact role name, or a role followed by a hyphen (`critic-arch` is a critic); any other id is a custom role.
|
|
293
|
+
- **Rendering.** Items appear under **Environment & Memory**: shared defaults, then at most five project items, then **Active Skills**. A skill is delivered as its name, description and pinned hash reference, not its full `SKILL.md`.
|
|
294
|
+
|
|
295
|
+
When something is withheld, the step still runs without it and a gap is recorded in the packet's `budget.unresolvedGaps` and the `dispatch_context_assembled` log event, never in the prompt:
|
|
296
|
+
|
|
297
|
+
| Gap | Meaning |
|
|
298
|
+
|---|---|
|
|
299
|
+
| `dispatch_context_withheld:uncommitted` | A memory or promoted-skill file is modified, untracked or ignored |
|
|
300
|
+
| `dispatch_context_withheld:git_unavailable` | `git status` failed or took longer than 5 seconds |
|
|
301
|
+
| `dispatch_context_withheld:memory_revision_drift` | Memory or skills changed since the run pinned its revision |
|
|
302
|
+
| `dispatch_context_memory_unreadable` | A memory file does not parse |
|
|
303
|
+
| `dispatch_context_memory_rejected:<id>` | One fact could not become a context item |
|
|
304
|
+
| `dispatch_context_skill_unverified:<id>` | A promoted skill does not match its hash |
|
|
305
|
+
| `dispatch_context_skills_unreadable` | The promoted skills could not be listed |
|
|
306
|
+
| `dispatch_context_render_deferred:<n>` | More project items were selected than the prompt renders |
|
|
307
|
+
| `dispatch_context_not_loaded` | Context could not be loaded before this step |
|
|
308
|
+
| `dispatch_context_failed` | Loading or assembly failed unexpectedly |
|
|
309
|
+
|
|
310
|
+
A project with no memory and no promoted skill dispatches exactly as before.
|
|
311
|
+
|
|
312
|
+
### Prompt layout and pruning
|
|
313
|
+
|
|
314
|
+
The agent's prompt is the step's `instructions`, then a Markdown context packet. Its header names the project, the agent ID as the role, the step, the attempt, the permission ceiling and the allowed outcomes. Numbered sections follow: **1. Objective** (the run prompt), **2. Acceptance Criteria** (one line per required evidence key), **3. Plan Pointer** (step N of M), and **5. Environment & Memory**. Section 4, predecessor outputs, is not filled by Runtime dispatch today.
|
|
315
|
+
|
|
316
|
+
Before rendering, the packet is pruned to a budget of 16,000 tokens, estimated at four characters per token over the rendered text. When it is over budget, pruning removes items in a fixed order until it fits:
|
|
317
|
+
|
|
318
|
+
1. Shared defaults (L1).
|
|
319
|
+
2. Episode items, then project knowledge items (L2).
|
|
320
|
+
3. Predecessor artifact snippets, then the artifact lists (L5).
|
|
321
|
+
|
|
322
|
+
The objective, the plan pointer and the acceptance criteria are never removed. If the packet still does not fit, its `budget.unresolvedGaps` records `context_budget_exceeded_task_inviolable`. Removed items are not recorded as gaps.
|
|
323
|
+
|
|
324
|
+
## Limits and known issues
|
|
325
|
+
|
|
326
|
+
- **The hub misses authored memory with the default layout.** The hub looks for `.kxm/memory` two directories above its database file. With the default `.kxm/state/kxm.db` that resolves inside `.kxm/`, so `kxm context get`, `recall`, `explain` and `wiki-compile` see no memory facts. Runtime dispatch context reads memory correctly.
|
|
327
|
+
- **A multi-project hub shares one checkout's memory and skills.** The hub reads authored memory from its own checkout and promoted skills from `.kxm/skills` in the directory it started in, and attaches both to every project that asks, labeled as that project's. Do not rely on a shared hub to keep memory or skills apart between projects.
|
|
328
|
+
- **The `episodes` section is usually empty.** No record in the hub pool has the `episode` kind today. Use `kxm context episode` for episodic records.
|
|
329
|
+
- **`--run` and `--stage` do not filter.** They are recorded in the audit only.
|
|
330
|
+
- **History is short.** The hub purges superseded state and closed proposals 7 days after they end, so `--as-of` only reaches back that far. Terminal runs and their journal are purged on the same schedule.
|
|
331
|
+
- **The wiki compiles every retained journal entry and pending proposal**, not only reviewed ones. Its index links the temporal-state page at the wrong path, and `wiki-lint` can report a false `stale_state_link` on that page when a superseded value sits close to the Current heading.
|
|
332
|
+
|
|
333
|
+
## Troubleshooting
|
|
334
|
+
|
|
335
|
+
| Symptom | Cause | Fix |
|
|
336
|
+
|---|---|---|
|
|
337
|
+
| `kxm context` answers 401 `invalid_auth` | `KXM_AUTH_TOKEN` is unset or wrong | Export the hub admin token |
|
|
338
|
+
| Promotion answers 503 `admin_auth_not_configured` | The hub started without `KXM_AUTH_TOKEN` | Restart the hub with an admin token |
|
|
339
|
+
| Promotion answers `state_promotion_invalid` | The promoter is the proposal's author | Promote as a different identity |
|
|
340
|
+
| A proposal answers `context_authority_violation` | An agent claimed `instruction` or `policy` | Propose at `evidence` or `hypothesis` |
|
|
341
|
+
| An agent request answers `context_isolation_violation` | It named a project other than its own | Use the agent's own project |
|
|
342
|
+
| `kxm context state` answers 409 `state_contradiction` | Two current values exist for one key | Promote one value with evidence |
|
|
343
|
+
| A Runtime step lacks expected memory | A dispatch gap withheld it | Commit the memory files and start a new run |
|
|
344
|
+
| `memory sync failed: none of AGENTS.md, CLAUDE.md, GEMINI.md exists` | Sync never creates an instruction file | Create the file your harness reads, then sync again |
|
|
345
|
+
| `memory sync failed: <file> has …; wrote no file` | The file has an orphan marker, an end before its start, or a second block | Keep one marker pair, or delete both, then sync again |
|
|
346
|
+
|
|
347
|
+
## Next steps
|
|
348
|
+
|
|
349
|
+
- Turn run evidence into ranked improvements: [Continuous improvement](continuous-improvement.md)
|
|
350
|
+
- Govern reusable procedures: [Governed skills](governed-skills.md)
|
|
351
|
+
- Understand who may do what: [Trust model](../concepts/trust-model.md)
|
|
352
|
+
- Every flag and output key: [CLI reference](../reference/cli-reference.md#kxm-context) and [MCP and Pi tools](../reference/tools.md)
|