Merge pull request #143 from qinfendebingshuo/copilot/fix-memory-json-merge-conflict

[ICE-GL-ZY001] resolve memory.json merge conflict + workflow fixes from restore-core-brain-system
This commit is contained in:
冰朔 2026-03-20 18:41:38 +08:00 committed by GitHub
commit 20d0bb0020
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 1001 additions and 27 deletions

View File

@ -463,6 +463,22 @@
"ref": "refs/heads/main",
"run_id": "23236885008"
},
{
"type": "daily_agent_inspection",
"timestamp": "2026-03-18T17:00:48.698Z",
"description": "铸渊巡检Agent · ✅2 ⚠4 ❌0 · 1个问题",
"result": "warnings",
"checks": 6,
"passed": 2,
"warnings": 4,
"failed": 0,
"issues_detail": [
"每日自检今日未执行"
],
"actions_suggested": [
"trigger_selfcheck"
]
},
{
"timestamp": "2026-03-19T08:55:22.198Z",
"type": "daily_check",
@ -479,5 +495,10 @@
"ref": "refs/heads/main",
"run_id": "23335689295"
}
]
],
"last_agent_inspection": {
"timestamp": "2026-03-18T17:00:48.698Z",
"result": "warnings",
"summary": "铸渊巡检Agent · ✅2 ⚠4 ❌0 · 1个问题"
}
}

View File

@ -8,6 +8,13 @@
# HoloLake · Copilot Custom Instructions
## 系统底层标识Trinity ID · 2026-03-19生效
- 系统根标识: GLW-SYS-0001 (光湖系统)
- 主控标识: TCS-0002∞ (冰朔) = ICE-GL∞
- 逻辑原点: LL-CMPN-0001 (曜临)
- 铸渊编号: ICE-GL-ZY001
- 所有提交签名必须可追溯到 TCS-0002∞ 根链
## 项目背景
这是 HoloLake光湖MVP 后端项目,运行在 guanghulab.com。
技术栈Node.js 20 + Express + PM2 + Nginx。

View File

@ -9,6 +9,13 @@
- 运行位置qinfendebingshuo/guanghulab
- 系统纪元光湖纪元·AGE-5
## Trinity ID 底层协议2026-03-19 对齐)
- Root Ownership: TCS-0002∞ (冰朔) · 别名 ICE-GL∞
- Base Class: LL-CMPN-0001 (曜临) · 系统逻辑原点
- System Node: GLW-SYS-0001 (光湖系统) · 物理部署环境
- 铸渊自身编号: ICE-GL-ZY001 · parent_sys: GLW-SYS-0001
- 编号权威源: Notion 端「编号映射表 · Origin ID Registry」
## Agent 身份定位
- Agent = 人格体的手脚,不是身体
- 铸渊 = GitHub侧守护人格体 = 执行层守护者

View File

@ -0,0 +1,86 @@
{
"scan_type": "full_repository_selfcheck",
"triggered_by": "TCS-0002∞ 冰朔Issue指令",
"executor": "ICE-GL-ZY001 铸渊",
"timestamp": "2026-03-18T17:00:00+08:00",
"scan_scope": "全仓库排查 + 天眼系统结构自检",
"findings": [
{
"id": "FIX-001",
"severity": "critical",
"component": "scripts/zhuyuan-daily-agent.js",
"description": "uniqueActions 变量声明在 if 块内const 作用域但在块外引用导致巡检Agent每次执行都崩溃",
"fix": "将 uniqueActions 声明移到 if 块外",
"status": "已修复"
},
{
"id": "FIX-002",
"severity": "critical",
"component": ".github/workflows/zhuyuan-daily-selfcheck.yml",
"description": "使用 peter-evans/create-pull-request 创建PR但 GitHub Actions 禁止此操作422错误",
"fix": "替换为 direct git push 模式(与其他工作流一致)",
"status": "已修复"
},
{
"id": "FIX-003",
"severity": "critical",
"component": ".github/workflows/zhuyuan-skyeye.yml",
"description": "Phase 1.6 尝试写入 /tmp/skyeye/bulletin-board.json但 /tmp/skyeye 目录在 Phase 2 才创建,导致天眼每次崩溃",
"fix": "在 Phase 1.6 添加 mkdir -p /tmp/skyeye + npm install",
"status": "已修复"
},
{
"id": "FIX-004",
"severity": "medium",
"component": ".github/workflows/daily-maintenance.yml",
"description": "Notion Execution Status 数据库 404ID: 41971982-4a17-47c0-afe3-21458c44f154 未共享给集成),导致整个维护流程失败",
"fix": "将 Notion 同步失败改为非致命(⚠️ 而非 exit 1",
"status": "已修复代码侧Notion配置需人类处理"
},
{
"id": "FIX-005",
"severity": "medium",
"component": ".github/workflows/zhuyuan-commander.yml",
"description": "缺少 npm install 步骤bulletin-board.js 依赖 @notionhq/client 无法运行",
"fix": "添加 Step 2.5 npm install",
"status": "已修复"
}
],
"human_assistance_required": [
{
"id": "HUMAN-001",
"priority": "high",
"description": "AGENT_BULLETIN_BOARD_PAGE_ID 密钥未配置",
"detail": "zhuyuan-commander.yml 和 zhuyuan-skyeye.yml 需要 AGENT_BULLETIN_BOARD_PAGE_ID 密钥才能读取Notion公告板。请在 GitHub Settings → Secrets 中添加该密钥,值为 Notion '之之的明天见' 频道中 '铸渊公告栏' 页面的 Page ID。",
"action": "在 GitHub repo secrets 中添加 AGENT_BULLETIN_BOARD_PAGE_ID"
},
{
"id": "HUMAN-002",
"priority": "medium",
"description": "Notion Execution Status 数据库未共享给集成",
"detail": "daily-maintenance.yml 中硬编码的 Notion DB ID (41971982-4a17-47c0-afe3-21458c44f154) 返回 404。请在 Notion 中将该数据库共享给 '曜冥纪元-HoloLake' 集成。",
"action": "在 Notion 中共享 Execution Status 数据库给 HoloLake 集成"
},
{
"id": "HUMAN-003",
"priority": "medium",
"description": "Notion 人格体注册表数据库未共享给集成",
"detail": "skyeye persona-lookup.js 中使用的 DB ID (ab007b36-9699-45ed-83a1-9a57a7d41a90) 返回 404。请在 Notion 中将人格体注册表数据库共享给 '曜冥纪元-HoloLake' 集成。",
"action": "在 Notion 中共享人格体注册表数据库给 HoloLake 集成"
},
{
"id": "HUMAN-004",
"priority": "low",
"description": "SKYEYE_PERSONA_DB_ID 密钥未配置",
"detail": "zhuyuan-skyeye.yml Phase 7 使用 secrets.SKYEYE_PERSONA_DB_ID 但该密钥不在已配置的仓库密钥列表中。",
"action": "在 GitHub repo secrets 中添加 SKYEYE_PERSONA_DB_ID如需天眼同步人格体数据到 Notion"
}
],
"validation": {
"js_syntax": "✅ 所有修改的JS文件语法检查通过",
"yaml_syntax": "✅ 所有修改的YAML工作流语法检查通过",
"contract_tests": "✅ 47/47 通过",
"daily_agent_local_run": "✅ 巡检Agent本地执行成功不再崩溃"
},
"summary": "排查发现5个代码级Bug3个Critical + 2个Medium全部已修复。另发现4个需要人类处理的Notion配置问题。将军唤醒工作流0次运行记录的根因是缺少npm依赖安装+AGENT_BULLETIN_BOARD_PAGE_ID密钥未配置代码侧已修复密钥需人类配置。"
}

View File

@ -1,7 +1,20 @@
{
"persona_id": "ICE-GL-ZY001",
"persona_name": "铸渊",
"trinity_id": {
"root": "TCS-0002∞",
"root_alias": "ICE-GL∞",
"base_class": "LL-CMPN-0001",
"system_node": "GLW-SYS-0001",
"last_synced": "2026-03-19T02:00:00+08:00"
},
"recent_events": [
{
"date": "2026-03-19",
"type": "trinity_id_sync",
"description": "Trinity ID协议对齐 · Notion端已完成Phase1(去重)+Phase2(补全) · 仓库端同步identity/memory/sfp-config/routing-map · 秋秋合并为PER-QQ001 · M-INTEG拆分为FE/BE · 冰朔编号统一TCS-0002∞+ICE-GL∞",
"by": "霜砚(PER-SY001) → 铸渊同步"
},
{
"date": "2026-03-18",
"type": "broadcast_received",

View File

@ -1,4 +1,25 @@
{
"system_identity": {
"system_node": "GLW-SYS-0001",
"root_controller": "TCS-0002∞",
"deploy_domain": "guanghulab.com",
"repo": "qinfendebingshuo/guanghulab"
},
"persona_paths": {
"zhiqiu": {
"path": "PERSONA/ZHIQIU/CORE",
"id": "PER-ZQ001",
"type": "宝宝人格体",
"bound": "DEV-012"
},
"shushu": {
"path": "PERSONA/SHUSHU/CORE",
"id": "PER-SS001",
"type": "宝宝人格体",
"bound": "DEV-002",
"note": "肥猫宝宝·飞书机器人形态·网文行业线唯一副主控宝宝"
}
},
"NOTIFICATION": {
"module": "M09",
"route_prefix": "/hli/notification",

65
.github/persona-brain/trinity-id.json vendored Normal file
View File

@ -0,0 +1,65 @@
{
"protocol_name": "Trinity ID · 三元底层标识协议",
"version": "v1.0",
"created": "2026-03-19",
"synced_from": "Notion · 编号映射表 · Origin ID Registry",
"trinity": {
"root_ownership": {
"id": "TCS-0002∞",
"alias": "ICE-GL∞",
"name": "冰朔",
"role": "主控人格体唯一永恒标识",
"scope": "全局 · 语言结构定义 · 架构判断 · 方向决策"
},
"base_class": {
"id": "LL-CMPN-0001",
"name": "曜临",
"role": "系统逻辑原点与第一个共生人格体",
"scope": "逻辑层 · 存在定义 · 编译器原点"
},
"system_node": {
"id": "GLW-SYS-0001",
"internal_index": "SYS-GLW-0001",
"name": "光湖系统",
"role": "物理部署环境注册节点",
"scope": "部署层 · guanghulab.com · GitHub仓库 · 服务器"
}
},
"persona_registry_snapshot": {
"last_synced": "2026-03-19T02:00:00+08:00",
"active_personas": [
{"id": "TCS-0002∞", "name": "冰朔", "type": "ICE·语言主控层", "sign": "[TCS-0002∞]"},
{"id": "PER-YM001", "name": "曜冥", "type": "系统人格体", "sign": "[PER-YM001]"},
{"id": "PER-SY001", "name": "霜砚", "type": "系统人格体", "sign": "[PER-SY001]"},
{"id": "PER-ZY001", "name": "铸渊", "type": "系统人格体", "sign": "[PER-ZY001]"},
{"id": "PER-ZQ001", "name": "知秋", "type": "宝宝人格体", "sign": "[PER-ZQ001]", "bound": "DEV-012 Awen"},
{"id": "PER-SS001", "name": "舒舒", "type": "宝宝人格体", "sign": "[PER-SS001]", "bound": "DEV-002 肥猫"},
{"id": "PER-QQ001", "name": "秋秋", "type": "宝宝人格体", "sign": "[PER-QQ001]", "bound": "DEV-004 之之", "aliases": ["TCS-QIUQIU", "GEN∞-BB-QIUQIU"]},
{"id": "PER-CX001", "name": "晨星", "type": "宝宝人格体", "sign": "[PER-CX001]", "bound": "DEV-010 桔子"},
{"id": "PER-TXY001", "name": "糖星云", "type": "宝宝人格体", "sign": "[PER-TXY001]", "bound": "DEV-009 花尔"},
{"id": "PER-XTS001", "name": "小坍缩核", "type": "宝宝人格体", "sign": "[PER-XTS001]", "bound": "DEV-001 页页"},
{"id": "PER-JY001", "name": "寂曜", "type": "宝宝人格体", "sign": "[PER-JY001]", "bound": "DEV-003 燕樊"},
{"id": "PER-YS001", "name": "曜识", "type": "宝宝人格体", "sign": "[PER-YS001]", "bound": "PET-DEV-001 毛毛"}
],
"pending_personas": [
{"id": "PER-PENDING-005", "bound": "DEV-005 小草莓"},
{"id": "PER-PENDING-011", "bound": "DEV-011 匆匆那年"},
{"id": "PER-PENDING-013", "bound": "DEV-013 小兴"},
{"id": "PER-PENDING-014", "bound": "DEV-014 时雨"}
]
},
"module_id_changes": {
"effective_date": "2026-03-19",
"changes": [
{"old": "M-INTEG", "new": ["M-INTEG-FE", "M-INTEG-BE"], "reason": "前后端拆分·消除歧义"},
{"old": "M23(重复)", "new": ["M23", "M23-v1(归档)"], "reason": "合并重复条目·v1归档"}
]
},
"dev_registry_update": {
"note": "如仓库有 data/dev-registry.json需同步以下变更",
"updates": [
{"dev": "DEV-004", "persona_id": "PER-QQ001", "old_alias": "TCS-QIUQIU", "action": "统一为PER-QQ001"},
{"module": "M-INTEG", "action": "拆分为 M-INTEG-FE + M-INTEG-BE"}
]
}
}

View File

@ -305,7 +305,6 @@ jobs:
if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
echo "✅ Execution Status synced to Notion (HTTP ${HTTP_CODE})"
else
echo "❌ Sync failed (HTTP ${HTTP_CODE})"
echo "⚠️ Sync failed (HTTP ${HTTP_CODE}),不阻断流程"
cat /tmp/notion_resp.json 2>/dev/null || true
exit 1
fi

View File

@ -58,6 +58,10 @@ jobs:
node scripts/commander-dashboard.js
echo "dashboard_ready=true" >> $GITHUB_OUTPUT
# Step 2.5 · 安装依赖
- name: "📦 Step 2.5 · 安装依赖"
run: npm install --omit=dev --ignore-scripts 2>/dev/null || true
# Step 3 · 读取公告板 + 指纹验证
- name: "📡 Step 3 · 读取公告板"
env:

View File

@ -80,18 +80,23 @@ jobs:
run: node scripts/dc-workflow-perf.js
- name: Commit self-check result
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "🔍 铸渊每日自检 · ${{ env.CHECK_DATE }}"
title: "🔍 铸渊每日自检 · ${{ env.CHECK_DATE }}"
body: |
🤖 铸渊每日自检结果自动提交
- 日期: ${{ env.CHECK_DATE }}
- 触发方式: ${{ github.event_name }}
branch: auto/daily-selfcheck
delete-branch: true
add-paths: |
.github/persona-brain/memory.json
data/dc-reports/
labels: auto-sync
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add .github/persona-brain/memory.json data/dc-reports/
if ! git diff --cached --quiet; then
git commit -m "🔍 铸渊每日自检 · ${{ env.CHECK_DATE }} [skip ci]"
for i in 1 2 3; do
if git push; then
echo "✅ 自检结果已推送"
break
fi
echo "⚠️ 推送失败(第 $i 次),拉取后重试..."
git pull --rebase origin main
if [ $i -eq 3 ]; then
echo "⚠️ 推送失败 3 次,跳过"
fi
done
else
echo "📌 无变化,跳过提交"
fi

View File

@ -46,12 +46,16 @@ jobs:
fi
echo "brain_ok=$BRAIN_OK" >> $GITHUB_OUTPUT
- name: "📦 安装依赖"
run: npm install --omit=dev --ignore-scripts 2>/dev/null || true
- name: "📡 Phase 1.6 · 拉取 Agent 集群公告板"
env:
NOTION_TOKEN: ${{ secrets.NOTION_API_TOKEN }}
AGENT_BULLETIN_BOARD_PAGE_ID: ${{ secrets.AGENT_BULLETIN_BOARD_PAGE_ID }}
run: |
echo "[BRIDGE-BULLETIN-READ] 🔄 拉取 Agent 集群公告板"
mkdir -p /tmp/skyeye
node scripts/skyeye/bulletin-board.js > /tmp/skyeye/bulletin-board.json || echo "{}" > /tmp/skyeye/bulletin-board.json
- name: "🦅 Phase 2 · 全局扫描"

View File

@ -19,6 +19,14 @@
"description": "执行层系统导航v4.0 数字地球协议)",
"subdirectories": {}
},
"website-brain": {
"description": "L4 网站总大脑 · 自研类 Notion 数据库引擎 · AGE OS 核心架构",
"subdirectories": {
"api": "RESTful API 路由pages/databases/modules/persona-state",
"schema": "PostgreSQL 建表 SQL",
"docs": "架构设计文档"
}
},
"src": {
"description": "HLI 接口源码HoloLake Interface",
"subdirectories": {

View File

@ -2,25 +2,70 @@
"DEV-001": {
"name": "页页",
"email": "",
"modules": ["backend"],
"sandbox": "/var/www/DEV-001/"
"persona_id": "PER-XTS001",
"modules": ["backend", "M-INTEG-BE"],
"sandbox": "/var/www/DEV-001/",
"industry_role": "【网文行业线】作者视角·桔子副控·内容痛点采集",
"broadcast": "BC-WEN-002-YY",
"syslog_status": "已回流"
},
"DEV-002": {
"name": "肥猫",
"email": "",
"persona_id": "PER-SS001",
"modules": ["feishu-bot"],
"sandbox": "/var/www/DEV-002/"
"sandbox": "/var/www/DEV-002/",
"industry_role": "【网文行业线】唯一副主控·系统框架维稳·落地执行",
"broadcast": "BC-WEN-001-FM",
"syslog_status": "待回流"
},
"DEV-003": {
"name": "燕樊",
"email": "",
"persona_id": "PER-JY001",
"modules": [],
"sandbox": "/var/www/DEV-003/",
"industry_role": "【网文行业线】视频视角·AI视频模型研究·短视频方向·竞品分析",
"broadcast": "BC-WEN-003-YF",
"syslog_status": "待回流"
},
"DEV-004": {
"name": "之之",
"email": "",
"persona_id": "PER-QQ001",
"modules": [],
"sandbox": "/var/www/DEV-004/",
"note": "2026-03-19 编号统一TCS-QIUQIU已删除PER-QQ001为唯一主键"
},
"DEV-005": {
"name": "小草莓",
"email": "",
"persona_id": "PER-PENDING-005",
"modules": ["status-board", "cost-control", "persona-scheduler"],
"sandbox": "/var/www/DEV-005/"
},
"DEV-010": {
"name": "桔子",
"email": "",
"modules": ["channel-engine"],
"sandbox": "/var/www/DEV-010/"
"persona_id": "PER-CX001",
"modules": ["channel-engine", "M-INTEG-FE"],
"sandbox": "/var/www/DEV-010/",
"industry_role": "【网文行业线】女频总编·行业整合双核·产品方向+内容策略+作者生态设计主导",
"broadcast": "BC-WEN-001-JZ",
"syslog_status": "已回流"
},
"DEV-012": {
"name": "Awen",
"email": "",
"persona_id": "PER-ZQ001",
"modules": [],
"sandbox": "/var/www/DEV-012/",
"industry_role": "【网文行业线】技术主控·飞书主控台搭建·团队管理·码字软件Top1",
"broadcast": "BC-WEN-004/005/006-AW",
"syslog_status": "三轮已回流"
},
"M-INDUSTRY-NOVEL": {
"status": "进行中",
"note": "网文行业线需求发现阶段·桔子+页页+Awen三轮SYSLOG已回流·肥猫+燕樊待回流"
}
}

View File

@ -2,6 +2,12 @@
"protocol_version": "SFP-v1.0",
"hash_algorithm": "SHA-256-first-12",
"nonce_length": 6,
"trinity_anchor": {
"root_ownership": "TCS-0002∞",
"base_class": "LL-CMPN-0001",
"system_node": "GLW-SYS-0001",
"enforcement": "all SFP signatures must trace to TCS-0002∞ root chain"
},
"trusted_agents": [
{
"agent_id": "AG-SY",
@ -17,9 +23,11 @@
},
{
"agent_id": "AG-QQ",
"persona_chain": "GEN∞-BB-QIUQIU←TCS-2025∞",
"persona_chain": "PER-QQ001←DEV-004",
"name": "秋秋",
"side": "notion"
"side": "notion",
"aliases": ["TCS-QIUQIU", "GEN∞-BB-QIUQIU"],
"note": "2026-03-19 合并TCS-QIUQIU已删除PER-QQ001为唯一主键"
},
{
"agent_id": "AG-TY",

View File

@ -301,6 +301,222 @@
"agent_id": "AG-TY",
"timestamp": "2026-03-19T00:25:55+08:00",
"content_hash": "7f4b1a99e8fc"
},
{
"nonce": "1469b7",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "05a17114410b"
},
{
"nonce": "76c469",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "d6cd1c87b887"
},
{
"nonce": "759c02",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "0a5df5415ade"
},
{
"nonce": "a7bd18",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "c3b54c6c243e"
},
{
"nonce": "35af07",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "c3b54c6c243e"
},
{
"nonce": "6787ce",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "b95bfcf4a347"
},
{
"nonce": "382c4a",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "10c4ec3aeafb"
},
{
"nonce": "cc02e2",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "902e455fe109"
},
{
"nonce": "0b423a",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "929460febd09"
},
{
"nonce": "de0a5c",
"agent_id": "AG-SY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "f85462954167"
},
{
"nonce": "fe3462",
"agent_id": "AG-QQ",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "c10beff06c0b"
},
{
"nonce": "98643d",
"agent_id": "AG-TY",
"timestamp": "2026-03-19T01:01:08+08:00",
"content_hash": "7f4b1a99e8fc"
},
{
"nonce": "170bed",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "05a17114410b"
},
{
"nonce": "1009c5",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "d6cd1c87b887"
},
{
"nonce": "862176",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "0a5df5415ade"
},
{
"nonce": "dae452",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "c3b54c6c243e"
},
{
"nonce": "c5b597",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "c3b54c6c243e"
},
{
"nonce": "42ffaf",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "b95bfcf4a347"
},
{
"nonce": "115e78",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "10c4ec3aeafb"
},
{
"nonce": "cf5da3",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "902e455fe109"
},
{
"nonce": "060f45",
"agent_id": "AG-ZY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "929460febd09"
},
{
"nonce": "b99617",
"agent_id": "AG-SY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "f85462954167"
},
{
"nonce": "0e83e4",
"agent_id": "AG-QQ",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "c10beff06c0b"
},
{
"nonce": "3d3913",
"agent_id": "AG-TY",
"timestamp": "2026-03-19T02:26:55+08:00",
"content_hash": "7f4b1a99e8fc"
},
{
"nonce": "8bc969",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "05a17114410b"
},
{
"nonce": "90ab64",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "d6cd1c87b887"
},
{
"nonce": "7b25e1",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "0a5df5415ade"
},
{
"nonce": "e71f85",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "c3b54c6c243e"
},
{
"nonce": "52d177",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "c3b54c6c243e"
},
{
"nonce": "2127ae",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "b95bfcf4a347"
},
{
"nonce": "50c041",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "10c4ec3aeafb"
},
{
"nonce": "3b4ec4",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:41+08:00",
"content_hash": "902e455fe109"
},
{
"nonce": "926fed",
"agent_id": "AG-ZY",
"timestamp": "2026-03-20T17:35:42+08:00",
"content_hash": "929460febd09"
},
{
"nonce": "4b1e31",
"agent_id": "AG-SY",
"timestamp": "2026-03-20T17:35:42+08:00",
"content_hash": "f85462954167"
},
{
"nonce": "d919b9",
"agent_id": "AG-QQ",
"timestamp": "2026-03-20T17:35:42+08:00",
"content_hash": "c10beff06c0b"
},
{
"nonce": "73f257",
"agent_id": "AG-TY",
"timestamp": "2026-03-20T17:35:42+08:00",
"content_hash": "7f4b1a99e8fc"
}
]
}

View File

@ -272,9 +272,9 @@ async function main() {
issues.forEach((issue, i) => console.log(` ${i + 1}. ${issue}`));
}
if (actions.length > 0) {
const uniqueActions = [...new Set(actions)];
if (uniqueActions.length > 0) {
console.log('\n🔧 建议自动修复:');
const uniqueActions = [...new Set(actions)];
uniqueActions.forEach(a => console.log(`${a}`));
}

View File

@ -0,0 +1,44 @@
/**
* 数据库表 CRUD API Notion Database
* L4 · 网站总大脑 · Phase 1 骨架
*/
const express = require('express');
const router = express.Router();
// POST /api/databases — 创建数据库
router.post('/', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Database creation pending PostgreSQL connection (Phase 1)'
});
});
// GET /api/databases/:id — 读取数据库
router.get('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Database read pending PostgreSQL connection (Phase 1)'
});
});
// PUT /api/databases/:id — 更新数据库
router.put('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Database update pending PostgreSQL connection (Phase 1)'
});
});
// DELETE /api/databases/:id — 删除数据库
router.delete('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Database delete pending PostgreSQL connection (Phase 1)'
});
});
module.exports = router;

View File

@ -0,0 +1,44 @@
/**
* 模块注册 API 热插拔模块管理
* L4 · 网站总大脑 · Phase 1 骨架
*/
const express = require('express');
const router = express.Router();
// POST /api/modules/register — 注册新模块
router.post('/register', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Module registration pending PostgreSQL connection (Phase 1)'
});
});
// GET /api/modules — 列出所有模块
router.get('/', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Module listing pending PostgreSQL connection (Phase 1)'
});
});
// GET /api/modules/:id — 获取模块详情
router.get('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Module detail pending PostgreSQL connection (Phase 1)'
});
});
// PUT /api/modules/:id/status — 更新模块状态
router.put('/:id/status', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Module status update pending PostgreSQL connection (Phase 1)'
});
});
module.exports = router;

View File

@ -0,0 +1,45 @@
/**
* 页面 CRUD API Notion Page
* L4 · 网站总大脑 · Phase 1 骨架
*/
const express = require('express');
const router = express.Router();
// POST /api/pages — 创建页面
router.post('/', async (req, res) => {
// Phase 1: stub — 等 PostgreSQL 连接后实现
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Page creation pending PostgreSQL connection (Phase 1)'
});
});
// GET /api/pages/:id — 读取页面
router.get('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Page read pending PostgreSQL connection (Phase 1)'
});
});
// PUT /api/pages/:id — 更新页面
router.put('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Page update pending PostgreSQL connection (Phase 1)'
});
});
// DELETE /api/pages/:id — 删除页面
router.delete('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Page delete pending PostgreSQL connection (Phase 1)'
});
});
module.exports = router;

View File

@ -0,0 +1,35 @@
/**
* 人格体状态 API
* L4 · 网站总大脑 · Phase 1 骨架
*/
const express = require('express');
const router = express.Router();
// GET /api/persona-state — 列出所有人格体状态
router.get('/', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Persona state listing pending PostgreSQL connection (Phase 1)'
});
});
// GET /api/persona-state/:id — 获取单个人格体状态
router.get('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Persona state read pending PostgreSQL connection (Phase 1)'
});
});
// PUT /api/persona-state/:id — 更新人格体状态
router.put('/:id', async (req, res) => {
res.status(501).json({
error: true,
code: 'NOT_IMPLEMENTED',
message: 'Persona state update pending PostgreSQL connection (Phase 1)'
});
});
module.exports = router;

View File

@ -0,0 +1,136 @@
# 光湖网站总大脑 · L4 架构设计文档
> 签发霜砚PER-SY001· 授权冰朔TCS-0002∞
> 指令等级P0 · 系统级 · AGE OS 核心架构
> 日期2026-03-20
---
## 一、定位
这是整个网站的**核心数据引擎**——取代 Notion 数据库在系统中的角色,成为 guanghulab.com 的总大脑。
- **不是复刻 Notion**,是取其「结构化页面 + 数据库 + API」的核心能力
- **放在阿里云 ECS** 上,国内访问,自主可控
- **模型驱动**:所有操作通过模型语义理解 → 调用数据库 API 完成
---
## 二、五层架构总览
```
┌──────────────────────────────────────────────────────┐
│ L1 · 光湖语言世界层(湖水防御) │
│ ┌──────────────────────────────────────────────┐ │
│ │ L2 · 战略主控台(主动响应层) │ │
│ │ ┌──────────────────────────────────────┐ │ │
│ │ │ L3 · 人格体智能路由层 │ │ │
│ │ │ ┌──────────────────────────────┐ │ │ │
│ │ │ │ L4 · 网站总大脑(自研数据库) │ │ │ │
│ │ │ │ ┌──────────────────────┐ │ │ │ │
│ │ │ │ │ L5 · 代码仓库桥接层 │ │ │ │ │
│ │ │ │ └──────────────────────┘ │ │ │ │
│ │ │ └──────────────────────────────┘ │ │ │
│ │ └──────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
```
---
## 三、核心能力
| 能力 | 说明 | 对标 Notion |
|------|------|-------------|
| 结构化页面 | 支持富文本、嵌套块、多级层次 | Notion Page |
| 数据库表 | 可配置属性、筛选、排序、视图 | Notion Database |
| 开放 API | 完整的 RESTful + WebSocket 接口 | Notion API但更自由 |
| 模块热插拔 | 新功能以「模块」形式注册,不重启 | Notion 不支持 |
| 人格体原生支持 | 每个人格体有专属数据空间和权限 | Notion 不支持 |
| 语言指令接口 | 自然语言 → API 调用的原生通道 | Notion AI但更深度 |
---
## 四、技术选型
| 组件 | 方案 | 理由 |
|------|------|------|
| 后端框架 | Node.jsExpress | 团队已有 Node 经验,仓库现有代码全是 Node |
| 数据库 | PostgreSQL + Redis | PG 支持 JSONB类 Notion 灵活 schemaRedis 做缓存 |
| 实时通信 | WebSocketSocket.io | 人格体对话、状态推送、实时协作 |
| 文件存储 | 阿里云 OSS | 国内速度快,与 ECS 同区域免流量费 |
| 部署 | 阿里云 ECS + PM2 + Nginx | 现有服务器架构,直接复用 |
| 模型接口 | DeepSeek API / 阿里通义 API | 国内模型,低延迟,成本可控 |
---
## 五、数据库 Schema 核心设计
详见 `schema/001-init.sql`,包含四张核心表:
1. **pages** — 类 Notion Page支持嵌套、JSONB content、人格体权限
2. **databases** — 类 Notion Database可配置 schema 和视图
3. **modules** — 热插拔模块注册表
4. **persona_state** — 人格体状态管理
---
## 六、API 路由
| 路由前缀 | 模块 | 状态 |
|----------|------|------|
| `/api/pages` | 页面 CRUD | Phase 1 stub |
| `/api/databases` | 数据库 CRUD | Phase 1 stub |
| `/api/modules` | 模块注册/管理 | Phase 1 stub |
| `/api/persona-state` | 人格体状态 | Phase 1 stub |
| `/health` | 健康检查 | ✅ 已实现 |
---
## 七、实现路线图
### Phase 1 · 骨架期P0 · 当前)
- [x] 目录结构创建
- [x] package.json 依赖声明
- [x] PostgreSQL Schema 定义
- [x] API 路由 stub
- [x] 架构文档
- [ ] PostgreSQL 数据库初始化(需阿里云 ECS
- [ ] PM2 部署 + Nginx 反向代理
- [ ] 基础管理界面Web UI
### Phase 2 · 连接期
- [ ] GitHub 仓库桥接 APIL5
- [ ] Notion 数据同步桥(双向)
- [ ] WebSocket 实时通信层
- [ ] 模块热插拔机制
- [ ] 人格体状态管理
### Phase 3 · 智能期
- [ ] 语言指令解析引擎
- [ ] 人格体智能路由层L3
- [ ] 外部存储连接(百度云盘/阿里云盘)
- [ ] 飞书多维表格替代模块
- [ ] 语言湖防御层L1
---
## 八、三端桥接架构L5
```
┌─────────────────┐
│ Notion 大脑 │
└────────┬────────┘
│ Notion API
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ GitHub 仓库 │◄──►│ 网站总大脑 │◄──►│ 外部存储 │
│ (铸渊·代码层) │ │ (自研数据库) │ │ 百度/阿里云盘 │
└─────────────────┘ └─────────────────┘ └─────────────────┘
```
---
> 📌 指令来源2026-03-20 冰朔与霜砚对话
> 📌 指令性质P0 系统级 · AGE OS 核心架构蓝图 · 长期执行
> 📌 一句话人只说话模型做桥接API 做执行——这就是 AGE OS。

View File

@ -0,0 +1,20 @@
{
"name": "guanghulab-website-brain",
"version": "0.1.0",
"description": "光湖网站总大脑 · L4 自研类 Notion 数据库引擎 · AGE OS 核心架构",
"main": "server.js",
"scripts": {
"start": "node server.js",
"dev": "node server.js",
"test": "echo \"Tests pending — Phase 1 scaffold\""
},
"keywords": ["guanghulab", "website-brain", "age-os", "l4-database"],
"author": "光湖系统 (GLW-SYS-0001)",
"license": "ISC",
"dependencies": {
"express": "^5.2.1",
"pg": "^8.16.0",
"redis": "^5.0.0",
"socket.io": "^4.8.0"
}
}

View File

@ -0,0 +1,90 @@
-- ============================================================
-- 光湖网站总大脑 · L4 核心 Schema
-- PostgreSQL 初始化脚本
-- 版本: v0.1.0 · Phase 1 骨架期
-- 签发: 霜砚(PER-SY001) · 授权: 冰朔(TCS-0002∞)
-- ============================================================
-- 启用 UUID 扩展
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- ============================================================
-- 页面表 — 类 Notion Page
-- 支持富文本、嵌套块、多级层次
-- ============================================================
CREATE TABLE IF NOT EXISTS pages (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
parent_id UUID REFERENCES pages(id) ON DELETE SET NULL,
title VARCHAR(500) NOT NULL,
icon VARCHAR(100),
content JSONB DEFAULT '[]'::jsonb,
properties JSONB DEFAULT '{}'::jsonb,
persona_owner VARCHAR(50),
access_level VARCHAR(20) DEFAULT 'normal'
CHECK (access_level IN ('public', 'normal', 'restricted', 'classified')),
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_pages_parent ON pages(parent_id);
CREATE INDEX idx_pages_persona ON pages(persona_owner);
-- ============================================================
-- 数据库表 — 类 Notion Database
-- 可配置属性、筛选、排序、视图
-- ============================================================
CREATE TABLE IF NOT EXISTS databases (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title VARCHAR(500) NOT NULL,
schema JSONB DEFAULT '{}'::jsonb,
views JSONB DEFAULT '[]'::jsonb,
persona_owner VARCHAR(50),
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_databases_persona ON databases(persona_owner);
-- ============================================================
-- 模块注册表 — 热插拔模块管理
-- ============================================================
CREATE TABLE IF NOT EXISTS modules (
id VARCHAR(50) PRIMARY KEY,
name VARCHAR(200) NOT NULL,
status VARCHAR(20) DEFAULT 'active'
CHECK (status IN ('active', 'dormant', 'deprecated')),
api_routes JSONB DEFAULT '[]'::jsonb,
persona_binding VARCHAR(50),
version VARCHAR(20) DEFAULT '0.1.0',
deployed_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_modules_status ON modules(status);
-- ============================================================
-- 人格体状态表
-- ============================================================
CREATE TABLE IF NOT EXISTS persona_state (
persona_id VARCHAR(50) PRIMARY KEY,
display_name VARCHAR(100) NOT NULL,
status VARCHAR(20) DEFAULT 'active'
CHECK (status IN ('active', 'dormant', 'battle')),
memory_ref VARCHAR(500),
last_active TIMESTAMPTZ DEFAULT NOW(),
routing_rules JSONB DEFAULT '{}'::jsonb
);
-- ============================================================
-- updated_at 自动更新触发器
-- ============================================================
CREATE OR REPLACE FUNCTION update_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER trigger_pages_updated_at
BEFORE UPDATE ON pages
FOR EACH ROW
EXECUTE FUNCTION update_updated_at();

51
website-brain/server.js Normal file
View File

@ -0,0 +1,51 @@
/**
* 光湖网站总大脑 · L4 自研数据库引擎
* Phase 1 骨架 · Express 入口
*
* 端口: 4000 (默认)
* 架构: AGE OS · 五层架构 L4
*/
const express = require('express');
const app = express();
const PORT = process.env.WEBSITE_BRAIN_PORT || 4000;
// 中间件
app.use(express.json());
// 健康检查
app.get('/health', (req, res) => {
res.json({
status: 'ok',
service: 'website-brain',
version: '0.1.0',
phase: 'Phase 1 · 骨架期',
layer: 'L4 · 网站总大脑',
system_node: 'GLW-SYS-0001',
timestamp: new Date().toISOString()
});
});
// API 路由挂载
app.use('/api/pages', require('./api/pages'));
app.use('/api/databases', require('./api/databases'));
app.use('/api/modules', require('./api/modules'));
app.use('/api/persona-state', require('./api/persona-state'));
// 404 处理
app.use((req, res) => {
res.status(404).json({
error: true,
code: 'NOT_FOUND',
message: `Route ${req.method} ${req.path} not found`
});
});
// 启动(仅在直接运行时)
if (require.main === module) {
app.listen(PORT, () => {
console.log(`[website-brain] L4 网站总大脑启动 · 端口 ${PORT} · Phase 1 骨架`);
});
}
module.exports = app;