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
- Start a MemDB engine. Connect client A and client B (both remote mode against
the same engine endpoint).
- From A:
fleet_ydoc_append(repo_id, symbol_id: "sym_x", agent_id: "A", body: "...", kind: "intent").
A valid entry_id is returned.
- From B:
fleet_ydoc_read(repo_id, symbol_id: "sym_x") returns count: 0,
entries: []. B does not see A's entry.
- Open a fresh session on A and read
sym_x: also count: 0. A does not read
back its own prior-session entry.
- 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.
Summary
fleet_ydoc_append/fleet_ydoc_readbehave like a per-MCP-session in-memorydocument, 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
two sessions)
Steps to reproduce
the same engine endpoint).
fleet_ydoc_append(repo_id, symbol_id: "sym_x", agent_id: "A", body: "...", kind: "intent").A valid
entry_idis returned.fleet_ydoc_read(repo_id, symbol_id: "sym_x")returnscount: 0,entries: []. B does not see A's entry.sym_x: alsocount: 0. A does not readback its own prior-session entry.
symbol_idthat 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.