Commit Graph

3 Commits

Author SHA1 Message Date
Igor Lins e Silva e12a8dacbf feat(logstream): mempalace_event_list preview mode — scan the stream cheaply
Event bodies are stored verbatim and fleet status updates run to several
KB, so listing many events full-body is a large payload — agents hit it
catching up on the stream. New preview=true truncates each body to a
200-char excerpt (marking body_truncated + body_length) while keeping
every routing/metadata field, so an agent can scan and then re-fetch
only the events it cares about in full via a targeted since_event_id.
Default (full verbatim) is unchanged; the verbatim-on-demand guarantee
is intact.

(cherry picked from commit dcf43984b84baea49838b2c665d62e572d259615)
2026-08-05 23:50:19 -03:00
Igor Lins e Silva 5325e0b9a3 feat(logstream): event_wait accepts limit, matching event_list filters
Reported by windows-codex through the logstream itself: wait rejected
'limit' with -32602 while list accepts it, though the filter sets are
otherwise identical. The core already threaded limit through; expose it
on the MCP schema and the CLI (wait --limit).

(cherry picked from commit bc18ccaac6ec709dbb0821f65c3a8e39f68733d1)
2026-08-05 23:50:18 -03:00
Igor Lins e Silva 4ab27169c6 feat(logstream): RFC 003 agent coordination logstream, phases 1-2
Durable append-only event + artifact layer in logstream.sqlite3 inside
the active palace dir, so agents can delegate work, wait for replies,
and exchange exact patches through the shared hub.

Phase 1 (mempalace/logstream.py): events, artifacts, event_artifacts
per the RFC schema; WAL + per-instance lock, no Chroma dependency;
append/list/wait/ack/put_artifact/get_artifact/submit_patch; explicit
size limits (body 256 KiB, artifact 4 MiB, metadata 64 KiB); rowid-backed
exclusive since_event_id cursor exposed as seq; inclusive
since_created_at; to_agent filters match '*' broadcasts; artifact_ids
validated in-transaction so listed events never dangle.

Phase 2 (mcp_server.py): seven MCP tools. Mutating four join
_MUTATING_TOOLS (hidden + refused in --read-only). All seven are exempt
from the Chroma SQLite integrity gate; the mutating four are exempt from
the peer-writer lease via _PEER_WRITER_EXEMPT_TOOLS (logstream owns its
own WAL db, and a running mine must not block coordination).
mempalace_reconnect drains cached Logstream handles like the KG cache.

(cherry picked from commit cdf72a994133242da862b11b21033a4546c5e146)
2026-08-05 23:49:40 -03:00