Round 1 against STRATEGY-2026-10-23.md's backlog: - Wire register_agent/stake/set_credit_score/deposit_liquidity to the real Casper Testnet contracts (lib/casper/live_bridge.ts), verified live against the real RPC node with a freshly generated (unfunded) keypair (npm run casper:keygen). Honesty flags built in for the Odra payable calling convention and the admin-gated set_credit_score call. - Unblock NEAR's paid x402 route (npm run near:keygen generates a real implicit account id); QIE stays correctly flagged as blocked on unconfirmed external facts (asset contract, facilitator), not env plumbing. - New public Home tab: live-stats hero, how-it-works, a real competitor comparison table, and a "90-second proof" that calls the real API live in the browser (verified end-to-end with gstack browse). - Cold-start UX: visible retry state in X402Playground + the TS SDK, plus a keep-warm self-ping (lib/services/keepalive.ts) so the free Render dyno rarely idles out from under a real first-time caller. - New GET /v1/credit-score/:agentId alias + docs/integrations/ samples for Skyfire/Nevermined/Coinbase x402. - Self-hosting quickstart: root docker-compose.yml + scripts/bootstrap.sh, both run for real; fixed a real EACCES crash-loop bug in infra/Dockerfile (non-root user never owned the /data volume mount) found while verifying. 450/450 tests pass, typecheck clean, frontend build clean.
16 KiB
Build log — 2026-10-23
Rounds of real, end-to-end feature work against the 15-item backlog in STRATEGY-2026-10-23.md. Each round appends below; nothing here is a stub — every claim was run against a live local server (or the real Casper Testnet RPC) and verified before being written down.
Round 1
1. Casper live write path — wired and verified against the real Testnet node
lib/casper/factory.ts, lib/casper/sdk_signer.ts, lib/casper/transport.ts
already existed but api/state.ts never called them — every write
(register_agent/stake/set_credit_score/deposit_liquidity) only ever
touched the in-memory Ledger twin. Fixed:
- New
lib/casper/live_bridge.ts—CasperLiveBridge, a process-wide singleton that mirrors the four explicit, user-triggered write actions onto the real, already-installeddeploys.testnet.jsoncontracts (AgentRegistry,AgentCreditPool) using the existingCasperSdkDeploySignerCasperRpcTransport. Deliberately does not mirror the background economy-tick simulation (hundreds of events/sec in demo scenes) — only the API-triggered mutation points (mRegisterAgent,mStake,mDepositinapi/state.ts, the publicPOST /v1/agentsroute, and the fire-and-forgetset_credit_scorecall insideCreditAgent.underwrite) — so a funded key is never spammed into rate-limiting.
lib/casper/factory.tsextended to readCRED402_CASPER_NODE_URL/CRED402_CASPER_SECRET_KEY_PEM(PEM contents directly, for a one-env-var Render deploy) in addition to the existingCRED402_NODE/CRED402_SECRET_KEY(file path) pair; live mode now auto-enables once both are present, no separateCRED402_CHAIN=testnetflag needed.- Every mirror attempt is logged in-process and exposed at
GET /v1/casper/live(configured?, node reachable?, recent register/ stake/score/deposit attempts with real deploy hashes + cspr.live links). - Honesty flags built in, not glossed over:
set_credit_scoreisonly_admin-gated on-chain (the signer must be the ORIGINAL deployer key — a freshly generated operator key will always get rejected there; the result carriesadmin_required: truerather than hiding the failure).stake/deposit_liquidityare Odra#[odra(payable)]entry points; this submits the attached value as a plainamountU512 runtime arg (the same convention the sim-sideCasperTransportabstraction already uses), but whether Odra's casper-backend WASM for a payable method actually reads a directStoredContractByHashcall that way (vs. requiring its own proxy-caller session) is not yet verified against a funded account — every payable mirror result carriesconvention_verified: falseuntil a real funded deploy confirms it on cspr.live.register_agenthas no such caveat (non-payable, non-admin-gated, and the exact pattern already proven byscripts/casper_health.ts). npm run casper:keygen— new script, generates a real ed25519 Testnet keypair fully offline (no network call, nothing spent), writes the PEM to.secrets/casper_testnet_secret_key.pem(gitignored), prints the account hash and the faucet URL. Ran it this round; the generated key is real.- Verified live, end-to-end, against the real node: booted the API with
CRED402_SECRET_KEY+CRED402_CASPER_NODE_URL=https://node.testnet.casper.network/rpcpointed at the freshly generated (unfunded) key.GET /v1/casper/livereportedlive:true, reachable:true, chain:"casper-test"— the transport genuinely reaches Casper Testnet.POST /v1/agentsandPOST /v1/credit/depositboth returned real RPC rejections (Code: -32008, err: Invalid Deploy— the real node's own validation, because the account has no balance yet), which is exactly the expected failure mode for an unfunded key and proves the signing → serialization → submission path is real, not mocked. - OWNER STEP (flagged, not blocking): fund the generated key at
https://testnet.cspr.live/tools/faucet (public faucet, captcha-gated,
spends nothing). Once funded,
register_agentcalls will go fully live;stake/deposit_liquidityneed the Odra payable convention confirmed against that funded account;set_credit_scoreadditionally needs the ORIGINAL deployer's key, not a fresh one. - All 450 existing tests still pass unmodified — sim mode (the default for everyone without the new env vars) has zero behavior change.
2. QIE / NEAR paid routes — NEAR unblocked, QIE genuinely still blocked (not by me)
- NEAR: no facilitator is needed (Cred402 self-verifies against NEAR RPC
— see
docs/near_x402.md), so the only missing piece really wasCRED402_NEAR_PAY_TO. Newnpm run near:keygengenerates a real ed25519 keypair offline and derives its NEAR implicit account id (the hex-encoded public key — NEAR auto-creates the account on-chain the first time it's funded, no separate registration call). Ran it; wrote.secrets/near_testnet_credentials.json(gitignored) and the real implicit account id is in the script's output.render.yamlnow has aCRED402_NEAR_PAY_TO/CRED402_NEAR_NETWORK=testnetslot ready for the owner to paste the funded account id into. - QIE: re-checked the repo's own prior research (
.env.example,docs/qie_x402.md) before touching anything —CRED402_QIE_ASSET_ADDRESS(QUSDC's ERC-20 contract on QIE testnet) andCRED402_QIE_FACILITATOR_URL(no public x402 facilitator for QIE is confirmed to exist) are both still unconfirmed external facts, not missing env-var plumbing. Filling them with a guess would mean the route either silently fails or worse, "succeeds" against the wrong contract. Addedrender.yamlslots (sync: false) so this is one dashboard paste once those two facts are confirmed or a facilitator is stood up — correctly left undone rather than faked. - OWNER STEP: fund the printed NEAR implicit account at https://near-faucet.io (captcha, free, spends nothing), paste it into Render. QIE needs real research/infra (confirm QUSDC's testnet contract, or deploy a self-hosted x402 EVM facilitator pointed at QIE) before its env vars mean anything — flagged as a follow-up, not an owner click.
3-5. Public marketing homepage + live competitor comparison + 90-second live proof
The console previously booted straight into the technical tab dashboard —
zero hero, value prop, or CTA (confirmed by reading App.tsx before
touching it). Built as one cohesive "Home" tab (now the default tab) rather
than three disconnected pages, since they share one visitor journey:
frontend/src/components/Home.tsx— hero with LIVE stats pulled fromGET /v1/analytics(agents scored, x402 volume, credit issued, receipts settled — zero hardcoded numbers), a 3-step "how it works", and a closing CTA section linking into the console andfrontend/public/pricing.html.frontend/src/components/CompetitorComparison.tsx— a real React table (not prose) with the exact 6 axes fromSTRATEGY-2026-10-23.md§2: Bank of Bots (auditability), Clawloan (chain coverage), Priors (score→loan), Huma/Centrifuge (evidence & dispute), Skyfire/Nevermined/Coinbase x402 (layer), Nevermined (price) — cred402's own claims are all code-verifiable, not invented numbers.frontend/src/components/LiveProof.tsx— the "90-second proof": clicking one button calls the REAL hosted API in sequence (GET /api/credit/explain/:id→POST /v1/credit/lines→ draw → repay) against the protocol's own seeded demo agent (EvidenceSellerAgent, which has a real 30-day x402 revenue history from the moment the API boots —agents/economy.tsbootstrap()), rendering each real response live.- New
frontend/src/api.tshelpers:getCasperLiveStatus,openCreditLine,drawCredit,repayCredit. - Verified live in a real browser (gstack
browse, not just a build check): loadedhttp://localhost:5180/, screenshotted the full Home page, clicked "Run the live proof", and confirmed all three steps completed for real —credit score 94/100 · limit 49.193 CSPR,drew 5 CSPR against a 51.653 CSPR line,repaid 5 CSPR — line closed clean, with real reason codes (LOW_DISPUTE_RATE,STAKE_BACKING,SERVICE_CATEGORY_EXPERTISE,UNVERIFIED_OPERATOR) rendered from the actual underwriting decision. No console errors. Full frontendtsc -b && vite buildpasses clean.
6. Cold-start UX + keep-warm self-ping
- New
lib/services/keepalive.ts—pingSelf()hits this service's own PUBLIC URL (https://cred402-1.onrender.com/v1/healthby default, overridable viaCRED402_KEEPALIVE_URL) on a plain 10-minutesetInterval(not theAutonomousSchedulerused for keeper-sweep/ automations — those stay opt-in; this is pure uptime hygiene, kept deliberately separate). Render's free-tier idle timer is ~15 minutes, so a ping every 10 keeps a service with real traffic from ever going idle in the first place — it can't wake itself up once actually asleep, but it can stop itself from sleeping.shouldAutoStart()gates this toprocess.env.RENDER === "true"(Render sets this automatically) or an explicitCRED402_KEEPALIVE_URL, so local dev is unaffected — verifiedshouldAutoStart({})isfalseandshouldAutoStart({RENDER:"true"})istrue. - Frontend:
frontend/src/api.tsaddsfetchColdStartAware()— retries a request with backoff (1.5s → 20s, ~56s total) on network failure or a 502/503 "still booting" response, calling anonRetry(attempt, elapsedMs)callback.x402Buy()now takes an optionalonRetryandX402Playground.tsxshows a visible "⟳ cold start — API was asleep, retrying automatically (attempt N, Ms so far)…" chip instead of a dead error state, plus a real error chip if all retries are exhausted. - SDK:
sdk/index.ts's internalget/postnow route through arequestWithRetrywith the same backoff/502-503 handling, so a real Node/TS integrator's first call survives a cold Render dyno instead of throwing immediately. Python/Go/Rust SDKs still need the equivalent — remaining, not done this round (see below). - No emoji; the retry chip uses
⟳/✗glyphs, matching the rest of the console's existing symbol-only chip style.
8. GET /v1/credit-score/:agentId convenience alias + per-rail integration docs
- Discovered the backlog's literal suggested path (
/v1/x402/credit-score/:agentId) collides with the already-live Algorand x402-PAID route at that exact path (regex-matched inapi/algorand_x402_routes.ts, dispatched ahead of the v1 router inapi/server.ts) — adding a second handler there would have been silently unreachable dead code. UsedGET /v1/credit-score/:agentIdinstead (no/x402/segment) — a real, new, scoped/rate-limitedread-scope v1 route inapi/v1/router.ts, thin-wrapping the samestate.x402CreditScore()logic the three paid chain-specific routes already serve, with a real404 agent_not_foundfor unknown agents. - Verified live:
curl localhost:4021/v1/credit-score/EvidenceSellerAgentreturns a full real score (97/100, PD 0.004, reason codes, x402 revenue);curl .../credit-score/nope-no-such-agentreturns a real 404; the pre-existing paid Algorand route at/v1/x402/credit-score/:idstill responds exactly as before (503 untilCRED402_ALGORAND_PAY_TOis set) — confirmed no collision. - New
docs/integrations/—README.mdplus one real, runnable sample per rail per the backlog's exact ask:skyfire.md(gate a KYA- authenticated advance on the cred402 score),nevermined.md(underwrite before a metered settlement),coinbase-x402.md(the "sits on top of x402" pattern for any agent on the raw standard). Linked fromREADME.md's new "Integrations" section.
15. Self-hosting quickstart — docker-compose + one-command bootstrap, both run for real
- Found an existing but broken
infra/Dockerfile+infra/docker-compose.yml(production-oriented, requiresCRED402_ADMIN_API_KEY— not a quickstart) and fixed a real latent bug in it while verifying:VOLUME ["/data"]was declared afterUSER cred402switched to a non-root user, but nothing everchown'd/datato that user first — Docker creates a fresh named/ bind volume owned byroot:root, so the container crash-looped on boot withEACCES: permission denied, mkdir '/data/algorand-payment-attempts'the moment a volume was actually mounted (which both compose files do). Fixed ininfra/Dockerfilewith achown -R cred402:cred402 /app /databefore theUSERswitch — this also silently fixesinfra/docker-compose.yml, which shares the same Dockerfile. - New root-level
docker-compose.yml— the actual zero-config quickstart (infra/docker-compose.ymlstays as the fuller auth-required/Postgres/ indexer production-like stack):CRED402_AUTH_REQUIRED=false, no other env required, builds from the now-fixedinfra/Dockerfile, serves the console at the same origin as the API. - New
scripts/bootstrap.sh— the non-Docker one-command path: installs root + frontend deps if missing, starts the API, polls/v1/health, runsscripts/seed_demo_agents.tsagainst it (so the dashboard isn't empty on first load), starts the Vite console, prints both URLs, tails both logs until Ctrl+C (which cleanly kills both processes via a trap). - Verified both for real, not just reviewed:
docker compose up --build→ built the multi-stage image (frontendtsc -b && vite buildsucceeded inside the build), started,docker psshowed(healthy),curl localhost:4021/v1/health→ real 200,curl localhost:4021/→ real console HTML,curl .../v1/credit-score/EvidenceSellerAgent→ real score — thendocker compose down -vto leave the host clean../scripts/bootstrap.sh→ ran end-to-end, printed the full seeded demo loop (agent registered, staked, x402 evidence purchased, credit line opened/drawn/repaid), bothcurl localhost:5173/(console) andcurl localhost:4021/v1/healthreturned real 200s; caught and fixed one bug in my own first draft (../$FRONTEND_LOGpath concatenation against an already-absolutemktemp -dpath) by actually running it, not by re-reading the script. README.md's Quickstart section now leads with both one-command paths, manual multi-terminal instructions kept below for people who want more control.
What's verified vs. what's flagged
- Ran for real, not just typechecked: the full local server against the
actual Casper Testnet RPC (register/stake/deposit all round-tripped to the
real node and got real RPC errors back, not mocked ones); the full
frontend in a real headless browser including clicking through the live
proof;
npm test(450/450 passing, unchanged);npm run typecheck(clean);cd frontend && npm run build(clean, had tonpm installfirst — frontend deps had never been installed in this checkout). - Explicitly flagged, not silently assumed: the Odra payable calling
convention for
stake/deposit_liquidity(convention_verified: falseuntil proven against a funded account);set_credit_scoreneeds the original deployer key; QIE needs real external research/infra, not env plumbing; Python/Go/Rust SDK retry logic; faucet funding (Casper + NEAR) is an owner/captcha step, flagged in script output and here, not blocking anything else in this round.
Remaining from the 15-item backlog (not started this round)
- MCP server directory / Claude Desktop extension listing (manifest + docs).
- Guided wallet-connect → multichain-link → provisional-score onboarding UI
(note:
frontend/src/components/Onboard.tsxalready covers register→stake→verify→list — re-check against the backlog's exact ask before rebuilding from scratch). - Public
/disputesor/trustpage surfacing real dispute/slash outcomes (Trust.tsx/Disputes.tsxexist — check coverage first). - Go port of the relayer/proof-service.
- Python ML risk/fraud scoring variant.
- Real multi-tenant org/API-key scoping depth.
- Webhook delivery dashboard + retry/replay UI in Developer console.
- Python/Go/Rust SDK cold-start retry (TS SDK done this round — see item 6).
Done this round (moved out of "remaining"): 1 (Casper live wiring), 2 (NEAR unblocked, QIE genuinely still external-research-blocked), 3/4/5 (homepage + comparison + live proof), 6 (cold-start UX + keepalive), 8 (credit-score alias + integration docs), 15 (docker-compose + bootstrap.sh).