Repository navigation
fix(connectors): engram scope comes from the server, never from a per-call agent_id - #128
Merged
Merged
Conversation
…read scope (F-007) Engram's engram-mcp takes its scope from its own identity: a server started with --agent-id serves that agent, one started without serves the whole file, and a call naming any other agent is refused. The console starts one server with no agent and names the agent on every read, so those reads fail against the new server. This commit adds the tests and the scaffolds they need to compile: - connectors: spawn_args, check_scope, stats_args, recall_args (scaffolds keep today's behaviour: a named agent goes on the wire, nothing is refused); McpError::Scope. - api memory: ScopePool and valid_agent_scope (scaffold starts a server on every read, keeps none, accepts any name); read_scope in commands.rs (scaffold passes the name through). On the scaffolds the scope, reuse, bound, idle, and name tests fail on assertions; the whole-file and per-agent spawn tests and the failed-start test pass by design (they describe today's behaviour and must keep it). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
engram-mcp takes its scope from its own identity now: started with --agent-id it serves that agent, started without one it serves the whole file, and a call naming another agent is refused. The console used to start one server with no agent and name the agent on every read, which the new server refuses. - connectors: a read names no agent to the server. The client remembers the scope it was started with and refuses a read that names another agent before anything is sent (McpError::Scope). stats and recall keep their signatures. - api memory: a per-agent view reads through a server started with that agent (ScopePool): reused, at most four at once, closed after ten minutes unread or when the least recently read one must make room. A start that fails is not held. The whole-file view keeps the server started at bootstrap. why and forget stay on the whole-file server. - A name that is not one printable word (no space, control character or leading dash, at most 256 bytes) is refused before any server starts; an empty name is the whole-file view. - Provenance is never sent: the connector has no write call. README badge 1089 to 1103 for the 14 new tests. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: the first commit adds the tests with compiling scaffolds so CI shows them failing on the current code; the fix follows.
The next Engram release takes the memory scope from the server's configured identity and refuses a call naming another agent. The connector stops passing agent_id per call (whole-file view) and never passes provenance=user, so the memory panel and Felyx keep working with both the current and the next Engram. Unblocks TAIPANBOX/engram#62.
🤖 Generated with Claude Code