@kontextmind/kxm 0.6.0

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 (227) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.kxm/README.md +14 -0
  3. package/.kxm/assets/README.md +5 -0
  4. package/.kxm/assets/retrospectives/README.md +5 -0
  5. package/.kxm/config/README.md +5 -0
  6. package/.kxm/config/agents.json +43 -0
  7. package/.kxm/config/env.example +56 -0
  8. package/.kxm/config/update.example.yaml +9 -0
  9. package/.kxm/config/workflows/fix.json +160 -0
  10. package/.kxm/config/workflows/jira-development.json +116 -0
  11. package/.kxm/config/workflows/provenance-quorum.json +150 -0
  12. package/.kxm/config/workflows/v04-dogfood.json +72 -0
  13. package/CHANGELOG.md +465 -0
  14. package/LICENSE +21 -0
  15. package/README.md +306 -0
  16. package/SECURITY.md +72 -0
  17. package/docs/README.md +48 -0
  18. package/docs/agent-communication-envelopes-and-gates.md +553 -0
  19. package/docs/architecture.md +242 -0
  20. package/docs/assignment-runner.md +241 -0
  21. package/docs/configuration.md +361 -0
  22. package/docs/continuous-improvement.md +114 -0
  23. package/docs/getting-started.md +253 -0
  24. package/docs/kxm-handbook.md +1090 -0
  25. package/docs/operations.md +205 -0
  26. package/docs/provenance-gates.md +291 -0
  27. package/docs/skills.md +45 -0
  28. package/docs/templates/README.md +95 -0
  29. package/docs/templates/adr.md +88 -0
  30. package/docs/templates/architecture.md +120 -0
  31. package/docs/templates/bug-fix.md +109 -0
  32. package/docs/templates/feature.md +108 -0
  33. package/docs/templates/handoff.md +72 -0
  34. package/docs/templates/postmortem.md +77 -0
  35. package/docs/templates/research.md +100 -0
  36. package/docs/templates/review.md +85 -0
  37. package/docs/templates/runbook.md +73 -0
  38. package/docs/templates/test-plan.md +87 -0
  39. package/docs/templates/test-report.md +72 -0
  40. package/docs/test-matrix.md +121 -0
  41. package/docs/troubleshooting.md +249 -0
  42. package/docs/vnext/README.md +62 -0
  43. package/docs/vnext/architecture.md +185 -0
  44. package/docs/vnext/effects-and-recovery.md +172 -0
  45. package/docs/vnext/lifecycles.md +235 -0
  46. package/docs/vnext/migration.md +220 -0
  47. package/docs/vnext/routing.md +184 -0
  48. package/docs/vnext/synchronization.md +172 -0
  49. package/docs/vnext/terminology.md +240 -0
  50. package/docs/vnext/validation.md +335 -0
  51. package/docs/webhook-workflows.md +240 -0
  52. package/docs/workflow-guide.md +1150 -0
  53. package/examples/README.md +102 -0
  54. package/examples/provenance-workflow.json +40 -0
  55. package/examples/requester.ts +30 -0
  56. package/examples/reviewer-agent.ts +29 -0
  57. package/examples/roundtrip.ts +46 -0
  58. package/examples/vnext/.kxm/agents/coordinator.yaml +16 -0
  59. package/examples/vnext/.kxm/agents/critic-1.yaml +16 -0
  60. package/examples/vnext/.kxm/agents/critic-2.yaml +15 -0
  61. package/examples/vnext/.kxm/agents/critic-3.yaml +15 -0
  62. package/examples/vnext/.kxm/agents/implementer.yaml +15 -0
  63. package/examples/vnext/.kxm/agents/planner.yaml +13 -0
  64. package/examples/vnext/.kxm/agents/reproducer.yaml +15 -0
  65. package/examples/vnext/.kxm/agents/reviewer.yaml +15 -0
  66. package/examples/vnext/.kxm/gates.yaml +8 -0
  67. package/examples/vnext/.kxm/models/critic-claude.yaml +11 -0
  68. package/examples/vnext/.kxm/models/critic-gemini.yaml +11 -0
  69. package/examples/vnext/.kxm/models/critic-grok.yaml +12 -0
  70. package/examples/vnext/.kxm/models/implementation.yaml +14 -0
  71. package/examples/vnext/.kxm/models/primary.yaml +17 -0
  72. package/examples/vnext/.kxm/prices.yaml +111 -0
  73. package/examples/vnext/.kxm/project/env.yaml +7 -0
  74. package/examples/vnext/.kxm/project.yaml +32 -0
  75. package/examples/vnext/.kxm/repo/repo.yaml +8 -0
  76. package/examples/vnext/.kxm/workflows/default.yaml +92 -0
  77. package/examples/vnext/.kxm/workflows/fix.yaml +376 -0
  78. package/examples/vnext/.kxm/workflows/improve.yaml +57 -0
  79. package/examples/vnext/README.md +53 -0
  80. package/examples/vnext/records/assignment-result-recorded.json +63 -0
  81. package/examples/vnext/records/assignment-result.json +46 -0
  82. package/examples/vnext/records/context-candidate.json +42 -0
  83. package/examples/vnext/records/delivery-manifest.json +66 -0
  84. package/examples/vnext/records/effect-uncertainty-resolved-sync.json +67 -0
  85. package/examples/vnext/records/effect-uncertainty-resolved.json +62 -0
  86. package/examples/vnext/records/run-created.json +54 -0
  87. package/examples/vnext/records/sync-event.json +65 -0
  88. package/examples/vnext/repositories/api/.kxm/repo/env.yaml +7 -0
  89. package/examples/vnext/repositories/api/.kxm/repo/repo.yaml +8 -0
  90. package/examples/vnext/repositories/web/.kxm/repo/repo.yaml +8 -0
  91. package/examples/workflow-signal.ts +63 -0
  92. package/package.json +129 -0
  93. package/plugins/kxm/.claude-plugin/plugin.json +73 -0
  94. package/plugins/kxm/.mcp.json +19 -0
  95. package/plugins/kxm/README.md +93 -0
  96. package/plugins/kxm/dist/cli.js +42853 -0
  97. package/plugins/kxm/dist/client.js +416 -0
  98. package/plugins/kxm/dist/core.js +1823 -0
  99. package/plugins/kxm/dist/extension.js +3797 -0
  100. package/plugins/kxm/dist/mcp-server.js +17104 -0
  101. package/plugins/kxm/dist/runtime.js +23361 -0
  102. package/plugins/kxm/dist/server.js +13640 -0
  103. package/plugins/kxm/dist/vnext-runtime-supervisor.js +21109 -0
  104. package/plugins/kxm/package.json +12 -0
  105. package/plugins/kxm/skills/kxm/SKILL.md +97 -0
  106. package/plugins/kxm/skills/kxm/references/protocol.md +103 -0
  107. package/plugins/kxm/skills/kxm-session/SKILL.md +53 -0
  108. package/plugins/kxm/src/arbiter.ts +355 -0
  109. package/plugins/kxm/src/artifacts-exist.ts +62 -0
  110. package/plugins/kxm/src/autocomplete.ts +236 -0
  111. package/plugins/kxm/src/cli.ts +3707 -0
  112. package/plugins/kxm/src/client.ts +614 -0
  113. package/plugins/kxm/src/commands.ts +1063 -0
  114. package/plugins/kxm/src/config.ts +290 -0
  115. package/plugins/kxm/src/context/providers.ts +101 -0
  116. package/plugins/kxm/src/context-packet.ts +332 -0
  117. package/plugins/kxm/src/context.ts +499 -0
  118. package/plugins/kxm/src/core.ts +6 -0
  119. package/plugins/kxm/src/database.ts +563 -0
  120. package/plugins/kxm/src/diagnostics.ts +184 -0
  121. package/plugins/kxm/src/envelope.ts +118 -0
  122. package/plugins/kxm/src/extension.ts +895 -0
  123. package/plugins/kxm/src/external-effects.ts +299 -0
  124. package/plugins/kxm/src/github-watch.ts +255 -0
  125. package/plugins/kxm/src/hub-binding.ts +160 -0
  126. package/plugins/kxm/src/hub.ts +2502 -0
  127. package/plugins/kxm/src/improve.ts +383 -0
  128. package/plugins/kxm/src/inbox.ts +10 -0
  129. package/plugins/kxm/src/kxm-install-kind.ts +113 -0
  130. package/plugins/kxm/src/kxm-update-config.ts +39 -0
  131. package/plugins/kxm/src/kxm-update.ts +238 -0
  132. package/plugins/kxm/src/local-snapshot.ts +406 -0
  133. package/plugins/kxm/src/logger.ts +198 -0
  134. package/plugins/kxm/src/mcp-server.ts +143 -0
  135. package/plugins/kxm/src/memory.ts +385 -0
  136. package/plugins/kxm/src/nous-pi.ts +287 -0
  137. package/plugins/kxm/src/nous-provider.ts +729 -0
  138. package/plugins/kxm/src/price-calc.ts +87 -0
  139. package/plugins/kxm/src/prices.ts +121 -0
  140. package/plugins/kxm/src/protocol.ts +172 -0
  141. package/plugins/kxm/src/recovery.ts +211 -0
  142. package/plugins/kxm/src/redact.ts +26 -0
  143. package/plugins/kxm/src/retrospective.ts +400 -0
  144. package/plugins/kxm/src/routing.ts +830 -0
  145. package/plugins/kxm/src/runtime.ts +9 -0
  146. package/plugins/kxm/src/server.ts +117 -0
  147. package/plugins/kxm/src/session-work.ts +571 -0
  148. package/plugins/kxm/src/session.ts +184 -0
  149. package/plugins/kxm/src/skills.ts +535 -0
  150. package/plugins/kxm/src/state.ts +326 -0
  151. package/plugins/kxm/src/store.ts +637 -0
  152. package/plugins/kxm/src/studio-layout.ts +268 -0
  153. package/plugins/kxm/src/suggest.ts +162 -0
  154. package/plugins/kxm/src/task-manager.ts +244 -0
  155. package/plugins/kxm/src/telemetry.ts +116 -0
  156. package/plugins/kxm/src/tui.ts +1046 -0
  157. package/plugins/kxm/src/vnext-bindings.ts +403 -0
  158. package/plugins/kxm/src/vnext-config.ts +1646 -0
  159. package/plugins/kxm/src/vnext-engine-artifacts.ts +86 -0
  160. package/plugins/kxm/src/vnext-engine-command.ts +533 -0
  161. package/plugins/kxm/src/vnext-engine-compile.ts +722 -0
  162. package/plugins/kxm/src/vnext-engine-evidence.ts +273 -0
  163. package/plugins/kxm/src/vnext-engine-fold.ts +1400 -0
  164. package/plugins/kxm/src/vnext-engine-gate-records.ts +583 -0
  165. package/plugins/kxm/src/vnext-engine-plan.ts +717 -0
  166. package/plugins/kxm/src/vnext-engine.ts +2458 -0
  167. package/plugins/kxm/src/vnext-gate-hash.ts +10 -0
  168. package/plugins/kxm/src/vnext-harness.ts +1142 -0
  169. package/plugins/kxm/src/vnext-init.ts +430 -0
  170. package/plugins/kxm/src/vnext-migrate.ts +1848 -0
  171. package/plugins/kxm/src/vnext-oneshot-producer.ts +424 -0
  172. package/plugins/kxm/src/vnext-permission.ts +936 -0
  173. package/plugins/kxm/src/vnext-pi-producer.ts +628 -0
  174. package/plugins/kxm/src/vnext-repair.ts +1094 -0
  175. package/plugins/kxm/src/vnext-runtime-owner.ts +320 -0
  176. package/plugins/kxm/src/vnext-runtime-store.ts +1560 -0
  177. package/plugins/kxm/src/vnext-runtime-supervisor.ts +586 -0
  178. package/plugins/kxm/src/vnext-runtime.ts +663 -0
  179. package/plugins/kxm/src/vnext-template.ts +247 -0
  180. package/plugins/kxm/src/wiki.ts +313 -0
  181. package/plugins/kxm/src/workflow.ts +1548 -0
  182. package/schemas/vnext/README.md +46 -0
  183. package/schemas/vnext/agent.schema.json +40 -0
  184. package/schemas/vnext/assignment-result.schema.json +66 -0
  185. package/schemas/vnext/backup-manifest.schema.json +89 -0
  186. package/schemas/vnext/candidate.schema.json +109 -0
  187. package/schemas/vnext/common.schema.json +422 -0
  188. package/schemas/vnext/context-candidate.schema.json +76 -0
  189. package/schemas/vnext/context-packet.schema.json +192 -0
  190. package/schemas/vnext/delivery-manifest.schema.json +159 -0
  191. package/schemas/vnext/environment.schema.json +66 -0
  192. package/schemas/vnext/gate-registry.schema.json +109 -0
  193. package/schemas/vnext/handoff-manifest.schema.json +146 -0
  194. package/schemas/vnext/init-operation.schema.json +61 -0
  195. package/schemas/vnext/local-repository-bindings.schema.json +30 -0
  196. package/schemas/vnext/memory-record.schema.json +45 -0
  197. package/schemas/vnext/migration-decision.schema.json +26 -0
  198. package/schemas/vnext/migration-plan.schema.json +123 -0
  199. package/schemas/vnext/migration-receipt.schema.json +52 -0
  200. package/schemas/vnext/model.schema.json +42 -0
  201. package/schemas/vnext/permission-diff.schema.json +57 -0
  202. package/schemas/vnext/prices.schema.json +115 -0
  203. package/schemas/vnext/project.schema.json +85 -0
  204. package/schemas/vnext/repository.schema.json +24 -0
  205. package/schemas/vnext/run-event.schema.json +460 -0
  206. package/schemas/vnext/session-brief.schema.json +153 -0
  207. package/schemas/vnext/sync-event.schema.json +234 -0
  208. package/schemas/vnext/template-provenance.schema.json +38 -0
  209. package/schemas/vnext/workflow.schema.json +248 -0
  210. package/scripts/assignment-run.d.mts +354 -0
  211. package/scripts/assignment-run.mjs +4451 -0
  212. package/scripts/build-runtime.mjs +56 -0
  213. package/scripts/check-generated.mjs +77 -0
  214. package/scripts/check-versions.mjs +34 -0
  215. package/scripts/emit-codex-artifacts.d.mts +9 -0
  216. package/scripts/emit-codex-artifacts.mjs +91 -0
  217. package/scripts/harness-run.d.mts +83 -0
  218. package/scripts/harness-run.mjs +2095 -0
  219. package/scripts/kxm-hub.mjs +105 -0
  220. package/scripts/kxm-publish-npm.mjs +327 -0
  221. package/scripts/kxm-release-github.mjs +472 -0
  222. package/scripts/kxm-runtime-supervisor.mjs +7 -0
  223. package/scripts/kxm-worker.mjs +1127 -0
  224. package/scripts/kxm.mjs +27 -0
  225. package/scripts/roster-policy.d.mts +20 -0
  226. package/scripts/roster-policy.mjs +161 -0
  227. package/scripts/smoke-multi-pi.mjs +479 -0
@@ -0,0 +1,72 @@
1
+ [
2
+ {
3
+ "id": "kxm-v04",
4
+ "source": "generic",
5
+ "project": "kxm-v04",
6
+ "target": "coordinator",
7
+ "secretEnv": "KXM_V04_WORKFLOW_SECRET",
8
+ "signalSecretEnv": "KXM_V04_SIGNAL_SECRET",
9
+ "event": "extension.v04_requested",
10
+ "delivery": "followUp",
11
+ "ttlMs": 604800000,
12
+ "promptTemplate": "Deliver the dogfood-driven v0.4 increment for {{repository}}.\n\nIssues: {{issues}}\nProject board: {{projectBoard}}\n\nYou are the sole code writer. Use grok-researcher and gemini-reviewer for independent research, planning, and review. Use the mesh workflow tools as the durable execution record. Record plans, decisions, contradictions, errors, and lessons. Keep GitHub issues and the project board current. The user authorizes branch creation, commits, pushes, pull requests, CI monitoring, and merge only after required checks pass. Never expose credentials, raw private prompts, or unrestricted model output. Preserve explicit authorization boundaries for third-party mutations performed by future workflows.",
13
+ "stages": [
14
+ {
15
+ "id": "research",
16
+ "area": "workflow",
17
+ "label": "Research",
18
+ "instructions": "Ask both peers independently to analyze issues 5, 6, 10, 11, 12, and 13. Inspect the existing implementation and dogfood logs. Identify root causes, portability and security risks, compatible CLI patterns, recovery semantics, GitHub signal behavior, retrospective redaction, and a practical real-Pi smoke topology. Record disagreements and write a research synthesis under .kxm/assets.",
19
+ "requiredEvidence": ["independent Grok research", "independent Gemini research", "dogfood evidence", "contradictions and resolutions", "acceptance criteria"],
20
+ "maxAttempts": 3
21
+ },
22
+ {
23
+ "id": "plan",
24
+ "area": "workflow",
25
+ "label": "Plan",
26
+ "instructions": "Ask both peers for independent production plans, then synthesize one architecture and rollout plan. Keep scope bounded and backward compatible. Define command contracts, safe diagnostic taxonomy, interrupted-tool recovery envelope, retrospective schemas, GitHub watcher semantics, cross-platform process behavior, tests, documentation, migrations, and rollback. Update all six issues with the selected plan.",
27
+ "requiredEvidence": ["independent plans", "selected architecture", "security boundaries", "file ownership", "test and rollout plan"],
28
+ "maxAttempts": 3
29
+ },
30
+ {
31
+ "id": "implement",
32
+ "area": "implementation",
33
+ "label": "Implement",
34
+ "instructions": "Implement the reviewed plan as the sole writer. Prefer composable commands over hidden automation. Keep all workspace material under .kxm, produce bounded machine-readable output, preserve secret redaction, and require explicit authority for external mutations. Add deterministic tests for every command, diagnostic, recovery transition, export, and GitHub signal state. Add an opt-in real-Pi smoke harness without making model downloads or credentials part of ordinary CI.",
35
+ "requiredEvidence": ["changed paths", "command examples", "security tests", "recovery tests", "GitHub adapter tests", "retrospective snapshots", "multi-Pi smoke harness"],
36
+ "maxAttempts": 6
37
+ },
38
+ {
39
+ "id": "local-gates",
40
+ "area": "gates",
41
+ "label": "Local gates",
42
+ "instructions": "Run npm ci and the complete repository validation gate, including coverage thresholds, strict typecheck, documentation lint, version consistency, package inspection, and Claude manifest validation. Run command examples in isolated temporary workspaces. Record and fix every warning or failure, then rerun affected gates.",
43
+ "requiredEvidence": ["clean install", "test and coverage results", "typecheck", "documentation lint", "package dry-run", "manifest validation", "isolated command smoke"],
44
+ "maxAttempts": 5
45
+ },
46
+ {
47
+ "id": "review",
48
+ "area": "gates",
49
+ "label": "Independent review",
50
+ "instructions": "Have Grok and Gemini independently review the actual diff for correctness, security, portability, recovery durability, command usability, GitHub idempotency, redaction, test quality, documentation, and upgrade compatibility. Resolve every material finding and rerun affected gates.",
51
+ "requiredEvidence": ["independent Grok review", "independent Gemini review", "accepted and rejected findings", "resolved findings", "rerun gates"],
52
+ "maxAttempts": 5
53
+ },
54
+ {
55
+ "id": "delivery",
56
+ "area": "gates",
57
+ "label": "Deliver and watch",
58
+ "instructions": "Commit and push the reviewed increment, open a pull request that links all six issues, and watch required GitHub checks. Use the GitHub signal adapter when available. Merge only when required checks are green, update project status, and leave infrastructure-dependent smoke work open if no labeled real-Pi runner is configured.",
59
+ "requiredEvidence": ["commit", "pull request", "green required checks", "merge or explicit blocker", "project status"],
60
+ "maxAttempts": 5
61
+ },
62
+ {
63
+ "id": "retrospective",
64
+ "area": "workflow",
65
+ "label": "Retrospective",
66
+ "instructions": "Export and review the durable run retrospective. Record recurring errors, unresolved contradictions, manual interventions, timing, and measurable follow-up actions. Do not silently turn proposed improvements into policy.",
67
+ "requiredEvidence": ["retrospective Markdown", "retrospective JSON", "review decision", "remaining backlog"],
68
+ "maxAttempts": 3
69
+ }
70
+ ]
71
+ }
72
+ ]
package/CHANGELOG.md ADDED
@@ -0,0 +1,465 @@
1
+ # Changelog
2
+
3
+ All notable user-facing changes are documented here. The project follows [Semantic Versioning](https://semver.org/).
4
+
5
+ ## Unreleased
6
+
7
+ ### Added
8
+
9
+ - **Public npm release automation unlatched (E7):** Unlatched `publish-npm` job
10
+ in `.github/workflows/release.yml` with `environment: npm-publish`. Added
11
+ `scripts/kxm-publish-npm.mjs` to enforce fail-closed verification: requires the
12
+ GitHub release for the tag to be published (`draft: false`), validates the
13
+ release asset presence and SHA-256 digest against the release manifest, and
14
+ executes `npm publish --access public`. Added `publishConfig.access: "public"`
15
+ in root `package.json` and unit test suite `test/core/kxm-publish-npm.test.ts`.
16
+
17
+ ## 0.6.0 - 2026-09-08
18
+
19
+ ### Added
20
+
21
+ - **Improvement report and candidates (E8, issue #97):** Replaced gate-count
22
+ bucketing in `improve.ts` with routing record grouping by
23
+ `(workflowHash, step, agentRole, promptHash)`. Rows compute recurrence, mean cost,
24
+ mean latency, verify-pass rate, and rework; high recurrence with high pass rate
25
+ emits coded-repeat candidates. Single candidate format `kxm.candidate.v1` in
26
+ tracked `.kxm/candidates/` with kind (`gate`, `skill`, `workflow-step`), evidence refs,
27
+ baseline metrics, declared outcome, measure, and proposed diff patch. Skills carry
28
+ standard YAML frontmatter (`name`, `description`). `skills promote` emits a unified diff
29
+ patch (`.patch`) instead of moving a directory. Added `improve.yaml` workflow in
30
+ `examples/vnext/.kxm/workflows/` completing on the driver. Un-gitignored retrospective exports.
31
+ - **Database backup, restore, and migrations (E6, issue #102):** Unified SQLite
32
+ lifecycle via `openDatabase` with fail-closed schema checks, WAL journal mode with
33
+ retry loop, busy timeout, and transaction helper with a nesting guard. Stepwise
34
+ legacy migrations for `MeshStore` (v1 -> v2, v2 -> v3) replace unconditional version
35
+ stamping. Added `kxm backup [--out <dir>]` and `kxm restore <manifest>` utilizing
36
+ SQLite's backup API (`VACUUM INTO`), WAL checkpoint, PRAGMA integrity checks, and
37
+ hashed manifest generation (`kxm.backup-manifest.v1`).
38
+ - **Harness-agnostic Git memory (E5b, issue #101):** Project memory authored in
39
+ `.kxm/memory/` using schema `kxm.memory.v1` with YAML frontmatter. Memory notes
40
+ recorded to `.kxm/memory/candidates/` with evidence authority, promoted exclusively
41
+ via PR/commit. Projections regenerated across `AGENTS.md`, `CLAUDE.md`, and
42
+ `GEMINI.md` via `kxm memory sync` with drift checks enforced in CI. Unified memory
43
+ brief available via `kxm memory brief [--json]`, Claude Code `SessionStart` hook,
44
+ and Pi `/kxm memory` slash command.
45
+ - **E5 memory floor and test tiering (issue #100):** Enforced memory security rules
46
+ (Rule 1 admin-authenticated state promotion without loopback bypass; Rule 2
47
+ exclusion of proposed candidates from currentState and content-hashed promoted
48
+ skill verification; Rule 3 control-plane field rejection, secret redaction, and
49
+ `scope` validation). Pins canonical `memoryRevision` (`ctxrev_<sha256>`) at run
50
+ creation. Reorganized tests into `test/core/` (PR gate) and `test/simulations/`
51
+ (heavy simulations) with parallel `--test-concurrency=4` and scheduled nightly
52
+ coverage.
53
+ - Agent-only vNext run loop (`vnext-engine.ts`): pins a D1 compiled plan in an
54
+ immutable hashed envelope, folds schema-valid `kxm.run-event.v1` events with
55
+ a run_state projection, and drives a model-free simulated producer under
56
+ transition/step budgets. Public drive, step, and scheduler share one
57
+ admission bound. Sync and async producer failures settle as
58
+ `producer_rejected` without leaking the attempt capability. A process
59
+ restart of an executing attempt is unreconciled; operator cancel before pin
60
+ still rebuilds. Duration/cost limits and the default/fix driver gate stay
61
+ fail-closed for later slices. Event store is schema v3 with immutable gate
62
+ rows; version-1 and version-2 files and `kxm.run-plan.v1` envelopes are
63
+ refused (E6). Gate dispatch stays S3/S4. Evaluated gate settlement applies
64
+ transition-budget failure, and complete/no-start observation facts are
65
+ closed on both insert and replay.
66
+ - Pure vNext workflow compile (`vnext-engine-compile.ts`) turns a validated
67
+ `kxm.workflow.v1` into a frozen JSON plan. Compile is not execution; D3/D4
68
+ remain open.
69
+ - Routing contract doc (`docs/vnext/routing.md`) and synchronization status
70
+ (schema-tested; Phase 8 implementation).
71
+ - Tag-triggered `release.yml` packs `kxm-<v>.tgz`, creates or reuses only a
72
+ **draft** GitHub release, and fails unless the REST asset digest equals the
73
+ local sha256. A published release for the tag is never modified; reruns skip
74
+ upload only when the existing digest matches. npm publish stays `if: false`
75
+ until a later published-release + `npm-publish` environment gate.
76
+ - Hosted `Plugin validation` CI job runs native `claude plugin validate` with
77
+ `@anthropic-ai/claude-code@2.1.261` (no model calls). After
78
+ `--ignore-scripts` install, the job runs that package's `install.cjs` so
79
+ the native binary is present.
80
+ - Session brief `AGENTS.md` / `CLAUDE.md` and Tracking in
81
+ `docs/vnext/implementation-plan.md` (roles, provider-native harness routing,
82
+ cost/insights, plan hygiene).
83
+ - Hub-local session chrome: `kxm session brief [--status]`, Pi TUI picker and
84
+ status line on new/fork sessions, `/kxm` (`status`/`hub`/`help`), skill
85
+ `kxm-session`. `kxm hub bind <url>` / `kxm hub unbind` persist a host-level
86
+ hub URL; `kxm init` is project-only.
87
+ Pi widget `ship` line shows git dirty/ahead vs verify/CI (does not run tests).
88
+ - `kxm hub bind <url>` writes `kxm.hub-binding.v1` and probes `/health` in
89
+ 300 ms (`on` / `off` / `unknown`). Hub listening line reports `auth=token`
90
+ or `auth=none`.
91
+ - `kxm update --check` / `--kxm` notices and applies operator package updates.
92
+ GitHub releases are the current install path; npm is for after the public
93
+ package. Git `.kxm/update.yaml` `auto` applies on `kxm update`.
94
+ - Opt-in Nous Pi providers `nous/*` (direct API, `NOUS_API_KEY` only) and
95
+ `nous-proxy/*` (local Hermes subscription proxy). Unset `KXM_NOUS_PROVIDERS`
96
+ leaves startup offline: no fetch and no `registerProvider`. Bounded live
97
+ `/v1/models` catalog discovery (or a matching dated pin) fail-closes on
98
+ unknown tokens, non-loopback proxy URLs, and incomplete or malformed rates
99
+ rather than guessing zero. Context-tier estimates are labeled upper bounds
100
+ in both direct and proxy display names (proxy keeps
101
+ `subscription proxy, market ref`) and are not registered as a Pi
102
+ `cost.tiers` schedule. Mac/Linux setup order is in `docs/configuration.md`.
103
+ On 2026-09-07, tests verified one streamed tool call plus usage on
104
+ `qwen/qwen3-coder-plus` for the direct API and an OAuth-backed Hermes
105
+ proxy. Other models and automatic auth refresh remain unverified.
106
+ Official Nous native Messages is for `anthropic/*`; Qwen uses
107
+ chat/completions, so direct Claude→Nous→Qwen is unsupported by that
108
+ documented route.
109
+
110
+ ### Fixed
111
+
112
+ - Concurrent Runtime registry and event-store initialization now checks and
113
+ creates the schema under one write transaction, preventing duplicate-table
114
+ failures when a supervisor and status reader first open the same database.
115
+ - Historical (before the 2026-09-05 platform pause): PR CI no longer skipped
116
+ Validate or Plugin validation for docs-only diffs, so the then-required
117
+ contexts (four expanded Validate names plus Plugin validation) still ran.
118
+ - Draft GitHub release lookup lists releases (including drafts, every page)
119
+ after a by-tag 404 so a retry reuses one draft instead of creating another.
120
+ Duplicate drafts, a published match, and list/pagination failures fail
121
+ closed with no mutation.
122
+ - Headless helper reads `prompt_file` and `output_schema` against the
123
+ invocation cwd before any auth or assignment spawn. Missing or unreadable
124
+ inputs fail closed with zero spawn and no child left waiting on stdin.
125
+ File-consuming argv tokens are absolute so the assignment can run in
126
+ `request.cwd`.
127
+ - Headless helper preflight requires `harness`, `role`, `model`, `permission`,
128
+ and `prompt_file` as nonempty strings, so omitted permission no longer
129
+ launches Pi with `-a` and omitted model no longer falls through to a CLI
130
+ default. Pi planner and reviewer roles cannot `edit`; only `experiment` may.
131
+ `max_cost_usd` and `timeout_ms` reject non-numbers, non-finite values, and
132
+ zero instead of dropping the flag. `just` recipes pass user paths as quoted
133
+ positional arguments and `JSON.stringify` them; `just runs` prints
134
+ `billed` / `list` / `unmetered` / `unknown` instead of `$0.0000` for absent
135
+ cost.
136
+ - Pi git installs no longer fail to load the extension when production
137
+ `node_modules` omits `yaml`. Update-config YAML parsing stays on the bundled
138
+ CLI path.
139
+ - Explicit `kxm update --kxm` refuses non-global installs (`install_kind_*`)
140
+ even when already current or the release check is unavailable. Auto-apply
141
+ still hints only when an update is available.
142
+
143
+ ### Changed
144
+
145
+ - CI, release, and smoke workflows select the ARC scale set
146
+ `kontextmind-doks` (scalar `runs-on`, not a label tuple). Plugin
147
+ validation moved off GitHub-hosted runners. Manual smoke is
148
+ equality-gated on `KXM_SMOKE_RUNNER` and stays disabled until Pi
149
+ credentials exist in ephemeral pods. Release/npm `if: false` and the
150
+ Windows pause are unchanged.
151
+ - Operator-authorized platform pause (2026-09-05): PR CI keeps two Linux
152
+ Validate legs (Node 22.19.0 and 24) plus Classify changes, Docs lint, and
153
+ Plugin validation (five jobs). Windows CI legs, hosted Windows probes, and
154
+ `release.yml` are paused (`release` job `if: false`); Windows is not
155
+ deprecated and no Windows source or tests were removed. Local verification
156
+ remains `npm run verify` on macOS. No new paid macOS runner.
157
+ - Headless `scripts/harness-run.mjs` now emits `kxm.harness-result.v2`:
158
+ transport `completed|failed|interrupted` is separate from closed model-claim
159
+ metadata and from product `routing-record.v1` `finalOutcome`. Direct-child
160
+ signal facts keep a null `exitCode` and the exact `signal`. Natural
161
+ successful exit waits for stdio drain; lingering pipes settle bounded
162
+ without signaling an already-exited child. Public result types are closed
163
+ (no object leak in token/cost scalars). Malformed optional text and
164
+ post-spawn stdin/pid writes fail at run stage with retained usage.
165
+ Timeout SIGTERM then SIGKILL can settle without a `close` and does not
166
+ claim descendant death. Public metadata is a closed allowlist; raw
167
+ model/stdio text stays in private sidecars. Grok adds `--no-subagents` and
168
+ `--disable-web-search` plus optional `max_turns`; Codex adds
169
+ `--ignore-user-config`. Obsolete v1 result files are diagnosed, not
170
+ upgraded.
171
+ - `kxm harness list` auth is tri-state `yes` / `no` / `unknown`. Codex
172
+ distinguishes ChatGPT vs API-key login status (text keeps `auth=yes` and
173
+ adds an `API key` note); Claude parses JSON `loggedIn`; Grok is an
174
+ observational catalog entry (`mode: either`) with a confirmed login probe.
175
+ Recognized logged-out payloads stay `no` on a normal nonzero CLI; spawn,
176
+ unparsed, and contradictory `ok`/`code` stay `unknown`. Pi without a named
177
+ provider/model is `unknown`. `eligibleHarnesses` selects only detected and
178
+ authenticated inventory entries and fail-closes when empty.
179
+ - Headless `scripts/harness-run.mjs` helper now fail-closes on native auth
180
+ preflight, unverified harnesses, native-provider Pi impersonation, and
181
+ unsupported Windows launchers. Read-only Claude uses `--safe-mode` and
182
+ `Read,Glob,Grep` (no `--bare`, no Bash). Usage is cumulative per assignment;
183
+ context occupancy is explicit unknown. Answer and stderr stay in private
184
+ sidecars. There is no `impl-pi` Grok fallback. This is a dev helper, not a
185
+ Phase 11 adapter.
186
+ - Pi install instructions pin `@main`; an older checkout tracking `master` must
187
+ `pi remove` then reinstall.
188
+ - `kxm mesh` (including `init`/`smoke` and `--json`) fails closed with a stderr
189
+ brake naming `kxm init`, `kxm hub`, and `scripts/smoke-multi-pi.mjs`. The
190
+ command stays absent from help.
191
+ - `MeshClient`/`MeshHttpError` are `HubClient`/`HubHttpError`; `MeshDashboard`
192
+ is `KxmDashboard`.
193
+ - Operator copy says `hub:off`; a docs brake test fails on leftover Mesh
194
+ operator tokens.
195
+ - Session readiness on `startup`/`new`/`fork` (status, widget, picker
196
+ skip/select, online/offline hub, RPC and opt-out, single registration) is a
197
+ deterministic extension test.
198
+ - Coverage include inverted to `plugins/kxm/src/**/*.ts`. Excludes are only
199
+ `server.ts` and `mcp-server.ts` (spawned bundles attribute to `dist`; see
200
+ CONTRIBUTING). Measured on Windows Node 22.21.0 locally (one leg; CI legs
201
+ were not read because this unit does not push): lines 93.75, branches 80.87,
202
+ functions 93.53. Thresholds set to 93/80/93 (per-leg minimum truncated to a
203
+ whole percent). **This is not a weakened gate**: the old 95/80/90 measured 13
204
+ hand-listed files, while 93/80/93 measures all 42 non-excluded files, so the
205
+ enforced surface roughly triples and functions actually rises from 90 to 93.
206
+ Lines reads lower only because the denominator changed. From here the values
207
+ may only ratchet up; 95/80/90 is a milestone, not the gate. `npm run verify` now ends with `check:generated`, which diffs
208
+ built `dist` against the staged copy. `kxm-hub` and `kxm-worker` bins are
209
+ removed (`kxm` remains; scripts still ship). Peers
210
+ `@earendil-works/pi-coding-agent` and `typebox` are optional, pinned as
211
+ devDependencies at lockfile versions 0.84.3 and 1.3.19.
212
+ `.kxm/config/workflows/provenance-quorum.json` now ships in `files`.
213
+ - CI classifies each push and pull request: documentation-only changes run
214
+ only the docs lint job, while code changes run the full matrix. Every leg
215
+ still runs coverage: dropping instrumentation on Windows would be faster,
216
+ but `--experimental-test-coverage` sets `NODE_V8_COVERAGE`, which child
217
+ processes inherit and which changes their shutdown path, so an
218
+ uninstrumented Windows leg fails the worker pre-ack test on Node 24.
219
+ A newer push cancels an older pull-request run. `check:generated` runs on
220
+ every validate leg; the standalone `generated` job is removed. `node_modules`
221
+ is cached per lockfile. Dependabot groups minor and patch npm updates and all
222
+ Actions updates.
223
+ - Product identity is **KXM** (`@kontextmind/kxm`, plugin `kxm`). Hub CLI is
224
+ `kxm hub start|view|stop`; live screens are `kxm dash`. Default database is
225
+ `.kxm/state/kxm.db`. Agent tools use the `kxm_*` prefix; env vars use `KXM_*`.
226
+ - `kxm dash` is a tabbed list/detail dashboard (agents, tasks, workflows, plans,
227
+ inbox, procs). `kxm harness list` / `kxm update` observe and update harnesses
228
+ without a second preferences store.
229
+ - First-run path is install, `kxm init`, foreground `kxm hub start`, `kxm hub
230
+ bind <url>`, `kxm session brief`, then `pi` and `/kxm hub`. Hub start prints
231
+ a cached update notice before spawn and refreshes in the background; a first
232
+ start with an empty cache may print the notice only after the hub is up.
233
+ Malformed `.kxm/update.yaml` is a stderr warning and does not block start;
234
+ `kxm update` still fails closed.
235
+ - **Breaking:** `kxm init --hub` and `--hub-url` are unknown options. Bind
236
+ with `kxm hub bind <url>`; remove the binding with `kxm hub unbind`.
237
+ - The `kxm mesh` group is deleted. Commander reports it as an unknown command.
238
+ - **Breaking renames (A2, no aliases):** wire headers `x-mesh-agent-id`,
239
+ `x-mesh-agent-key`, `x-mesh-delivery-id`, and `x-mesh-events-mode` are now
240
+ `x-kxm-agent-id`, `x-kxm-agent-key`, `x-kxm-delivery-id`, and
241
+ `x-kxm-events-mode`; hub and workers ship in one package and upgrade
242
+ together, with no header version check. The administrative caller id
243
+ `mesh-admin` is `kxm-admin` in context provenance, journal promotions, and
244
+ degradation approvals. Telemetry and session-manifest `host` is `local` or
245
+ `hub` (was `mesh`). Pi extension custom message types are `kxm-inbound` and
246
+ `kxm-recovery`; the status line reads `hub:<agent>`. Bin script and worker
247
+ messages say KXM. Prometheus `pi_mesh_*` metric names are unchanged until E3.
248
+ - CLI honesty: `kxm --version` prints the package version; every JSON payload
249
+ carries `schema: "kxm.cli-result.v1"` (worker envelopes keep
250
+ `kxm.worker-result.v1`); `ok:false` payloads go to stderr in both text and
251
+ JSON modes; `kxm runs status|cancel|list` report themselves as `runs ...`;
252
+ `kxm run` says that runs remain created until Phase 3a lands and its JSON
253
+ carries `phase: "pre-3a"`.
254
+ - Future slices do not add backwards-compat shims.
255
+
256
+ ## 0.5.1 - 2026-09-01
257
+
258
+ ### Changed
259
+
260
+ - `/fix` captures the immutable reproduction oracle only after independent two-critic `repro-review`. A sibling-API or newer-stack draft is invalid even if it fails. `repro-write` retries on `failed` instead of treating a wrong seam or `new DbContext()` as `blocked`.
261
+
262
+ ## 0.5.0 - 2026-08-31
263
+
264
+ KXM v0.5 extends the durable multi-agent communication/workflow plane into a **context operating system**. Everything is additive: existing v0.4 workflows, gates, telemetry, and CLI behavior are unchanged unless new context/transition features are enabled.
265
+
266
+ ### Added
267
+
268
+ - **Context schemas** (`kxm.context-item.v1`/`request`/`packet`): fail-closed validation, immutable provenance, explicit authority/confidence dimensions, lifecycle status, project isolation, deterministic token estimation. Storage in SQLite with a v2→v3 schema upgrade.
269
+ - **Temporal project state** (`kxm state`): one current value per key (or explicitly set-valued), `asOf` historical queries, supersession graph queries, contradiction detection, evidence-bound admin-only promotion. Agents may propose; only the control plane promotes.
270
+ - **Role-aware context arbiter**: deterministic packet assembly per role (repro/planner/critic/implementer/verifier or custom) with fixed token budgets; superseded/rejected records excluded by default; unresolved gaps reported. Surfaces: `kxm context get/recall/state/episode/promote/explain/wiki-compile/wiki-lint`, Pi tools `kxm_context/kxm_recall/kxm_state/kxm_episode/kxm_promote`, and the same five MCP tools.
271
+ - **Authority lattice** (issue #36): deterministic grant floor per origin — human/workflow → `policy`, git → `instruction`, peer/tool/external/derived → `evidence`. Reserialization privilege escalation fails closed; derived/summarized content is evidence at best with bounded transitive lineage; control-plane fields cannot be smuggled inside context items.
272
+ - **Compiled knowledge wiki** under `.kxm/knowledge/wiki/`: deterministic source-linked generation, current/superseded state preserved, open contradictions rendered explicitly, secrets redacted, and lint gates for broken refs, orphan pages, stale state links, and unsurfaced contradictions.
273
+ - **Typed workflow back-edges**: per-stage `on` outcome maps with `$terminal`, global/per-stage/per-edge budgets, durable transition journal, attempt-bound evidence on re-entry, and definition-load validation that rejects unknown targets, forward skips over approval/gate stages, and budgetless cycles.
274
+ - **Reference `/fix` workflow** (`.kxm/config/workflows/fix.json`): two-phase reproduction (read-only explore → tests-only write), immutable reproduction oracle (`weakened_reproduction`), approved plan-hash gating, human-approval security gate, bounded rework via back-edges, and a ready-for-human-acceptance final state with no auto-merge.
275
+ - **Governed skill lifecycle** under `.kxm/skills/` (`kxm skills create/evaluate/promote/reject/list/verify`): content-addressed candidates, four protected evaluations gating promotion, automatic quarantine on functional/safety failure, hash-pinned immutable promoted skills, explicit cross-model compatibility, and a gated skillopt hook. See `docs/skills.md`.
276
+ - **Routing telemetry** (`kxm.routing-record.v1`): behavioral configuration hash over model route + role prompt + skills + tool/context policy + workflow + verifier config; `kxm routing report` computes verified completion/cost/rework comparisons without reading raw prompts.
277
+ - **Governed journal promotion** (issue #32): new journal categories (`observation`, `hypothesis`, `experiment`, `state-change`, `skill-candidate`), mandatory evidence for lessons and skill candidates, and an admin-only, append-only promotion lifecycle (`POST /v1/journal/:id/promotion`).
278
+ - Journal entries can carry stage/attempt provenance; client supports `stageId`.
279
+
280
+ ### Changed
281
+
282
+ - Renamed the operator CLI from `pi-mesh` to `kxm` and rebuilt it on Commander.
283
+ - `kxm` now has first-class tools: `agent`, `session`, `workflow`, `gate`, `mesh`, and `improve`.
284
+ - Examples: `kxm agent worker`, `kxm session status`, `kxm workflow start`, `kxm gate validate`, `kxm mesh hub`.
285
+ - Agents (AI-driven) and gates (code-driven) share `kxm.worker.v1` and emit `kxm.worker-result.v1`.
286
+ - Source equivalent is `node scripts/kxm.mjs`. Hub startup output is `kxm mesh hub listening`.
287
+ - Added a live `@earendil-works/pi-tui` mesh dashboard with responsive toggle panels and authenticated metadata-only operations SSE for real-time agent/message/workflow state; the Node 22 minimum is now 22.19 to match the TUI runtime.
288
+ - Long-lived Pi workers now leave waiting work queued in the hub, activate one message at a time, prioritize safe steering, normalize autonomous `nextTurn`, and restart when a delivered message never starts.
289
+ - Long-lived Pi workers can isolate model context by durable workflow run: `--session-isolation workflow` keeps ordinary work in a stable default session, gives every hub-authorized run a bounded run-specific session, and uses pre-ack child swapping to preserve one JSONL writer and durable replay. The upgrade-compatible default remains `off` so existing shared Pi histories are not silently abandoned.
290
+ - Added the wiki-ready `docs/kxm-handbook.md` covering installation, configuration, the complete CLI, Pi, Claude Code, workflows, gates, observability, security, and recovery.
291
+ - Improvement telemetry now classifies any named project/workflow generically instead of hardcoding one consumer; `KXM_IMPROVE_TARGET` remains an explicit `cli`/`project` override.
292
+ - `kxm mesh init` now creates empty project-owned workspace directories instead of copying the package repository's provider-specific dogfood configuration.
293
+ - The TUI's project-token fallback now negotiates a presence-only SSE stream and refuses unmarked legacy streams, preserving the no-message-bodies observer contract when admin operations access is unavailable.
294
+ - Workflow validation mirrors the hub's file/inline XOR source contract; active definitions supply start/callback credentials, with the start secret as callback fallback.
295
+ - Added the runnable `artifacts-exist` gate, fail-closed roster/session parsing, secret-free workflow definition hashes, and dry-run telemetry suppression.
296
+
297
+ ## 0.4.3 - 2026-08-26
298
+
299
+ ### Added
300
+
301
+ - Per-requirement `peer-reply` evidence policies with run-start eligible-producer snapshots, immutable run/stage/requirement/attempt message context, hub-verified message references, and quorum by unique stable producer ID.
302
+ - Explicit admin-only, policy-declared, current-attempt quorum degradation through `pi-mesh workflow degrade`, including durable approval and degraded-stage audit records.
303
+ - Optional metadata-only peer-evidence audit fields in `pi-mesh.retrospective.v1`, preserving producer/context/timestamp/hash provenance and degradation approvals without prompt or reply bodies.
304
+ - Command-first provenance workflow example plus security, operations, protocol, troubleshooting, and trust-boundary guidance.
305
+
306
+ ### Changed
307
+
308
+ - Pi extension and Claude MCP send/fanout tools accept `workflowContext`; checkpoint and wait tools accept `evidenceRefs` with matching behavior across both harnesses.
309
+ - Caller-authored evidence strings, correlation IDs, and idempotency keys cannot satisfy a declared peer policy. Only exact durable replied messages for the active workflow context count.
310
+ - Long-lived workers can opt into path-delimited exact extension and skill sets. Each configured category disables discovery, validates resource types before supervision, and leaves default discovery unchanged when unset.
311
+ - Final provider failures no longer settle durable inbound work as a successful peer reply. The Pi extension retains the message and records metadata-only diagnostics; supervised workers restart after graceful RPC shutdown and can rotate through bounded fallback models while preserving session context.
312
+ - Long-lived workers support an explicit Pi tool allowlist and a bounded tool-execution watchdog. This lets read-only review peers operate without shell/write capabilities and recovers delivered work when an enabled tool never returns. The default watchdog includes one minute of supervisor grace beyond the longest local mesh wait.
313
+ - Worker-owned PID, control, recovery, context, and default log paths use a collision-resistant identity derived from the exact project and agent name; legacy name-only recovery files migrate only when their embedded owner matches exactly.
314
+
315
+ ### Fixed
316
+
317
+ - Workflow-context retries canonicalize field order and requirement-key spelling before hashing and compare hub state field-by-field, so semantically identical objects reuse one durable request while context-free retries retain their pre-0.4.3 hash.
318
+ - Typed workflow definitions may omit `acceptedStatuses`, matching the JSON parser and documented default of `["replied"]`.
319
+ - Supervised Pi restarts revalidate every exact extension and skill path and stop on static resource drift instead of silently restarting without a required skill.
320
+ - The release dogfood launcher separates administrative and worker project credentials, withholds webhook secrets from agents, and proves exact coordinator/reviewer readiness before starting a run.
321
+ - `--fresh-start` skips only the initial session resume, while later supervised recovery can use `--continue`; final quota/provider errors wait for Pi's own retries, preserve durable work, and use a configurable provider retry delay when no fallback remains.
322
+ - Hub and worker wrappers claim their PID files exclusively, refuse unverifiable stale claims, and clean up only their own recorded generation, so duplicate starts and sanitized-name collisions cannot orphan the process managed by `pi-mesh stop`.
323
+ - RPC supervision handles oversized provider and tool frames with bounded streaming metadata extraction. Raw RPC bytes stay only in the protected agent log and are never forwarded to supervisor stdout or structured lifecycle logs.
324
+ - Structurally unresumable settled sessions take the fresh-session path before provider rotation, while completed oversized tool results still cancel their watchdog.
325
+ - Recovery telemetry is attached only to its exact persisted workflow run. Unbound worker events are consumed without guessing an active workflow, and fresh provider/tool-timeout recovery relies on one durable inbound replay instead of injecting a duplicate turn.
326
+ - The release launcher reuses one delivery ID across workflow-start retries and requires a deterministic run/stage/attempt fanout key with a local wait below the supervisor watchdog.
327
+
328
+ ### Upgrade note
329
+
330
+ - Provenance fields are additive inside existing SQLite schema-v2 JSON records; no destructive database migration is required and existing history remains readable. Legacy evidence continues to work for ordinary requirements but never satisfies a declared peer policy.
331
+ - Peer quorum proves durable provenance within the shared project-credential boundary. It does not prove truth, model identity, independent inference, non-collusion, or human approval.
332
+
333
+ ## 0.4.2 - 2026-08-26
334
+
335
+ ### Fixed
336
+
337
+ - Fan-out local wait deadlines and caller aborts now return recoverable `pending` results with the durable message ID, current hub status, expiry, and wait outcome instead of a terminal-looking error that encouraged duplicate work.
338
+ - Fan-out performs a final status read at the wait boundary, preserves request handles after a successful send, and accepts Pi or Claude MCP cancellation signals without cancelling the durable request.
339
+ - Pi workers now reconcile expired or cancelled active requests, skip terminal queued work, automatically retry transient settlement failures with capped backoff, and always release terminal settlement state so the next valid request can run.
340
+ - Claude MCP inboxes now reconcile missed terminal events, evict expired and cancelled requests, survive reconnect/restart through delivered-message replay, and remove terminal reply races instead of presenting stale work.
341
+ - The real multi-Pi smoke harness no longer shortens message TTL to its local phase timeout.
342
+
343
+ ### Changed
344
+
345
+ - Operator guidance now distinguishes message TTL from local wait duration, recommends the 24-hour default for model work, and requires `kxm_get` or an exact idempotent retry while a peer remains pending.
346
+ - Pending peers explicitly do not count as planning, review, or workflow-checkpoint evidence.
347
+
348
+ ### Upgrade note
349
+
350
+ - `kxm_fanout` adds the nonterminal `pending` result state and the optional `messageStatus`, `expiresAt`, and `waitStatus` fields. Consumers that exhaustively switch on result status should handle `pending` by inspecting the returned message ID rather than dispatching a replacement request.
351
+
352
+ ## 0.4.1 - 2026-08-26
353
+
354
+ ### Fixed
355
+
356
+ - Signed workflow callbacks now reject any supplied `workflow.run`, `workflow.stage`, or `workflow.signal` evidence that disagrees with the callback route or active wait, without advancing or recording the rejected delivery.
357
+ - Operator installation guidance now distinguishes Pi's extension-and-skill Git install from the PATH CLI and uses the authenticated packed release asset for command-first setup.
358
+
359
+ ## 0.4.0 - 2026-08-26
360
+
361
+ ### Added
362
+
363
+ - Additive `pi-mesh` operator CLI for workspace init, validation, status, dry-run workflow planning, GitHub check watching, and retrospective export.
364
+ - Allowlisted diagnostic classification for failed workflow tools and 401/403 identity-scope errors, including bounded `operation`, `nextAction`, and assigned coordinator name.
365
+ - Command-first GitHub check watcher that posts the existing signed workflow signal, binds evidence to the exact run/stage/signal key, and posts `github_watch_timeout` as failed before exiting 4.
366
+ - Worker drain, `--continue` fallback, and a redacted recovery envelope under `.kxm/state`.
367
+ - Atomic Markdown/JSON retrospective export under `.kxm/assets/retrospectives` with `reviewDecision=proposed`.
368
+ - Opt-in real multi-Pi release harness that launches two authenticated Pi RPC workers in an isolated `.kxm`, verifies discovery, request/reply, fanout, durable restart/resume, journal, and checkpoint flows, and skips only when Pi or model credentials are unavailable.
369
+
370
+ ### Changed
371
+
372
+ - Failed-tool journal summaries now include an allowlisted diagnostic class instead of a generic "tool failed" sentence.
373
+ - Long-lived workers wait longer for a graceful SIGTERM drain and retry once without `--continue` after a fast failure.
374
+ - The npm artifact now ships self-contained JavaScript runtimes for `pi-mesh` and `kxm-hub`, so installed commands do not depend on Node stripping TypeScript inside `node_modules`.
375
+ - Workflow gates now accumulate evidence by normalized requirement identity across local waits and passing callbacks; unrelated check or context volume cannot satisfy a missing review, artifact, or retrospective requirement.
376
+ - Generated-runtime CI now rejects missing, untracked, or stale CLI, hub, and MCP artifacts after rebuilding them.
377
+ - GitHub watching requests complete 100-item check-run pages, treats `startup_failure` as failed, and uses a new delivery generation for each watcher invocation while preserving one ID across its transport retries.
378
+ - Default `pi-mesh signal` delivery IDs are unique per command invocation so a corrected callback after re-waiting cannot conflict with the prior failed attempt.
379
+
380
+ ### Upgrade note
381
+
382
+ - Extra 401/403 JSON fields are additive. 0.3.1 clients ignore them. Coordinator journal writes after a failed run remain allowed; checkpoints and waits still require a running or waiting run.
383
+ - Workflow checkpoint, wait, callback, and `pi-mesh signal` evidence changed from string arrays to keyed string objects. Use the canonical `requiredEvidence` value as each key. Pre-0.4 array evidence remains readable for history but does not satisfy a new keyed gate.
384
+
385
+ ## 0.3.1 - 2026-08-26
386
+
387
+ ### Added
388
+
389
+ - Durable external workflow waits that safely release coordinator turns and resume from signed CI, review, merge, or Jira result callbacks.
390
+ - Retry-deduplicated signal receipts, bounded wait deadlines, timeout journaling, and optional least-privilege callback secrets.
391
+ - Atomic signal transitions, minimal callback-secret responses, and durable timeout notifications to the coordinator.
392
+ - `kxm_workflow_wait` for Pi and Claude plus an executable signed callback example.
393
+ - Canonical `.kxm` workspace directories for tracked configuration and assets, ignored logs and state, and persisted hub/worker log files.
394
+ - Retry and nonzero failure handling when a long-lived worker cannot spawn Pi.
395
+ - Windows-safe long-lived worker launch through `ComSpec` for Pi command scripts.
396
+ - Cross-platform CI at the exact Node 22.13 floor and current Node 24 release.
397
+ - Bounded peer replies that return a terminal truncated response instead of leaving the sender blocked when model output exceeds the message limit.
398
+
399
+ ### Changed
400
+
401
+ - Expanded Pi to twelve tools and Claude MCP to fourteen tools.
402
+ - Replaced the native `better-sqlite3` dependency with Node's built-in SQLite runtime so Pi package installation does not require a C++ toolchain; the supported runtime is Node 22.13+ on the 22.x line or Node 24+.
403
+ - Scoped `kxm_fanout` idempotency to the caller prefix, correlation ID, and normalized target so retained messages from an earlier workflow cannot block a later run.
404
+
405
+ ### Upgrade note
406
+
407
+ - Fanout retry keys created before 0.3.1 used a different format. Finish or inspect outstanding fanouts before upgrading; an exact retry that crosses the upgrade can dispatch a new peer request and does not provide cross-version exactly-once behavior.
408
+
409
+ ## 0.3.0 - 2026-08-25
410
+
411
+ ### Added
412
+
413
+ - Signed Jira, GitHub, and generic webhook ingress with SHA-256 HMAC verification, provider delivery-ID deduplication, event filtering, and payload-path filters.
414
+ - Ordered durable workflow stages, evidence requirements, bounded warning/failure retries, and premature-settlement detection.
415
+ - `kxm_fanout` for up to three independent peer responses and coordinator synthesis.
416
+ - Structured capture for plans, decisions, contradictions, errors, and lessons plus project-scoped improvement reports.
417
+ - Restarting headless Pi RPC worker for long-lived coordinator agents.
418
+ - Complete Jira In Progress-to-reproduction, multi-agent planning, implementation, gates, documentation, push/watch, merge, Jira update, and retrospective example.
419
+
420
+ ### Changed
421
+
422
+ - Expanded Pi to eleven tools and Claude MCP to thirteen tools, covering fanout, cancellation, workflows, journals, and improvement reports.
423
+ - Extended SQLite schema versioning to durable workflow runs and learning journals.
424
+ - Added workflow code to the measured CI coverage gate.
425
+
426
+ ## 0.2.0 - 2026-08-25
427
+
428
+ ### Added
429
+
430
+ - Product, onboarding, configuration, architecture, operations, and troubleshooting guides.
431
+ - Strict TypeScript checking, CI configuration, and package-version consistency checks.
432
+ - Contributor, security, and community policies.
433
+ - Durable SQLite message and identity storage with schema compatibility checks.
434
+ - Per-project tokens, request IDs, security headers, rate limiting, and bounded client requests.
435
+ - Readiness and Prometheus metrics endpoints plus structured, content-redacted logs.
436
+ - Message TTL, cancellation, idempotent sends, terminal-record retention, and restart recovery.
437
+ - Executable Pi-to-Pi examples and a feature-to-test coverage matrix.
438
+ - Native Pi extension, Agent Skill, and Claude marketplace packaging from one repository.
439
+
440
+ ### Changed
441
+
442
+ - Reorganized the package as a clean Pi extension and Claude marketplace monorepo.
443
+ - Bundled the Claude MCP runtime for dependency-free marketplace installation.
444
+ - Made measured coverage part of the CI gate.
445
+
446
+ ## 0.1.0 - 2026-08-25
447
+
448
+ ### Added
449
+
450
+ - In-memory HTTP/SSE mesh hub with authentication and project-scoped presence.
451
+ - Native Pi tools for peer discovery, request sending, polling, and waiting.
452
+ - Pushed inbound Pi work with automatic settled-response replies.
453
+ - Claude Code MCP tools and optional channel delivery.
454
+ - Portable `pi-mesh-comms` Agent Skill.
455
+ - Pi package and Claude marketplace manifests.
456
+ - Mesh store schema version is now 3 (`context_items` table); v0.4 databases upgrade in place.
457
+ - `npm pack` ships the `/fix` workflow definition.
458
+ - Package version surfaces aligned at 0.5.0.
459
+
460
+ ### Security
461
+
462
+ - Authority grant floors are enforced at parse time (`context_authority_violation`, HTTP 403).
463
+ - Weak or edited reproductions against a `/fix` run are rejected (`weakened_reproduction`).
464
+ - Promotion of temporal state and journal entries requires authorized, evidence-bound control-plane decisions; authors can never self-promote.
465
+ - The authority lattice is documented in `docs/provenance-gates.md`; the skill lifecycle in `docs/skills.md`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KontextMind
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.