Skip to content

fix(connectors): engram scope comes from the server, never from a per-call agent_id - #128

Merged
TAIPANBOX merged 2 commits into
mainfrom
fix/engram-scope-from-the-server
Oct 18, 2026
Merged

TAIPANBOX merged 2 commits into
mainfrom
fix/engram-scope-from-the-server

Conversation

@TAIPANBOX

Copy link
Copy Markdown
Owner

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

TAIPANBOX and others added 2 commits October 18, 2026 13:20
…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>
@TAIPANBOX
TAIPANBOX marked this pull request as ready for review October 18, 2026 12:42
@TAIPANBOX
TAIPANBOX merged commit 390a4db into main Oct 18, 2026
3 of 4 checks passed
@TAIPANBOX
TAIPANBOX deleted the fix/engram-scope-from-the-server branch October 18, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant