Skip to content

fleet ydoc entries do not converge across processes/hosts; they appear session-scoped and not persisted #22

@Regis-RCR

Description

@Regis-RCR

Summary

fleet_ydoc_append / fleet_ydoc_read behave like a per-MCP-session in-memory
document, not a shared or persistent one. An entry appended from one MCP session
is invisible from another session, from another MCP process, and after an engine
restart. Intents, leases, and episodes do the opposite: they are shared across
clients of the same engine, and they survive a restart. The ydoc layer is the
odd one out.

Environment

  • memtrace 0.6.11
  • macOS (Apple Silicon)
  • One MemDB engine, two MCP clients in remote mode against it (or one client and
    two sessions)

Steps to reproduce

  1. Start a MemDB engine. Connect client A and client B (both remote mode against
    the same engine endpoint).
  2. From A: fleet_ydoc_append(repo_id, symbol_id: "sym_x", agent_id: "A", body: "...", kind: "intent").
    A valid entry_id is returned.
  3. From B: fleet_ydoc_read(repo_id, symbol_id: "sym_x") returns count: 0,
    entries: []. B does not see A's entry.
  4. Open a fresh session on A and read sym_x: also count: 0. A does not read
    back its own prior-session entry.
  5. Restart the engine. Read any symbol_id that had entries before: count: 0.
    (Leases / intents / episodes reappear via hydration; ydoc entries do not.)

Observed

ydoc entries are visible only within the single MCP session that appended them.
They do not propagate to other sessions, other processes, or other hosts sharing
the engine, and they are not persisted across a restart.

Expected

A shared document surface is expected to converge across clients that share
the backend, and to persist. Today the ydoc layer is effectively session-local
scratch memory.

Why it matters

In a multi-agent or multi-host setup, intents, leases, and episodes coordinate
through the shared backend. The ydoc layer does not, so cross-host convergence of
the ydoc never happens. A coordination primitive that only sees its own session
cannot coordinate anything.

Note

If ydoc is meant to be session-local in this build, a line documenting that
scope would set the right expectation. Otherwise, routing it through the same
backend the other primitives use should make it converge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions