Skip to content

feat: /deep-research/skale dedicated route + /evaluate null-deref fix#3

Merged
TKCollective merged 1 commit into
mainfrom
feat/skale-dedicated-route
May 23, 2026
Merged

feat: /deep-research/skale dedicated route + /evaluate null-deref fix#3
TKCollective merged 1 commit into
mainfrom
feat/skale-dedicated-route

Conversation

@TKCollective

Copy link
Copy Markdown
Owner

Ships Option D: dedicated /deep-research/skale route advertising SKALE Network (eip155:1187947933) via PayAI as the sole accept, keeping /research and /deep-research Base-only for Bazaar indexing.

Includes /evaluate defensive backfill for the null-deref that surfaced as 500 on short payloads in CI on 2026-05-15.

Smoke-tested locally:

  • /deep-research/skale → 402 with eip155:1187947933 only
  • /deep-research → 402 with eip155:8453 only (Bazaar safe)
  • /evaluate → 200 on test payload (no 500)

Ben (SKALE) shipping blog Wed May 27.

… + test calibration

Three independent fixes shipped together; each is intentionally additive
to keep the Bazaar-indexed routes (/research, /deep-research,
/research/batch) byte-identical to their pre-change 402 response shape.

1) NEW ROUTE — /deep-research/skale
   - SKALE Network (eip155:1187947933) as the sole accepts entry via PayAI
   - Same /deep-research backend (Sonar Pro, same body validation, same
     query length cap), aliased through Express's multi-path POST handler
   - No bazaar discovery extension on this route — CDP doesn't index
     SKALE-only resources and including the extension surface there would
     invite the exact rejection pattern that 579923c (2026-05-03) was
     installed to prevent
   - /traffic stats tag the SKALE path separately ('deep-research-skale')
     so the payment network is recoverable from request counts
   - Local smoke against the new handler returns a clean
     PaymentRequiredV2-shaped 402 with the SKALE accept and no Base bleed;
     /deep-research and /research 402 bodies are unchanged

2) FIX — /evaluate 500 on short payloads
   - Root cause: the 3-of-4-settled early-finish path in the parallel
     verification step left the 4th source as null until the budget timer
     fired. parseEvalResponse(null, label) then threw
       'Cannot read properties of null (reading "status")'
     surfacing as a 500 in CI on test payloads like
       { content: 'Test claim for CI', min_confidence: 0.5 }
   - Fix: backfill any null slots as
       { status: 'rejected', reason: 'finished_before_settle' }
     immediately after the await, before destructuring. Also guard
     parseEvalResponse against a null arg for belt-and-suspenders. Zero
     behavior change on the happy path.

3) CI TEST CALIBRATION — tests/api.test.js now matches reality
   - POST /preview assertion now reads result.confidence_score (the
     nested field the live API actually returns), not the non-existent
     top-level 'confidence' that was failing every run since 2026-04-29
   - POST /evaluate test payload swapped to a substantive claim so the
     parallel verification step has material to work with — the null-deref
     fix above makes short payloads safe too, but a real-content payload
     is what the endpoint is designed for
   - Stellar accept test on /research SKIPPED with reason citing the
     CDP-Bazaar constraint (commit 579923c) and pointing at the future
     stellar dedicated route
   - SKALE accept test on /research REMOVED and replaced with two new
     assertions targeting /deep-research/skale (SKALE present + ONLY
     SKALE present, no Base bleed)
   - One new guard assertion: /deep-research stays Base-only (any leak of
     SKALE or Stellar into its accepts[] would re-trigger CDP de-indexing)

Local test run against a SERVER_PORT=4949 instance with all three changes
applied: 35 passed, 1 skipped, 2 failed — both remaining fails are
environment-only (perplexity-key-dependent /preview 502 and
redis-dependent /fingerprints count), neither reproduce against
agentoracle.co. Against prod (TEST_URL=agentoracle.co) before deploy, the
expected 3 fails are the new /deep-research/skale 404s + /evaluate 500;
all three will resolve once this branch deploys.

No changes to:
  - /research, /deep-research, /research/batch routeConfig
  - paymentMiddleware mounting
  - bazaar extension registration or boot-time assertion
  - res.on('finish') diagnostic capture from 5dd6466 (today's earlier ship)
  - any other CDP-indexed surface
@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
x402-research-skill Ready Ready Preview, Comment May 23, 2026 2:17pm

@TKCollective TKCollective merged commit 1b1eead into main May 23, 2026
3 of 5 checks passed
@TKCollective TKCollective deleted the feat/skale-dedicated-route branch May 23, 2026 14:17
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