Repository navigation
Nothing records what the agent spent #406
Description
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
young-wallace commentedon Oct 17, 2026
@young-wallace has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @young-wallace to this issue.
johnson7104 commentedon Oct 17, 2026
@johnson7104 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @johnson7104 to this issue.
AGWAM001 commentedon Oct 17, 2026
@AGWAM001 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @AGWAM001 to this issue.
Stanley471 commentedon Oct 17, 2026
@Stanley471 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Stanley471 to this issue.
drips-wave commentedon Oct 17, 2026
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 🌊
feat(mcp): enforce cumulative spend ceiling and durable payment audit…
drips-wave commentedon Oct 21, 2026
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.
Miracle656 commentedon Oct 21, 2026
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.
Merge PR Divinity-Labs#480: classify paid-call errors by structured s…
fix(mcp): re-resolve the main merge that left server.ts unparseable
Miracle656 commentedon Oct 23, 2026
Delivered on
mainas of 59cc2a0 —src/mcp/ledger.tsrecords everypaid_calloutcome (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 intests/mcp.test.ts. Details in #523.