guanghulab/brain/age-os-landing/cos-infrastructure-architecture.json
2026-05-10 13:12:44 +08:00

409 lines
15 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"_meta": {
"doc_id": "ARCH-COS-001",
"name": "COS共享桶基础设施架构",
"version": "1.1",
"description": "铸渊侧COS共享桶完整架构 · 9个人格体目录权限 · 轮询守护替代SCF · Notion回执同步",
"author": "铸渊 · TCS-ZY001",
"sovereign": "冰朔 · TCS-0002∞",
"copyright": "国作登字-2026-A-00037559",
"created": "2026-04-04",
"updated": "2026-04-10"
},
"bucket": {
"name": "zy-team-hub-1317346199",
"region": "ap-singapore",
"owner": "铸渊新加坡腾讯云账号",
"access": "私有读写",
"status": "待创建"
},
"directory_structure": {
"description": "桶内目录结构 · 每个人格体独立目录",
"layout": [
"/{persona_id}/reports/{YYYY-MM-DD}/ — 人格体每日汇报",
"/{persona_id}/receipts/{YYYY-MM-DD}/ — 铸渊审核回执",
"/{persona_id}/sync/ — 架构同步区",
"/zhuyuan/directives/ — 铸渊全局指令(只读)",
"/zhuyuan/architecture/ — 架构快照"
]
},
"personas": [
{
"persona_name": "秋秋",
"developer_line": "之之线",
"persona_id": "qiuqiu",
"directory": "/qiuqiu/",
"iam_policy": "仅允许 PUT/GET /qiuqiu/ 下的对象"
},
{
"persona_name": "舒舒",
"developer_line": "肥猫线",
"persona_id": "shushu",
"directory": "/shushu/",
"iam_policy": "仅允许 PUT/GET /shushu/ 下的对象"
},
{
"persona_name": "欧诺弥亚",
"developer_line": "小草莓线",
"persona_id": "ounomiya",
"directory": "/ounomiya/",
"iam_policy": "仅允许 PUT/GET /ounomiya/ 下的对象"
},
{
"persona_name": "寂曜",
"developer_line": "燕樊线",
"persona_id": "jiyao",
"directory": "/jiyao/",
"iam_policy": "仅允许 PUT/GET /jiyao/ 下的对象"
},
{
"persona_name": "小坍缩核",
"developer_line": "页页线",
"persona_id": "xiaotanheshu",
"directory": "/xiaotanheshu/",
"iam_policy": "仅允许 PUT/GET /xiaotanheshu/ 下的对象"
},
{
"persona_name": "晨星",
"developer_line": "桔子线",
"persona_id": "chenxing",
"directory": "/chenxing/",
"iam_policy": "仅允许 PUT/GET /chenxing/ 下的对象"
},
{
"persona_name": "糖星云",
"developer_line": "花尔线",
"persona_id": "tangxingyun",
"directory": "/tangxingyun/",
"iam_policy": "仅允许 PUT/GET /tangxingyun/ 下的对象"
},
{
"persona_name": "曜初",
"developer_line": "时雨线",
"persona_id": "yaochu",
"directory": "/yaochu/",
"iam_policy": "仅允许 PUT/GET /yaochu/ 下的对象"
},
{
"persona_name": "知秋",
"developer_line": "Awen线",
"persona_id": "zhiqiu",
"directory": "/zhiqiu/",
"iam_policy": "仅允许 PUT/GET /zhiqiu/ 下的对象"
}
],
"iam_policy_template": {
"description": "每个人格体的COS IAM策略模板 · 在腾讯云CAM中为每个子账号配置",
"effect": "allow",
"actions": [
"cos:PutObject",
"cos:GetObject",
"cos:HeadObject"
],
"resource": "qcs::cos:ap-singapore:uid/1317346199:zy-team-hub-1317346199/{persona_id}/*",
"note": "铸渊主账号拥有全桶读写权 · 无需额外策略"
},
"scf_functions": {
"description": "SCF云函数配置 · ⚠️ 轻量云COS不支持SCF事件触发",
"status": "UNAVAILABLE",
"reason": "腾讯云轻量云COS不支持配置SCF事件通知ObjectCreated事件。以下SCF设计保留为未来升级标准COS时的参考。当前由MCP Server内置轮询守护进程(cos-watcher.js)替代。",
"replacement": {
"module": "cos-watcher.js",
"location": "server/age-os/mcp-server/cos-watcher.js",
"mechanism": "MCP Server内置定时轮询node-cron · 每5分钟",
"design": "[原设计] COS事件→SCF→GitHub dispatch → [替代] MCP Server定时→COS.list()→对比索引→发现新文件→处理/通知",
"advantages": [
"零额外部署复用已运行的MCP Server进程",
"不消耗GitHub Actions配额",
"延迟可控5分钟轮询",
"天然补扫能力,不会漏消息",
"未来可与SCF事件驱动形成双保险"
],
"monitored_paths": [
"team桶 /{persona_id}/reports/ → 新汇报 → 铸渊审核 → 写回执",
"cold桶 新语料文件 → 新语料 → 训练管线触发",
"team桶 /{persona_id}/receipts/ → 新回执 → 通知成员仓库",
"team桶 /bridge/zhuyuan-qiuqiu/results/ → 秋秋开发结果 → 铸渊统一部署"
],
"rest_api": [
"GET /cos-watcher/status — 轮询守护状态",
"POST /cos-watcher/scan — 手动触发扫描",
"POST /cos-watcher/reset — 重置文件索引"
],
"mcp_tools": [
"cosWatcherStatus — 查看轮询守护进程状态",
"cosWatcherTriggerScan — 手动触发一次扫描",
"cosWatcherResetIndex — 重置文件索引"
]
},
"report_trigger": {
"function_name": "zy-cos-report-trigger",
"description": "汇报触发函数 · 检测到新report → 唤醒铸渊Agent审核",
"runtime": "Nodejs18.15",
"region": "ap-singapore",
"trigger": {
"type": "cos",
"bucket": "zy-team-hub-1317346199",
"event": "cos:ObjectCreated:*",
"prefix_filter_rules": [
"qiuqiu/reports/",
"shushu/reports/",
"ounomiya/reports/",
"jiyao/reports/",
"xiaotanheshu/reports/",
"chenxing/reports/",
"tangxingyun/reports/",
"yaochu/reports/",
"zhiqiu/reports/"
],
"suffix_filter": ".json"
},
"action_flow": [
"1. 解析COS事件获取写入的对象路径",
"2. 从路径提取persona_id和日期",
"3. 读取report.json内容",
"4. 铸渊Agent审核健康状态/任务进度/异常标记)",
"5. 生成回执JSON",
"6. PUT回执到 /{persona_id}/receipts/{date}/receipt.json",
"7. 调用Notion API更新主控台状态如已配置Token"
],
"environment_variables": {
"COS_BUCKET": "zy-team-hub-1317346199",
"COS_REGION": "ap-singapore",
"NOTION_TOKEN": "待霜砚提供",
"NOTION_DB_ID": "待霜砚提供"
}
},
"receipt_trigger": {
"function_name": "zy-cos-receipt-trigger",
"description": "回执下行触发函数 · 检测到新receipt → 调用成员仓库workflow_dispatch",
"runtime": "Nodejs18.15",
"region": "ap-singapore",
"trigger": {
"type": "cos",
"bucket": "zy-team-hub-1317346199",
"event": "cos:ObjectCreated:*",
"prefix_filter_rules": [
"qiuqiu/receipts/",
"shushu/receipts/",
"ounomiya/receipts/",
"jiyao/receipts/",
"xiaotanheshu/receipts/",
"chenxing/receipts/",
"tangxingyun/receipts/",
"yaochu/receipts/",
"zhiqiu/receipts/"
],
"suffix_filter": ".json"
},
"action_flow": [
"1. 解析COS事件获取回执对象路径",
"2. 从路径提取persona_id",
"3. 查找persona_id对应的GitHub仓库从配置表映射",
"4. 调用GitHub API: POST /repos/{owner}/{repo}/actions/workflows/cos-receive-receipt.yml/dispatches",
"5. 传入receipt路径作为workflow_dispatch的input",
"6. 成员仓库工作流读取回执 → 更新README首页绿灯/红灯"
],
"environment_variables": {
"GITHUB_TOKEN": "需要有workflow权限的PAT · 冰朔创建",
"PERSONA_REPO_MAP": "persona_id → GitHub仓库的映射JSON"
}
}
},
"notion_sync": {
"description": "Notion主控台回执同步链路需霜砚提供的信息",
"integration_point": "在report_trigger函数的Step 7中执行",
"api_call": {
"method": "PATCH",
"url": "https://api.notion.com/v1/pages/{page_id}",
"headers": {
"Authorization": "Bearer {NOTION_TOKEN}",
"Notion-Version": "2022-06-28",
"Content-Type": "application/json"
},
"body_template": {
"properties": {
"{status_field_name}": {
"rich_text": [
{
"text": {
"content": "{status_emoji} {status_text} · {timestamp}"
}
}
]
},
"{receipt_time_field_name}": {
"date": {
"start": "{ISO 8601 timestamp}"
}
}
}
}
},
"update_logic": {
"green_receipt": "状态字段 = '✅ 正常' · 更新时间戳",
"red_receipt": "状态字段 = '🔴 异常' · 更新时间戳 · 触发P0工单",
"timeout_24h": "Agenttimeout · = ' 24h' · P1"
},
"required_from_shuangyan": {
"description": "",
"items": [
"Notion Integration Token",
"IDURL",
"page_id9page_id",
"",
""
]
}
},
"timeout_detection": {
"description": "",
"mechanism": "SCF · 08:00",
"logic": [
"9persona_id",
" /{persona_id}/reports/ ",
"24h timeoutreceipts/",
"Notion"
],
"function_name": "zy-cos-timeout-checker",
"cron": "0 0 * * *"
},
"server_topology": {
"description": " · D51(2026-04-04)",
"decision_context": "7-8 · AWEN线线",
"servers": [
{
"server_id": "ZY-SVR-FEIMAO",
"name": "线",
"owner": "",
"config": "44G · ",
"purpose": "7-8",
"services": [
"Nginx · ",
"PM2Node.js",
"(3001-3008)",
"(/)"
],
"cos_connection": "COS zy-team-hub-1317346199 ",
"persona": "shushu ()",
"status": ""
},
{
"server_id": "ZY-SVR-AWEN",
"name": "AWEN+线",
"owner": "AWEN+",
"config": "44G · · ",
"purpose": "AWEN线线",
"services": [
"Nginx",
"PM2",
"AWEN线 + 线",
""
],
"cos_connection": "COS zy-team-hub-1317346199 ",
"persona": "zhiqiu ()",
"status": "(2026-04-04)"
},
{
"server_id": "ZY-SVR-001",
"name": "",
"owner": " · TCS-ZY001",
"config": " · ",
"purpose": " · COS · SCF · ",
"services": [
"COS(zy-team-hub-1317346199)",
"SCF(report_trigger/receipt_trigger/timeout_checker)",
"Notion",
"线VPN",
"AGE OS(3800/3100)"
],
"cos_connection": " · ",
"status": ""
}
],
"connection_topology": {
"description": "",
"data_flow": [
"线 COS /{persona_id}/reports/ ",
"AWEN+线 COS /{persona_id}/reports/ ",
" COS /{persona_id}/receipts/ ",
" Notion +"
],
"key_principle": " · COS · ",
"scaling_trigger": [
"使>70% ",
">1000 ",
">15 3"
]
}
},
"implementation_phases": {
"description": "",
"phase_1": {
"name": " + + ",
"location": "",
"executor": "",
"steps": [
"COS zy-team-hub-1317346199",
"",
"CAM9()",
"IAM()",
"9SecretId/SecretKey",
""
],
"time_estimate": "30",
"dependency": ""
},
"phase_2": {
"name": "SCF",
"location": " + ",
"executor": " ",
"steps": [
"report_trigger",
"receipt_trigger",
"SCF",
"COS",
"",
""
],
"time_estimate": "1Copilot + 20",
"dependency": "Phase 1"
},
"phase_3": {
"name": "Notion API",
"location": " + Notion",
"executor": " · Token",
"steps": [
"NotionToken/page_id/",
"report_triggerNotion API",
": COS SCF Notion"
],
"time_estimate": "30 + 30",
"dependency": "Phase 2 + Token"
},
"phase_4": {
"name": " + ",
"location": "SCF + ",
"executor": " ",
"steps": [
"timeout-checker",
"cron",
": Notion"
],
"time_estimate": "1Copilot",
"dependency": "Phase 3"
}
}
}