diff --git a/scripts/generate-daily-report.js b/scripts/generate-daily-report.js index d2e16ac8..f3b979ca 100644 --- a/scripts/generate-daily-report.js +++ b/scripts/generate-daily-report.js @@ -179,7 +179,6 @@ function generateReport(devStatus, activity) { // 项目概览 const activeDevs = team.filter(d => d.status !== 'paused').length; const summary = devStatus.summary || {}; - const graduatedCount = summary.graduated_modules?.length || 0; const report = `# 🌊 光湖开发日报 · ${dateStr} diff --git a/scripts/sync-dev-status.js b/scripts/sync-dev-status.js index e221c7d1..158cd892 100644 --- a/scripts/sync-dev-status.js +++ b/scripts/sync-dev-status.js @@ -133,7 +133,9 @@ function mapNotionStatus(status) { function generateSummary(team) { const activeCount = team.filter(d => d.status === 'active').length; const waitingSyslog = team.filter(d => d.status === 'waiting_syslog').length; - const topStreak = team.reduce((max, d) => d.streak > max.streak ? d : max, { streak: 0 }); + const topStreakDev = team.length > 0 + ? team.reduce((max, d) => d.streak > max.streak ? d : max, team[0]) + : null; const alerts = team .filter(d => d.waiting && d.waiting.includes('⚠️')) .map(d => `${d.dev_id} ${d.name}: ${d.waiting}`); @@ -142,7 +144,7 @@ function generateSummary(team) { total_devs: team.length, active_waiting_syslog: waitingSyslog, active_normal: activeCount, - top_streak: topStreak.dev_id ? `${topStreak.dev_id} ${topStreak.name} ${topStreak.streak}连胜` : '无', + top_streak: topStreakDev ? `${topStreakDev.dev_id} ${topStreakDev.name} ${topStreakDev.streak}连胜` : '无', alerts, }; }