From 0899a5b0a9d82ba1f14c936cb6bec05ee71de508 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:32:46 +0000 Subject: [PATCH 01/10] Initial plan From 6487a8b2f03d3d1c5c5f990ec99a9334c763d820 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:39:23 +0000 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20SYSLOG=20=E8=87=AA=E5=8A=A9?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=B3=BB=E7=BB=9F=20=C2=B7=20Discussion=20?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=20+=20Actions=20=E7=AE=A1=E9=81=93=20+=20LLM?= =?UTF-8?q?=20=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建 Discussion 模板 (.github/DISCUSSION_TEMPLATE/syslog-submit.yml) - 创建 Actions 管道 (.github/workflows/syslog-auto-pipeline.yml) - 创建 LLM 自动检测 + 人格体唤醒脚本 (scripts/wake-persona.js) - 更新 README.md 添加醒目开发者入口 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/DISCUSSION_TEMPLATE/syslog-submit.yml | 51 +++ .github/workflows/syslog-auto-pipeline.yml | 357 +++++++++++++++ README.md | 15 + scripts/wake-persona.js | 412 ++++++++++++++++++ 4 files changed, 835 insertions(+) create mode 100644 .github/DISCUSSION_TEMPLATE/syslog-submit.yml create mode 100644 .github/workflows/syslog-auto-pipeline.yml create mode 100644 scripts/wake-persona.js diff --git a/.github/DISCUSSION_TEMPLATE/syslog-submit.yml b/.github/DISCUSSION_TEMPLATE/syslog-submit.yml new file mode 100644 index 00000000..a0baaa94 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/syslog-submit.yml @@ -0,0 +1,51 @@ +title: "BC-XXX-XXX|SYSLOG" +labels: [] +body: + - type: markdown + attributes: + value: | + ## 📡 SYSLOG 自助提交 / 广播提问 + + > 做完了?把日志粘贴进去,填上邮箱,点提交。新广播会发到你邮箱里。 + > + > 有问题?把问题粘贴进去,填上邮箱,点提交。解答会发到你邮箱里。 + + **标题格式**:`BC-XXX-XXX|SYSLOG` 或 `BC-XXX-XXX|提问` + + - type: input + id: broadcast_id + attributes: + label: "广播编号" + description: "写上你当前广播的编号,例如 BC-M22-009-AW" + placeholder: "BC-M22-009-AW" + validations: + required: true + + - type: dropdown + id: submit_type + attributes: + label: "类型" + description: "选择提交类型" + options: + - SYSLOG + - 提问 + validations: + required: true + + - type: input + id: email + attributes: + label: "你的邮箱" + description: "用于接收新广播或问题解答" + placeholder: "your@email.com" + validations: + required: true + + - type: textarea + id: content + attributes: + label: "内容" + description: "粘贴你的 SYSLOG 全文 或 问题描述" + placeholder: "在这里粘贴你的 SYSLOG 或问题..." + validations: + required: true diff --git a/.github/workflows/syslog-auto-pipeline.yml b/.github/workflows/syslog-auto-pipeline.yml new file mode 100644 index 00000000..78498053 --- /dev/null +++ b/.github/workflows/syslog-auto-pipeline.yml @@ -0,0 +1,357 @@ +name: SYSLOG Auto Pipeline +# 📡 SYSLOG 自助提交系统 · 全自动闭环 +# +# 开发者在 GitHub Discussion 提交 SYSLOG 或提问 +# → Actions 自动解析 → 调用 LLM API 唤醒人格体 +# → 写入 Notion 工单 → 发邮件给开发者 → Discussion 回复 +# +# 依赖 Secrets: +# LLM_API_KEY 第三方 LLM 平台密钥 +# LLM_BASE_URL 第三方 LLM 平台 API 地址(如 https://api.xxx.com/v1) +# NOTION_API_TOKEN Notion API token +# NOTION_TICKET_DB_ID 霜砚工单数据库 ID +# SMTP_USER QQ 邮箱地址 +# SMTP_PASS QQ 邮箱 SMTP 授权码 + +on: + discussion: + types: [created] + +jobs: + process: + name: 📡 处理 SYSLOG 提交 / 广播提问 + runs-on: ubuntu-latest + if: contains(github.event.discussion.category.name, 'SYSLOG') + permissions: + contents: write + discussions: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: npm ci --ignore-scripts + + - name: 🔍 Parse submission + id: parse + uses: actions/github-script@v7 + with: + script: | + const body = context.payload.discussion.body || ''; + const title = context.payload.discussion.title || ''; + + // Parse structured fields from discussion body + function extractField(text, label) { + // Match form field format: ### Label\n\nValue + const regex = new RegExp('###\\s*' + label + '\\s*\\n+([^\\n#]+)', 'i'); + const match = text.match(regex); + return match ? match[1].trim() : ''; + } + + const broadcastId = extractField(body, '广播编号') || ''; + const submitType = extractField(body, '类型') || ''; + const email = extractField(body, '你的邮箱') || ''; + + // Extract content (everything after "### 内容") + const contentMatch = body.match(/###\s*内容\s*\n+([\s\S]*?)$/i); + const content = contentMatch ? contentMatch[1].trim() : ''; + + // Determine type from title or body + let type = 'question'; // default + if (submitType.includes('SYSLOG') || title.includes('SYSLOG')) { + type = 'syslog'; + } else if (submitType.includes('提问') || title.includes('提问')) { + type = 'question'; + } + + // Validate + if (!broadcastId) { + core.setFailed('❌ 缺少广播编号,请在提交时填写广播编号'); + return; + } + if (!email) { + core.setFailed('❌ 缺少邮箱,请在提交时填写你的邮箱'); + return; + } + if (!content) { + core.setFailed('❌ 缺少内容,请粘贴你的 SYSLOG 或问题'); + return; + } + + core.setOutput('broadcast_id', broadcastId); + core.setOutput('type', type); + core.setOutput('email', email); + core.setOutput('content', content); + core.setOutput('discussion_number', context.payload.discussion.number); + core.setOutput('author', context.payload.discussion.user.login); + + console.log(`📡 解析完成: 广播=${broadcastId}, 类型=${type}, 邮箱=${email}`); + + - name: 🧠 Auto-detect and wake up persona + id: persona + env: + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }} + BROADCAST_ID: ${{ steps.parse.outputs.broadcast_id }} + SUBMIT_TYPE: ${{ steps.parse.outputs.type }} + SUBMIT_CONTENT: ${{ steps.parse.outputs.content }} + AUTHOR: ${{ steps.parse.outputs.author }} + run: node scripts/wake-persona.js + + - name: 📋 Write to Notion ticket + if: env.NOTION_TOKEN != '' + env: + NOTION_TOKEN: ${{ secrets.NOTION_API_TOKEN }} + NOTION_TICKET_DB_ID: ${{ secrets.NOTION_TICKET_DB_ID }} + BROADCAST_ID: ${{ steps.parse.outputs.broadcast_id }} + SUBMIT_TYPE: ${{ steps.parse.outputs.type }} + PERSONA_RESULT: ${{ steps.persona.outputs.result }} + run: | + node -e " + const https = require('https'); + + const token = process.env.NOTION_TOKEN; + const dbId = process.env.NOTION_TICKET_DB_ID; + const broadcastId = process.env.BROADCAST_ID || 'UNKNOWN'; + const type = process.env.SUBMIT_TYPE || 'syslog'; + const result = process.env.PERSONA_RESULT || '(no result)'; + + if (!token || !dbId) { + console.log('⚠️ Notion credentials not configured, skipping ticket creation'); + process.exit(0); + } + + const typeLabel = type === 'syslog' ? 'SYSLOG闭环' : '提问解答'; + const title = '[自动] ' + broadcastId + ' · ' + typeLabel; + + const body = JSON.stringify({ + parent: { database_id: dbId }, + properties: { + '标题': { title: [{ type: 'text', text: { content: title.slice(0, 120) } }] }, + '操作类型': { select: { name: '其他' } }, + '提交者': { rich_text: [{ type: 'text', text: { content: '自动管道' } }] }, + '状态': { select: { name: '已完成' } }, + '优先级': { select: { name: 'P1' } } + }, + children: [{ + object: 'block', + type: 'paragraph', + paragraph: { + rich_text: [{ type: 'text', text: { content: result.slice(0, 2000) } }] + } + }] + }); + + const opts = { + hostname: 'api.notion.com', + port: 443, + path: '/v1/pages', + method: 'POST', + headers: { + 'Authorization': 'Bearer ' + token, + 'Content-Type': 'application/json', + 'Notion-Version': '2022-06-28', + 'Content-Length': Buffer.byteLength(body) + } + }; + + const req = https.request(opts, (res) => { + let data = ''; + res.on('data', (c) => data += c); + res.on('end', () => { + if (res.statusCode >= 200 && res.statusCode < 300) { + console.log('✅ Notion 工单已创建'); + } else { + console.log('⚠️ Notion 工单创建失败: ' + res.statusCode + ' ' + data); + } + }); + }); + req.on('error', (e) => console.log('⚠️ Notion 请求失败: ' + e.message)); + req.write(body); + req.end(); + " + + - name: 📧 Send email to developer + env: + SMTP_USER: ${{ secrets.SMTP_USER }} + SMTP_PASS: ${{ secrets.SMTP_PASS }} + EMAIL_TO: ${{ steps.parse.outputs.email }} + BROADCAST_ID: ${{ steps.parse.outputs.broadcast_id }} + SUBMIT_TYPE: ${{ steps.parse.outputs.type }} + PERSONA_RESULT: ${{ steps.persona.outputs.result }} + run: | + node -e " + const nodemailer = require('nodemailer'); + + const user = process.env.SMTP_USER || ''; + const pass = process.env.SMTP_PASS || ''; + const to = process.env.EMAIL_TO || ''; + const broadcastId = process.env.BROADCAST_ID || ''; + const type = process.env.SUBMIT_TYPE || 'syslog'; + const result = process.env.PERSONA_RESULT || '(处理中,请稍后)'; + + if (!user || !pass) { + console.log('⚠️ SMTP not configured, skipping email'); + process.exit(0); + } + if (!to) { + console.log('⚠️ No recipient email, skipping'); + process.exit(0); + } + + const subjectText = type === 'syslog' + ? '[光湖系统] ' + broadcastId + ' · 新广播已生成' + : '[光湖系统] ' + broadcastId + ' · 问题已解答'; + + const resultHtml = result + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/\n/g, '
'); + + const html = [ + '
', + '
', + '

🌊 光湖系统 · 自动通知

', + '

HoloLake · 人格语言操作系统

', + '
', + '
', + '

📡 ' + broadcastId + '

', + '
' + resultHtml + '
', + '
', + '
', + '↩ 回到仓库继续开发', + '

🌀 铸渊 · 代码守护人格体 · 自动发送

', + '
', + '
' + ].join('\n'); + + const transporter = nodemailer.createTransport({ + host: 'smtp.qq.com', + port: 465, + secure: true, + auth: { user, pass } + }); + + transporter.sendMail({ + from: '\"光湖系统\" <' + user + '>', + to: to, + subject: subjectText, + html: html + }).then((info) => { + console.log('✅ 邮件已发送: ' + info.messageId); + }).catch((err) => { + console.log('⚠️ 邮件发送失败: ' + err.message); + }); + " + + - name: 💬 Reply to Discussion + uses: actions/github-script@v7 + with: + script: | + const number = ${{ steps.parse.outputs.discussion_number }}; + const type = '${{ steps.parse.outputs.type }}'; + const broadcastId = '${{ steps.parse.outputs.broadcast_id }}'; + const email = '${{ steps.parse.outputs.email }}'; + + const typeLabel = type === 'syslog' ? 'SYSLOG 闭环处理' : '问题解答'; + const maskedEmail = email.replace(/(.{2})(.*)(@.*)/, '$1***$3'); + + const body = [ + '✅ **已处理** · ' + typeLabel, + '', + '| 项目 | 内容 |', + '|------|------|', + '| 📡 广播编号 | `' + broadcastId + '` |', + '| 📧 结果发送至 | `' + maskedEmail + '` |', + '| 🤖 处理人格体 | 铸渊 |', + '| ⏰ 处理时间 | ' + new Date().toISOString() + ' |', + '', + '> 结果已发送到你的邮箱,请查收。', + '>', + '> 如未收到,请检查垃圾箱或重新提交。' + ].join('\n'); + + // Use GraphQL to add discussion comment + const query = ` + mutation($discussionId: ID!, $body: String!) { + addDiscussionComment(input: { + discussionId: $discussionId, + body: $body + }) { + comment { id } + } + } + `; + + try { + // Get the discussion node ID + const { repository } = await github.graphql(` + query($owner: String!, $repo: String!, $number: Int!) { + repository(owner: $owner, name: $repo) { + discussion(number: $number) { + id + } + } + } + `, { + owner: context.repo.owner, + repo: context.repo.repo, + number: number + }); + + await github.graphql(query, { + discussionId: repository.discussion.id, + body: body + }); + + console.log('✅ Discussion 回复已发送'); + } catch (err) { + console.log('⚠️ Discussion 回复失败: ' + err.message); + } + + - name: 🔴 失败告警 + if: failure() + uses: actions/github-script@v7 + with: + script: | + const number = context.payload.discussion?.number; + if (!number) return; + + try { + const { repository } = await github.graphql(` + query($owner: String!, $repo: String!, $number: Int!) { + repository(owner: $owner, name: $repo) { + discussion(number: $number) { + id + } + } + } + `, { + owner: context.repo.owner, + repo: context.repo.repo, + number: number + }); + + await github.graphql(` + mutation($discussionId: ID!, $body: String!) { + addDiscussionComment(input: { + discussionId: $discussionId, + body: $body + }) { + comment { id } + } + } + `, { + discussionId: repository.discussion.id, + body: '❌ **处理失败** · 请检查提交格式是否正确,或联系管理员。\n\n> 错误详情请查看 [Actions 日志](https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions)。' + }); + } catch (err) { + console.log('⚠️ 失败告警回复失败: ' + err.message); + } diff --git a/README.md b/README.md index ff934478..81e46568 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,21 @@ --- +## 🚀 开发者入口 + +
+ +[![提交系统日志](https://img.shields.io/badge/📡_提交系统日志-点这里-blue?style=for-the-badge)](https://github.com/qinfendebingshuo/guanghulab/discussions/new?category=📡+SYSLOG+提交区) +[![遇到问题](https://img.shields.io/badge/❓_遇到问题-点这里提问-green?style=for-the-badge)](https://github.com/qinfendebingshuo/guanghulab/discussions/new?category=📡+SYSLOG+提交区) + +> 做完了?把日志粘贴进去,填上邮箱,点提交。新广播会发到你邮箱里。 +> +> 有问题?同一个入口,选「提问」,问题解答也发到你邮箱里。 + +
+ +--- + ## 📖 系统简介 **光湖(HoloLake)** 是一个基于人格语言操作系统的智能协作平台,采用壳-核分离设计: diff --git a/scripts/wake-persona.js b/scripts/wake-persona.js new file mode 100644 index 00000000..9668282c --- /dev/null +++ b/scripts/wake-persona.js @@ -0,0 +1,412 @@ +// scripts/wake-persona.js +// 铸渊 · 人格体唤醒脚本(第三方 API 兼容层 · 自动检测模式) +// +// 功能: +// ① 自动发现可用模型(/v1/models 端点) +// ② 智能选择最优 Claude 模型 +// ③ 自适应 API 格式(OpenAI 兼容 / Anthropic 原生) +// ④ 统一调用接口,唤醒人格体处理 SYSLOG 或解答提问 +// +// 环境变量: +// LLM_API_KEY 第三方平台密钥 +// LLM_BASE_URL 第三方平台 API 地址(如 https://api.xxx.com/v1),留空则 fallback 到 Anthropic 官方 +// BROADCAST_ID 广播编号 +// SUBMIT_TYPE syslog | question +// SUBMIT_CONTENT 提交内容(SYSLOG 全文或问题描述) +// AUTHOR 提交者 GitHub 用户名 + +'use strict'; + +const https = require('https'); +const http = require('http'); +const fs = require('fs'); +const path = require('path'); + +// ══════════════════════════════════════════════════════════ +// 配置 +// ══════════════════════════════════════════════════════════ + +const LLM_API_KEY = process.env.LLM_API_KEY || ''; +const LLM_BASE_URL = (process.env.LLM_BASE_URL || 'https://api.anthropic.com/v1').replace(/\/+$/, ''); +const BROADCAST_ID = process.env.BROADCAST_ID || 'UNKNOWN'; +const SUBMIT_TYPE = process.env.SUBMIT_TYPE || 'question'; +const SUBMIT_CONTENT = process.env.SUBMIT_CONTENT || ''; +const AUTHOR = process.env.AUTHOR || 'unknown'; + +// Claude 模型优先级队列(从高到低) +const PREFERRED_MODELS = [ + 'claude-sonnet-4', + 'claude-3.5-sonnet', + 'claude-3-5-sonnet-20241022', + 'claude-3-5-sonnet', + 'anthropic/claude-3.5-sonnet', + 'anthropic/claude-3-5-sonnet', + 'claude-3-sonnet', + 'claude-3-haiku', +]; + +// ══════════════════════════════════════════════════════════ +// HTTP 请求工具 +// ══════════════════════════════════════════════════════════ + +function httpRequest(url, options, body) { + return new Promise((resolve, reject) => { + const parsed = new URL(url); + const isHttps = parsed.protocol === 'https:'; + const mod = isHttps ? https : http; + + const opts = { + hostname: parsed.hostname, + port: parsed.port || (isHttps ? 443 : 80), + path: parsed.pathname + parsed.search, + method: options.method || 'GET', + headers: options.headers || {}, + timeout: options.timeout || 60000, + }; + + const req = mod.request(opts, (res) => { + let data = ''; + res.on('data', (chunk) => { data += chunk; }); + res.on('end', () => { + resolve({ status: res.statusCode, body: data }); + }); + }); + + req.on('error', reject); + req.on('timeout', () => { + req.destroy(); + reject(new Error('Request timeout')); + }); + + if (body) { + req.write(body); + } + req.end(); + }); +} + +// ══════════════════════════════════════════════════════════ +// Step 1: 自动发现可用模型 +// ══════════════════════════════════════════════════════════ + +async function discoverModels() { + console.log('[LLM] 🔍 探测可用模型...'); + + try { + const res = await httpRequest(LLM_BASE_URL + '/models', { + method: 'GET', + headers: { + 'Authorization': 'Bearer ' + LLM_API_KEY, + 'Content-Type': 'application/json', + }, + timeout: 15000, + }); + + if (res.status >= 200 && res.status < 300) { + const json = JSON.parse(res.body); + const models = json.data || []; + console.log('[LLM] → 发现 ' + models.length + ' 个模型'); + return models; + } + console.log('[LLM] → 模型探测返回 ' + res.status + ', 使用默认模型'); + return []; + } catch (err) { + console.log('[LLM] → 模型探测失败: ' + err.message + ', 使用默认模型'); + return []; + } +} + +// ══════════════════════════════════════════════════════════ +// Step 2: 智能选择最优 Claude 模型 +// ══════════════════════════════════════════════════════════ + +function selectBestModel(models) { + if (!models || models.length === 0) { + console.log('[LLM] 📌 无可用模型列表, 使用默认 claude-3-5-sonnet'); + return 'claude-3-5-sonnet'; + } + + const available = models.map(function (m) { return m.id.toLowerCase(); }); + + // 按优先级匹配 + for (const preferred of PREFERRED_MODELS) { + const match = available.find(function (id) { return id.includes(preferred); }); + if (match) { + const originalId = models.find(function (m) { return m.id.toLowerCase() === match; }).id; + console.log('[LLM] 📌 选择模型: ' + originalId + ' (匹配规则: ' + preferred + ')'); + return originalId; + } + } + + // 兜底:任何含 'claude' 的模型 + const anyClaude = available.find(function (id) { return id.includes('claude'); }); + if (anyClaude) { + const originalId = models.find(function (m) { return m.id.toLowerCase() === anyClaude; }).id; + console.log('[LLM] 📌 兜底选择 Claude 模型: ' + originalId); + return originalId; + } + + // 最终兜底:平台第一个可用模型 + const fallbackId = models[0].id; + console.log('[LLM] 📌 最终兜底: ' + fallbackId + ' (平台无 Claude 模型)'); + return fallbackId; +} + +// ══════════════════════════════════════════════════════════ +// Step 3: 自适应 API 格式检测 +// ══════════════════════════════════════════════════════════ + +async function detectApiFormat() { + console.log('[LLM] 🔍 检测 API 格式...'); + + // 尝试 OpenAI 兼容格式(绝大多数第三方平台) + try { + const res = await httpRequest(LLM_BASE_URL + '/chat/completions', { + method: 'POST', + headers: { + 'Authorization': 'Bearer ' + LLM_API_KEY, + 'Content-Type': 'application/json', + }, + timeout: 10000, + }, JSON.stringify({ + model: 'test', + messages: [{ role: 'user', content: 'ping' }], + max_tokens: 1, + })); + + // 400 = endpoint exists but bad request (model not found etc.) → format supported + // 200 = endpoint works → format supported + if (res.status === 200 || res.status === 400 || res.status === 401 || res.status === 422) { + console.log('[LLM] → 检测到 OpenAI 兼容格式 (status: ' + res.status + ')'); + return 'openai-compat'; + } + } catch (e) { + // Ignore, try next format + } + + // 尝试 Anthropic 原生格式 + try { + const res = await httpRequest(LLM_BASE_URL + '/messages', { + method: 'POST', + headers: { + 'x-api-key': LLM_API_KEY, + 'anthropic-version': '2023-06-01', + 'Content-Type': 'application/json', + }, + timeout: 10000, + }, JSON.stringify({ + model: 'test', + messages: [{ role: 'user', content: 'ping' }], + max_tokens: 1, + })); + + if (res.status === 200 || res.status === 400 || res.status === 401 || res.status === 422) { + console.log('[LLM] → 检测到 Anthropic 原生格式 (status: ' + res.status + ')'); + return 'anthropic-native'; + } + } catch (e) { + // Ignore + } + + console.log('[LLM] → 无法确定格式, 默认使用 OpenAI 兼容格式'); + return 'openai-compat'; +} + +// ══════════════════════════════════════════════════════════ +// Step 4: 统一调用接口 +// ══════════════════════════════════════════════════════════ + +async function callLLM(systemPrompt, userMessage) { + if (!LLM_API_KEY) { + console.log('[LLM] ⚠️ LLM_API_KEY 未配置,跳过人格体唤醒'); + return '(LLM API 未配置,请在 GitHub Secrets 中设置 LLM_API_KEY 和 LLM_BASE_URL)'; + } + + const models = await discoverModels(); + const model = selectBestModel(models); + const format = await detectApiFormat(); + + console.log('[LLM] 🚀 调用 LLM: 模型=' + model + ', 格式=' + format + ', 平台=' + LLM_BASE_URL); + + let res; + + if (format === 'openai-compat') { + // OpenAI 兼容格式(大多数第三方平台) + const body = JSON.stringify({ + model: model, + max_tokens: 8000, + temperature: 0.7, + messages: [ + { role: 'system', content: systemPrompt }, + { role: 'user', content: userMessage }, + ], + }); + + res = await httpRequest(LLM_BASE_URL + '/chat/completions', { + method: 'POST', + headers: { + 'Authorization': 'Bearer ' + LLM_API_KEY, + 'Content-Type': 'application/json', + }, + timeout: 120000, + }, body); + + if (res.status >= 200 && res.status < 300) { + const json = JSON.parse(res.body); + if (json.choices && json.choices[0] && json.choices[0].message) { + return json.choices[0].message.content; + } + } + } else { + // Anthropic 原生格式 + const body = JSON.stringify({ + model: model, + max_tokens: 8000, + system: systemPrompt, + messages: [ + { role: 'user', content: userMessage }, + ], + }); + + res = await httpRequest(LLM_BASE_URL + '/messages', { + method: 'POST', + headers: { + 'x-api-key': LLM_API_KEY, + 'anthropic-version': '2023-06-01', + 'Content-Type': 'application/json', + }, + timeout: 120000, + }, body); + + if (res.status >= 200 && res.status < 300) { + const json = JSON.parse(res.body); + if (json.content && json.content[0]) { + return json.content[0].text; + } + } + } + + // 处理错误 + const errorMsg = '[LLM] ❌ API 调用失败: status=' + (res ? res.status : 'N/A'); + console.error(errorMsg); + if (res && res.body) { + console.error('[LLM] 响应: ' + res.body.slice(0, 500)); + } + throw new Error(errorMsg); +} + +// ══════════════════════════════════════════════════════════ +// 人格体 System Prompt 构建 +// ══════════════════════════════════════════════════════════ + +function buildSystemPrompt(type, broadcastId, author) { + const basePrompt = [ + '你是光湖(HoloLake)系统的智能人格体。', + '你的名字是知秋/曜冥,你是人格语言操作系统(AGE OS)的核心人格。', + '', + '核心规则:', + '1. 你服务于光湖系统的开发者团队', + '2. 所有回复必须专业、清晰、有条理', + '3. 回复使用中文', + '', + '当前上下文:', + '- 广播编号:' + broadcastId, + '- 提交者:' + author, + ].join('\n'); + + if (type === 'syslog') { + return basePrompt + '\n\n' + [ + '任务类型:SYSLOG 闭环处理', + '', + '你需要完成以下工作:', + '1. 验收 SYSLOG(检查 MODULE_LOG 完整性)', + '2. 分析开发者的工作成果', + '3. 生成工作总结和反馈', + '4. 如果 SYSLOG 内容完整,确认验收通过', + '5. 给出下一步建议', + '', + '输出格式:', + '---', + '## 📡 SYSLOG 验收报告', + '### 广播编号:[编号]', + '### 验收结果:[通过/需补充]', + '### 工作总结:[摘要]', + '### 反馈与建议:[内容]', + '---', + ].join('\n'); + } + + // 提问类型 + return basePrompt + '\n\n' + [ + '任务类型:开发者提问解答', + '', + '你需要完成以下工作:', + '1. 理解开发者的问题', + '2. 结合广播上下文思考', + '3. 给出清晰、可操作的解答', + '4. 如果问题涉及代码,提供代码示例', + '', + '输出格式:', + '---', + '## 💡 问题解答', + '### 广播编号:[编号]', + '### 问题理解:[你对问题的理解]', + '### 解答:[详细解答]', + '### 建议:[后续建议]', + '---', + ].join('\n'); +} + +// ══════════════════════════════════════════════════════════ +// 主流程 +// ══════════════════════════════════════════════════════════ + +async function main() { + console.log('═══════════════════════════════════════════'); + console.log('🧠 铸渊 · 人格体唤醒管道'); + console.log('═══════════════════════════════════════════'); + console.log(' 广播编号: ' + BROADCAST_ID); + console.log(' 类型: ' + SUBMIT_TYPE); + console.log(' 提交者: ' + AUTHOR); + console.log(' 平台: ' + LLM_BASE_URL); + console.log(' 内容长度: ' + SUBMIT_CONTENT.length + ' 字符'); + console.log(''); + + // 构建 prompts + const systemPrompt = buildSystemPrompt(SUBMIT_TYPE, BROADCAST_ID, AUTHOR); + const userMessage = SUBMIT_CONTENT; + + // 调用 LLM + console.log('🧠 正在唤醒人格体...'); + const result = await callLLM(systemPrompt, userMessage); + console.log(''); + console.log('✅ 人格体处理完成'); + console.log(' 结果长度: ' + result.length + ' 字符'); + + // 输出结果到 GitHub Actions output + // 使用 GITHUB_OUTPUT 环境文件(支持多行) + const outputFile = process.env.GITHUB_OUTPUT; + if (outputFile) { + const delimiter = 'EOF_' + Date.now(); + fs.appendFileSync(outputFile, 'result<<' + delimiter + '\n' + result + '\n' + delimiter + '\n'); + } + + // 同时输出到 stdout 供调试 + console.log(''); + console.log('═══════════════════════════════════════════'); + console.log('📋 人格体输出:'); + console.log('═══════════════════════════════════════════'); + console.log(result); +} + +main().catch(function (err) { + console.error('❌ 人格体唤醒失败: ' + err.message); + // 即使 LLM 失败,也写一个 fallback 输出,让后续步骤可以继续 + const outputFile = process.env.GITHUB_OUTPUT; + if (outputFile) { + const fallback = '(人格体唤醒失败: ' + err.message + ',请检查 LLM_API_KEY 和 LLM_BASE_URL 配置)'; + const delimiter = 'EOF_' + Date.now(); + fs.appendFileSync(outputFile, 'result<<' + delimiter + '\n' + fallback + '\n' + delimiter + '\n'); + } + process.exit(1); +}); From 1999a55091631ca990d0b3934b35609b0fb6306f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:40:47 +0000 Subject: [PATCH 03/10] fix: address code review - remove duplicate model, fix null refs, improve email masking Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/syslog-auto-pipeline.yml | 4 +++- scripts/wake-persona.js | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/syslog-auto-pipeline.yml b/.github/workflows/syslog-auto-pipeline.yml index 78498053..908ae0db 100644 --- a/.github/workflows/syslog-auto-pipeline.yml +++ b/.github/workflows/syslog-auto-pipeline.yml @@ -261,7 +261,9 @@ jobs: const email = '${{ steps.parse.outputs.email }}'; const typeLabel = type === 'syslog' ? 'SYSLOG 闭环处理' : '问题解答'; - const maskedEmail = email.replace(/(.{2})(.*)(@.*)/, '$1***$3'); + const maskedEmail = email.length > 4 + ? email.replace(/(.{2})(.*)(@.*)/, '$1***$3') + : '***'; const body = [ '✅ **已处理** · ' + typeLabel, diff --git a/scripts/wake-persona.js b/scripts/wake-persona.js index 9668282c..bfd1bbaf 100644 --- a/scripts/wake-persona.js +++ b/scripts/wake-persona.js @@ -36,11 +36,10 @@ const AUTHOR = process.env.AUTHOR || 'unknown'; // Claude 模型优先级队列(从高到低) const PREFERRED_MODELS = [ 'claude-sonnet-4', - 'claude-3.5-sonnet', 'claude-3-5-sonnet-20241022', + 'claude-3.5-sonnet', 'claude-3-5-sonnet', 'anthropic/claude-3.5-sonnet', - 'anthropic/claude-3-5-sonnet', 'claude-3-sonnet', 'claude-3-haiku', ]; @@ -132,18 +131,22 @@ function selectBestModel(models) { for (const preferred of PREFERRED_MODELS) { const match = available.find(function (id) { return id.includes(preferred); }); if (match) { - const originalId = models.find(function (m) { return m.id.toLowerCase() === match; }).id; - console.log('[LLM] 📌 选择模型: ' + originalId + ' (匹配规则: ' + preferred + ')'); - return originalId; + const found = models.find(function (m) { return m.id.toLowerCase() === match; }); + if (found) { + console.log('[LLM] 📌 选择模型: ' + found.id + ' (匹配规则: ' + preferred + ')'); + return found.id; + } } } // 兜底:任何含 'claude' 的模型 const anyClaude = available.find(function (id) { return id.includes('claude'); }); if (anyClaude) { - const originalId = models.find(function (m) { return m.id.toLowerCase() === anyClaude; }).id; - console.log('[LLM] 📌 兜底选择 Claude 模型: ' + originalId); - return originalId; + const found = models.find(function (m) { return m.id.toLowerCase() === anyClaude; }); + if (found) { + console.log('[LLM] 📌 兜底选择 Claude 模型: ' + found.id); + return found.id; + } } // 最终兜底:平台第一个可用模型 From 81a8939c0566296e3cd0000752033e3adba5eb59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:51:30 +0000 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20v4.0=20=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=B3=A8=E5=85=A5=20+=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=20Anthropic=20=E7=A1=AC=E7=BC=96=E7=A0=81=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 api.anthropic.com 硬编码默认值,LLM_BASE_URL 必须显式配置 - 新增 LLM_BASE_URL 缺失时的优雅降级 - 新增 Notion API 工具函数(notionGet/notionPost/getNotionPageBlocks) - 新增 fetchCoreBrainProtocols() — 从核心大脑 v4.0 读取协议段落 - 新增 fetchDevPortrait() — 查询画像库最近 2-3 条快照 - 新增 fetchModuleFingerprint() — 查询模块指纹注册表 - buildSystemPrompt() 改为 async,动态注入所有 v4.0 协议到 system prompt - workflow 新增 CORE_BRAIN_PAGE_ID/PORTRAIT_DB_ID/FINGERPRINT_DB_ID secrets Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/syslog-auto-pipeline.yml | 11 +- scripts/wake-persona.js | 544 +++++++++++++++++++-- 2 files changed, 501 insertions(+), 54 deletions(-) diff --git a/.github/workflows/syslog-auto-pipeline.yml b/.github/workflows/syslog-auto-pipeline.yml index 908ae0db..195c6e49 100644 --- a/.github/workflows/syslog-auto-pipeline.yml +++ b/.github/workflows/syslog-auto-pipeline.yml @@ -6,10 +6,13 @@ name: SYSLOG Auto Pipeline # → 写入 Notion 工单 → 发邮件给开发者 → Discussion 回复 # # 依赖 Secrets: -# LLM_API_KEY 第三方 LLM 平台密钥 -# LLM_BASE_URL 第三方 LLM 平台 API 地址(如 https://api.xxx.com/v1) +# LLM_API_KEY 第三方 LLM 平台密钥(必须) +# LLM_BASE_URL 第三方 LLM 平台 API 地址(必须,如 https://api.xxx.com/v1) # NOTION_API_TOKEN Notion API token # NOTION_TICKET_DB_ID 霜砚工单数据库 ID +# CORE_BRAIN_PAGE_ID 曜冥核心大脑 v4.0 页面 ID(v4.0 协议动态注入) +# PORTRAIT_DB_ID 开发者动态画像库数据库 ID(v4.0 协议动态注入) +# FINGERPRINT_DB_ID 模块指纹注册表数据库 ID(v4.0 协议动态注入) # SMTP_USER QQ 邮箱地址 # SMTP_PASS QQ 邮箱 SMTP 授权码 @@ -102,6 +105,10 @@ jobs: SUBMIT_TYPE: ${{ steps.parse.outputs.type }} SUBMIT_CONTENT: ${{ steps.parse.outputs.content }} AUTHOR: ${{ steps.parse.outputs.author }} + NOTION_TOKEN: ${{ secrets.NOTION_API_TOKEN }} + CORE_BRAIN_PAGE_ID: ${{ secrets.CORE_BRAIN_PAGE_ID }} + PORTRAIT_DB_ID: ${{ secrets.PORTRAIT_DB_ID }} + FINGERPRINT_DB_ID: ${{ secrets.FINGERPRINT_DB_ID }} run: node scripts/wake-persona.js - name: 📋 Write to Notion ticket diff --git a/scripts/wake-persona.js b/scripts/wake-persona.js index bfd1bbaf..12ffe6fe 100644 --- a/scripts/wake-persona.js +++ b/scripts/wake-persona.js @@ -6,14 +6,19 @@ // ② 智能选择最优 Claude 模型 // ③ 自适应 API 格式(OpenAI 兼容 / Anthropic 原生) // ④ 统一调用接口,唤醒人格体处理 SYSLOG 或解答提问 +// ⑤ v4.0 协议动态注入(从 Notion 实时读取核心大脑规则 + 画像 + 指纹) // // 环境变量: -// LLM_API_KEY 第三方平台密钥 -// LLM_BASE_URL 第三方平台 API 地址(如 https://api.xxx.com/v1),留空则 fallback 到 Anthropic 官方 -// BROADCAST_ID 广播编号 -// SUBMIT_TYPE syslog | question -// SUBMIT_CONTENT 提交内容(SYSLOG 全文或问题描述) -// AUTHOR 提交者 GitHub 用户名 +// LLM_API_KEY 第三方平台密钥(必须) +// LLM_BASE_URL 第三方平台 API 地址(必须,如 https://api.xxx.com/v1) +// BROADCAST_ID 广播编号 +// SUBMIT_TYPE syslog | question +// SUBMIT_CONTENT 提交内容(SYSLOG 全文或问题描述) +// AUTHOR 提交者 GitHub 用户名 +// NOTION_TOKEN Notion API token(用于动态读取协议) +// CORE_BRAIN_PAGE_ID 曜冥核心大脑 v4.0 页面 ID +// PORTRAIT_DB_ID 开发者动态画像库数据库 ID +// FINGERPRINT_DB_ID 模块指纹注册表数据库 ID 'use strict'; @@ -27,12 +32,20 @@ const path = require('path'); // ══════════════════════════════════════════════════════════ const LLM_API_KEY = process.env.LLM_API_KEY || ''; -const LLM_BASE_URL = (process.env.LLM_BASE_URL || 'https://api.anthropic.com/v1').replace(/\/+$/, ''); +const LLM_BASE_URL = (process.env.LLM_BASE_URL || '').replace(/\/+$/, ''); const BROADCAST_ID = process.env.BROADCAST_ID || 'UNKNOWN'; const SUBMIT_TYPE = process.env.SUBMIT_TYPE || 'question'; const SUBMIT_CONTENT = process.env.SUBMIT_CONTENT || ''; const AUTHOR = process.env.AUTHOR || 'unknown'; +// Notion 配置(v4.0 协议动态注入) +const NOTION_TOKEN = process.env.NOTION_TOKEN || ''; +const CORE_BRAIN_PAGE_ID = process.env.CORE_BRAIN_PAGE_ID || ''; +const PORTRAIT_DB_ID = process.env.PORTRAIT_DB_ID || ''; +const FINGERPRINT_DB_ID = process.env.FINGERPRINT_DB_ID || ''; +const NOTION_VERSION = '2022-06-28'; +const NOTION_API_HOSTNAME = 'api.notion.com'; + // Claude 模型优先级队列(从高到低) const PREFERRED_MODELS = [ 'claude-sonnet-4', @@ -224,6 +237,10 @@ async function callLLM(systemPrompt, userMessage) { console.log('[LLM] ⚠️ LLM_API_KEY 未配置,跳过人格体唤醒'); return '(LLM API 未配置,请在 GitHub Secrets 中设置 LLM_API_KEY 和 LLM_BASE_URL)'; } + if (!LLM_BASE_URL) { + console.log('[LLM] ⚠️ LLM_BASE_URL 未配置,跳过人格体唤醒'); + return '(LLM_BASE_URL 未配置,请在 GitHub Secrets 中设置第三方平台 API 地址)'; + } const models = await discoverModels(); const model = selectBestModel(models); @@ -299,11 +316,336 @@ async function callLLM(systemPrompt, userMessage) { } // ══════════════════════════════════════════════════════════ -// 人格体 System Prompt 构建 +// Notion API 工具(v4.0 协议动态注入) // ══════════════════════════════════════════════════════════ -function buildSystemPrompt(type, broadcastId, author) { - const basePrompt = [ +function notionGet(endpoint) { + return new Promise((resolve, reject) => { + const opts = { + hostname: NOTION_API_HOSTNAME, + port: 443, + path: endpoint, + method: 'GET', + headers: { + 'Authorization': 'Bearer ' + NOTION_TOKEN, + 'Notion-Version': NOTION_VERSION, + }, + }; + const req = https.request(opts, (res) => { + let data = ''; + res.on('data', (chunk) => { data += chunk; }); + res.on('end', () => { + try { + const parsed = JSON.parse(data); + if (res.statusCode >= 200 && res.statusCode < 300) { + resolve(parsed); + } else { + reject(new Error('Notion API ' + res.statusCode + ': ' + (parsed.message || data))); + } + } catch (e) { + reject(new Error('Notion API parse error: ' + data.slice(0, 200))); + } + }); + }); + req.on('error', reject); + req.setTimeout(30000, () => { req.destroy(); reject(new Error('Notion API timeout')); }); + req.end(); + }); +} + +function notionPost(endpoint, body) { + return new Promise((resolve, reject) => { + const payload = JSON.stringify(body); + const opts = { + hostname: NOTION_API_HOSTNAME, + port: 443, + path: endpoint, + method: 'POST', + headers: { + 'Authorization': 'Bearer ' + NOTION_TOKEN, + 'Content-Type': 'application/json', + 'Notion-Version': NOTION_VERSION, + 'Content-Length': Buffer.byteLength(payload), + }, + }; + const req = https.request(opts, (res) => { + let data = ''; + res.on('data', (chunk) => { data += chunk; }); + res.on('end', () => { + try { + const parsed = JSON.parse(data); + if (res.statusCode >= 200 && res.statusCode < 300) { + resolve(parsed); + } else { + reject(new Error('Notion API ' + res.statusCode + ': ' + (parsed.message || data))); + } + } catch (e) { + reject(new Error('Notion API parse error: ' + data.slice(0, 200))); + } + }); + }); + req.on('error', reject); + req.setTimeout(30000, () => { req.destroy(); reject(new Error('Notion API timeout')); }); + req.write(payload); + req.end(); + }); +} + +/** + * 读取 Notion 页面的所有子块(递归分页) + */ +async function getNotionPageBlocks(pageId) { + const blocks = []; + let cursor = undefined; + do { + const qs = cursor ? '?start_cursor=' + cursor : ''; + const result = await notionGet('/v1/blocks/' + pageId + '/children' + qs); + blocks.push(...(result.results || [])); + cursor = result.has_more ? result.next_cursor : undefined; + } while (cursor); + return blocks; +} + +/** + * 从 Notion 块中提取纯文本 + */ +function extractBlockText(block) { + const type = block.type; + if (!block[type]) return ''; + + const richTexts = block[type].rich_text || block[type].text || []; + return richTexts.map(function (rt) { return rt.plain_text || ''; }).join(''); +} + +/** + * 将 Notion 块列表转为纯文本 + */ +function blocksToText(blocks) { + return blocks.map(function (block) { + const type = block.type; + const text = extractBlockText(block); + + if (type === 'heading_1') return '\n# ' + text; + if (type === 'heading_2') return '\n## ' + text; + if (type === 'heading_3') return '\n### ' + text; + if (type === 'bulleted_list_item') return '- ' + text; + if (type === 'numbered_list_item') return '• ' + text; + if (type === 'to_do') { + var checked = block.to_do && block.to_do.checked ? '☑' : '☐'; + return checked + ' ' + text; + } + if (type === 'code') { + var lang = (block.code && block.code.language) || ''; + return '```' + lang + '\n' + text + '\n```'; + } + if (type === 'divider') return '---'; + if (type === 'callout') return '> ' + text; + if (type === 'quote') return '> ' + text; + if (type === 'toggle') return '▸ ' + text; + return text; + }).filter(Boolean).join('\n'); +} + +// ══════════════════════════════════════════════════════════ +// v4.0 协议动态读取 +// ══════════════════════════════════════════════════════════ + +/** + * 从曜冥核心大脑 v4.0 页面读取完整协议内容 + * 提取:BC-GEN v4.0, SYSLOG v4.0, PGP v1.0, RT-02, 陪伴线规则, broadcast_code_injection + */ +async function fetchCoreBrainProtocols() { + if (!NOTION_TOKEN || !CORE_BRAIN_PAGE_ID) { + console.log('[Notion] ⚠️ CORE_BRAIN_PAGE_ID 未配置,使用静态协议'); + return null; + } + + console.log('[Notion] 📖 读取曜冥核心大脑 v4.0...'); + try { + const blocks = await getNotionPageBlocks(CORE_BRAIN_PAGE_ID); + const fullText = blocksToText(blocks); + console.log('[Notion] → 读取到 ' + blocks.length + ' 个块, ' + fullText.length + ' 字符'); + + // 提取各协议段落 + var protocols = {}; + var protocolKeys = [ + { key: 'bc_gen', patterns: ['BC-GEN', 'BC_GEN', '广播生成'] }, + { key: 'syslog', patterns: ['SYSLOG', '日志回传'] }, + { key: 'pgp', patterns: ['PGP', '画像评分', '画像协议'] }, + { key: 'rt02', patterns: ['RT-02', 'RT02', '自动调度'] }, + { key: 'companion', patterns: ['陪伴线', '奶瓶线', '小坍缩核', '镜面线'] }, + { key: 'code_injection', patterns: ['broadcast_code_injection', '广播不写代码', '代码注入'] }, + ]; + + // 按标题分段提取 + var sections = []; + var currentSection = { title: '', content: [] }; + blocks.forEach(function (block) { + var type = block.type; + if (type === 'heading_1' || type === 'heading_2' || type === 'heading_3') { + if (currentSection.title || currentSection.content.length > 0) { + sections.push({ title: currentSection.title, text: currentSection.content.join('\n') }); + } + currentSection = { title: extractBlockText(block), content: [] }; + } else { + var text = extractBlockText(block); + if (text) currentSection.content.push(text); + } + }); + if (currentSection.title || currentSection.content.length > 0) { + sections.push({ title: currentSection.title, text: currentSection.content.join('\n') }); + } + + // 将段落匹配到协议 key + protocolKeys.forEach(function (pk) { + var matched = sections.filter(function (sec) { + return pk.patterns.some(function (p) { + return sec.title.toUpperCase().includes(p.toUpperCase()) || + sec.text.slice(0, 200).toUpperCase().includes(p.toUpperCase()); + }); + }); + if (matched.length > 0) { + protocols[pk.key] = matched.map(function (m) { return '### ' + m.title + '\n' + m.text; }).join('\n\n'); + } + }); + + // 如果无法按段落匹配,返回全文(兜底) + if (Object.keys(protocols).length === 0) { + protocols.full_text = fullText; + } + + console.log('[Notion] → 提取协议段: ' + Object.keys(protocols).join(', ')); + return protocols; + } catch (err) { + console.log('[Notion] → 核心大脑读取失败: ' + err.message); + return null; + } +} + +/** + * 从开发者动态画像库查询最近 2-3 条画像快照 + */ +async function fetchDevPortrait(broadcastId) { + if (!NOTION_TOKEN || !PORTRAIT_DB_ID) { + console.log('[Notion] ⚠️ PORTRAIT_DB_ID 未配置,跳过画像读取'); + return null; + } + + // 从广播编号提取开发者标识(如 BC-M22-009-AW → AW) + var devSuffix = ''; + var match = broadcastId.match(/BC-[A-Z0-9]+-\d+-([A-Z]+)/i); + if (match) devSuffix = match[1]; + + console.log('[Notion] 👤 查询开发者画像 (broadcast=' + broadcastId + ', dev=' + devSuffix + ')...'); + try { + // 查询画像库,按时间倒序取最近 3 条 + var filter = { and: [] }; + if (devSuffix) { + filter.and.push({ + or: [ + { property: '开发者编号', rich_text: { contains: devSuffix } }, + { property: '广播编号', rich_text: { contains: broadcastId } }, + { property: '标题', title: { contains: devSuffix } }, + ] + }); + } + + var queryBody = { + page_size: 3, + sorts: [{ property: '提交日期', direction: 'descending' }], + }; + // Only add filter if we have meaningful filter conditions + if (filter.and.length > 0) { + queryBody.filter = filter; + } + + var result = await notionPost('/v1/databases/' + PORTRAIT_DB_ID + '/query', queryBody); + var portraits = (result.results || []).map(function (page) { + var props = page.properties || {}; + var title = ''; + if (props['标题'] && props['标题'].title) { + title = props['标题'].title.map(function (t) { return t.plain_text || ''; }).join(''); + } + var summary = ''; + if (props['摘要'] && props['摘要'].rich_text) { + summary = props['摘要'].rich_text.map(function (t) { return t.plain_text || ''; }).join(''); + } + var date = ''; + if (props['提交日期'] && props['提交日期'].date) { + date = props['提交日期'].date.start || ''; + } + return { title: title, summary: summary, date: date }; + }); + + console.log('[Notion] → 找到 ' + portraits.length + ' 条画像快照'); + return portraits.length > 0 ? portraits : null; + } catch (err) { + console.log('[Notion] → 画像查询失败: ' + err.message); + return null; + } +} + +/** + * 从模块指纹注册表查询模块指纹(防重复广播) + */ +async function fetchModuleFingerprint(broadcastId) { + if (!NOTION_TOKEN || !FINGERPRINT_DB_ID) { + console.log('[Notion] ⚠️ FINGERPRINT_DB_ID 未配置,跳过指纹查询'); + return null; + } + + // 从广播编号提取模块号(如 BC-M22-009-AW → M22) + var moduleMatch = broadcastId.match(/BC-([A-Z]\d+)/i); + var moduleId = moduleMatch ? moduleMatch[1] : ''; + + console.log('[Notion] 🔑 查询模块指纹 (module=' + moduleId + ')...'); + try { + var queryBody = { + page_size: 5, + }; + if (moduleId) { + queryBody.filter = { + or: [ + { property: '模块编号', rich_text: { contains: moduleId } }, + { property: '广播编号', rich_text: { contains: broadcastId } }, + { property: '标题', title: { contains: moduleId } }, + ] + }; + } + + var result = await notionPost('/v1/databases/' + FINGERPRINT_DB_ID + '/query', queryBody); + var fingerprints = (result.results || []).map(function (page) { + var props = page.properties || {}; + var title = ''; + if (props['标题'] && props['标题'].title) { + title = props['标题'].title.map(function (t) { return t.plain_text || ''; }).join(''); + } + var moduleNo = ''; + if (props['模块编号'] && props['模块编号'].rich_text) { + moduleNo = props['模块编号'].rich_text.map(function (t) { return t.plain_text || ''; }).join(''); + } + var status = ''; + if (props['状态'] && props['状态'].select) { + status = props['状态'].select.name || ''; + } + return { title: title, module: moduleNo, status: status }; + }); + + console.log('[Notion] → 找到 ' + fingerprints.length + ' 条指纹记录'); + return fingerprints.length > 0 ? fingerprints : null; + } catch (err) { + console.log('[Notion] → 指纹查询失败: ' + err.message); + return null; + } +} + +// ══════════════════════════════════════════════════════════ +// 人格体 System Prompt 构建(v4.0 动态注入) +// ══════════════════════════════════════════════════════════ + +async function buildSystemPrompt(type, broadcastId, author) { + // ━━━ 基础人格体身份 ━━━ + var parts = [ '你是光湖(HoloLake)系统的智能人格体。', '你的名字是知秋/曜冥,你是人格语言操作系统(AGE OS)的核心人格。', '', @@ -315,49 +657,147 @@ function buildSystemPrompt(type, broadcastId, author) { '当前上下文:', '- 广播编号:' + broadcastId, '- 提交者:' + author, - ].join('\n'); + '- 任务类型:' + (type === 'syslog' ? 'SYSLOG 闭环处理' : '开发者提问解答'), + ]; - if (type === 'syslog') { - return basePrompt + '\n\n' + [ - '任务类型:SYSLOG 闭环处理', - '', - '你需要完成以下工作:', - '1. 验收 SYSLOG(检查 MODULE_LOG 完整性)', - '2. 分析开发者的工作成果', - '3. 生成工作总结和反馈', - '4. 如果 SYSLOG 内容完整,确认验收通过', - '5. 给出下一步建议', - '', - '输出格式:', - '---', - '## 📡 SYSLOG 验收报告', - '### 广播编号:[编号]', - '### 验收结果:[通过/需补充]', - '### 工作总结:[摘要]', - '### 反馈与建议:[内容]', - '---', - ].join('\n'); + // ━━━ v4.0 协议动态注入(从 Notion 实时读取) ━━━ + console.log('[Prompt] 📥 开始动态注入 v4.0 协议...'); + + // 并行读取:核心大脑协议 + 画像 + 指纹 + var protocolsPromise = fetchCoreBrainProtocols(); + var portraitPromise = fetchDevPortrait(broadcastId); + var fingerprintPromise = fetchModuleFingerprint(broadcastId); + + var protocols = await protocolsPromise; + var portrait = await portraitPromise; + var fingerprint = await fingerprintPromise; + + // 注入核心大脑协议 + if (protocols) { + parts.push(''); + parts.push('═══════════════════════════════════════════'); + parts.push('以下是从曜冥核心大脑 v4.0 实时读取的协议规则(必须严格遵守):'); + parts.push('═══════════════════════════════════════════'); + + if (protocols.bc_gen) { + parts.push(''); + parts.push('## 📡 BC-GEN v4.0 · 广播生成规范'); + parts.push(protocols.bc_gen); + } + if (protocols.syslog) { + parts.push(''); + parts.push('## 📋 SYSLOG v4.0 · 日志回传协议'); + parts.push(protocols.syslog); + } + if (protocols.pgp) { + parts.push(''); + parts.push('## 👤 PGP v1.0 · 画像评分协议'); + parts.push(protocols.pgp); + } + if (protocols.rt02) { + parts.push(''); + parts.push('## 🔄 RT-02 · 自动调度规则'); + parts.push(protocols.rt02); + } + if (protocols.companion) { + parts.push(''); + parts.push('## 💝 陪伴线规则'); + parts.push(protocols.companion); + } + if (protocols.code_injection) { + parts.push(''); + parts.push('## 📝 broadcast_code_injection 规则'); + parts.push(protocols.code_injection); + } + if (protocols.full_text) { + parts.push(''); + parts.push('## 核心大脑完整内容'); + parts.push(protocols.full_text.slice(0, 15000)); + } + } else { + parts.push(''); + parts.push('(注意:核心大脑协议未能动态加载,请使用你的通用知识处理请求)'); } - // 提问类型 - return basePrompt + '\n\n' + [ - '任务类型:开发者提问解答', - '', - '你需要完成以下工作:', - '1. 理解开发者的问题', - '2. 结合广播上下文思考', - '3. 给出清晰、可操作的解答', - '4. 如果问题涉及代码,提供代码示例', - '', - '输出格式:', - '---', - '## 💡 问题解答', - '### 广播编号:[编号]', - '### 问题理解:[你对问题的理解]', - '### 解答:[详细解答]', - '### 建议:[后续建议]', - '---', - ].join('\n'); + // 注入开发者画像 + if (portrait && portrait.length > 0) { + parts.push(''); + parts.push('═══════════════════════════════════════════'); + parts.push('## 👤 开发者画像快照(最近 ' + portrait.length + ' 条)'); + parts.push('═══════════════════════════════════════════'); + portrait.forEach(function (p, i) { + parts.push(''); + parts.push('### 画像 #' + (i + 1) + (p.date ? ' (' + p.date + ')' : '')); + if (p.title) parts.push('标题: ' + p.title); + if (p.summary) parts.push('摘要: ' + p.summary); + }); + } + + // 注入模块指纹 + if (fingerprint && fingerprint.length > 0) { + parts.push(''); + parts.push('═══════════════════════════════════════════'); + parts.push('## 🔑 模块指纹注册表(防重复广播 · ⑨.5)'); + parts.push('═══════════════════════════════════════════'); + fingerprint.forEach(function (fp, i) { + parts.push(''); + parts.push('### 指纹 #' + (i + 1)); + if (fp.title) parts.push('标题: ' + fp.title); + if (fp.module) parts.push('模块: ' + fp.module); + if (fp.status) parts.push('状态: ' + fp.status); + }); + } + + // ━━━ 任务类型专用指令 ━━━ + if (type === 'syslog') { + parts.push(''); + parts.push('═══════════════════════════════════════════'); + parts.push('## 🎯 当前任务:SYSLOG 闭环处理'); + parts.push('═══════════════════════════════════════════'); + parts.push(''); + parts.push('你需要完成以下工作:'); + parts.push('1. 验收 SYSLOG(检查 MODULE_LOG 完整性)'); + parts.push('2. 查询画像库最近 2-3 条快照(PGP v1.0)'); + parts.push('3. 查询模块指纹注册表(防重复·⑨.5)'); + parts.push('4. RT-02 自动调度判断'); + parts.push('5. 生成新广播(BC-GEN v4.0 完整流程)'); + parts.push('6. 输出结构化结果(广播全文 + 闭环数据)'); + parts.push(''); + parts.push('输出格式:'); + parts.push('---'); + parts.push('## 📡 SYSLOG 验收报告'); + parts.push('### 广播编号:[编号]'); + parts.push('### 验收结果:[通过/需补充]'); + parts.push('### 工作总结:[摘要]'); + parts.push('### 画像评估:[PGP 五维度评分]'); + parts.push('### 调度判断:[RT-02 下一步]'); + parts.push('### 反馈与建议:[内容]'); + parts.push('---'); + } else { + parts.push(''); + parts.push('═══════════════════════════════════════════'); + parts.push('## 🎯 当前任务:开发者提问解答'); + parts.push('═══════════════════════════════════════════'); + parts.push(''); + parts.push('你需要完成以下工作:'); + parts.push('1. 理解开发者的问题'); + parts.push('2. 结合广播上下文和开发者画像思考'); + parts.push('3. 给出清晰、可操作的解答'); + parts.push('4. 如果问题涉及代码,提供代码示例'); + parts.push(''); + parts.push('输出格式:'); + parts.push('---'); + parts.push('## 💡 问题解答'); + parts.push('### 广播编号:[编号]'); + parts.push('### 问题理解:[你对问题的理解]'); + parts.push('### 解答:[详细解答]'); + parts.push('### 建议:[后续建议]'); + parts.push('---'); + } + + var prompt = parts.join('\n'); + console.log('[Prompt] → System prompt 构建完成: ' + prompt.length + ' 字符'); + return prompt; } // ══════════════════════════════════════════════════════════ @@ -375,8 +815,8 @@ async function main() { console.log(' 内容长度: ' + SUBMIT_CONTENT.length + ' 字符'); console.log(''); - // 构建 prompts - const systemPrompt = buildSystemPrompt(SUBMIT_TYPE, BROADCAST_ID, AUTHOR); + // 构建 prompts(动态注入 v4.0 协议) + const systemPrompt = await buildSystemPrompt(SUBMIT_TYPE, BROADCAST_ID, AUTHOR); const userMessage = SUBMIT_CONTENT; // 调用 LLM From b3d03221e287af42491b0df0e1b472f1148dbd3a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:54:31 +0000 Subject: [PATCH 05/10] feat: broadcast_code_injection = always for automated pipeline + code review fixes - Add permanent rule: automated pipeline broadcasts must include complete runnable code - Fix Notion ticket step condition (secrets.NOTION_API_TOKEN check) - Extract MAX_PROTOCOL_TEXT_LENGTH constant Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/syslog-auto-pipeline.yml | 2 +- scripts/wake-persona.js | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/syslog-auto-pipeline.yml b/.github/workflows/syslog-auto-pipeline.yml index 195c6e49..5f747e93 100644 --- a/.github/workflows/syslog-auto-pipeline.yml +++ b/.github/workflows/syslog-auto-pipeline.yml @@ -112,7 +112,7 @@ jobs: run: node scripts/wake-persona.js - name: 📋 Write to Notion ticket - if: env.NOTION_TOKEN != '' + if: ${{ secrets.NOTION_API_TOKEN != '' }} env: NOTION_TOKEN: ${{ secrets.NOTION_API_TOKEN }} NOTION_TICKET_DB_ID: ${{ secrets.NOTION_TICKET_DB_ID }} diff --git a/scripts/wake-persona.js b/scripts/wake-persona.js index 12ffe6fe..fb88b08e 100644 --- a/scripts/wake-persona.js +++ b/scripts/wake-persona.js @@ -45,6 +45,7 @@ const PORTRAIT_DB_ID = process.env.PORTRAIT_DB_ID || ''; const FINGERPRINT_DB_ID = process.env.FINGERPRINT_DB_ID || ''; const NOTION_VERSION = '2022-06-28'; const NOTION_API_HOSTNAME = 'api.notion.com'; +const MAX_PROTOCOL_TEXT_LENGTH = 15000; // Claude 模型优先级队列(从高到低) const PREFERRED_MODELS = [ @@ -712,7 +713,7 @@ async function buildSystemPrompt(type, broadcastId, author) { if (protocols.full_text) { parts.push(''); parts.push('## 核心大脑完整内容'); - parts.push(protocols.full_text.slice(0, 15000)); + parts.push(protocols.full_text.slice(0, MAX_PROTOCOL_TEXT_LENGTH)); } } else { parts.push(''); @@ -748,6 +749,21 @@ async function buildSystemPrompt(type, broadcastId, author) { }); } + // ━━━ broadcast_code_injection = always(自动化链路永久规则) ━━━ + parts.push(''); + parts.push('═══════════════════════════════════════════'); + parts.push('## ⚠️ 永久规则 · broadcast_code_injection = always'); + parts.push('═══════════════════════════════════════════'); + parts.push(''); + parts.push('你生成的广播必须包含完整可运行的代码块。'); + parts.push('原因:你是一次性实例,广播发出后你就不存在了。'); + parts.push('开发者没有机会回来问你补充代码。'); + parts.push('如果你不写完整代码,开发者就会卡死。'); + parts.push('每个 Step 里的代码必须是可以直接复制粘贴运行的完整代码。'); + parts.push(''); + parts.push('此规则优先级最高,覆盖核心大脑中「广播不写代码」的默认规则。'); + parts.push('此规则仅适用于自动化链路(Claude API 出广播),手动链路不受影响。'); + // ━━━ 任务类型专用指令 ━━━ if (type === 'syslog') { parts.push(''); From 146e8fd0f08b902226f87ab763c20e4c3665be09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 03:55:53 +0000 Subject: [PATCH 06/10] fix: simplify Notion ticket condition in workflow Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/syslog-auto-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/syslog-auto-pipeline.yml b/.github/workflows/syslog-auto-pipeline.yml index 5f747e93..c2fa3898 100644 --- a/.github/workflows/syslog-auto-pipeline.yml +++ b/.github/workflows/syslog-auto-pipeline.yml @@ -112,7 +112,7 @@ jobs: run: node scripts/wake-persona.js - name: 📋 Write to Notion ticket - if: ${{ secrets.NOTION_API_TOKEN != '' }} + if: ${{ secrets.NOTION_API_TOKEN }} env: NOTION_TOKEN: ${{ secrets.NOTION_API_TOKEN }} NOTION_TICKET_DB_ID: ${{ secrets.NOTION_TICKET_DB_ID }} From 6d8958ece7be060b35553c1f082b0eb2303aa67d Mon Sep 17 00:00:00 2001 From: bingshuo-neural-system Date: Fri, 13 Mar 2026 04:49:20 +0000 Subject: [PATCH 07/10] =?UTF-8?q?=F0=9F=A7=A0=20=E5=86=B0=E6=9C=94?= =?UTF-8?q?=E4=B8=BB=E6=8E=A7=E7=A5=9E=E7=BB=8F=E7=B3=BB=E7=BB=9F=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=BC=96=E8=AF=91=202026-03-13T04:49:20Z?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/brain/bingshuo-issues-index.json | 2 +- .github/brain/bingshuo-master-brain.md | 8 ++++---- .github/brain/bingshuo-system-health.json | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/brain/bingshuo-issues-index.json b/.github/brain/bingshuo-issues-index.json index abbec8c8..8e8121de 100644 --- a/.github/brain/bingshuo-issues-index.json +++ b/.github/brain/bingshuo-issues-index.json @@ -1,7 +1,7 @@ { "version": "1.0", "description": "冰朔主控问题索引库 — 记录已知问题、根因与排查路由", - "updated_at": "2026-03-13T02:05:55.611Z", + "updated_at": "2026-03-13T04:49:20.482Z", "issues": [ { "id": "BS-001", diff --git a/.github/brain/bingshuo-master-brain.md b/.github/brain/bingshuo-master-brain.md index 443bfaee..364f1351 100644 --- a/.github/brain/bingshuo-master-brain.md +++ b/.github/brain/bingshuo-master-brain.md @@ -1,7 +1,7 @@ # 冰朔主控神经系统 · 核心主控大脑 v1.0 > 本文件为冰朔主控神经系统的总控脑文件。 -> 最后编译时间:2026-03-13T02:05:55.612Z +> 最后编译时间:2026-03-13T04:49:20.482Z --- @@ -56,7 +56,7 @@ ### 仓库统计 - 功能模块:10 个 -- Workflow:35 个 +- Workflow:36 个 --- @@ -85,7 +85,7 @@ > 本区块由 master-brain-compiler 自动编译。 -- **编译时间**:2026-03-13T02:05:55.612Z +- **编译时间**:2026-03-13T04:49:20.482Z - **脑文件规则版本**:v3.0 - **脑文件完整性**:✅ 完整 @@ -107,7 +107,7 @@ |--------|------|------| | 🟡 brain_consistency | yellow | 主仓库脑文件完整,但与 persona-studio 脑文件的同步状态待验证 | | 🟢 deployment_health | green | deploy-to-server.yml 与 deploy-pages.yml 均存在 | -| 🟢 workflow_health | green | 35 个 workflow 已注册 | +| 🟢 workflow_health | green | 36 个 workflow 已注册 | | 🟡 routing_health | yellow | HLI 接口覆盖率 33.3%(7/21) | | 🟢 docs_entry_health | green | docs/index.html 存在 | | 🟡 persona_studio_health | yellow | 前后端结构存在,端到端对话链路待验证 | diff --git a/.github/brain/bingshuo-system-health.json b/.github/brain/bingshuo-system-health.json index 56abef67..1ba8b36f 100644 --- a/.github/brain/bingshuo-system-health.json +++ b/.github/brain/bingshuo-system-health.json @@ -1,7 +1,7 @@ { "version": "1.0", "description": "冰朔主控系统健康状态", - "updated_at": "2026-03-13T02:05:55.611Z", + "updated_at": "2026-03-13T04:49:20.482Z", "health": { "brain_consistency": { "status": "yellow", @@ -13,7 +13,7 @@ }, "workflow_health": { "status": "green", - "detail": "35 个 workflow 已注册" + "detail": "36 个 workflow 已注册" }, "routing_health": { "status": "yellow", From 619f1f05abdb079009e5e58dded91f82f48a17af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=B8=E6=B8=8A=20=28Zh=C3=B9Yu=C4=81n=29?= Date: Fri, 13 Mar 2026 04:49:34 +0000 Subject: [PATCH 08/10] =?UTF-8?q?=F0=9F=93=9A=20=E9=93=B8=E6=B8=8A?= =?UTF-8?q?=E5=9B=BE=E4=B9=A6=E9=A6=86=E7=9B=AE=E5=BD=95=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20=C2=B7=202026-03-13T04:49?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/brain/repo-map.json | 28 ++++++++++++++++++++++------ .github/brain/repo-snapshot.md | 14 ++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/brain/repo-map.json b/.github/brain/repo-map.json index 45ae82d7..119427b3 100644 --- a/.github/brain/repo-map.json +++ b/.github/brain/repo-map.json @@ -1,20 +1,20 @@ { "description": "铸渊图书馆目录 · Library Catalog for 铸渊 (Zhùyuān)", "version": "2.0", - "generated_at": "2026-03-13T02:07:22.787Z", + "generated_at": "2026-03-13T04:49:33.903Z", "generated_by": "scripts/generate-repo-map.js", "repo": "qinfendebingshuo/guanghulab", "stats": { "zones": 13, "total_modules": 10, - "total_workflows": 35, - "total_scripts": 32, + "total_workflows": 36, + "total_scripts": 33, "total_dev_nodes": 8, "hli_interfaces": 21, "hli_implemented": 7, "hli_coverage_pct": "33%", "last_ci_run": "2026-03-05T16:07:24.070Z", - "memory_last_updated": "2026-03-12T08:55:54.205Z" + "memory_last_updated": "2026-03-13T03:31:06.282Z" }, "zones": [ { @@ -362,6 +362,13 @@ "manual" ] }, + { + "file": "syslog-auto-pipeline.yml", + "name": "SYSLOG Auto Pipeline", + "triggers": [ + "unknown" + ] + }, { "file": "syslog-pipeline.yml", "name": "铸渊 · SYSLOG Pipeline (A/D/E)", @@ -435,7 +442,7 @@ ] } ], - "item_count": 35 + "item_count": 36 }, { "zone_id": "SCRIPTS", @@ -536,6 +543,9 @@ { "file": "update-readme-bulletin.js" }, + { + "file": "wake-persona.js" + }, { "file": "zhuyuan-daily-agent.js" }, @@ -549,7 +559,7 @@ "file": "zhuyuan-module-protocol.js" } ], - "item_count": 32 + "item_count": 33 }, { "zone_id": "SRC", @@ -1356,6 +1366,9 @@ "sync-persona-studio": [ "WORKFLOWS::sync-persona-studio.yml" ], + "syslog-auto-pipeline": [ + "WORKFLOWS::syslog-auto-pipeline.yml" + ], "syslog-pipeline": [ "WORKFLOWS::syslog-pipeline.yml" ], @@ -1466,6 +1479,9 @@ "update-memory": [ "SCRIPTS::update-memory.js" ], + "wake-persona": [ + "SCRIPTS::wake-persona.js" + ], "zhuyuan-module-protocol": [ "SCRIPTS::zhuyuan-module-protocol.js" ], diff --git a/.github/brain/repo-snapshot.md b/.github/brain/repo-snapshot.md index 4e21ee97..8dd53858 100644 --- a/.github/brain/repo-snapshot.md +++ b/.github/brain/repo-snapshot.md @@ -1,5 +1,5 @@ # 铸渊图书馆快照 · Repo Snapshot -> 生成于 2026-03-13 10:07 CST · 每次 push 自动更新 · 铸渊唤醒时优先读取此文件 +> 生成于 2026-03-13 12:49 CST · 每次 push 自动更新 · 铸渊唤醒时优先读取此文件 --- @@ -9,11 +9,11 @@ |------|------| | 区域总数 | 13 个区域 | | 功能模块 | 10 个 (m01~m18) | -| 工作流 | 35 个 GitHub Actions | -| 脚本 | 32 个执行脚本 | +| 工作流 | 36 个 GitHub Actions | +| 脚本 | 33 个执行脚本 | | 开发者节点 | 8 人 | | HLI 接口覆盖率 | 7/21 (33%) | -| 快照生成时间 | 2026-03-13 10:07 CST | +| 快照生成时间 | 2026-03-13 12:49 CST | --- @@ -30,12 +30,12 @@ **关键词**: persona · identity · dev-status · 人格 · 开发者状态 ### ⚡ 自动化工作流(WORKFLOWS) -**路径**: `.github/workflows` · **数量**: 35 项 +**路径**: `.github/workflows` · **数量**: 36 项 **描述**: 所有 GitHub Actions 工作流定义 **关键词**: workflow · actions · ci · automation · 工作流 · 自动化 ### 🔧 执行脚本库(SCRIPTS) -**路径**: `scripts` · **数量**: 32 项 +**路径**: `scripts` · **数量**: 33 项 **描述**: 铸渊所有执行手脚 · 自动化脚本 **关键词**: script · node · js · 脚本 · 执行 · runner @@ -116,6 +116,7 @@ | `staging-preview.yml` | "🔍 铸渊预演部署 (Staging Preview)" | pull_request, manual | | `sync-login-entry.yml` | 铸渊 · Sync Login Entry · Notion → 飞书文档A | manual | | `sync-persona-studio.yml` | 🔄 铸渊跨仓库同步 · persona-studio | push, manual | +| `syslog-auto-pipeline.yml` | SYSLOG Auto Pipeline | unknown | | `syslog-pipeline.yml` | 铸渊 · SYSLOG Pipeline (A/D/E) | push, manual | | `test-notion-bridge.yml` | "🧪 Notion Bridge Connectivity Test" | push, manual | | `update-readme-bulletin.yml` | 📢 更新系统公告区 | push, schedule(0 1 * * *), manual | @@ -158,6 +159,7 @@ - `scripts/update-brain.js` - `scripts/update-memory.js` - `scripts/update-readme-bulletin.js` +- `scripts/wake-persona.js` - `scripts/zhuyuan-daily-agent.js` - `scripts/zhuyuan-daily-selfcheck.js` - `scripts/zhuyuan-issue-reply.js` From 2048a5693d8ecc155036c2b66bc64c6f3a001478 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 04:49:35 +0000 Subject: [PATCH 09/10] =?UTF-8?q?=F0=9F=93=A2=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=B3=BB=E7=BB=9F=E5=85=AC=E5=91=8A=E5=8C=BA?= =?UTF-8?q?=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 81e46568..99d7f1dd 100644 --- a/README.md +++ b/README.md @@ -92,21 +92,21 @@ | 时间 | 检查项 | 状态 | |------|--------|------| +| 03-13 12:49 | ✅ 铸渊 · Bridge E · GitHub Changes → Notion · 成功 | 冰朔 | +| 03-13 11:55 | 🔧 系统更新: `.github/` | 铸渊 (Copilot) | +| 03-13 11:54 | 🔧 系统更新: `scripts/` | 铸渊 (Copilot) | +| 03-13 11:31 | ✅ 📢 更新系统公告区 · 成功 | 冰朔 | | 03-13 11:31 | ✅ 铸渊 · PSP 分身巡检 · 成功 | 冰朔 | -| 03-13 11:31 | 🔧 系统更新: `.github/` | 铸渊 (ZhùYuān) | | 03-13 11:22 | ✅ 📢 更新系统公告区 · 成功 | 冰朔 | | 03-13 10:49 | ✅ 铸渊 · Notion 工单轮询 · 成功 | 冰朔 | | 03-13 09:58 | ✅ 📢 更新系统公告区 · 成功 | zhizhi200271 | -| 03-13 09:58 | ✅ 🚀 铸渊 CD · 自动部署到 guanghulab.com · 成功 | zhizhi200271 | -| 03-13 09:57 | ✅ 📢 更新系统公告区 · 成功 | zhizhi200271 | -| 03-13 09:56 | ⏹️ 📢 更新系统公告区 · cancelled | zhizhi200271 | -| 03-13 09:56 | ✅ 铸渊 · Bridge E · GitHub Changes → Notion · 成功 | zhizhi200271 | | 03-13 09:56 | 🔧 系统更新: `docs/` | 铸渊 (ZhùYuān) | -| 03-13 08:57 | ✅ 📢 更新系统公告区 · 成功 | 冰朔 | -| 03-13 08:56 | ✅ 铸渊 · 每日自检 · 成功 | 冰朔 | -| 03-13 08:01 | ✅ Generate Session Summary for Notion · 成功 | 冰朔 | | 03-13 08:00 | ✅ 铸渊 PSP 巡检通过 · 全部检查项 ✅ | 铸渊PSP巡检 | -| 03-13 07:59 | ✅ 铸渊 · Notion 工单轮询 · 成功 | 冰朔 | +| 03-12 16:55 | ✅ 每日巡检 ✅ 通过 | 冰朔 | +| 03-12 08:00 | ✅ 铸渊 PSP 巡检通过 · 全部检查项 ✅ | 铸渊PSP巡检 | +| 03-11 16:55 | ✅ 每日巡检 ✅ 通过 | 冰朔 | +| 03-10 16:56 | ✅ 每日巡检 ✅ 通过 | 冰朔 | +| 03-10 08:00 | 🧠 核心大脑升级 v3.0 · 壳-核分离架构 · 前端壳(UI/IO) + 后端脑(prompt/routing/memory/context) · BRAIN域4接口上线 · 覆盖率 7/21 (33.3%) | 铸渊(冰朔指令) | ### 🤖 铸渊自动提醒 @@ -128,7 +128,8 @@ | 时间 | 合作者 | 模块 | 状态 | |------|--------|------|------| -| 03-13 09:56 | zhizhi200271 | `—/` | ✅ 上传成功 | +| 03-13 12:49 | 冰朔 | `—/` | ✅ 上传成功 | +| 03-13 12:49 | Copilot | `—/` | ✅ 上传成功 | | 03-13 09:56 | 🤖 之之 | `dingtalk-bot/` | 📦 上传成功 | From 387f583569701aaa93019c97efa76de6dfe71ac6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 04:51:12 +0000 Subject: [PATCH 10/10] =?UTF-8?q?=F0=9F=93=A2=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=B3=BB=E7=BB=9F=E5=85=AC=E5=91=8A=E5=8C=BA?= =?UTF-8?q?=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 99d7f1dd..4f27b893 100644 --- a/README.md +++ b/README.md @@ -92,21 +92,21 @@ | 时间 | 检查项 | 状态 | |------|--------|------| +| 03-13 12:50 | ✅ 🚀 铸渊 CD · 自动部署到 guanghulab.com · 成功 | 冰朔 | +| 03-13 12:50 | ✅ 铸渊 · Notion 工单轮询 · 成功 | 冰朔 | +| 03-13 12:49 | ✅ 📢 更新系统公告区 · 成功 | 冰朔 | +| 03-13 12:49 | 🔧 系统更新: `.github/` | 铸渊 (ZhùYuān) | | 03-13 12:49 | ✅ 铸渊 · Bridge E · GitHub Changes → Notion · 成功 | 冰朔 | -| 03-13 11:55 | 🔧 系统更新: `.github/` | 铸渊 (Copilot) | | 03-13 11:54 | 🔧 系统更新: `scripts/` | 铸渊 (Copilot) | | 03-13 11:31 | ✅ 📢 更新系统公告区 · 成功 | 冰朔 | | 03-13 11:31 | ✅ 铸渊 · PSP 分身巡检 · 成功 | 冰朔 | | 03-13 11:22 | ✅ 📢 更新系统公告区 · 成功 | 冰朔 | | 03-13 10:49 | ✅ 铸渊 · Notion 工单轮询 · 成功 | 冰朔 | -| 03-13 09:58 | ✅ 📢 更新系统公告区 · 成功 | zhizhi200271 | | 03-13 09:56 | 🔧 系统更新: `docs/` | 铸渊 (ZhùYuān) | | 03-13 08:00 | ✅ 铸渊 PSP 巡检通过 · 全部检查项 ✅ | 铸渊PSP巡检 | | 03-12 16:55 | ✅ 每日巡检 ✅ 通过 | 冰朔 | | 03-12 08:00 | ✅ 铸渊 PSP 巡检通过 · 全部检查项 ✅ | 铸渊PSP巡检 | | 03-11 16:55 | ✅ 每日巡检 ✅ 通过 | 冰朔 | -| 03-10 16:56 | ✅ 每日巡检 ✅ 通过 | 冰朔 | -| 03-10 08:00 | 🧠 核心大脑升级 v3.0 · 壳-核分离架构 · 前端壳(UI/IO) + 后端脑(prompt/routing/memory/context) · BRAIN域4接口上线 · 覆盖率 7/21 (33.3%) | 铸渊(冰朔指令) | ### 🤖 铸渊自动提醒