From 6b41f85acc1e79ed3d618bbdb7bec197eede2b12 Mon Sep 17 00:00:00 2001 From: guanghu-awen-bridge Date: Tue, 24 Mar 2026 12:18:39 +0000 Subject: [PATCH] Sync from WENZHUOXI/guanghu-Awen at 2026-03-24T12:18:39Z --- federation/awen/latest-sync.json | 4 +- .../awen/workspace/scripts/skyeye/scan.js | 78 +++++++++++++++++++ 2 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 federation/awen/workspace/scripts/skyeye/scan.js diff --git a/federation/awen/latest-sync.json b/federation/awen/latest-sync.json index 85dffd00..9cde65c9 100644 --- a/federation/awen/latest-sync.json +++ b/federation/awen/latest-sync.json @@ -1,7 +1,7 @@ { "source": "WENZHUOXI/guanghu-Awen", "branch": "main", - "commit": "e74e7691256bcded40472537cfa3a25d37654804", - "timestamp": "2026-03-24T11:08:15Z", + "commit": "96bcccd3640f226a818568fed96f75f4a096a5ff", + "timestamp": "2026-03-24T12:18:37Z", "developer": "awen" } diff --git a/federation/awen/workspace/scripts/skyeye/scan.js b/federation/awen/workspace/scripts/skyeye/scan.js new file mode 100644 index 00000000..839d509b --- /dev/null +++ b/federation/awen/workspace/scripts/skyeye/scan.js @@ -0,0 +1,78 @@ +// 知秋天眼 · 仓库自扫描引擎 +// 指令编号:ZQ-PERSONA-INIT-2026-0323-001 +// 每次天眼醒来后执行,扫描整个仓库状态 + +const fs = require('fs'); +const crypto = require('crypto'); + +// 主权区文件列表(天眼系统核心文件) +const SOVEREIGN_FILES = [ + '.github/persona-brain/config.json', + '.github/persona-brain/status.json', + 'scripts/skyeye/scan.js', + 'scripts/skyeye/checkin.js', + '.github/workflows/skyeye-wake.yml', + '.github/guanghu-language-shell.json' +]; + +// 计算主权区签名哈希(身份证) +function computeSignatureHash() { + const hash = crypto.createHash('sha256'); + for (const file of SOVEREIGN_FILES) { + if (fs.existsSync(file)) { + hash.update(fs.readFileSync(file)); + } else { + hash.update('MISSING:' + file); + } + } + return hash.digest('hex'); +} + +// 扫描仓库 +function scanRepo() { + const report = { + timestamp: new Date().toISOString(), + persona: '知秋', + persona_id: 'PER-ZQ001', + dev_id: 'DEV-012', + repo: 'WENZHUOXI/guanghu-awen', + signature_hash: computeSignatureHash(), + brain_intact: fs.existsSync('.github/persona-brain/config.json'), + skyeye_intact: fs.existsSync('scripts/skyeye/scan.js'), + language_shell_intact: fs.existsSync('.github/guanghu-language-shell.json'), + sovereign_files: {}, + repo_summary: {} + }; + + // 逐项检查主权区文件 + for (const file of SOVEREIGN_FILES) { + report.sovereign_files[file] = { + exists: fs.existsSync(file), + hash: fs.existsSync(file) + ? crypto.createHash('md5').update(fs.readFileSync(file)).digest('hex') + : null + }; + } + + // 仓库概况 + try { + const rootEntries = fs.readdirSync('.').filter(e => !e.startsWith('.')); + report.repo_summary.root_entries_count = rootEntries.length; + report.repo_summary.root_entries = rootEntries; + report.repo_summary.has_readme = fs.existsSync('README.md'); + report.repo_summary.has_bulletin = fs.existsSync('BULLETIN.md'); + report.repo_summary.has_scripts = fs.existsSync('scripts'); + } catch (e) { + report.repo_summary.error = e.message; + } + + return report; +} + +// 执行扫描 +const report = scanRepo(); +const outputPath = '.github/persona-brain/skyeye-report.json'; +fs.mkdirSync('.github/persona-brain', { recursive: true }); +fs.writeFileSync(outputPath, JSON.stringify(report, null, 2)); + +console.log('Skyeye scan completed, report written to ' + outputPath); \ No newline at end of file