Skip to content

Add deterministic testnet USDC routing agent with failure-memory demo#1

Open
Azubuike321 wants to merge 1 commit intomainfrom
codex/build-autonomous-usdc-routing-agent
Open

Add deterministic testnet USDC routing agent with failure-memory demo#1
Azubuike321 wants to merge 1 commit intomainfrom
codex/build-autonomous-usdc-routing-agent

Conversation

@Azubuike321
Copy link
Copy Markdown
Owner

Motivation

  • Provide a minimal, deterministic agent that routes testnet USDC and demonstrably avoids previously failing routes by remembering outcomes.
  • Meet the hackathon MVP requirement: record failures, persist them, and change routing decisions deterministically (no ML/LLM).

Description

  • Add a JSON-backed economic memory store implemented in src/memoryStore.js that records per (routeId, recipientAgentId) successCount, failureCount, and lastAttemptedTimestamp.
  • Implement a rule-based RoutingAgent in src/routingAgent.js that computes a simple riskScore (equal to failureCount) and selects the route with the lowest score.
  • Provide a transfer simulator src/mockUsdcTransfer.js with explicit outcomes (success, revert, timeout, mocked_failure) to simulate testnet USDC behavior.
  • Add src/demo.js and an npm script to reproduce the required sequence: intentional failure on route-A, memory update, and subsequent reroute to route-B with success; persistent state is written to data/economic-memory.json.

Testing

  • Executed the demo with npm run demo and it succeeded (logs show chosen route, transfer outcome, failure reason, and memory updates for both attempts).
  • Verified data/economic-memory.json contains route-A with failureCount: 1 and route-B with successCount: 1, demonstrating the agent avoided the failed path on the second attempt.
  • No additional automated tests were added to keep the project minimal and focused on the required demonstration.

Codex Task

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 6, 2026

Deploy Preview for gregoryazubuike ready!

Name Link
🔨 Latest commit fae5404
🔍 Latest deploy log https://app.netlify.com/projects/gregoryazubuike/deploys/6985ee85224ad70008d47aea
😎 Deploy Preview https://deploy-preview-1--gregoryazubuike.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant