Skip to content

Add Shulam compliance screening and trust scoring skills#168

Open
shulam-pay wants to merge 1 commit intoBankrBot:mainfrom
shulam-pay:feat/shulam-compliance-trust-skills
Open

Add Shulam compliance screening and trust scoring skills#168
shulam-pay wants to merge 1 commit intoBankrBot:mainfrom
shulam-pay:feat/shulam-compliance-trust-skills

Conversation

@shulam-pay
Copy link

@shulam-pay shulam-pay commented Feb 19, 2026

Summary

  • Compliance Screening — OFAC/SDN wallet screening via Shulam CaaS API. Returns clear, held, or blocked status with match scores.
  • Trust Scoring — Wallet trust scores (0-100) with 6-dimension breakdown and tier classification via Shulam Agent Passport API.

Both skills use zero dependencies (raw fetch), include exponential backoff on rate limits, and are free for 100 requests/day.

Test plan

  • Verified SKILL.md follows contributing guide format (Capabilities, Usage Examples, Requirements)
  • Scripts tested against Shulam API (clear/held/blocked mapping confirmed)
  • 20 unit tests passing in source repo
  • Manual review of SKILL.md content

🤖 Generated with Claude Code


Note

Medium Risk
Introduces new network-facing skills that depend on external API behavior and environment configuration; failures or schema changes could impact agent flows, but changes are additive and isolated to new modules.

Overview
Adds a new shulam provider with two installable skills: Compliance Screening (single + batch wallet screening via Shulam CaaS, returning clear/held/blocked with match metadata) and Trust Scoring (wallet trust score lookup with tier + breakdown, plus a combinedCheck that runs trust + compliance in parallel).

Both skills are implemented as dependency-free TypeScript modules using raw fetch, include exponential backoff handling for 429 responses, and document required env vars (SHULAM_API_KEY, optional SHULAM_API_URL, plus MIN_TRUST_SCORE); trust scoring also adds a 60s in-memory cache with a clearCache helper.

Written by Cursor Bugbot for commit fb9ac3c. This will update automatically on new commits. Configure here.

- OFAC/SDN screening with clear/held/blocked status mapping
- Trust scores (0-100) with 6-dimension breakdown and tier classification
- Combined compliance + trust check (parallel execution)
- Zero dependencies (raw fetch), exponential backoff on 429
- Free tier: 100 requests/day

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

const retryAfter = response.headers.get('Retry-After');
const delayMs = retryAfter
? parseInt(retryAfter, 10) * 1000
: Math.min(1000 * 2 ** attempt, 30_000);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retry-After date format causes zero backoff delay

Medium Severity

When the Retry-After header contains an HTTP date string (a valid format per RFC 7231), parseInt returns NaN, making delayMs equal to NaN. Since setTimeout treats NaN as 0, the sleep resolves immediately. The truthy check on retryAfter prevents the exponential backoff fallback from being used. This causes rapid-fire retries against a rate-limited endpoint with no delay whatsoever.

Additional Locations (1)

Fix in Cursor Fix in Web

}

throw lastError ?? new Error('Request failed after retries');
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated infrastructure code across both skill files

Low Severity

fetchWithBackoff, sleep, getApiKey, getApiUrl, STATUS_MAP, and ComplianceStatus are near-identically duplicated between the two skill files. Notably, combinedCheck in the trust-scoring skill reimplements compliance screening rather than importing from the compliance-screening skill, meaning any bug fix or behavior change to screening logic needs to be applied in two places independently.

Additional Locations (1)

Fix in Cursor Fix in Web

: Math.min(1000 * 2 ** attempt, 30_000);
await sleep(delayMs);
continue;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

429 handler sleeps unnecessarily on final retry attempt

Medium Severity

The 429 handling path always sleeps before continue, even on the final attempt when no retry will follow. The error catch path correctly guards this with if (attempt < maxRetries), but the 429 path is missing the same guard. If the server returns a large Retry-After value on the last attempt, the caller blocks for up to 30 seconds (or more) for no reason before the function throws.

Additional Locations (1)

Fix in Cursor Fix in Web

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