Skip to content

test: Receipt text projections need regression coverage #115

Description

@nishuzumi

Problem

Ordered leaf text strings are the only thing the MCP layer projects to Agents (mcp-server/src/server.ts receiptTexts), and the Agent safety rules require comparing every ordered text with user intent. Yet no protocol package asserts its text formats in tests today — erc20, Kuru, PancakeSwap V3, and the newly merged PancakeSwap V2 (#22) all test outcomes, ordering, and rejection paths, but never the text projections themselves.

A silent formatting regression (dropped field, reordered interpolation, wrong unit) would pass every existing test while changing exactly the evidence Agents read.

What to add

For each Receipt-producing package (erc, kuru, pancakeswap V2+V3, and every future protocol):

  • assert the exact leaf text for each Change class the parser produces (ERC20 transfer/approval, native transfer, protocol events such as Sync/Swap and WMON Deposit/Withdrawal);
  • assert the top-level Receipt text format;
  • in at least one flow test, assert the complete ordered leaf-text sequence as flattened by receiptTexts-equivalent traversal, so order and completeness are locked together.

Notes

  • Raw base-unit amounts and address (or NATIVE sentinel) rendering are the accepted convention; the assertions should lock that convention, not change it.
  • Package template should gain a text-assertion example so new protocols inherit the practice.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions