Skip to content

test(mcp): staging E2E for fact ids on DataEdge V2 (#908) - #909

Open
p-diogo wants to merge 2 commits into
mainfrom
test/908-mcp-fact-ids-staging-e2e
Open

p-diogo wants to merge 2 commits into
mainfrom
test/908-mcp-fact-ids-staging-e2e

Conversation

@p-diogo

@p-diogo p-diogo commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Adds mcp/tests/e2e/fact-ids-staging-e2e.mjs: a staging E2E for the MCP server's fact-id code (#901, #903) on DataEdge V2. No product code changed.

What it runs. The built server (mcp/dist/index.js) over stdio through the MCP client SDK, the way a host does, against the staging relay, with a throwaway account (a fresh phrase that exists only in the child's environment). It checks that every tool names a fact by its payload id, accepts <sender>:<id> in any address case, refuses another account's id before any read or write, changes nothing for a missing id, and confirms a forget. It refuses to write unless billing says chain 100 and the staging V2 DataEdge.

cd mcp && npm run build
node tests/e2e/fact-ids-staging-e2e.mjs --self-test          # offline
node tests/e2e/fact-ids-staging-e2e.mjs --report <file.json>  # staging

Result on staging (2026-12-04 20:36 UTC, server 3.8.0 built from 77a3daaa, 182 s):

== 48 passed, 0 failed, exit 0
  • Relay: https://api-staging.totalreclaw.xyz, tier free, chain 100
  • DataEdge: 0xd3dce61edbcfc76c781a617bed722bbdc23a57c6 (staging V2)
  • Smart Account: 0x4ddaea739a320e8ae9ee203977f661e2c7bdc35f
  • 14 UserOps on Gnosis; every fact of the throwaway vault is forgotten at the end (recall returns nothing, fact count 0). First remember: 0x705aa7e3…
Step What it checks Result
S0 preflight server registered; billing says chain 100 and the staging V2 DataEdge 4 / 4
S1 remember A, B, C, D stored; ids are payload ids; no id with a : 5 / 5
S2 recall indexed; every returned id is a payload id; A–D found 3 / 3
S3 pin by bare id pin succeeds; recall shows A pinned 3 / 3
S4 retype by <sender>:<id> B retyped to preference; old id inactive 4 / 4
S5 set_scope by upper-case sender C set to work; old id inactive 4 / 4
S6 unpin by <sender>:<id> asks first (pinned_unpin), then succeeds with the token 4 / 4
S7 replaces replaces=<sender>:<id> stores D2, old D not returned 4 / 4
S8 forget by <sender>:<id> confirmed, not partial; recall no longer returns C 2 / 2
S9 forget a pinned memory asks first (pinned_forget), deletes nothing, then confirmed with the token 6 / 6
S10 another account's id forget, pin and retype refuse it; A unchanged 4 / 4
S11 a missing id forget and pin answer not found; active facts unchanged 3 / 3
S12 cleanup vault empty; no phrase words in any file under the temp HOME 2 / 2

Offline: --self-test 30 / 30; npx jest tests/fact-ids-v1-v2.test.ts 91 / 91; npx jest --runInBand 88 suites, 1544 passed, 5 skipped.

Two things the plan did not spell out, both taken from the server code: the preflight reads chain_id / data_edge_address from /v1/billing/status (no tool exposes them), and S6 goes through the confirmation flow, because totalreclaw_unpin stops on a pinned memory (internal#778) like totalreclaw_forget does.

One caveat on the result line: the staging run was made before a last review pass on the script. That pass changed argument parsing (--self-test with --report used to start the staging run), output masking, the "asks first" predicate, the fact-count handling and how a relay outage is handled. It does not change what the run asks the server; the changes are covered by --self-test and were not run on staging again.

Refs #908.

🤖 Generated with Claude Code

p-diogo and others added 2 commits December 4, 2026 21:51
Co-Authored-By: Claude Code <noreply@anthropic.com>
…gnores pin state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@p-diogo

p-diogo commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

Reran on staging with the final script (e9d61ea9): 48 passed, 0 failed on DataEdge V2 0xd3Dc…3A57C6, chain 100. An independent review approved the script; its two small findings are fixed in e9d61ea9. Ready for your review and merge.

This branch has not been deployed

No deployments
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