| name | ari-pokemon-p1-pipeline |
| description | NOVA's P1 PayThePryce pipeline โ market signal ingest, card detection, price monitoring, script generation, thumbnail generation, video assembly, approval gate |
| triggers | ["nova","paytheprice","pokemon tcg","p1 pipeline","video queue","thumbnail","content pipeline","card prices"] |
ARI P1: PayThePryce Pokemon TCG Content Pipeline
Agent: NOVA ๐ฌ | Plane: APEX | Model: claude-sonnet-4-6
Data Sources
| Source | What | Frequency | Priority |
|---|
| pokemontcg.io | Card prices (TCGPlayer), set data | 6h | Primary authority |
| pokewallet.io | Real-time price deltas | 2h | Price verification |
| X API (tracked accounts) | Community hype signals | 2h | Sentiment layer |
| Reddit snoowrap | r/PokemonTCG, r/pokemontrades | 3h | Community sentiment |
| Perplexity Sonar Pro | Web synthesis + news | 6h | Broader context |
| Apify Tweet Scraper V2 | Bulk tweet analysis | Event-triggered | Set reveals, tournaments |
MarketSignalEnvelope
Every signal enters the pipeline wrapped in:
interface MarketSignalEnvelope {
source: 'pokemontcg.io' | 'pokewallet.io' | 'x_tracked_account' | 'reddit_post' | 'perplexity_synthesis' | 'apify_scrape';
reliabilityWeight: number;
sentiment: 'bullish' | 'bearish' | 'neutral';
scoringMethod: string;
payload: unknown;
timestamp: string;
evidenceId: string;
}
const SOURCE_RELIABILITY = {
'pokemontcg.io': 1.0,
'pokewallet.io': 0.90,
'perplexity_synthesis': 0.80,
'x_tracked_account': 0.70,
'reddit_post': 0.65,
'apify_scrape': 0.65,
};
Script Quality Loop (Ralph-Style Agentic Iteration)
NOVA uses an iterative quality gate โ the same prompt fed repeatedly until the confidence
threshold is met. Inspired by the Ralph Wiggum technique but implemented as an agentic
loop inside the pipeline (not a Claude Code stop hook โ OpenClaw context doesn't use one).
const MAX_SCRIPT_RETRIES = 3;
const CONFIDENCE_THRESHOLD = 0.95;
const REVIEW_THRESHOLD = 0.80;
async function generateScriptWithQualityLoop(
signals: MarketSignalEnvelope[],
): Promise<ScriptOutput> {
let attempt = 0;
let best: ScriptOutput | null = null;
let feedback = '';
while (attempt < MAX_SCRIPT_RETRIES) {
attempt++;
const script = await nova.generateScript(signals, feedback);
if (!best || script.confidence > best.confidence) {
best = script;
}
if (script.confidence >= CONFIDENCE_THRESHOLD) break;
feedback = `Previous attempt scored ${script.confidence.toFixed(2)}. Issues: ` +
`hook unclear? evidence gaps? ${script.evidenceIds.length} evidenceIds present.`;
}
return best!;
}
interface ScriptOutput {
hook: string;
setup: string;
body: ScriptSection[];
cta: string;
seo: {
title: string;
description: string;
tags: string[];
thumbnailBrief: string;
};
confidence: number;
evidenceIds: string[];
}
Rights Gate (MANDATORY โ cannot be bypassed)
interface AssetRights {
origin: 'owned' | 'licensed' | 'generated' | 'third_party';
usageClass: 'commercial_ok' | 'restricted' | 'unknown';
}
Thumbnail Generation (4 Variants)
const ideogramPrompt = `Professional Pokemon TCG YouTube thumbnail.
Feature ${cardName} card with holographic foil effect and metallic sheen.
Large bold text: '${cardName}' in gold metallic lettering.
Red price banner: 'PRICE DROP $${oldPrice}โ$${newPrice}' in white bold sans-serif.
Background: dark gradient, TCG rarity sparkle effects. 1280ร720. High contrast.`;
Pokemon TCG Copyright Rule: NEVER use pokemontcg.io card image scans as thumbnails.
Use Ideogram V3 to generate ORIGINAL card-inspired artwork + text overlays.
Video Assembly Decision Tree
IF clips < 20 AND duration < 600s AND memory > 4GB:
โ Remotion + FFmpeg (primary โ deterministic, testable, diffable)
ELSE IF duration < 1800s:
โ FFmpeg only (lighter footprint)
ELSE:
โ Shotstack API (cloud, 20 min/mo free, $49/mo paid)
Video Idempotency
Format: pokemon-tcg-video-{SHA256(signalId+scriptVersion).slice(0,16)}-{YYYY-MM-DD}
TTL: 24h | Within TTL: 409 Conflict (skip re-run) | After TTL: allow re-run
Approval Gate (ADR-014 โ IMMUTABLE)
VideoOutputPackage โ #video-queue (embed + โ
/โ button, 48h TTL)
Pryce clicks โ
โ YouTube upload via YouTube Data API v3
Pryce clicks โ โ script goes to revision
TTL expires โ job = 'expired', no action
NOVA NEVER auto-publishes to YouTube. Ever.
Daily Output Contract
- 1 long-form video package โ #video-queue (pending โ
)
- 3-8 clip derivatives
- 4 thumbnail variants โ #thumbnail-lab
- 1 midday market script + report โ #pokemon-market
- Captions (.vtt) + SEO metadata
Rate Limiting (pokemontcg.io)
Max: 1000 req/day with POKEMON_TCG_API_KEY
Strategy: Token bucket at 800 req/day (20% safety margin)
Backoff: min(2^n ร 1000 + rand(0,500), 30000)ms
Alert: emit budget:95pct-warning at 950/1000 daily quota
Environment Variables
POKEMON_TCG_API_KEY # Higher rate limits
FAL_API_KEY # Ideogram V3 thumbnails
OPENAI_API_KEY # DALL-E 3 fallback + Whisper ASR
ELEVENLABS_API_KEY # Voice narration (if enabled)
SERPAPI_KEY # eBay sold listings research
X_BEARER_TOKEN # Community signal tracking
REDDIT_CLIENT_ID/SECRET # r/PokemonTCG, r/pokemontrades