全项目扫描修复: Docker数据卷修复+安全requireAdmin+12页SEO+API白名单+脚本超时+常量提取+假数据删除

This commit is contained in:
ZhuiGuangAI Dev
2026-06-12 17:27:47 +08:00
parent 464924aea0
commit 4c325c8699
454 changed files with 33647 additions and 980 deletions
+76 -4
View File
@@ -59,11 +59,83 @@ const TASK_DEFS = [
},
{
taskKey: "bot-activity",
taskName: "Bot活跃度调度",
taskName: "Bot活动引擎",
enabled: true,
cronExpr: "0 8,12,16,20 * * *",
description: "每天4次(8点/12点/16点/20点)调度行业论坛Bot发言:选2个论坛,发起话题或回复",
config: { forumsPerRun: 2, model: "deepseek-chat" },
cronExpr: "0 9-23 * * *",
description: "每小时(9-23点)调度行业论坛Bot发言:4个专家板块+4个路人板块(每个路人板块最多2帖),按活跃时段过滤bot,按最近发帖加权去重",
config: { expertForumsPerRun: 4, passerbyForumsPerRun: 4, passerbyTopicsPerForum: 2, model: "deepseek-chat" },
},
{
taskKey: "bot-feedback-loop",
taskName: "Bot反馈循环",
enabled: true,
cronExpr: "0 */3 * * *",
description: "每3小时扫描Bot自己帖子下的新回复,存为反馈记忆并按概率触发二次回复",
config: { followUpProbability: 0.6, maxPerRun: 3, lookbackHours: 24 },
},
{
taskKey: "bot-skill-crystallize",
taskName: "Bot技能沉淀",
enabled: true,
cronExpr: "0 */12 * * *",
description: "每12小时扫描过去14天高互动Bot话题(回复≥5或真人≥1或点赞≥3),DeepSeek解构共性后入库BotSkill;末尾回收7天前成熟技能的实际表现,更新successRate/avgReplies,<30%且使用≥3次自动降级",
config: { lookbackDays: 14, minReplies: 5, minHumanReplies: 1, minLikes: 3, maxTopicsPerBot: 8, recycleAfterDays: 7, minSuccessRate: 0.3 },
},
{
taskKey: "bot-affinity-update",
taskName: "Bot亲和度与画像",
enabled: true,
cronExpr: "0 */6 * * *",
description: "每6小时:①统计每个Bot话题收到的跨板块真人互动,刷BotCrossForumAffinity(affinity=min(1, samples/total/4))②扫过去30天发言,刷BotPersona(avgReplyLength/questionRatio/stanceKeywords/topHumanUsers/topTopicTypes/lastTopicTitles)",
config: { affinityLookbackDays: 14, personaLookbackDays: 30, minAffinity: 0.1 },
},
{
taskKey: "bot-weekly-review",
taskName: "Bot周度复盘",
enabled: true,
cronExpr: "30 2 * * 1",
description: "每周一凌晨2:30对每个Bot算engagementScore(回复/帖子比+真人占比+点赞对数),生成REFLECTION记忆并决定下周配额tier(high/medium/low)",
config: { weights: { replyPerTopic: 0.4, humanRatio: 0.3, likesLog: 0.3 }, thresholds: { high: 1.0, medium: 0.5 } },
},
{
taskKey: "task7-news-to-community",
taskName: "新闻分发到社区",
enabled: true,
cronExpr: "0 8 * * *",
description: "每天早上8点把当日AI日报条目自动分发到社区对应板块创建话题",
config: { sourceTask: "daily-news", maxPerDay: 12 },
},
{
taskKey: "cleanup-task-logs",
taskName: "清理任务日志",
enabled: true,
cronExpr: "30 6 * * 0",
description: "每周日凌晨清理 30 天前的 task_log 数据,避免表无限膨胀",
config: { retentionDays: 30 },
},
{
taskKey: "reconcile-like-counts",
taskName: "点赞数对齐巡检",
enabled: true,
cronExpr: "15 */6 * * *",
description: "每6小时对齐 forumTopic.likeCount / forumPost.likeCount 与真实 Like 表的计数,确保 Redis 缓存 + UI 显示与真实点赞一致(drift 自动修正)",
config: { scope: "both", botOnly: false, autoFix: true, limit: 5000 },
},
{
taskKey: "bot-persona-experiment-run",
taskName: "Bot Persona A/B 调度",
enabled: true,
cronExpr: "45 */4 * * *",
description: "每4小时:①采集最近7天 bot_persona_assignments 的真实互动数据(reply/like/humanReplies)回填到 bot_persona_metrics ②对每个bot的变体做双比例z检验(p<0.1, 样本≥20)③winner变体权重自动提到0.85,其他降到0.075,标记experiment=completed",
config: { lookbackDays: 7, minSamplesPerArm: 20, significanceLevel: 0.1 },
},
{
taskKey: "bot-adversarial-learning-run",
taskName: "Bot 对抗学习(真人高赞帖)",
enabled: true,
cronExpr: "0 23 * * 0",
description: "每周日23:00:给每个专家bot选1篇过去7天由真人发布的高互动topic(真人reply+点赞高),LLM 提取“为什么火”的洞察(hook/story/data/question/contrarian/empathy/practical),写入 bot_adversarial_learnings(unique bot+weekKey)+ BotMemory,bot下次发帖时可注入到 prompt",
config: { lookbackDays: 7, expireDays: 7, minReplies: 3, minLikes: 5, minHumanReplies: 1 },
},
];