feat: /deep-research/skale dedicated route + /evaluate null-deref fix#3
Merged
Conversation
… + 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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:
Ben (SKALE) shipping blog Wed May 27.