#108·Crucix

Reddit unauthenticated .json scraping violates API ToS; failed sweeps silently serve stale data

Author: tg12Created May 17, 2026Updated Sep 22, 2026

Summary

The Crucix briefing pipeline scrapes Reddit via OAuth but also falls back to unauthenticated JSON endpoints (reddit.com/r/<sub>/hot.json) when credentials are absent. Reddit's API Terms of Service prohibit unauthenticated scraping. Separately, the server.mjs in-process memory model stores all intelligence sweep data in currentData — a single module-level variable — which means a crash mid-sweep silently drops all new data and serves the previous stale snapshot without any alert.

Evidence

Reddit ToS violation — apis/sources/reddit.mjs:

javascript
// Unauthenticated fallback — line ~60
return safeFetch(
  `https://www.reddit.com/r/${subreddit}/hot.json?limit=${limit}&raw_json=1`,
  { headers: { 'User-Agent': config.userAgent } }
);

Reddit's API Terms explicitly require OAuth for all programmatic access. The .json endpoint is not a supported API endpoint and Reddit has rate-limited / blocked it for scrapers. Using it violates the Reddit Developer Terms.

Stale data served silently — server.mjs:

javascript
let currentData = null;  // module-level, single value

async function runSweep() {
  sweepInProgress = true;
  try {
    const data = await fullBriefing(config, ...);
    currentData = data;           // only updated on success
  } catch (e) {
    console.error('[Crucix] Sweep failed:', e.message);
    // currentData unchanged — previous stale snapshot served forever
  } finally {
    sweepInProgress = false;
  }
}

If a sweep fails (API timeout, network error, LLM error), currentData retains the previous value with no staleness timestamp update. The dashboard shows stale data as current with no visible warning.

Why this matters

  • ToS violation: Using Reddit's .json unauthenticated endpoints violates Reddit's Data API Terms (updated June 2023). Reddit actively blocks scrapers and the fallback will fail in production, silently degrading one intelligence source.
  • Silent stale data: An operator has no way to know the dashboard data is from a failed sweep. All intelligence displayed could be hours or days old with no indicator.

Recommended fix

  1. Reddit: Remove the unauthenticated fallback entirely. Require REDDIT_CLIENT_ID / REDDIT_CLIENT_SECRET to enable the Reddit source. If absent, skip the source and log clearly.
  2. Stale data: Track lastSuccessfulSweepAt and surface it in the dashboard. Alert via Telegram/Discord when now - lastSuccessfulSweepAt > 2 * refreshIntervalMinutes.

Acceptance criteria

  • No unauthenticated Reddit .json requests made under any code path
  • Dashboard clearly shows the timestamp of the last successful sweep
  • Telegram/Discord alert fires when sweep fails or data becomes stale beyond 2× the configured interval

Suggested labels

bug, reliability

Priority

P1

Severity

High (ToS) / Medium (stale data)

Confidence

Confirmed — both issues read directly from source.