Skip to content

c0mpute first for AI text (do not merge while site is stopped) - #102

Closed
ralyodio wants to merge 1 commit into
masterfrom
c0mpute-first-ai
Closed

ralyodio wants to merge 1 commit into
masterfrom
c0mpute-first-ai

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Do not merge while c0upons.com is stopped. The site's containers on dev2 are stopped on purpose (a dropped site). Merging to master triggers deploy-dev2.yml, which deploys and restarts it.

What moved to c0mpute

Both through @profullstack/ai-providers 0.2.0 (pinned exact) generateObject: c0mpute peer nodes first, then Anthropic and OpenAI alternating as paid fallbacks. The router parks a provider that is out of credit, which replaces the hand-rolled one-hour Anthropic block.

  • apps/web/lib/scrape.ts scrapeListing (POST /api/scrape, metadata for a submitted deal URL). Same JSON Schema, now validated by parseListing (every field a string or null) with one repair turn per provider. No longer throws ANTHROPIC_API_KEY is not set. Timeout 170 s, route maxDuration 60 -> 180 s.
  • apps/web/app/api/webhooks/email/route.ts offers extraction for coupons@ mail. The model is always offered now (c0mpute needs no vendor key); any failure still falls back to the rules in extractOffers, as before. Timeout 90 s, inside the route's 120 s maxDuration, so Forward Email still gets an answer and does not retry. Anthropic fallback keeps claude-haiku-4-5.

Stays on the vendor

  • lib/reveal-code.ts / lib/reveal-coupon.ts: the reveal agent is an Anthropic beta toolRunner loop over Obscura MCP browser tools. c0mpute has no tool calling, so it is untouched and still needs ANTHROPIC_API_KEY; without one the scripted walk (reveal-heuristic.ts) runs, as today.

Fallback

Both keys are dead today. Scrape fails with the same 502 as now if c0mpute fails. Email falls back to the rules, as now.

Privacy

Scrape sends a public product page. The email path sends deal newsletters that arrive at our own coupons@ alias (vendor marketing mail, not user content). No private user content goes to peer nodes.

Deploy notes

C0MPUTE_API_KEY (fleet ik_live_ account key) should go in dev2 app.env (or the root .env that loadRootEnv reads) before this deploys; without it c0mpute runs on the 10 a day free tier.

Tests

bun run typecheck clean, bun run test 91 pass. CI runs the build.

🤖 Generated with Claude Code

lib/scrape.ts and the Forward Email webhook go through
@profullstack/ai-providers 0.2.0 generateObject: c0mpute peer network
first, Anthropic and OpenAI as paid fallbacks. The email path still falls
back to the rules on any model failure, and stays inside the route's
maxDuration. The reveal-code agent loop (tool calling over MCP) stays on
Anthropic.

Co-Authored-By: Claude Opus 5.5 <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.2.07610010093100

View full report

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

40 finding(s)

MEDIUM: 33 | LOW: 7

Severity Rule Location
MEDIUM sql-template-interpolation apps/web/app/api/bounties/[id]/claim/route.ts:18
MEDIUM sql-template-interpolation apps/web/app/api/bounties/[id]/claim/route.ts:34
MEDIUM sql-template-interpolation apps/web/app/api/bounties/[id]/claim/route.ts:43
MEDIUM sql-template-interpolation apps/web/app/api/bounties/route.ts:95
MEDIUM sql-template-interpolation apps/web/app/api/coupons/route.ts:68
MEDIUM sql-template-interpolation apps/web/app/api/coupons/route.ts:75
MEDIUM sql-template-interpolation apps/web/app/api/coupons/vote/route.ts:31
MEDIUM sql-template-interpolation apps/web/app/api/coupons/vote/route.ts:33
MEDIUM sql-template-interpolation apps/web/app/api/stores/[slug]/route.ts:9
MEDIUM sql-template-interpolation apps/web/app/api/webhooks/crawlproof/route.ts:83
MEDIUM sql-template-interpolation apps/web/app/api/webhooks/crawlproof/route.ts:90
MEDIUM js-open-redirect apps/web/app/bounties/new/page.tsx:61
MEDIUM js-unescaped-html-sink apps/web/app/coupons/[id]/page.tsx:57
MEDIUM js-unescaped-html-sink apps/web/app/layout.tsx:88
MEDIUM sql-template-interpolation apps/web/app/stores/[slug]/page.tsx:16
MEDIUM sql-template-interpolation apps/web/lib/bbs-post.ts:164
MEDIUM sql-template-interpolation apps/web/lib/flipp-sync.ts:445
MEDIUM sql-template-interpolation apps/web/lib/inbound-email.ts:574
MEDIUM sql-template-interpolation apps/web/lib/inbound-email.ts:644
MEDIUM sql-template-interpolation apps/web/lib/mcp-tools.ts:81
MEDIUM sql-template-interpolation apps/web/lib/members.ts:54
MEDIUM sql-template-interpolation apps/web/lib/nichedb-sync.ts:186
MEDIUM sql-template-interpolation apps/web/lib/nichedb-sync.ts:206
MEDIUM sql-template-interpolation apps/web/lib/peerpush-sync.ts:338
MEDIUM sql-template-interpolation apps/web/lib/peerpush-sync.ts:353
MEDIUM sql-template-interpolation apps/web/lib/reddit-sync.ts:336
MEDIUM sql-template-interpolation apps/web/lib/reddit-sync.ts:355
MEDIUM sql-template-interpolation apps/web/lib/reddit-sync.ts:361
MEDIUM sql-template-interpolation apps/web/lib/reveal-coupon.ts:115
MEDIUM sql-template-interpolation apps/web/lib/reveal-coupon.ts:170
MEDIUM sh-predictable-temp-path apps/web/public/install.sh:37
MEDIUM sh-predictable-temp-path apps/web/public/install.sh:39
MEDIUM sql-template-interpolation apps/web/scripts/migrate.mjs:192
LOW sql-template-interpolation test/bbs-post.test.mjs:129
LOW sql-template-interpolation test/bbs-post.test.mjs:143
LOW sql-template-interpolation test/bbs-post.test.mjs:164
LOW sql-template-interpolation test/inbound-email.test.mjs:139
LOW sql-template-interpolation test/peerpush-sync.test.mjs:183
LOW sql-template-interpolation test/reveal-sweep.test.mjs:69
LOW sql-template-interpolation test/reveal-sweep.test.mjs:112

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio

ralyodio commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Closed (not merged) on purpose: CI is green, but c0upons.com is a stopped site and merging deploys it. gh-prs-merge sweeps merge any open green PR, so this is parked closed. Branch c0mpute-first-ai is kept; reopen and merge only when the site comes back.

@ralyodio ralyodio closed this Nov 7, 2026
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