Skip to content

Feat/mainnet live testing - #59

Merged
daftpixie merged 4 commits into
mainfrom
feat/mainnet-live-testing
Mar 6, 2026
Merged

Feat/mainnet live testing#59
daftpixie merged 4 commits into
mainfrom
feat/mainnet-live-testing

Conversation

@daftpixie

Copy link
Copy Markdown
Owner

Summary

Type

  • Feature
  • Bug fix
  • Refactor
  • Docs
  • Test
  • Chore

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • Tests added/updated for changes
  • No secrets or API keys in diff
  • Security implications considered

Solana / DeFi Changes

  • Transaction simulation verified
  • Slippage guards checked
  • No server-side signing
  • Address validation with assertIsAddress()

Matt and others added 4 commits March 6, 2026 06:28
…int script

WS1: Remove test agent spend button from delegation-card UI
WS2: x402 service proxy billing layer
  - service-pricing.ts: USDC price registry (image $0.10-0.15, text $0.02)
  - server-middleware.ts: buildX402Middleware() with ExactSvmScheme/Solana CAIP-2
  - routes/services.ts: POST /api/services/{image-generate,image-generate-pro,image-edit,text-generate}
  - ENABLE_X402_BILLING=false bypass for dev; PLATFORM_TREASURY_ADDRESS for payTo
  - app.ts: mount /services + add X-Payment to CORS allowHeaders
WS4: Direct X (Twitter) OAuth 1.0a posting as @ozskr
  - x-client.ts: HMAC-SHA1 OAuth 1.0a, postTweet(), uploadMedia() via Node crypto
  - x-direct-adapter.ts: SocialPublisher adapter with AI disclosure injection
  - routes/social-direct.ts: POST /api/social/direct/post-x
  - publisher-factory.ts: getXDirectPublisher() singleton + XDirectAdapter switch case
WS3: scripts/register-toto-mainnet.ts — 8004-solana NFT mint with Pinata IPFS
  - Supports --dry-run flag; writes result to scripts/toto-nft-result.json
  - Valid OASF taxonomy tags verified via getAllSkills()/getAllDomains()

Typecheck: clean. Assisted-by: Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CRITICAL fixes:
- social-direct.ts: run moderateContent() pipeline before post (endorsement
  guardrails + OpenAI text mod); reject with 422 if not APPROVED. Removes
  auto-approval bypass that violated CLAUDE.md moderation mandate.
- register-toto-mainnet.ts: add simulateTransaction() on prepared tx before
  live mainnet send; balance check was not a substitute per CLAUDE.md.

HIGH fixes:
- register-toto-mainnet.ts: zero secretBytes.fill(0) after Keypair construction
  to clear raw key material from heap.
- SSRF: add image-url-validator.ts with validatePublicImageUrl() — rejects IP
  hostnames, localhost/.local/.internal patterns, non-HTTPS URLs. Applied to
  social-direct.ts and x-direct-adapter.ts mediaUrl fetch paths.
- server-middleware.ts: return HTTP 503 (not passthrough) when
  PLATFORM_TREASURY_ADDRESS is unset or x402 init throws — fails closed.

MEDIUM fixes:
- social-direct.ts: add directPostLimiter (10/hr) on POST /social/direct/post-x.

INFO fixes:
- publisher-factory.ts: SocialProvider.DIRECT now maps to XDirectAdapter
  (not TwitterAdapter); remove unused TwitterAdapter import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t commerce

- x402 server-middleware: async resource server init, lazy _mw cache per route,
  503 on PLATFORM_TREASURY_ADDRESS unset (fail closed), ENABLE_X402_BILLING bypass
- services route: image-generate + video-generate endpoints behind authMiddleware
  and buildX402Middleware, Zod-validated request bodies
- use-x402-generate hook: full x402 payment flow (probe → 402 parse → sign → retry)
- fal.ai client + model router: image/video generation with cost tracking
- pricing layer: model registry, fal pricing client, Claude cost estimator,
  pricing calculator for x402 price derivation
- content feature: hooks (use-agent-balance, use-content-commerce) + components
- generate-modal: integrated x402 payment flow and delegation balance display
- delegation-card: fix delegationStatus field name (was status, caused balance=null)
- agent service usage migration: 20260307000000_agent_service_usage.sql
- eslint.config.mjs: ignore .trigger/** and .claude/worktrees/**
- wallet auth hook: session refresh and token persistence improvements
- rpc.ts: devnet RPC endpoint improvements
- providers.tsx: QueryClient config + x402 provider setup

Assisted-by: Claude Code
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…evoked

Destructure `error` from maybeSingle() and only reject with SESSION_REVOKED
when the query succeeds but returns no rows. A DB error (timeout, connectivity)
previously produced data=null which was indistinguishable from "no session",
causing false 401s during transient Supabase outages.

Defense-in-depth: JWT signature verification still runs regardless.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ozskr Ready Ready Preview, Comment Mar 6, 2026 10:36pm

@daftpixie
daftpixie merged commit d788d31 into main Mar 6, 2026
11 of 13 checks passed
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