Repository navigation
Usage log: write in batches (at most every 10 minutes) and read the day file raw - #63
Merged
Merged
Conversation
mpp-pay from x402-doctor (#139): the agent sends USDC.e on Tempo with the MPP memo and answers with the transaction hash, checked on a Tempo RPC; the 402 then carries an evm and a tempo challenge and /openapi.json lists both offers. Off until MPP_TEMPO_RECIPIENT is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
A 402 with a payment that was refused now logs network (from the x402 payment header, or the MPP credential's method: evm = base, tempo = Tempo), so the usage log can show which network traffic comes from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…ithub.com/Fizzl13/SmartContractExplainer into claude/x402-agents-solana-payments-nceg9b
On mainnet the paid routes also accept the same dollar price in RLUSD on the XRP Ledger, to XRPL_PAY_TO (default Frits's account with the RLUSD trust line; XRPL_PAY_TO=off turns it off), verified and submitted by an in-process facilitator from @x402/xrpl, as in the other Fizzl services. The usage log counts RLUSD in dollars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…ithub.com/Fizzl13/SmartContractExplainer into claude/x402-agents-solana-payments-nceg9b
Agents built on t54's x402-xrpl / Xrpl.X402 SDK (most of the XRPL AI Hub)
sign with the x402 SourceTag 804681468, bind the invoice in Memos and send
{ signedTxBlob, invoiceId }. @x402/xrpl refuses Memos, so those payments now
go to t54's hosted facilitator, which verified and settled such a payment
on testnet; standard @x402/xrpl payments stay in-process (also re-tested on
testnet with the SourceTag in the requirements). Every XRPL accept now
carries extra.sourceTag. XRPL_T54_URL=off keeps everything local.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…lana-payments-nceg9b
Google crawled the homepage but has not indexed it yet; these give it a clear signal which URL to index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…ithub.com/Fizzl13/SmartContractExplainer into claude/x402-agents-solana-payments-nceg9b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…ithub.com/Fizzl13/SmartContractExplainer into claude/x402-agents-solana-payments-nceg9b
A refused MPP credential is logged as payment_failed with protocol mpp; it now also carries reason (the problem detail sent back, max 160 characters), so a client that can't pay us shows what went wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…ithub.com/Fizzl13/SmartContractExplainer into claude/x402-agents-solana-payments-nceg9b
With ALGORAND_PAY_TO set (an Algorand account with the USDC opt-in), both paid routes also offer the same dollar price in USDC (ASA 31566704) on Algorand mainnet, settled by GoPlausible's public facilitator, which pays the Algorand fee. It sits before the URL facilitator and offers only Algorand, so PayAI never claims it. Off without the variable or with "off". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
GoPlausible's x402 catalog reads the x402-merchant extension (name, website, logo, categories) when it settles a payment and shows it on the merchant, one per pay-to address. Both paid routes now carry it, the same on every fizzl.eu service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
check_wallet_approvals and explain_approval declare an outputSchema (verdict, explanation) and answer with structuredContent next to the same "VERDICT: explanation" text (which the usage log reads); feedback does too. Extra fields are allowed, so new ones never break a call. MCP directories such as Smithery score output schemas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
The XRPL AI Hub (xrpl-ai.org) ingests /.well-known/x402 and lists each
resource by its name and description; without them it shows the long
402 text. The manifest moves to well-known.js, with resources as
{ url, method, name, description } objects (the endpoints list stays)
and a description that names the payment options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
HSTS (one year), nosniff, a Referrer-Policy and X-Frame-Options, and no x-powered-by header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Dependabot alerts are off here, so a new advisory like this week's MCP SDK one went unnoticed. Every Monday npm audit now checks PlainText's production dependencies. A high or critical finding the server can reach opens one issue labelled dependency-audit (GitHub emails the owner) or adds the new list to the open one, and the next clean run closes it. Checked against the lockfile from before the MCP SDK update: it reports exactly that advisory, and nothing on the current lockfile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
A refused MPP credential was logged with its reason, a refused x402 payment only as payment_failed. The 402 that answers it already says why: PAYMENT-REQUIRED carries error when verification failed, PAYMENT-RESPONSE carries errorReason when settlement failed. The log now keeps that as reason (first line only, URLs blanked so an RPC error can never put a keyed URL in the log). All 32 tests pass, including a new one that fails without this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
…ay file raw PlainText wrote the usage log once per call: 2,700 commits a day, each downloading and re-uploading the whole day file. That is about 1.9 GB a day of Render bandwidth, billed above the 5 GB the plan includes. It now batches like the other services: one write per 10 minutes (USAGE_LOG_FLUSH_MS), the queue written first on SIGTERM (a deploy or the free plan going to sleep). The day file is also read raw, as in the other services: the JSON form has no content for files over 1 MB, which would have overwritten the day with only the new lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Render's Billing page shows 68.5 GB of outbound bandwidth this month against the 5 GB the plan includes. 63.2 GB of it is "service-initiated" (traffic the services start themselves), billed at $0.15/GB; so far $9.60.
Biggest source: PlainText wrote the usage log once per call. In the last 24 hours that was 2,700 commits. Doctor, presign-guard and Ichimoku made about 165 each. Every write downloads the whole day file and uploads it again, base64-encoded. With a day file averaging about 0.3 MB, that comes to roughly 0.7 MB per call, or about 1.9 GB a day.
Change. The writer now works like the other services (same code as x402-doctor's
lib/usage-log.js):USAGE_LOG_FLUSH_MS), or sooner at 200 queued events.Expected: at most 144 writes a day instead of about 2,700, so roughly 1.8 GB a day less (about $8 a month). Events now reach the log up to 10 minutes later, as for the other services.
Test. Two calls give one read and one write, nothing before the flush, and a 1.1 MB day file keeps its lines. The test fails on the old code.
npm test: 33/33 pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Generated by Claude Code