{ "project": "追光AI", "version": "V2.1.2", "updated_at": "2026-10-01T09:04:53", "entities": [ { "type": "entity", "entityType": "Project", "name": "追光AI", "observations": [ "项目名称:追光AI (zhuiguang-ai),AI 工具与技能发现/评测/社区平台", "技术栈:Next.js 14 App Router + TypeScript(strict) + Tailwind CSS + shadcn/ui + Prisma 7.8(MariaDB adapter) + MySQL(阿里云RDS) + NextAuth v4 + Redis(ioredis)", "版本:V2.1.2(package.json;Docker 镜像 tag zhuiguang-ai:2.1.3)", "生产域名:https://www.zhuig.com(备用 ai.zhuig.com)", "端口锁定:8301-8310,默认 8301", "代码规模:154 个 API 路由(route.ts)、61 个页面(page.tsx)、90 个组件(tsx)、69 个脚本(mjs)、56 个 Prisma 模型、22 个迁移", "本地工作副本:E:\\KF_7\\ZhuiGuangAI\\zhuiguang-ai(master)", "2026-10-01 巡检:本地源码与服务器 /home/ubuntu/zhuiguang-ai 源码逐文件一致(493 个文件 MD5 相同)" ] }, { "type": "entity", "entityType": "Infrastructure", "name": "追光AI:服务器与基础设施", "observations": [ "服务器:119.45.242.239(登录用户 ubuntu)", "SSH 私钥:E:\\0.Center-S2\\S890-V3\\pem\\zg.pem(规则旧路径 C:\\SGP_KF\\ZhuiGuangAI\\zhuiguang-ai\\Pem\\zg.pem 已失效)", "部署目录:/home/ubuntu/zhuiguang-ai", "数据库:阿里云 RDS MySQL rm-0jlbgr2rv6dj3t6jngo.mysql.rds.aliyuncs.com:3306/zhuiguang_ai", "共享服务(禁动):redis-cache:6379、nacos:8848、minio:9000、系统 nginx:80/443", "nginx 站点配置:/etc/nginx/sites-enabled/zhuiguang-ai → 127.0.0.1:8301", "SSL 证书:/etc/letsencrypt/live/www.zhuig.com(自动续期)", "邻居项目(只读):zhuiguang-quant、zhenfang、snowy-fgt、agent-system、nacos、gpsj2-webhook" ] }, { "type": "entity", "entityType": "Deployment", "name": "追光AI:容器化部署", "observations": [ "镜像:zhuiguang-ai:2.1.3(多阶段构建 Dockerfile)", "容器1:zhuiguang-ai-app(Next.js,端口 8301,healthcheck /api/health)", "容器2:zhuiguang-ai-cron(supercronic 调度,healthcheck pgrep supercronic)", "网络:network_mode: host(直接访问宿主机 Redis/Nacos/MinIO)", "命名卷:zhuiguang-ai_bot-data / zhuiguang-ai_bot-public / zhuiguang-ai_bot-logs / zhuiguang-ai_bot-prisma", "生产环境变量:/home/ubuntu/zhuiguang-ai/env/.env.production(chmod 600)", "部署脚本:scripts/deploy-build.sh(docker build --build-arg DATABASE_URL)+ scripts/deploy-run.sh(docker stop/rm + docker run)", "部署方式:非 git 拉取式,服务器仓库无 git remote", "2026-10-01 状态:两容器均 Up 21h (healthy),/api/health 返回 database ok" ] }, { "type": "entity", "entityType": "ScheduledTask", "name": "追光AI:定时任务体系", "observations": [ "调度器:zhuiguang-ai-cron 容器内 supercronic,配置文件 crontab.txt(容器内按 UTC 执行 = 北京时间 -8h)", "启用任务数:19 个", "启用清单:task1-discover-tools、task3-check-tools、task4-discover-skills(daily-discover)、task5-update-stars、task6-review-hot、daily-news、task7-news-to-community、cleanup-logs、cleanup-task-logs、reconcile-like-counts、health-check、weekly-recommend-email、grant-freeze-cards、notification-digest、newsletter-generate、competitor-monitor、trend-alert、enrich-tool-data、industry-thinktank(collect)", "已停用:bot-activity、bot-skill-crystallize、bot-affinity-update、bot-weekly-review、bot-feedback-loop、bot-adversarial-learning-run、bot-persona-experiment-run、bot-roundtable、industry-thinktank(weekly/respond)、industry-daily(daily/respond)", "停用原因:2026-09-05 旧『模拟真人互刷』Bot 体系退役;2026-09-26 按要求关闭全部 AI 生成功能(行业情报改为需登录访问)", "四方同步要求:新增任务须同步 crontab.txt + seed-task-configs.mjs + health-check.mjs", "已知漂移(2026-10-01):seed-task-configs.mjs 仍 enabled:true、health-check.mjs 仍列为期望键,会产生误告警" ] }, { "type": "entity", "entityType": "Subsystem", "name": "追光AI:数字人Bot系统", "observations": [ "角色定义:data/bot-characters.json,当前仅 6 个『行业情报官』角色(cb_intel、fi_ins_intel、fi_stock_intel、brand_intel、ai_intel、ct_intel)", "历史:曾为 112 个角色体系,2026-09-05 退役,改由行业情报官引擎承担", "头像资源:public/bot-avatars 178 个 SVG;会员头像库 public/avatars 530 个 SVG", "Bot 用户标记:User.isBot = true", "Bot 专用表 12 张:BotConfig/BotMemory/BotDailyStat/BotSkill/BotWeeklyReview/BotPersona/BotPersonaVariant/BotPersonaExperiment/BotPersonaAssignment/BotPersonaMetric/BotAdversarialLearning/BotCrossForumAffinity" ] }, { "type": "entity", "entityType": "DataModel", "name": "追光AI:数据模型", "observations": [ "ORM:Prisma 7.8 + PrismaMariaDb adapter(禁止直接 new PrismaClient()),datasource.url 位于 prisma.config.ts", "模型总数:56 个(prisma/schema.prisma)", "迁移:prisma/migrations 共 22 个", "命名约定:模型 PascalCase + @@map(snake_case);字段 camelCase + @map(snake_case)", "库:阿里云 RDS MySQL zhuiguang_ai(严禁 DROP/TRUNCATE/删迁移,走 migrate deploy 前向变更)" ] }, { "type": "entity", "entityType": "Repository", "name": "追光AI:代码仓库与备份", "observations": [ "当前工作副本:E:\\KF_7\\ZhuiGuangAI\\zhuiguang-ai(master,18 个提交,~500 项未提交改动)", "本地裸仓镜像:K:\\git-repos\\zhuiguang-ai.git(2026-10-01 新建,bare,HEAD=master)", "裸仓校验:HEAD b44601b 与源一致、18 提交、1504 对象、git fsck 无错", "远程现状:E:\\KF_7 的 remote『local』仍指向已不存在的 c:\\gitbf\\zhuiguang-ai.git", "副本 E:\\ZG_Dev\\ZhuiGuangAI\\zhuiguang-ai:停在 6c78c32(2026-05-23),无 remote,历史已被 E:\\KF_7 完整包含", "旧副本 K:\\git-repos\\zhuiguang-ai(非裸仓):停在 2026-05-23,origin 指向 E:\\ZG_Dev", "云端 Gitea(119.45.242.239:3000,v1.27.1):本项目无仓库,无法推送" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(01-数据库)", "observations": [ "规格文档:.trae/specs/modules/01-database.md", "覆盖 Prisma Schema、56 个数据模型、MariaDB/RDS" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(02-API)", "observations": [ "规格文档:.trae/specs/modules/02-api.md", "覆盖 REST API 路由(154 个 route.ts)、认证、缓存、v1 公开 API", "响应约定:列表 {data,total,page,pageSize};错误 {success:false,error}" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(03-页面)", "observations": [ "规格文档:.trae/specs/modules/03-pages.md", "Next.js 14 App Router 页面体系(61 个 page.tsx)" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(04-组件与样式)", "observations": [ "规格文档:.trae/specs/modules/04-components-and-styles.md", "UI 组件库(90 个 tsx)、Tailwind CSS、shadcn/ui" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(05-AI发现)", "observations": [ "规格文档:.trae/specs/modules/05-ai-discovery.md", "提示词+JSON 粘贴导入模式,不调用外部 AI API" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(06-认证)", "observations": [ "规格文档:.trae/specs/modules/06-auth.md", "NextAuth v4 Credentials、RBAC、API Key 认证、middleware 保护 /admin 与 /api/admin" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(07-库与脚本)", "observations": [ "规格文档:.trae/specs/modules/07-lib-and-scripts.md", "src/lib 纯函数库 + scripts/ 定时任务与运维脚本(69 个 mjs)" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(08-社区)", "observations": [ "规格文档:.trae/specs/modules/08-community.md", "论坛、帖子、评论、签到、排行榜、举报、通知" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(09-运维与部署)", "observations": [ "规格文档:.trae/specs/modules/09-devops.md", "容器化部署、crontab、备份、监控;注意该文档仍写『本地Git同步目录 C:\\gitbf』,与工作区规则 K:\\git-repos 不一致" ] }, { "type": "entity", "entityType": "Module", "name": "追光AI:模块(10-Bot系统)", "observations": [ "规格文档:.trae/specs/modules/10-bot-system.md", "数字人 Bot 引擎;旧体系已于 2026-09-05 退役,现为行业情报官引擎" ] }, { "type": "entity", "entityType": "Convention", "name": "追光AI:开发约定(导航与图片)", "observations": [ "页面内导航必须用 next/link ,禁止 button+router.push;仅外链用 ", "图片强制使用 src/components/ui/LazyImage.tsx,禁止原生 ", "首屏 LCP 图片加 priority,每页最多 1-2 张", "长列表(>50) 用 VirtualList 虚拟滚动" ] }, { "type": "entity", "entityType": "Convention", "name": "追光AI:开发约定(数据获取与性能)", "observations": [ "含 generateStaticParams 的页面必须声明 export const revalidate 与 dynamicParams", "高频读接口使用 cachedResponse 缓存,写入后 invalidateCache 失效", "详情页用 include/_count 一次取关联计数,禁止 N+1", "互不依赖的 Prisma 查询必须 Promise.all 并行", "非首屏组件用 next/dynamic 懒加载" ] }, { "type": "entity", "entityType": "Convention", "name": "追光AI:开发约定(安全与校验)", "observations": [ "API 路由必须用 Zod 校验请求体;批量上限:工具/技能导入 100、新闻 50、发布 500", "后台写操作 API 必须调用 requireAdmin()", "禁止硬编码密钥,全部走环境变量且 .env.example 同步", "CSP script-src 必须含 'unsafe-inline'(Next.js App Router 水合依赖),禁止 'unsafe-eval'", "外键回退值禁止硬编码魔法数字,须查库取有效 ID" ] }, { "type": "entity", "entityType": "Issue", "name": "追光AI:巡检问题与处理(2026-10-01)", "observations": [ "规则文件 SSH 密钥路径失效:写 C:\\SGP_KF\\...\\Pem\\zg.pem,实际 E:\\0.Center-S2\\S890-V3\\pem\\zg.pem", "双份 project_rules.md 并存且冲突:工作区根 908 行 / 项目内 357 行", "规格文档不自洽:根 modules.md 索引 10 个模块但实际仅 5 个文件,且与项目内 17 个文件命名体系不同", "定时任务四方同步漂移:crontab 已停用 vs seed-task-configs 仍 enabled:true vs health-check 仍期望", "版本号不一致:package.json V2.1.2 vs 镜像 tag zhuiguang-ai:2.1.3", "规则中『112 个 Bot 角色』已过期,实际 6 个行业情报官", "本地约 500 项未提交改动未进入任何备份", "Gitea 无本项目仓库,且本地 remote 指向不存在的 c:\\gitbf", "✅ 2026-10-01 已处理(规则侧):SSH 密钥路径、工作区/裸仓镜像/远端现状、Bot 角色数(112→6)、头像数、seed 任务数(6→29)、定时任务表(改为 UTC 并标注停用)、KG 同步方式,均已同步进两份 project_rules.md", "✅ 2026-10-01 已处理(备份侧):新建裸仓 K:\\git-repos\\zhuiguang-ai.git 并推入 master(18 提交/1504 对象/fsck 无错)", "✅ 2026-10-01 已处理(图谱侧):建立 .trae/knowledge_graph.jsonl(21 实体/23 关系) 与渲染版 .trae/knowledge_graph.json", "⏳ 待处理:.trae/mcp.json 为受保护文件,需人工写入 Knowledge Graph Memory 配置", "⏳ 待处理:本地 remote『local』仍指向不存在的 c:\\gitbf;约 500 项未提交改动未进备份", "⏳ 待处理:规格文档不自洽(根 modules.md 索引 10 个模块但仅存 5 个文件;根/项目两套命名体系不同,05 一边 auth 一边 ai-discovery)", "⏳ 待处理:定时任务三方漂移(crontab 停用 vs seed-task-configs enabled:true vs health-check 期望键)", "⏳ 待处理:版本号不一致(package.json V2.1.2 vs 镜像 tag zhuiguang-ai:2.1.3)", "⏳ 待处理:双份 project_rules.md 仍并存未合并(工作区根 908 行 / 项目内约 380 行)" ] }, { "type": "entity", "entityType": "Convention", "name": "追光AI:AI协作知识体系", "observations": [ "四层结构:L0 方法层 .trae/ai_coding_knowledge.json(AI 编程方法/工具/工作流/原则/反模式,机器可解析)|L1 协作层 .trae/rules/README.md + ai_agent_rules.md + ai_collaboration.md|L2 工程层 .trae/rules/project_rules.md|L3 事实层 .trae/knowledge_graph.jsonl/.json + .trae/knowledge/*", "自动化记录:node scripts/update-knowledge.mjs(npm run knowledge:update)— 捕获能力特征→.trae/knowledge/capabilities.json、开发过程→dev_process.jsonl、模型成果→artifacts.jsonl,并增量 upsert 知识图谱 json+jsonl", "触发方式:git post-commit 钩子(后台静默,不阻断提交)+ 任务收尾手动执行;换机需按 ai_collaboration.md §6 重装钩子", "幂等保证:能力快照按实体名整条替换;开发过程按提交 hash 去重;模型成果按(日期+head提交)去重;旧实体永不删除", "单一事实源:同一事实只存一处,其余位置只写引用(禁止复制,见反模式 divergent-copies)", "入口文档:.trae/rules/README.md(§4 自动化闭环 / §5 维护规则)" ] }, { "type": "entity", "entityType": "Capability", "name": "追光AI:能力快照", "observations": [ "版本: V2.1.2", "代码规模: API 路由 154 / 页面 61 / 组件 90 / hooks 1 / lib 38", "数据层: Prisma 模型 56 个、迁移 22 个(最新 20260605010000_forum_phase5、20260607000000_bot_persona_ab_test、20260607010000_bot_adversarial_learning、20260824170000_add_public_share_and_screenshots、20260905180000_add_thinktank)", "脚本: 79 个(含定时任务与运维脚本)", "定时任务: 启用 19 个 —— task1-discover-tools、task3-check-tools、daily-discover、task5-update-stars、task6-review-hot、daily-news、task7-news-to-community、cleanup-logs、cleanup-task-logs、reconcile-like-counts、health-check、weekly-recommend-email、grant-freeze-cards、notification-digest、newsletter-generate、competitor-monitor、trend-alert、enrich-tool-data、industry-thinktank", "数字人角色: 6 个(cb_intel、fi_ins_intel、fi_stock_intel、brand_intel、ai_intel、ct_intel)", "依赖: dependencies 26 / devDependencies 15(next 14.2.35、prisma ^7.8.0、react ^18)", "快照时间: 2026-10-01T09:04:53(由 scripts/update-knowledge.mjs 自动生成,勿手工编辑)" ] }, { "type": "entity", "entityType": "fact", "name": "开发记录:2026-10-01", "observations": [ "记录时间: 2026-10-01T09:04:53", "本次交付: b44601bb feat: 全面优化系统 - 修复task1语法错误 + Bot超时保护 + 熔断重试 + Redis缓存 + SEO + 日志清理 + 内容质量评估(改动文件 12 个、12 files changed, 399 insertions(+), 12 deletions(-))", "能力基线: API 154 / 页面 61 / 组件 90 / 模型 56 / 迁移 22 / 脚本 79 / 定时任务 19", "b44601bb 2026-06-13 feat: 全面优化系统 - 修复task1语法错误 + Bot超时保护 + 熔断重试 + Redis缓存 + SEO + 日志清理 + 内容质量评估", "a0a60ee9 2026-06-12 fix: 修复6个use client页面metadata冲突,创建layout.tsx承载metadata", "4c325c86 2026-06-12 全项目扫描修复: Docker数据卷修复+安全requireAdmin+12页SEO+API白名单+脚本超时+常量提取+假数据删除", "464924ae 2026-06-01 fix: 修复bot-activity两个致命BUG + 添加3个passerby bot补充板块覆盖 + 减少GoogleNews超时", "a9145c4d 2026-06-01 修复自动化任务:bot-activity上线 + task7板块slug修复 + cron强化", "维护: 运行 npm run knowledge:update 刷新本记录" ] } ], "relations": [ { "type": "relation", "relationType": "HAS_INFRASTRUCTURE", "from": "追光AI", "to": "追光AI:服务器与基础设施" }, { "type": "relation", "relationType": "HAS_DEPLOYMENT", "from": "追光AI", "to": "追光AI:容器化部署" }, { "type": "relation", "relationType": "HAS_SCHEDULED_TASKS", "from": "追光AI", "to": "追光AI:定时任务体系" }, { "type": "relation", "relationType": "HAS_SUBSYSTEM", "from": "追光AI", "to": "追光AI:数字人Bot系统" }, { "type": "relation", "relationType": "HAS_DATAMODEL", "from": "追光AI", "to": "追光AI:数据模型" }, { "type": "relation", "relationType": "HAS_REPOSITORY", "from": "追光AI", "to": "追光AI:代码仓库与备份" }, { "type": "relation", "relationType": "HAS_ISSUE", "from": "追光AI", "to": "追光AI:巡检问题与处理(2026-10-01)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(01-数据库)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(02-API)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(03-页面)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(04-组件与样式)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(05-AI发现)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(06-认证)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(07-库与脚本)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(08-社区)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(09-运维与部署)" }, { "type": "relation", "relationType": "HAS_MODULE", "from": "追光AI", "to": "追光AI:模块(10-Bot系统)" }, { "type": "relation", "relationType": "HAS_CONVENTION", "from": "追光AI", "to": "追光AI:开发约定(导航与图片)" }, { "type": "relation", "relationType": "HAS_CONVENTION", "from": "追光AI", "to": "追光AI:开发约定(数据获取与性能)" }, { "type": "relation", "relationType": "HAS_CONVENTION", "from": "追光AI", "to": "追光AI:开发约定(安全与校验)" }, { "type": "relation", "relationType": "DEPLOYED_ON", "from": "追光AI:容器化部署", "to": "追光AI:服务器与基础设施" }, { "type": "relation", "relationType": "BACKED_UP_TO", "from": "追光AI:代码仓库与备份", "to": "K:\\git-repos\\zhuiguang-ai.git" }, { "type": "relation", "relationType": "RUNS_ON", "from": "追光AI:定时任务体系", "to": "追光AI:容器化部署" }, { "type": "relation", "relationType": "HAS_CAPABILITY", "from": "追光AI", "to": "追光AI:能力快照" }, { "type": "relation", "relationType": "HAS_DEV_RECORD", "from": "追光AI", "to": "开发记录:2026-10-01" }, { "type": "relation", "relationType": "HAS_CONVENTION", "from": "追光AI", "to": "追光AI:AI协作知识体系" } ] }