diff --git a/.husky/pre-push b/.husky/pre-push index 314dd92c1..3fffcce99 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -18,6 +18,20 @@ if [ -n "$BRANCH" ] && [ "$BRANCH" != "main" ] && [ "$BRANCH" != "master" ]; the exit 1 fi echo " Branch PR state: ${PR_STATE:-unknown}" + + # Guard against branch contamination from a dirty local main. + # A feature/fix branch should never have more than 20 commits — if it does, + # the branch was likely created from a local main that had unmerged feature branches. + COMMIT_COUNT=$(git rev-list --count origin/main..HEAD 2>/dev/null || echo 0) + if [ "$COMMIT_COUNT" -gt 20 ]; then + echo "" + echo "============================================================" + echo "ERROR: Branch '$BRANCH' is $COMMIT_COUNT commits ahead of origin/main." + echo "This usually means it was branched from a dirty local main." + echo "Fix: create branches from a worktree or use: git checkout -b origin/main" + echo "============================================================" + exit 1 + fi fi echo "Running type check..." diff --git a/api/health.js b/api/health.js index 35acf965f..84f4fc09b 100644 --- a/api/health.js +++ b/api/health.js @@ -95,7 +95,7 @@ const SEED_META = { outages: { key: 'seed-meta:infra:outages', maxStaleMin: 30 }, climateAnomalies: { key: 'seed-meta:climate:anomalies', maxStaleMin: 120 }, // runs as independent Railway cron (0 */2 * * *) unrestEvents: { key: 'seed-meta:unrest:events', maxStaleMin: 120 }, // 45min cron; 120 = 2h grace (was 75 = 30min buffer, too tight) - cyberThreats: { key: 'seed-meta:cyber:threats', maxStaleMin: 480 }, + cyberThreats: { key: 'seed-meta:cyber:threats', maxStaleMin: 240 }, // 2h interval; 240min = 2x interval cryptoQuotes: { key: 'seed-meta:market:crypto', maxStaleMin: 30 }, etfFlows: { key: 'seed-meta:market:etf-flows', maxStaleMin: 60 }, gulfQuotes: { key: 'seed-meta:market:gulf-quotes', maxStaleMin: 30 },