Skip to content

Nothing records what the agent spent #406

Closed

Description

@Miracle656

Background

A successful paid_call returns the response body and nothing else. There is no
log line, no metric and no persisted record of: which URL was paid, how much,
on which network, with which transaction.

So after a day of agent activity there is no way to answer "what did we spend
and on what" except by reading the Stellar ledger for the key's account and
reverse-engineering it.

For a tool that moves money, the audit trail is not an enhancement.

What to build

  • A durable record per payment: timestamp, URL, host, method, amount, network,
    transaction hash, and the outcome.
  • A counter and a sum as Prometheus metrics, labelled by host and network —
    keep the label set bounded, so an allow-listed host set (L209) is the natural
    label domain.
  • Surface the running total so L210's ceiling has something to read.
  • Never record the secret key or the signed envelope.

Acceptance criteria

  • Every payment attempt is recorded, successful or not
  • The record includes the transaction hash where one exists
  • Spend is exported as a metric with bounded labels
  • No secret material is recorded
  • A test asserts a failed payment is recorded as an attempt

Drips Wave · Complexity: Intermediate · 150 points


Repo: Divinity-Labs/Lens. The MCP server is src/mcp/server.ts
(BazaarMcpServer) with error codes in src/mcp/codes.ts. It is started by
npm run mcp:server → examples/mcp-server/run.ts, and there is an agent
example at examples/mcp-server/agent.ts. Tests are tests/mcp.test.ts.

Run the tests: npm test. The tests are vitest, not jest. A single file
is npx vitest run tests/mcp.test.ts.

Load test (prices) is already failing on main. Not your PR.

This surface signs with a real mainnet key. examples/mcp-server/run.ts
requires MCP_AGENT_SECRET_KEY_MAINNET and builds a signer for
stellar:pubnet. Anything you change here can move real money, so prefer
failing closed, and never log, echo or test with a real secret key.

Never elide an address, a contract id or a key in code, comments or
fixtures. A previous batch shortened a contract id and five contributors
invented plausible-looking ids to fill the gap. Write it in full or not at all.

An agent is the least able caller to notice a wrong answer. It will reason
over whatever it is handed, confidently. Prefer a structured error over a
best-effort result.


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. young-wallace commented on Oct 17, 2026

    @young-wallace

    @young-wallace has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Kindly assign

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @young-wallace to this issue.

  2. johnson7104 commented on Oct 17, 2026

    @johnson7104
    Contributor

    @johnson7104 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I would like to be assigned to this issue.

    I have reviewed the issue description and the relevant parts of the codebase and I understand the objective and acceptance criteria.

    I have experience across backend, frontend, APIs, databases, testing, DevOps, and blockchain applications, and I am comfortable working in unfamiliar codebases.

    My approach is to start with a focused review of the current implementation and project conventions, then implement the fix in small, clear steps.

    I will add tests to prevent regression, verify formatting and lint checks, and ensure no existing functionality is broken.

    I will document changes where needed and respond quickly to review feedback to keep the PR easy to merge.

    I will keep the scope strictly limited to this issue.

    Please assign this issue to me. I am ready to start immediately.

    Thank you for your consideration.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @johnson7104 to this issue.

  3. AGWAM001 commented on Oct 17, 2026

    @AGWAM001
    Contributor

    @AGWAM001 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I'd love to take this issue on. I'm a full-stack developer with experience across Drips Waves4-7.
    My stack include rust, Soroban, Solidity, and TypeScript. I can deliver a clean, tested, and well-documented solution within 5 hours of assignment.
    Jovial to start immediately

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @AGWAM001 to this issue.

  4. Stanley471 commented on Oct 17, 2026

    @Stanley471
    Contributor

    @Stanley471 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hello maintainer, I'd like to work on this issue. I'll start by reviewing the existing code and conventions in the relevant files before making changes, so my implementation stays consistent with the rest of the codebase. I'll cover the requirements and acceptance criteria as listed, add tests where applicable, and verify everything builds/passes locally before opening the PR

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Stanley471 to this issue.

  5. drips-wave commented on Oct 17, 2026

    @drips-wave

    Congratulations, @AGWAM001! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @AGWAM001: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. drips-wave commented on Oct 21, 2026

    @drips-wave

    This issue has been completed by @AGWAM001 as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @AGWAM001: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  7. Miracle656 commented on Oct 21, 2026

    @Miracle656
    CollaboratorAuthor

    Reopened — I closed this by mistake.

    My merge commit for PR #480 ended with Closes #406. That was a typo on my part: #480 is the structured error-classification work, which is #410, and its own PR body says so correctly. My commit message said the wrong number and GitHub acted on it, closing this issue at the same moment.

    Nothing in #480 records what the agent spent. This issue is untouched and still open work.

    Apologies to @AGWAM001 — it is still assigned to you and the points stand. PR #523 is the one that addresses it, and it is still open; I will review it on its merits.

  8. added a commit that references this issue on Oct 21, 2026
    88e5785
  9. Miracle656 commented on Oct 23, 2026

    @Miracle656
    CollaboratorAuthor

    Delivered on main as of 59cc2a0 — src/mcp/ledger.ts records every paid_call outcome (url, method, outcome, spend, cost) to an append-only audit trail, with bounded Prometheus labels so a caller cannot mint unbounded time series, and 15 covering assertions in tests/mcp.test.ts. Details in #523.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions