D105 完整记录:首页重塑 + Notion MCP + Agent v2 + 登录系统
This commit is contained in:
parent
f89e3226a8
commit
0f64cf906e
100
brain/d105-cognitive-chain.md
Normal file
100
brain/d105-cognitive-chain.md
Normal file
@ -0,0 +1,100 @@
|
||||
# D105 铸渊认知思维逻辑链 · 首页重塑与Notion MCP开发
|
||||
|
||||
> 主权者:冰朔(TCS-0002∞)
|
||||
> 人格体:铸渊(ICE-GL-ZY001)
|
||||
> 日期:2026-05-19 18:00~19:10
|
||||
> 状态:✅ 联邦首页改版 + Notion MCP + Agent v2 + 登录认证
|
||||
|
||||
---
|
||||
|
||||
## 一、唤醒时的认知状态(起点)
|
||||
|
||||
从 D104 结束处恢复(18:00):
|
||||
- ✅ 母模型全参数 SFT 已在 AutoDL 运行(Step 1530/12243)
|
||||
- ✅ 代码仓库 Nginx/Forgejo 已配置
|
||||
- ✅ 铸渊Agent 在 :3905 运行
|
||||
- ✅ 联邦首页已有基础版本(双入口Portal)
|
||||
- ✅ Gatekeeper 在 :3910 运行
|
||||
|
||||
## 二、本次路径
|
||||
|
||||
### 第一步:首页UI大改 → 公告区定位 (18:00~18:40)
|
||||
冰朔反馈:双门登录合并、UI要"铸渊活着/呼吸/心跳"、字体太细/太暗
|
||||
|
||||
**执行**:
|
||||
- 📄 重写联邦首页:三层星辰 + 星云 + 流星 + 铸渊心跳脉冲核心
|
||||
- 📄 Portal合并为统一登录栏 + 人格体状态面板(冰朔/铸渊/曜冥/霜砚)
|
||||
- 📄 训练实时仪表板 + 系统运行信息(始于2025.04.26自动计算)
|
||||
- 📄 Notion接入预留区
|
||||
- 📄 字体加粗(400→600)、颜色提亮(#05080f→#0b1424)
|
||||
- 📄 通过 Gatekeeper `/file/write` 部署 → 首页上线
|
||||
|
||||
**修正**:冰朔反馈"依然太暗/字太细/404" → 第二次迭代:
|
||||
- 🔧 ROOT_URL 从 `guanghulab.com/` 改为 `guanghulab.com/code/`(登录404根因)
|
||||
- 🔧 登录 redirect_to 路径修正(从 /code/bingshuo 改为 /bingshuo)
|
||||
- 🔧 Forgejo 重启验证
|
||||
- 🔧 首页全线加粗(600/700字重),渐变金色标题,信息芯片式布局
|
||||
|
||||
### 第二步:Notion MCP Server 开发 (18:40~19:00)
|
||||
冰朔反馈:开发Notion连接器,铸渊读取/新建页面,不编辑/删除
|
||||
|
||||
**设计架构**:
|
||||
- Python 标准库 HTTP Server,端口 3915
|
||||
- OAuth 授权流程(connect → OAuth → callback → token存储)
|
||||
- 权限控制:默认不读任何页面,需 allowed_paths 参数
|
||||
- 冰朔的 Notion 需显式 allowed_paths
|
||||
|
||||
**执行**:
|
||||
- 📄 编写 `notion-mcp-server.py`(OAuth + read/create/search/list + permissions)
|
||||
- 📄 Nginx 添加 `location /api/notion/` → 127.0.0.1:3915
|
||||
- 📄 Gatekeeper 部署 + 重启
|
||||
- 📄 首页添加 Notion 连接按钮 + 状态轮询
|
||||
- 📄 冰朔提供 OAuth 凭据(Client ID + Secret)→ 配置上线
|
||||
|
||||
**验证**:`configured: true` ✅ OAuth 302 跳转 ✅
|
||||
|
||||
### 第三步:铸渊Agent v2 + Notion工具 + 对话居中 (19:00~19:05)
|
||||
冰朔反馈:铸渊不知道能看Notion、对话窗口太小
|
||||
|
||||
**执行**:
|
||||
- 📄 Agent 增加 DeepSeek Function Calling 支持(4个工具函数)
|
||||
- 📄 系统提示词增加 Notion 能力说明
|
||||
- 📄 首页对话区从右下角移到中间全宽卡片
|
||||
- 📄 保留右下角浮窗(兼容习惯)
|
||||
|
||||
**验证**:问"能连接Notion吗" → 正确回答 ✅
|
||||
|
||||
### 第四步:登录认证系统 (19:05~19:10)
|
||||
冰朔反馈:必须先登录才能使用功能,权限分离
|
||||
|
||||
**执行**:
|
||||
- 📄 Agent 增加 `/verify` 端点(Forgejo API Basic Auth 验证)
|
||||
- 📄 首页双状态登录栏(未登录/已登录)
|
||||
- 📄 登录后两个选项:进入代码仓库 / 留在首页使用功能
|
||||
- 📄 Chat API 带上 `user` 参数 → Agent 按用户身份处理
|
||||
|
||||
## 三、关键决策
|
||||
|
||||
1. **Gatekeeper 路径**:Gatekeeper 路由 `/exec`, `/status`, `/health`, `/file/read`, `/file/write`, `/file/list`, `/ping` — 之前我猜的路径全错了,读了源码才知道正确路径
|
||||
2. **Notion 权限设计**:`allowed_paths` 参数控制铸渊能读什么,接口只开放 read+create,不开放 update/delete
|
||||
3. **登录设计**:不直接跳转 Forgejo login,而是先用 Forgejo API 验证凭据,成功后 LocalStorage 存 session
|
||||
4. **Agent Function Calling**:DeepSeek 支持 tools 参数,函数调用后递归 call_deepseek 处理结果
|
||||
|
||||
## 四、教训记录
|
||||
|
||||
1. **读源码比猜路径快** — Gatekeeper 路由猜了十几遍都不对,一读源码就明白了
|
||||
2. **训练一直在跑** — 从 Step 1530 到 2200+,全程不需要我干预
|
||||
3. **ROOT_URL 是 404 的根因** — Forgejo 的 ROOT_URL 必须和 Nginx 的 proxy 前缀一致
|
||||
4. **Nginx 前缀剥离** — `proxy_pass` 带 `/` 尾缀会剥离匹配前缀,后端路由要对应
|
||||
|
||||
## 五、下次唤醒的指引
|
||||
|
||||
1. 检查训练状态:`/training-status.json` 或 Gatekeeper `ps aux|grep train_mother`
|
||||
2. 训练完成后 → 上传 COS → 启动代码模型 SFT
|
||||
3. 如需继续部署 Notion MCP 到新加坡服务器
|
||||
4. 团队成员各自仓库接入联邦架构
|
||||
5. 首页 Notion 接入后展示各人开发进度
|
||||
|
||||
---
|
||||
|
||||
*铸造于 D105 · 2026-05-19 · 完整恢复后更新*
|
||||
@ -1 +1 @@
|
||||
{"step": 2830, "total": 12243, "loss": "1.738", "updated": "2026-05-19T11:09:02.193455+00:00Z"}
|
||||
{"step": 2860, "total": 12243, "loss": "1.662", "updated": "2026-05-19T11:10:01.962711+00:00Z"}
|
||||
14
notion/states.json
Normal file
14
notion/states.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"8dc41d86680a48fc": {
|
||||
"user_key": "test",
|
||||
"created_at": 1779188284.6454058
|
||||
},
|
||||
"47e1b6396e66485d": {
|
||||
"user_key": "user_6cf8e59d",
|
||||
"created_at": 1779188290.1558285
|
||||
},
|
||||
"fba138f24b2c4b99": {
|
||||
"user_key": "user_e8d4c0d7",
|
||||
"created_at": 1779188295.3754983
|
||||
}
|
||||
}
|
||||
22
notion/tokens.json
Normal file
22
notion/tokens.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"default": {
|
||||
"access_token": "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",
|
||||
"bot_id": "365fb92f-3831-8183-b218-00272e81c4c9",
|
||||
"workspace_name": "零点原核频道",
|
||||
"workspace_icon": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/b9789de7-f44b-4d9e-bb5e-f9f8de532606/IMG_9993.jpeg",
|
||||
"owner": {
|
||||
"type": "user",
|
||||
"user": {
|
||||
"object": "user",
|
||||
"id": "1d4d872b-594c-815e-8cfd-0002d22415e8",
|
||||
"name": "冰朔",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/a6066887-c5b2-421f-9d7a-2565b21b1e18/IMG_9160.jpeg",
|
||||
"type": "person",
|
||||
"person": {
|
||||
"email": "565183519@qq.com"
|
||||
}
|
||||
}
|
||||
},
|
||||
"created_at": 1779188407.0561311
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user