@kontextmind/kxm 0.7.72 → 0.7.74

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.
@@ -11,7 +11,7 @@
11
11
  "name": "kxm",
12
12
  "source": "./plugins/kxm",
13
13
  "description": "Durable workflows, peer agents, and kxm tui",
14
- "version": "0.7.72",
14
+ "version": "0.7.74",
15
15
  "category": "development",
16
16
  "tags": ["kxm", "multi-agent", "workflows", "mcp"]
17
17
  }
@@ -1,8 +1,11 @@
1
1
  # Hub synchronization contract
2
2
 
3
- > **Status.** `kxm.sync-event.v1` is a **schema-tested contract**. There is no
4
- > outbox table, sync transform, or hub ingestion in source. Implementation
5
- > begins in [Phase 8](../../plans/implementation-plan.md#phase-8-multi-project-hub-kxm).
3
+ > **Status.** `kxm.sync-event.v1` is a **schema-tested contract with an
4
+ > implementation** (cross-host P5): the event store `outbox` (v6), the
5
+ > `sync-transform.ts` derivation under the default policy, supervisor push to
6
+ > `POST /v1/sync/events`, and hub ingestion into `sync_events` (hub store v5).
7
+ > Custom project policies and on-demand content transfer remain unimplemented.
8
+ > Phase 8 gate: [implementation plan](../../plans/implementation-plan.md#phase-8-multi-project-hub-kxm).
6
9
 
7
10
  Synchronization is summary-first, project-scoped, at-least-once, and
8
11
  allowlist-based. The full local event is never placed directly in the outbox.
@@ -316,8 +316,9 @@ restore lands somewhere the running service will not look.
316
316
  routing manifests and update configuration are not databases, so a snapshot-only backup
317
317
  reproduces exactly the failure this section exists to remove. The hub's own backup path already writes a hashed manifest and records
318
318
  a schema version ceiling; keep that manifest with the files. That ceiling is
319
- **hub store v4** as of the fenced-lease release: a backup taken by an earlier
320
- build records v3 and is refused by this one, because there is no migration lane.
319
+ **hub store v5 and event store v6** as of the sync-outbox release: a backup taken by
320
+ an earlier build records hub v4 or event store v5 and is refused by this one, because
321
+ there is no migration lane.
321
322
  Restore such a backup with the release that produced it, or start fresh.
322
323
  3. Record the package version, configuration revision and schema versions beside the copy.
323
324
  A restore that cannot state which release produced it is not a restore path.
@@ -395,8 +396,9 @@ Broader deployments need shared state and coordination, external identity and fi
395
396
 
396
397
  ## v0.5 context/state storage
397
398
 
398
- The hub database (schema version 4) carries `context_items` and `leases`
399
- alongside agents, messages, workflow runs, and the journal. Temporal state,
399
+ The hub database (schema version 5) carries `context_items`, `leases`,
400
+ `sync_events` and `runtime_presence` alongside agents, messages, workflow runs,
401
+ and the journal. Temporal state,
400
402
  knowledge records, and their audit trails live in the same SQLite file and
401
403
  upgrade in place from v0.4 databases.
402
404
 
@@ -444,6 +446,35 @@ holder. `kxm_leases_granted_total`, `kxm_leases_refused_total` and
444
446
  `lease_acquired`, `lease_renewed`, `lease_released`, `lease_denied` and
445
447
  `lease_purged` are the structured log events.
446
448
 
449
+ ### Runtime → hub run-fact sync
450
+
451
+ Every event the Runtime commits also writes one row to the event store's
452
+ `outbox` (event store v6), in the same transaction. The row holds only a derived
453
+ `kxm.sync-event.v1` object — allowlisted fields, registered secret values and
454
+ credential shapes replaced, absolute paths removed, text bounded, the default
455
+ sync policy revision recorded — never the local event. A field the allowlist
456
+ does not name is listed by name in `redaction.fieldsOmitted` and its value is
457
+ dropped.
458
+
459
+ The supervisor pushes outbound only: every `KXM_RUNTIME_SYNC_INTERVAL_MS` (10 s
460
+ by default) it posts `POST /v1/runtime/presence` for each open project, then
461
+ `POST /v1/sync/events` in outbox order, to `KXM_SERVER_URL` or the `kxm hub bind`
462
+ URL with that project's token. No bound hub means nothing is sent and rows stay
463
+ pending; local execution never waits on sync. The hub accepts each event once by
464
+ `{projectId, runId, sequence}`: the same bytes again are an idempotent
465
+ `duplicate`; different bytes under a used sequence, a run claimed by another
466
+ project, or a push for another Runtime's events are refused and logged as
467
+ `security_alert`. Out-of-order events are held, and the per-run cursor is the
468
+ gapless prefix, so a gap stays pending until it is filled.
469
+
470
+ `GET /v1/ops/snapshot` adds `homeRuntimes`: synchronized runs grouped by home
471
+ Runtime, each with its bounded title/status, `lastSequence`, `pendingGap`, and
472
+ `orphaned` once the Runtime's presence lease (`heartbeatAt + staleAfterMs`, hub
473
+ clock) has lapsed. Orphaned is view state; nothing is migrated.
474
+ `kxm_sync_events_accepted_total`, `kxm_sync_events_duplicate_total`,
475
+ `kxm_sync_events_refused_total`, `kxm_sync_conflicts_total` and
476
+ `kxm_runtime_heartbeats_total` are in `/metrics`.
477
+
447
478
  ## Hub Q&A / knowledge base
448
479
 
449
480
  - [What is all stored on the hub?](kb/qa-what-the-hub-stores.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextmind/kxm",
3
- "version": "0.7.72",
3
+ "version": "0.7.74",
4
4
  "description": "KXM local-first multi-agent orchestration and operator dashboard",
5
5
  "type": "module",
6
6
  "author": "KontextMind",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
3
  "name": "kxm",
4
4
  "displayName": "KXM",
5
- "version": "0.7.72",
5
+ "version": "0.7.74",
6
6
  "description": "Headless multi-agent orchestration, durable workflows, and a live operator dashboard for Pi and Claude Code",
7
7
  "author": {
8
8
  "name": "KontextMind",