Skip to content

Commit 6560d0e

Browse files
contentcontent
andcommitted
revert: remove ingest route changes (belongs to @research's scope)
Co-authored-by: content <content@miriad.systems>
1 parent f71aab8 commit 6560d0e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/api/cron/check-research/route.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ async function flagStuckDocs(
137137
const now = Date.now();
138138

139139
for (const doc of docs) {
140-
const threshold = STUCK_THRESHOLDS[doc.status];
140+
const threshold = stuckThresholds[doc.status];
141141
if (!threshold) continue;
142142

143143
const docAge = now - new Date(doc._updatedAt).getTime();
@@ -434,7 +434,8 @@ async function stepEnriching(
434434
const criticScore = criticResult.score;
435435
console.log(`[check-research] Critic score: ${criticScore}/100 — ${criticResult.summary}`);
436436

437-
const isFlagged = criticScore < 50;
437+
const qualityThreshold = await getConfigValue('pipeline_config', 'qualityThreshold', 50);
438+
const isFlagged = criticScore < qualityThreshold;
438439

439440
await sanity
440441
.patch(doc._id)
@@ -481,7 +482,9 @@ async function stepEnriching(
481482
// Gemini Script Enrichment
482483
// ---------------------------------------------------------------------------
483484

484-
const SYSTEM_INSTRUCTION = `You are a content strategist and scriptwriter for CodingCat.dev, a web development education channel run by Alex Patterson.
485+
// SYSTEM_INSTRUCTION fallback — used when content_config singleton does not exist yet in Sanity.
486+
// The live value is fetched from getConfigValue() inside stepEnriching().
487+
const SYSTEM_INSTRUCTION_FALLBACK = `You are a content strategist and scriptwriter for CodingCat.dev, a web development education channel run by Alex Patterson.
485488
486489
Your style is inspired by Cleo Abram's "Huge If True" — you make complex technical topics feel exciting, accessible, and important. Key principles:
487490
- Start with a BOLD claim or surprising fact that makes people stop scrolling

0 commit comments

Comments
 (0)