Skip to content

AI: quality gate on c0mpute first, frontier fallback - #2

Merged
ralyodio merged 1 commit into
mainfrom
ai-c0mpute-default
Nov 5, 2026
Merged

ralyodio merged 1 commit into
mainfrom
ai-c0mpute-default

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

scoreQuality called api.anthropic.com directly with a key that currently answers "credit balance too low", so the quality gate failed open on every inbound post. It now routes through @profullstack/ai-providers: c0mpute first, OpenAI and Anthropic only as fallbacks.

Part of the fleet rollout (ai-providers ROLLOUT.md wave 1) — this one release moves 7 consumers: crawlproof, coinpayportal, bl0ggers, d0rz, logicsrc, media-streamer, niche-db.

Changes

  • anthropicApiKey is now optional. c0mpute needs no key, so a receiver with minQualityScore set but no key now scores instead of silently skipping the gate.
  • openaiApiKey added for the other paid fallback.
  • QualityScore reports provider and model, so you can see what answered.
  • A JSON schema is sent to the model — a small peer node has to be told the shape.
  • Timeout 15s → 120s: a peer node is slower than Haiku.
  • Unchanged: never throws, still fails open.

Testing

pnpm test — 54 passed. tsc --noEmit clean. The quality tests now fake c0mpute's real wire protocol (POST /api/chat + SSE) end to end through the package, plus an injected-router suite.

🤖 Generated with Claude Code

scoreQuality called api.anthropic.com directly and needed a key that has
no credit, so the quality gate failed open on every inbound post. It now
goes through @profullstack/ai-providers: c0mpute (our own peer network)
first, OpenAI and Anthropic only when a paid key is set.

- anthropicApiKey is now optional; c0mpute needs no key, so a receiver
  with minQualityScore set but no key scores instead of skipping.
- QualityScore reports which provider and model answered.
- A JSON schema goes to the model, because a small peer node needs to be
  told the shape.
- Timeout default 15s -> 120s: a peer node is slower than Haiku.
- Still never throws and still fails open.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​profullstack/​ai-providers@​0.1.0761009690100
Updatedvitest@​4.1.6 ⏵ 4.1.1098 +19979 +199 +2100
Updated@​types/​node@​22.19.19 ⏵ 22.20.1100 +110081 +196100

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Low priority
License policy violation: npm rollup under unrecognized license

License: unrecognized license - This license was not allowed or given any lesser classification by the applicable policy (package/LICENSE.md)

From: pnpm-lock.yaml → npm/tsup@8.5.1 → npm/rollup@4.62.3

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/rollup@4.62.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

1 finding(s)

LOW: 1

Severity Rule Location
LOW secret-generic-credential tests/sender-receiver.test.ts:40

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 49fa4e0 into main Nov 5, 2026
4 checks passed
@ralyodio
ralyodio deleted the ai-c0mpute-default branch November 5, 2026 17:03
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