Skip to content

MCP-05: query-aware ECAN-style working-set attention over MCP-04 - #22

Merged
patrickdugan merged 31 commits into
research/mcp04-stateful-preflight-20261121from
research/mcp05-ecan-working-set-20261122
Nov 22, 2026
Merged

patrickdugan merged 31 commits into
research/mcp04-stateful-preflight-20261121from
research/mcp05-ecan-working-set-20261122

Conversation

@patrickdugan

Copy link
Copy Markdown
Contributor

Scope

Builds on MCP-04's typed packet and exact provider-token preflight. Adds a deterministic, ECAN-inspired read-memory policy with:

  • query/snapshot/local-edit-epoch aware read atom keys and distinct source-result lineages;
  • coalescing repeated identical reads without treating repetitions as independent evidence;
  • bounded, historically qualified negative observations pinned beside the existing edit and user constraints;
  • priority order for optional recoverable read handles using task relevance, recency, reuse saturation and edited-path co-use.

The existing content-addressed result-handle store and verifier-only authority remain unchanged. The implementation is a CPU policy prototype, not native Hyperon PathMap or learned ECAN.

Verification

  • Isolated attention ledger tests: 7 passed locally.
  • Added integrated stdlib tests in MCP/test_mcp05_attention.py.
  • Full repository CI, MCP-04 integration, provider-token parity and native Bonsai/Inky task replay remain to be checked. This PR stays draft until those gates are satisfied.

Run: python -m pytest -q MCP/test_mcp05_attention.py MCP/test_mcp04.py MCP/test_hubrun.py

Protocol: MCP05_PROTOCOL.md. Compare raw vs MCP-04 vs MCP-05 with paired seeds, exact upstream token usage, repeated reads, stale edit-site outcomes, solutions and full failed-task cost.

Dependent on: #18 (MCP-04), which in turn is based on #14 (MCP-01).

No changes to native research mem​branes, test split, or environment verifier.

Copy link
Copy Markdown
Contributor Author

MCP-05 CPU review checkpoint (head 5f94fbdd7e9e767860c87767778f44743d5b4e20):

  • The MCP-04 CPU protocol workflow ran MCP/test_mcp05_attention.py, MCP/test_mcp05_replay.py, MCP/test_mcp04.py, and MCP/test_hubrun.py: 40 passed in 33.49s. Run 44974256641.
  • The mcp05 relay arm is now independent of the frozen mcp04 control. Exact upstream preflight and provider parity checks apply to both; policy tests use one identical fake provider to verify arm separation.
  • Negative-evidence pinning now requires an explicit complete empty-result response (including structured empty result sets); embedded textual mentions cannot become pinned negatives.
  • The native three-arm runner is bash MCP/hubrun/scripts/mcp05_replay.sh smoke|full. The scorer insists on matched task IDs, a complete 8+5 full task allocation per arm, native verifiers traces, and provider-token parity. No native Bonsai model-backed scores are claimed here.
  • Open integration limitation: archived result handles are served on the relay's loopback GET endpoint. Whether the target agent can invoke that recovery path depends on its environment tools. A model-visible handle-read tool or sufficient retained snippets may be needed for genuine repeat-read reductions. Preserve this as an explicit follow-up before claiming retrieval savings.

The larger MCP retrieval gym workflow is a separate gate. Leave this PR draft until the pinned native replay and tool access are reviewed.

@patrickdugan
patrickdugan marked this pull request as ready for review November 22, 2026 02:53
@patrickdugan
patrickdugan merged commit ebd7360 into research/mcp04-stateful-preflight-20261121 Nov 22, 2026
2 checks passed
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