修复代码审查反馈:改进错误日志、常量命名、类型检查

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-09 09:30:51 +00:00
parent 3e8395923a
commit f00d67061e
3 changed files with 7 additions and 5 deletions

View File

@ -63,8 +63,8 @@
<!-- BINGSHUO_BULLETIN_START -->
| 时间 | 检查项 | 状态 |
|------|--------|------|
| 03-09 17:16 | 🔧 系统更新: `scripts/` | 铸渊 (Copilot) |
| 03-09 17:15 | 🔧 系统更新: `.github/` | 铸渊 (Copilot) |
| 03-09 17:29 | 🔧 系统更新: `.github/` | 铸渊 (Copilot) |
| 03-09 17:29 | 🔧 系统更新: `scripts/` | 铸渊 (Copilot) |
| 03-09 17:15 | 🔧 系统更新: `docs/` | 铸渊 (Copilot) |
| 03-09 17:15 | 🔧 系统更新: `persona-brain-db/` | 铸渊 (Copilot) |
| 03-09 16:56 | ✅ 每日巡检 ✅ 通过 | 冰朔 |

View File

@ -34,6 +34,7 @@ const COLLABORATORS_PATH = path.join(__dirname, '..', '.github', 'brain', 'colla
const MAX_BINGSHUO_ENTRIES = 15;
const MAX_COLLAB_ENTRIES = 20;
const MAX_GIT_LOG_COMMITS = 30;
const BINGSHUO_USERNAME = 'qinfendebingshuo';
/* ── 公告区标记 ─────────────────────────── */
const MARKERS = {
@ -86,7 +87,7 @@ const SYSTEM_PREFIXES = ['scripts', 'docs', '.github', 'persona-brain-db'];
function formatTime(ts) {
if (!ts) return '—';
const d = new Date(ts);
if (isNaN(d.getTime())) return String(ts).substring(0, 10);
if (isNaN(d.getTime())) return typeof ts === 'string' ? ts.substring(0, Math.min(10, ts.length)) : '—';
const fmt = new Intl.DateTimeFormat('zh-CN', {
timeZone: 'Asia/Shanghai',
month: '2-digit',
@ -583,7 +584,7 @@ async function sendAlertEmails(bingshuoIssues, collabIssuesByDev) {
// 冰朔邮件
if (bingshuoIssues.length > 0) {
const bingshuoEmail = process.env.BINGSHUO_EMAIL
|| await fetchUserEmail('qinfendebingshuo')
|| await fetchUserEmail(BINGSHUO_USERNAME)
|| null;
if (bingshuoEmail) {

View File

@ -19,7 +19,8 @@ try {
try {
collaborators = JSON.parse(fs.readFileSync('.github/brain/collaborators.json', 'utf8'));
} catch {
} catch (err) {
console.log('⚠️ collaborators.json 读取失败,使用空列表:', err.message);
collaborators = [];
}