@kontextmind/kxm 0.7.95 → 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.
Files changed (140) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.kxm/README.md +39 -9
  3. package/CHANGELOG.md +1 -1
  4. package/README.md +147 -257
  5. package/SECURITY.md +21 -12
  6. package/docs/README.md +133 -54
  7. package/docs/adr/ADR-0002-browser-automation-steel-doks.md +24 -18
  8. package/docs/adr/ADR-0003-sqlite-only-store.md +100 -0
  9. package/docs/adr/ADR-0004-edge-identity-authentik.md +99 -0
  10. package/docs/adr/README.md +33 -0
  11. package/docs/concepts/architecture.md +262 -0
  12. package/docs/concepts/data-and-storage.md +194 -0
  13. package/docs/concepts/trust-model.md +152 -0
  14. package/docs/contracts/README.md +22 -14
  15. package/docs/contracts/effects-and-recovery.md +3 -0
  16. package/docs/contracts/migration.md +2 -2
  17. package/docs/contracts/routing.md +6 -5
  18. package/docs/contributing/assignment-runner.md +388 -0
  19. package/docs/contributing/ci-and-release.md +231 -0
  20. package/docs/contributing/development.md +362 -0
  21. package/docs/contributing/harness-routing-internals.md +192 -0
  22. package/docs/{packages.md → contributing/packages.md} +13 -15
  23. package/docs/{skills → contributing}/repo-work-delivery.md +20 -21
  24. package/docs/contributing/test-matrix.md +208 -0
  25. package/docs/{tui-components.md → contributing/tui-components.md} +30 -22
  26. package/docs/contributing/writing-docs.md +340 -0
  27. package/docs/glossary.md +471 -0
  28. package/docs/guides/agent-skills.md +137 -0
  29. package/docs/guides/browser-automation.md +160 -0
  30. package/docs/guides/context-and-memory.md +352 -0
  31. package/docs/guides/continuous-improvement.md +228 -0
  32. package/docs/guides/governed-skills.md +173 -0
  33. package/docs/guides/nous-providers.md +186 -0
  34. package/docs/guides/peer-messaging.md +304 -0
  35. package/docs/guides/pi-workers.md +219 -0
  36. package/docs/guides/provenance-gates.md +313 -0
  37. package/docs/guides/webhook-workflows.md +364 -0
  38. package/docs/kb/how-credentials-retrieved-safely.md +38 -12
  39. package/docs/kb/how-to-capture-and-annotate-section.md +15 -13
  40. package/docs/kb/how-to-connect-playwright-to-steel.md +16 -11
  41. package/docs/kb/how-to-recover-expired-session-or-orphan.md +26 -16
  42. package/docs/kb/how-to-resume-after-mfa.md +19 -11
  43. package/docs/kb/how-to-take-over-session.md +17 -13
  44. package/docs/kb/why-authentication-disappeared.md +22 -14
  45. package/docs/kb/why-automation-opened-different-browser.md +23 -14
  46. package/docs/kb/why-session-viewer-cannot-control.md +13 -12
  47. package/docs/operations/backup-and-restore.md +248 -0
  48. package/docs/operations/deploy.md +307 -0
  49. package/docs/operations/monitoring.md +209 -0
  50. package/docs/operations/runtime-sync.md +192 -0
  51. package/docs/operations/troubleshooting.md +265 -0
  52. package/docs/operations/upgrade.md +124 -0
  53. package/docs/prompts/browser-annotate-feedback.md +7 -7
  54. package/docs/prompts/browser-diagnose-recover.md +11 -10
  55. package/docs/prompts/browser-explore.md +7 -7
  56. package/docs/prompts/browser-repro-fix.md +7 -7
  57. package/docs/prompts/browser-start.md +12 -11
  58. package/docs/prompts/browser-takeover.md +8 -8
  59. package/docs/{cli-reference.md → reference/cli-reference.md} +83 -41
  60. package/docs/{config-reference.md → reference/config-reference.md} +159 -148
  61. package/docs/reference/configuration.md +299 -0
  62. package/docs/reference/harness-routing.md +508 -0
  63. package/docs/reference/http-api.md +203 -0
  64. package/docs/reference/tools.md +370 -0
  65. package/docs/{workflow-guide.md → reference/workflow-catalog.md} +92 -153
  66. package/docs/reference/workflow-definitions.md +286 -0
  67. package/docs/start/first-workflow.md +287 -0
  68. package/docs/start/install.md +146 -0
  69. package/docs/start/quickstart-claude-code.md +405 -0
  70. package/docs/start/quickstart-pi.md +213 -0
  71. package/docs/templates/README.md +78 -73
  72. package/docs/templates/adr.md +13 -13
  73. package/docs/templates/architecture.md +55 -71
  74. package/docs/templates/bug-fix.md +13 -16
  75. package/docs/templates/feature.md +14 -19
  76. package/docs/templates/handoff.md +44 -46
  77. package/docs/templates/postmortem.md +30 -43
  78. package/docs/templates/research.md +15 -20
  79. package/docs/templates/review.md +49 -50
  80. package/docs/templates/runbook.md +38 -30
  81. package/docs/templates/test-plan.md +16 -23
  82. package/docs/templates/test-report.md +14 -17
  83. package/examples/README.md +9 -5
  84. package/examples/provenance-workflow.json +1 -1
  85. package/examples/webhook-workflows/jira-development.json +59 -0
  86. package/examples/webhook-workflows/jira-issue-updated.json +12 -0
  87. package/package.json +1 -1
  88. package/packages/core/tui/README.md +1 -1
  89. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  90. package/plugins/kxm/README.md +31 -32
  91. package/plugins/kxm/dist/cli.js +5 -5
  92. package/plugins/kxm/dist/mcp-server.js +1 -1
  93. package/plugins/kxm/dist/runtime.js +1 -1
  94. package/plugins/kxm/package.json +1 -1
  95. package/plugins/kxm/skills/kxm/references/protocol.md +3 -1
  96. package/plugins/kxm/skills/kxm-browser-auth/SKILL.md +1 -1
  97. package/plugins/kxm/skills/kxm-browser-diagnostics/SKILL.md +5 -5
  98. package/plugins/kxm/skills/kxm-browser-explore/SKILL.md +2 -2
  99. package/plugins/kxm/skills/kxm-browser-session/SKILL.md +10 -13
  100. package/plugins/kxm/skills/kxm-browser-takeover/SKILL.md +1 -1
  101. package/plugins/kxm/skills/kxm-browser-verify/SKILL.md +1 -1
  102. package/plugins/kxm/skills/kxm-context-memory/SKILL.md +13 -4
  103. package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +3 -1
  104. package/plugins/kxm/skills/kxm-mind-setup/SKILL.md +2 -1
  105. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +31 -54
  106. package/plugins/kxm/skills/kxm-projects/SKILL.md +1 -1
  107. package/plugins/kxm/skills/kxm-protocol/SKILL.md +1 -1
  108. package/plugins/kxm/skills/kxm-routing-improve/SKILL.md +15 -7
  109. package/plugins/kxm/skills/kxm-runs/SKILL.md +11 -5
  110. package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
  111. package/plugins/kxm/skills/kxm-tasks/SKILL.md +9 -7
  112. package/plugins/kxm/skills/kxm-workflow/SKILL.md +10 -2
  113. package/plugins/kxm/src/cli/system.ts +1 -1
  114. package/plugins/kxm/src/cli.ts +3 -3
  115. package/plugins/kxm/src/init-guide-setup.ts +1 -1
  116. package/plugins/kxm/src/mcp-server.ts +1 -1
  117. package/plugins/kxm/src/modes.ts +1 -1
  118. package/schemas/README.md +1 -1
  119. package/docs/agent-communication-envelopes-and-gates.md +0 -553
  120. package/docs/agent-skills.md +0 -198
  121. package/docs/architecture.md +0 -245
  122. package/docs/assignment-runner.md +0 -264
  123. package/docs/browser-automation.md +0 -139
  124. package/docs/configuration.md +0 -437
  125. package/docs/continuous-improvement.md +0 -226
  126. package/docs/getting-started.md +0 -277
  127. package/docs/harness-routing.md +0 -616
  128. package/docs/kb/qa-authentik-authentication.md +0 -97
  129. package/docs/kb/qa-extension-install-and-hub-bootstrap.md +0 -85
  130. package/docs/kb/qa-hub-on-a-public-host.md +0 -48
  131. package/docs/kb/qa-sqlite-vs-duckdb.md +0 -35
  132. package/docs/kb/qa-what-the-hub-stores.md +0 -64
  133. package/docs/kxm-handbook.md +0 -1181
  134. package/docs/operations.md +0 -510
  135. package/docs/operator-pi-packages.md +0 -67
  136. package/docs/provenance-gates.md +0 -295
  137. package/docs/skills.md +0 -47
  138. package/docs/test-matrix.md +0 -132
  139. package/docs/troubleshooting.md +0 -322
  140. package/docs/webhook-workflows.md +0 -240
@@ -2,7 +2,7 @@
2
2
  schema: "kxm.doc.v1"
3
3
  id: "BUG-0001"
4
4
  type: "bug"
5
- title: "Observable Failure / Defect Summary"
5
+ title: "Bug: <observable failure>"
6
6
  project: "kxm"
7
7
  status: "draft" # draft | in_review | approved | superseded | archived
8
8
  owner: "@owner"
@@ -19,9 +19,9 @@ details:
19
19
  reproducibility: "always" # always | intermittent | environment_specific
20
20
  ---
21
21
 
22
- # Bug: <Observable Failure / Defect Summary>
22
+ # Bug: <Observable failure / defect summary>
23
23
 
24
- ## Impact & Affected Scope
24
+ ## Impact and affected scope
25
25
 
26
26
  - **User / Operator Impact:** <What fails, crashes, or produces incorrect outputs?>
27
27
 
@@ -29,35 +29,35 @@ details:
29
29
 
30
30
  - **Workaround:** <Temporary safe mitigation if available>
31
31
 
32
- ## Expected vs. Actual Behavior
32
+ ## Expected and actual behavior
33
33
 
34
34
  - **Expected:** <Precise, observable contract expectation>
35
35
 
36
36
  - **Actual:** <Exact error message, stack trace, or wrong output>
37
37
 
38
- ## Environment & Baseline State
38
+ ## Environment and baseline state
39
39
 
40
40
  - **Baseline Commit:** `<git-sha-before-fix>`
41
41
 
42
- - **Node / Runtime Version:** `Node 22.19.0 / Node 24.15.0`
42
+ - **Node version:** `<for example 22.19.0 or 24>`
43
43
 
44
44
  - **Active Harness / Model:** `<Harness and model if relevant>`
45
45
 
46
46
  - **OS:** `macOS / Linux`
47
47
 
48
- ## Mandatory Repro Before Fix (Oracle Invariant)
48
+ ## Mandatory reproduction before the fix
49
49
 
50
50
  To prevent phantom fixes, a failing reproduction test MUST be established before modifying production code:
51
51
 
52
52
  - **Failing Test File:** `test/core/<bug-name>.test.ts`
53
53
 
54
- - **Reproduction Command:** `node --test test/core/<bug-name>.test.ts`
54
+ - **Reproduction Command:** `node --disable-warning=ExperimentalWarning --experimental-strip-types --test test/core/<bug-name>.test.ts`
55
55
 
56
56
  - **Baseline Observed Result:** `FAIL` (exit code 1)
57
57
 
58
58
  - **Repro Failure Receipt:** `artifact:.kxm/assets/repro-fail.log@sha256:...`
59
59
 
60
- ## Failure Path Sequence
60
+ ## Failure path sequence
61
61
 
62
62
  ```mermaid
63
63
  sequenceDiagram
@@ -74,7 +74,7 @@ sequenceDiagram
74
74
 
75
75
  *Failure sequence: Unhandled contention leads to ungraceful crash instead of deterministic retry or clean fail-closed error.*
76
76
 
77
- ## Root Cause Analysis
77
+ ## Root cause analysis
78
78
 
79
79
  - **Immediate Cause:** <What line or condition directly triggered the symptom?>
80
80
 
@@ -82,7 +82,7 @@ sequenceDiagram
82
82
 
83
83
  - **Rejected Hypotheses:** <What initial assumptions were investigated and ruled out?>
84
84
 
85
- ## Proposed Fix & Contract Changes
85
+ ## Proposed fix and contract changes
86
86
 
87
87
  - **Code Changes:** <Summary of modifications to code or schemas>
88
88
 
@@ -90,19 +90,16 @@ sequenceDiagram
90
90
 
91
91
  - **Security / Isolation:** <Does the fix maintain fail-closed invariants?>
92
92
 
93
- ## Verification Witness Matrix
93
+ ## Verification witness matrix
94
94
 
95
95
  | Verification Check | Target Commit / Tree | Expected Result | Actual Result | Witness Artifact |
96
-
97
96
  |---|---|---|---|---|
98
97
  | Repro Test (Before Fix) | `<baseline-commit>` | FAIL | FAIL | `artifact:...@sha256` |
99
-
100
98
  | Repro Test (After Fix) | `<candidate-commit>` | PASS | PASS | `artifact:...@sha256` |
101
99
  | Full Core Test Suite | `<candidate-commit>` | 100% PASS | 100% PASS | `npm run test:core` |
102
-
103
100
  | Full Verify Gate | `<candidate-commit>` | PASS | PASS | `npm run verify` |
104
101
 
105
- ## Regression Prevention
102
+ ## Regression prevention
106
103
 
107
104
  - **Automated Gate Added:** <New unit test or lint check preventing recurrence>
108
105
 
@@ -2,7 +2,7 @@
2
2
  schema: "kxm.doc.v1"
3
3
  id: "FEAT-0001"
4
4
  type: "feature"
5
- title: "Feature Name"
5
+ title: "Feature: <feature name>"
6
6
  project: "kxm"
7
7
  status: "draft" # draft | in_review | approved | superseded | archived
8
8
  owner: "@owner"
@@ -15,12 +15,12 @@ tags: []
15
15
  related: []
16
16
  details:
17
17
  delivery_status: "proposed"
18
- target_workflow: "feature-delivery"
18
+ target_workflow: "build-feature" # a workflow slug from docs/reference/workflow-catalog.md
19
19
  ---
20
20
 
21
- # Feature: <Feature Name>
21
+ # Feature: <Feature name>
22
22
 
23
- ## Problem & Users
23
+ ## Problem and users
24
24
 
25
25
  - **Who needs this:** <Describe primary user persona or operator role>
26
26
 
@@ -28,7 +28,7 @@ details:
28
28
 
29
29
  - **Evidence / Driver:** <User friction, issue link, or performance data demonstrating the need>
30
30
 
31
- ## Goals & Non-Goals
31
+ ## Goals and non-goals
32
32
 
33
33
  - **Goals:**
34
34
  - <Measurable outcome 1>
@@ -37,16 +37,14 @@ details:
37
37
  - **Non-Goals:**
38
38
  - <Explicitly excluded behavior or deferred capability>
39
39
 
40
- ## Requirements & Acceptance Criteria
40
+ ## Requirements and acceptance criteria
41
41
 
42
42
  | ID | Requirement | Acceptance Criterion (Given / When / Then) | Verification Kind |
43
-
44
43
  |---|---|---|---|
45
44
  | REQ-01 | <Observable behavior> | Given ..., when ..., then ... | gate / witness |
46
-
47
45
  | REQ-02 | <Error or permission boundary> | Given invalid input, when submitted, then fail closed with ... | gate / witness |
48
46
 
49
- ## User & Execution Flow
47
+ ## User and execution flow
50
48
 
51
49
  ```mermaid
52
50
  flowchart LR
@@ -60,7 +58,7 @@ flowchart LR
60
58
 
61
59
  *Flow description: The request is validated against permissions and schema before execution. Invalid calls fail closed with actionable errors.*
62
60
 
63
- ## Behavior & Interface Contracts
61
+ ## Behavior and interface contracts
64
62
 
65
63
  - **Inputs & CLI Flags:** <Specify syntax and types>
66
64
 
@@ -70,24 +68,21 @@ flowchart LR
70
68
 
71
69
  - **Concurrency & Idempotency:** <Timeout limits, lock keys, and duplicate dispatch protection>
72
70
 
73
- ## Quality & Resource Budgets
71
+ ## Quality and resource budgets
74
72
 
75
73
  | Dimension | Target Budget | Measurement Condition | Verification Method |
76
-
77
74
  |---|---|---|---|
78
75
  | Latency P50 | < e.g., 200ms | Local CLI dispatch | Benchmark test |
79
-
80
76
  | Token Budget | < e.g., 8,000 tokens | Context packet compilation | Context Arbiter log |
81
- | Test Coverage | >= 92% lines, >= 80% branches | `npm run test:core` | Vitest / Node test runner |
77
+ | Test Coverage | >= 91% lines, >= 80% branches, >= 92% functions | `npm run test:coverage` | Node test runner (`node:test`) |
82
78
 
83
- ## Dependencies & Risks
79
+ ## Dependencies and risks
84
80
 
85
81
  | Dependency / Risk | Potential Impact | Mitigation Strategy | Owner |
86
-
87
82
  |---|---|---|---|
88
83
  | <Dependency> | <Failure mode> | <Fallback or isolation> | <Role> |
89
84
 
90
- ## Validation & Verification Gates
85
+ ## Validation and verification gates
91
86
 
92
87
  - **Unit / Core Suite:** `npm run test:core`
93
88
 
@@ -95,7 +90,7 @@ flowchart LR
95
90
 
96
91
  - **Combined Commit Gate:** `npm run verify`
97
92
 
98
- ## Rollout & Rollback
93
+ ## Rollout and rollback
99
94
 
100
95
  - **Rollout Strategy:** <Staged feature flag, CLI release, or workflow gate>
101
96
 
@@ -103,6 +98,6 @@ flowchart LR
103
98
 
104
99
  - **Rollback Action:** <Git revert or toggle flag>
105
100
 
106
- ## Open Questions
101
+ ## Open questions
107
102
 
108
103
  1. <Unresolved design question, assigned owner, and target decision milestone>
@@ -2,71 +2,69 @@
2
2
  schema: "kxm.doc.v1"
3
3
  id: "HND-0001"
4
4
  type: "handoff"
5
- title: "Structured Agent / Stage Handoff Manifest"
5
+ title: "Structured handoff manifest"
6
6
  project: "kxm"
7
- status: "approved"
8
- owner: "@source_role"
7
+ status: "draft" # draft | in_review | approved | superseded | archived
8
+ owner: "@source-role"
9
9
  created: "2026-09-08"
10
10
  updated: "2026-09-08"
11
11
  authority: "evidence"
12
12
  confidence: "verified"
13
- summary: "Formal handoff from <source_role> to <target_role> for workflow <workflow_id>."
13
+ summary: "Handoff from <source-role> to <target-role> for workflow run <run-id>."
14
14
  tags: ["handoff", "workflow", "stage-transition"]
15
15
  related: []
16
16
  details:
17
- workflow_run_id: "run-01928abc"
18
- handoff_manifest_id: "hnd_01928abcde12"
19
- intent: "request_review" # continue | request_review | reject_rework_required | complete
17
+ manifest_schema: "kxm.handoff-manifest.v1"
18
+ workflow_run_id: "<run-id>"
19
+ handoff_id: "<handoff-id>"
20
+ intent: "request_review" # request_review | dispatch_fix | request_approval | complete_workflow
21
+ handoff_status: "pending" # pending | accepted | rejected | superseded
22
+ rework_of: null
20
23
  ---
21
24
 
22
- # Structured Handoff Manifest
25
+ # Handoff: <source-role> to <target-role>
23
26
 
24
- ## Stage Transition Provenance
27
+ > [!IMPORTANT]
28
+ > Planned: the `kxm.handoff-manifest.v1` schema exists, but no KXM command or Runtime step writes handoff manifests yet, so record each handoff by hand.
25
29
 
26
- - **Workflow Run ID:** `run-01928abc`
30
+ This page is the readable view of one `kxm.handoff-manifest.v1` record, defined
31
+ in `schemas/handoff-manifest.schema.json`. Keep its field names so the two stay
32
+ aligned.
27
33
 
28
- - **Task ID:** `task-127`
34
+ ## Stage transition
29
35
 
30
- - **Source Role:** `writer` (Harness: `grok`, Model: `grok-4.6`)
36
+ - **Workflow run ID:** `<run-id>`
37
+ - **Task ID:** `<task-id>`
38
+ - **Source:** role `writer`, agent `<agent-id>`, harness `grok`, model
39
+ `grok-4.6`, step `<step-id>`, attempt `<attempt-id>`
40
+ - **Target:** role `reviewer-arch`, permission `read-only`
41
+ - **Intent:** `request_review` (one of `request_review`, `dispatch_fix`,
42
+ `request_approval`, `complete_workflow`)
43
+ - **Rework of:** `<handoff-id>`, or none
31
44
 
32
- - **Target Role:** `reviewer-arch` (Harness: `claude`, Model: `claude-fable-5-1`)
45
+ ## Repository anchors
33
46
 
34
- - **Intent:** `request_review`
47
+ - **Base commit:** `<base-commit-sha>`
48
+ - **Candidate tree hash:** `<candidate-tree-sha>`
49
+ - **Branch:** `kxm/run-<run-id>-<description>`
35
50
 
36
- ## Repository & Branch Anchors
51
+ ## Deliverables
37
52
 
38
- - **Base Commit:** `44a7b50f9a2b6e14d3c2a1e09876543210abcdef`
53
+ - **Patches:** `artifact:.kxm/assets/<run-id>/changes.patch@sha256:<digest>`
54
+ - **Reports:** `artifact:.kxm/assets/<run-id>/test-report.md@sha256:<digest>`
55
+ - **Artifacts:** `<name>`: `artifact:<path>@sha256:<digest>`
39
56
 
40
- - **Candidate Commit:** `88b6c40a12e34f56789abcdef0123456789abcde`
57
+ ## Verification evidence
41
58
 
42
- - **Candidate Tree Hash:** `789abcdef0123456789abcdef0123456789abcde`
59
+ - **Witness command:** `npm run verify`
60
+ - **Witness exit code:** `0`
61
+ - **Witness passed:** `true`
62
+ - **Critic verdicts:** `<critic>`: `PASS`, with a one-line summary. The
63
+ manifest accepts `PASS`, `FAIL`, `WARN` or `UNKNOWN`.
43
64
 
44
- - **Deterministic Branch:** `kxm/run-01928abc-fix-issue-127-memory-arbiter`
65
+ ## Transferred context
45
66
 
46
- ## Deliverables & Evidence
47
-
48
- ### 1. Artifacts Created
49
-
50
- - `artifact:.kxm/assets/changes.patch@sha256:abc...`
51
-
52
- - `artifact:.kxm/assets/witness.log@sha256:def...`
53
-
54
- ### 2. Witness Receipt
55
-
56
- - **Command:** `npm run verify`
57
-
58
- - **Exit Code:** `0`
59
-
60
- - **Receipt Hash:** `sha256:fedcba0987654321...`
61
-
62
- ## Transferred Context & Decisions
63
-
64
- - **Settled Decisions:**
65
- - Used SQLite `external_effects` table for CAS leasing.
66
- - Implemented descriptive branch slugification with de-duplication.
67
-
68
- - **Assumptions:**
69
- - Remote repository branch protection requires PR merge.
70
-
71
- - **Open Questions / Notes for Target Role:**
72
- - Please verify memory revision hash changes deterministically when files in `.kxm/memory/` are touched.
67
+ - **Settled decisions:** <decisions the target role must not reopen>
68
+ - **Assumptions:** <assumptions the target role should verify>
69
+ - **Open questions:** <questions for the target role>
70
+ - **Suggested next step:** step `<step-id>`, action `<action>`
@@ -2,9 +2,9 @@
2
2
  schema: "kxm.doc.v1"
3
3
  id: "PM-0001"
4
4
  type: "postmortem"
5
- title: "Incident Postmortem: <Incident Title>"
5
+ title: "Incident postmortem: <incident title>"
6
6
  project: "kxm"
7
- status: "approved"
7
+ status: "draft" # draft | in_review | approved | superseded | archived
8
8
  owner: "@incident-lead"
9
9
  created: "2026-09-08"
10
10
  updated: "2026-09-08"
@@ -20,58 +20,45 @@ details:
20
20
  time_to_mitigate_minutes: 20
21
21
  ---
22
22
 
23
- # Incident Postmortem: <Incident Title>
23
+ # Incident postmortem: <incident title>
24
24
 
25
- ## Executive Summary
25
+ ## Summary
26
26
 
27
- - **Incident Period:** `2026-09-08 14:10 UTC` to `2026-09-08 14:35 UTC` (25 minutes)
27
+ - **Incident period:** `<start UTC>` to `<end UTC>` (<duration>)
28
+ - **User impact:** <number of workflow runs blocked or delayed, and for whom>
29
+ - **Root cause:** <one sentence on the failure mechanism>
28
30
 
29
- - **User Impact:** <Number of workflow runs blocked or delayed>
30
-
31
- - **Root Cause:** <One-sentence summary of failure mechanism>
32
-
33
- ## Incident Timeline (UTC)
34
-
35
- | Time | Event Description | Detected By |
31
+ ## Timeline (UTC)
36
32
 
33
+ | Time | Event | Detected by |
37
34
  |---|---|---|
38
- | 14:10 | AI worker crashed during git push; CAS effect left in `dispatched` state | Log watcher |
39
-
40
- | 14:15 | Subsequent retry attempts blocked due to unexpired CAS lease | `kxm dash` operator |
41
- | 14:22 | Operator pressed `d` (degrade) to inspect worktree manually | Interactive TUI |
42
-
43
- | 14:30 | Fix committed; lease expiration policy patched | Operator |
44
- | 14:35 | Hub restarted; all queued workflow runs completed | Verifier |
45
-
46
- ## Root Cause Analysis (5 Whys)
47
-
48
- 1. **Why did the retry fail?** Because the CAS effect lease was locked in `dispatched` state.
49
-
50
- 2. **Why was it still locked?** Because the previous worker process exited abnormally without calling abort.
51
-
52
- 3. **Why did the lease not expire?** Because the lease had no automated heartbeat timeout.
53
-
54
- 4. **Why was there no timeout?** Because CAS leasing was assumed to be synchronous.
55
-
56
- 5. **Systemic Root Cause:** Missing failure recovery watchdog for unconfirmed external side-effect leases.
57
-
58
- ## What Went Well / What Went Wrong
35
+ | <hh:mm> | <first symptom, for example a worker exits during `git push`> | <log watcher, `kxm dash`, a user> |
36
+ | <hh:mm> | <what the operator saw next, for example retries refused on a held lease> | <source> |
37
+ | <hh:mm> | <mitigation, for example the operator degrades the run from `kxm dash` with `d`> | <source> |
38
+ | <hh:mm> | <fix committed or configuration changed> | <source> |
39
+ | <hh:mm> | <service restored and verified, for example queued runs complete> | <source> |
59
40
 
60
- ### What Went Well
41
+ ## Root cause analysis (five whys)
61
42
 
62
- - The database remained consistent; zero duplicate PRs were created on GitHub.
43
+ 1. **Why did <symptom> happen?** <Because …>
44
+ 2. **Why did <cause 1> happen?** <Because …>
45
+ 3. **Why did <cause 2> happen?** <Because …>
46
+ 4. **Why did <cause 3> happen?** <Because …>
47
+ 5. **Systemic root cause:** <the missing control, test, or gate>
63
48
 
64
- - Degrade-to-human hotkey (`d`) allowed the operator to take over immediately.
49
+ ## What went well and what went wrong
65
50
 
66
- ### What Went Wrong
51
+ ### What went well
67
52
 
68
- - The error message in `kxm dash` did not explicitly indicate how to force-release an abandoned lease.
53
+ - <For example: state stayed consistent and no duplicate pull request was created>
69
54
 
70
- ## Corrective & Preventive Action Items
55
+ ### What went wrong
71
56
 
72
- | Action Item | Type | Owner | Target Date | Issue Reference |
57
+ - <For example: the error message did not say how to recover>
73
58
 
74
- |---|---|---|---|---|
75
- | Add 300s automated lease timeout to `ExternalEffectsLedger` | Prevent | Platform Lead | 2026-09-10 | #165 |
59
+ ## Corrective and preventive actions
76
60
 
77
- | Add `kxm routing unquarantine` CLI command | Mitigate | CLI Lead | 2026-09-12 | #166 |
61
+ | Action | Type | Owner | Tracking |
62
+ |---|---|---|---|
63
+ | <Add a failing test that reproduces the incident> | Prevent | <role> | <issue link> |
64
+ | <Improve the error message to name the recovery command> | Mitigate | <role> | <issue link> |
@@ -2,7 +2,7 @@
2
2
  schema: "kxm.doc.v1"
3
3
  id: "RES-0001"
4
4
  type: "research"
5
- title: "Research Topic / Spike Question"
5
+ title: "Research: <topic or spike question>"
6
6
  project: "kxm"
7
7
  status: "draft" # draft | in_review | approved | superseded | archived
8
8
  owner: "@owner"
@@ -18,9 +18,9 @@ details:
18
18
  target_decision_date: "2026-09-15"
19
19
  ---
20
20
 
21
- # Research: <Research Topic / Spike Question>
21
+ # Research: <Research topic / spike question>
22
22
 
23
- ## Decision to Enable
23
+ ## Decision to enable
24
24
 
25
25
  - **Pending Decision:** <What exact architectural, model routing, or product decision depends on this investigation?>
26
26
 
@@ -28,7 +28,7 @@ details:
28
28
 
29
29
  - **Constraints & Guardrails:** <Budget limits, latency thresholds, security boundaries>
30
30
 
31
- ## Questions & Falsifiable Hypotheses
31
+ ## Questions and falsifiable hypotheses
32
32
 
33
33
  - **Primary Question:** <What are we trying to discover or prove?>
34
34
 
@@ -36,7 +36,7 @@ details:
36
36
 
37
37
  - **Falsification Condition:** <What exact result or metric will prove this hypothesis wrong?>
38
38
 
39
- ## Methodology & Verification Setup
39
+ ## Methodology and verification setup
40
40
 
41
41
  ```mermaid
42
42
  flowchart LR
@@ -50,48 +50,43 @@ flowchart LR
50
50
 
51
51
  *Methodology flow: Establish bounds, execute reproducible trials, analyze telemetry metrics, and recommend concrete next actions.*
52
52
 
53
- - **Harness & Model Arms:** <List evaluated routes, e.g. Grok native vs Pi wrapper vs Claude Fable>
53
+ - **Harness & Model Arms:** <List evaluated routes, for example native `grok` versus `pi` with an OpenRouter model>
54
54
 
55
55
  - **Test Fixture / Workload:** <Exact repository task or test suite executed>
56
56
 
57
57
  - **Budget Ceiling:** <Maximum dollar or token limit for this spike>
58
58
 
59
- ## Evidence Register
59
+ ## Evidence register
60
60
 
61
61
  | Evidence ID | Claim / Finding | Source Artifact / Telemetry Run | Version / Date | Confidence |
62
-
63
62
  |---|---|---|---|---|
64
63
  | EV-01 | <Empirical claim> | `artifact:.kxm/logs/telemetry.jsonl@sha256:...` | 2026-09-08 | verified |
64
+ | EV-02 | <Model behavior observation> | `<run-id>` transcript | 2026-09-08 | probable |
65
65
 
66
- | EV-02 | <Model behavior observation> | `run-01928abc` transcript | 2026-09-08 | probable |
67
-
68
- ## Option Comparison Matrix
69
-
70
- | Evaluation Criterion | Weight | Option A (e.g., Native) | Option B (e.g., Wrapper) | Measured Evidence |
66
+ ## Option comparison matrix
71
67
 
68
+ | Evaluation Criterion (example values) | Weight | Option A (e.g., Native) | Option B (e.g., Wrapper) | Measured Evidence |
72
69
  |---|---|---|---|---|
73
70
  | Verification Pass Rate | High | 84.0% | 40.0% | EV-01 |
74
-
75
71
  | Latency P50 | Medium | 187s | 284s | EV-01 |
76
72
  | Cost per Successful Run | High | $0.20 | $1.03 | EV-01 |
77
-
78
73
  | Rework Rate | High | 68% | 100% | EV-01 |
79
74
 
80
- ## Findings & Distinctions
75
+ ## Findings and distinctions
81
76
 
82
- ### Verified Observations (Backed by Evidence IDs)
77
+ ### Verified observations (backed by evidence IDs)
83
78
 
84
79
  - <Direct observation referencing EV-xx>
85
80
 
86
- ### Inferences & Working Hypotheses
81
+ ### Inferences and working hypotheses
87
82
 
88
83
  - <Reasoning or extrapolation; clearly separated from hard evidence>
89
84
 
90
- ### Unresolved Unknowns
85
+ ### Unresolved unknowns
91
86
 
92
87
  - <Gaps that remain uncertain or could not be measured>
93
88
 
94
- ## Recommendation & Revisit Conditions
89
+ ## Recommendation and revisit conditions
95
90
 
96
91
  - **Recommended Course of Action:** <Specific choice or architectural pattern>
97
92
 
@@ -2,84 +2,83 @@
2
2
  schema: "kxm.doc.v1"
3
3
  id: "REV-0001"
4
4
  type: "review"
5
- title: "Dual-Critic Review Report"
5
+ title: "Dual-critic review report"
6
6
  project: "kxm"
7
- status: "approved" # draft | in_review | approved | rejected
7
+ status: "draft" # draft | in_review | approved | superseded | archived
8
8
  owner: "@critics"
9
9
  created: "2026-09-08"
10
10
  updated: "2026-09-08"
11
11
  authority: "evidence"
12
12
  confidence: "verified"
13
- summary: "Independent dual-critic evaluation for candidate commit <git-sha>."
13
+ summary: "Independent dual-critic review of candidate tree <tree-sha>."
14
14
  tags: ["review", "critics", "quorum"]
15
15
  related: []
16
16
  details:
17
- quorum_verdict: "passed" # passed | rework_required | blocked
18
- target_commit: "<git-sha>"
17
+ outcome: "accepted" # accepted | repair_required
18
+ target_commit: "<commit-sha>"
19
+ judged_tree: "<tree-sha>"
19
20
  critics:
20
- - role: "reviewer-arch"
21
+ - kind: "review-arch"
22
+ role: "reviewer-arch"
21
23
  harness: "claude"
22
- model: "claude-fable-5-1"
23
- verdict: "pass_with_stipulations"
24
- - role: "reviewer-cli"
24
+ model: "fable"
25
+ verdict: "PASS" # PASS | BLOCK
26
+ - kind: "review-cli"
27
+ role: "reviewer-cli"
25
28
  harness: "codex"
26
29
  model: "gpt-5.6-sol"
27
- verdict: "pass"
30
+ verdict: "PASS" # PASS | BLOCK
28
31
  ---
29
32
 
30
- # Dual-Critic Review Report
33
+ # Dual-critic review report
31
34
 
32
- ## Review Scope & Provenance
35
+ ## Review scope and provenance
33
36
 
34
- - **Candidate Commit:** `<git-sha>`
37
+ - **Candidate commit:** `<commit-sha>`
38
+ - **Judged tree:** `<tree-sha>`. Each critic records the exact tree it
39
+ reviewed; a verdict on any other tree does not count.
40
+ - **Branch:** `kxm/run-<run-id>-<description>`
41
+ - **Independence rule:** each critic comes from a different vendor than the
42
+ writer and than each other. For example, a Grok (xAI) writer with Claude
43
+ (Anthropic) and Codex (OpenAI) critics.
35
44
 
36
- - **Candidate Tree Hash:** `<tree-sha>`
45
+ ## Critic 1: architecture (`review-arch`)
37
46
 
38
- - **Deterministic Branch:** `kxm/run-<id>-<description>`
39
-
40
- - **Independent Provider Rule:** Reviewers MUST originate from different providers than the implementer (Grok/xAI implementer $\rightarrow$ Claude/Anthropic + Codex/OpenAI critics).
41
-
42
- ## Critic 1: Claude Fable 5.1 (Planning & Architecture Critic)
43
-
44
- - **Role:** `reviewer-arch`
45
-
46
- - **Focus Areas:** Fail-closed security boundaries, memory isolation, permission ceilings, state consistency.
47
-
48
- - **Verdict:** **PASS WITH STIPULATIONS**
47
+ - **Role:** `reviewer-arch`, read-only
48
+ - **Focus:** fail-closed security boundaries, permission ceilings, state
49
+ consistency, memory isolation.
50
+ - **Verdict:** `PASS` or `BLOCK`
49
51
 
50
52
  ### Findings
51
53
 
52
- | ID | Severity | Category | Path | Line | Description |
53
-
54
- |---|---|---|---|---|---|
55
- | F-01 | warning | concurrency | `plugins/kxm/src/external-effects.ts` | 68 | Uncommitted CAS lease must enforce a 5-minute timeout on worker crash. |
54
+ | ID | Severity | Location | Finding |
55
+ |---|---|---|---|
56
+ | A-01 | warning | `<path>:<symbol>` | <What is wrong and why it matters> |
57
+ | A-02 | info | `<path>:<symbol>` | <Observation that needs no change> |
56
58
 
57
- | F-02 | info | architecture | `plugins/kxm/src/arbiter.ts` | 240 | Project knowledge correctly prioritized ahead of `_shared` defaults. |
59
+ ## Critic 2: CLI and docs (`review-cli`)
58
60
 
59
- ## Critic 2: GPT Astra / Codex (CLI, Ergonomics & Failure Modes)
60
-
61
- - **Role:** `reviewer-cli`
62
-
63
- - **Focus Areas:** CLI flags, error messages, terminal output, performance, failure resilience.
64
-
65
- - **Verdict:** **PASS**
61
+ - **Role:** `reviewer-cli`, read-only
62
+ - **Focus:** CLI flags, error messages, terminal output, documentation,
63
+ failure modes.
64
+ - **Verdict:** `PASS` or `BLOCK`
66
65
 
67
66
  ### Findings
68
67
 
69
- | ID | Severity | Category | Path | Line | Description |
70
-
71
- |---|---|---|---|---|---|
72
- | A-01 | info | ergonomics | `plugins/kxm/src/external-effects.ts` | 80 | Descriptive branch slugging provides clean readability in `git branch`. |
73
-
74
- ## Quorum & Dissent Reconciliation
75
-
76
- | Finding ID | Raised By | Severity | Author Response / Resolution | Status |
68
+ | ID | Severity | Location | Finding |
69
+ |---|---|---|---|
70
+ | C-01 | info | `<path>:<symbol>` | <Observation> |
77
71
 
78
- |---|---|---|---|---|
79
- | F-01 | Claude Fable | warning | Implemented 300s expiration check in `claimEffect()`. | Resolved |
72
+ ## Resolution of findings
80
73
 
81
- ## Final Quorum Signoff
74
+ | Finding | Raised by | Resolution | Status |
75
+ |---|---|---|---|
76
+ | A-01 | `review-arch` | <Change made, or why none is needed> | Resolved |
82
77
 
83
- - **Quorum Status:** **RECONCILED PASS**
78
+ ## Outcome
84
79
 
85
- - **Action:** Ready for acceptance binding via `just accept` or workflow stage transition.
80
+ - **Both critics `PASS` on the judged tree:** ready for acceptance, through
81
+ the workflow's next step or, in the KXM repository, `just accept`.
82
+ - **Either critic `BLOCK`:** send the work back for repair, re-run the witness,
83
+ and review the new tree. In the KXM repository that is a `repair` assignment
84
+ with `rework_of`; see [Assignment runner](../contributing/assignment-runner.md).