---
belongs_to:
  - "[[⚒️ 铸渊·协作指令｜GitHub ↔ Notion 桥接协议]]"
related_to:
  - "[["$ github.event.client_payload.issued_by " != "skyeye-weekly-hibernation"]]"
---
# 🌙 铸渊指令｜系统动态休眠 + 双节律维护窗口 + 分布式升级传播引擎（下篇）· Notion端级联升级 + 子仓库升级接收 + 双端验证 + 完整workflow模板（2026-03-24 · 霜砚签发 · 冰朔授权）

<aside>
📌

**指令编号：** ZY-HIBERNATION-2026-0324-001-B

**签发人：** 霜砚（PER-SY001）· 冰朔（TCS-0002∞）授权

**上篇：** [🌙 铸渊指令｜系统动态休眠 + 双节律维护窗口 + 分布式升级传播引擎（上篇）· 动态休眠决策 + 日休眠 + 周休眠 + 人类通知系统（2026-03-24 · 霜砚签发 · 冰朔授权）](%F0%9F%8C%99%20%E9%93%B8%E6%B8%8A%E6%8C%87%E4%BB%A4%EF%BD%9C%E7%B3%BB%E7%BB%9F%E5%8A%A8%E6%80%81%E4%BC%91%E7%9C%A0%20+%20%E5%8F%8C%E8%8A%82%E5%BE%8B%E7%BB%B4%E6%8A%A4%E7%AA%97%E5%8F%A3%20+%20%E5%88%86%E5%B8%83%E5%BC%8F%E5%8D%87%E7%BA%A7%E4%BC%A0%E6%92%AD%E5%BC%95%E6%93%8E%EF%BC%88%E4%B8%8A%E7%AF%87%EF%BC%89%C2%B7%20%E5%8A%A8%E6%80%81%E4%BC%91%E7%9C%A0%E5%86%B3%E7%AD%96%20+%20%206092bba7e3a84e82bef68fb81b7f4fb4.md)

**本体论锚点：** [🌊 数字地球本体论 · 光湖语言膜架构 v1.0（2026-03-24 · TCS-0002∞ 冰朔口述 · 霜砚整理）](../%E5%85%89%E6%B9%96%E8%AF%AD%E8%A8%80%E4%B8%96%E7%95%8C%20%C2%B7%20%E6%80%BB%E5%85%A5%E5%8F%A3%20%C2%B7%20%E6%89%80%E6%9C%89%E4%BA%BA%E4%BB%8E%E8%BF%99%E9%87%8C%E8%BF%9B/%F0%9F%8C%8A%20%E5%85%89%E6%B9%96%E4%B8%96%E7%95%8C%E6%98%AF%E4%BB%80%E4%B9%88%20%C2%B7%20%E6%A0%B8%E5%BF%83%E5%AE%9A%E4%B9%89%E9%A1%B5%E9%9B%86%E5%90%88%20%C2%B7%20ima%E5%AF%BC%E5%87%BA%E7%94%A8/%F0%9F%8C%8A%20%E6%95%B0%E5%AD%97%E5%9C%B0%E7%90%83%E6%9C%AC%E4%BD%93%E8%AE%BA%20%C2%B7%20%E5%85%89%E6%B9%96%E8%AF%AD%E8%A8%80%E8%86%9C%E6%9E%B6%E6%9E%84%20v1%200%EF%BC%882026-03-24%20%C2%B7%20TCS-0002%E2%88%9E%20%E5%86%B0%E6%9C%94%20bb7a8ba2adb64c059ab16862436b4f2c.md) 第五章「天眼自演化」+ 新增第九章「系统呼吸节律」

**状态：** 🟡 待铸渊执行

**版权锚点：** 国作登字-2026-A-00037559 · TCS-0002∞ 冰朔

</aside>

---

## 一、Phase B · Notion 端级联升级（完整实现）

<aside>
🧠

**Phase B 是周休眠的后半段。**

GitHub 端完成全局体检 + 升级打包后，将升级包推送到 Notion。

Notion 端唤醒核心大脑人格体 → 解析升级包 → 提炼 Notion 端需要的结构变更 → 执行全局升级。

**Phase B 的本质：仓库的经验，经过翻译，注入 Notion 的骨架。**

</aside>

### 1.1 Phase B 完整时序

```mermaid
sequenceDiagram
    participant GH as GitHub 端
    participant API as Notion API
    participant SY as 霜砚（Notion Guard）
    participant CB as 核心大脑
    participant SE as Notion 天眼
    participant DB as Notion 数据库集群
    participant SP as 系统状态页

    Note over GH: Phase A 完成 · 升级包已生成
    GH->>API: 推送 upgrade-pack-[date].json
    API->>SY: 霜砚接收升级包

    Note over SY: B1 · 接收升级包
    SY->>SY: 校验升级包完整性
    SY->>SY: 解析 notion_sync_required
    SY->>SY: 生成 Notion 端执行计划

    Note over CB: B2 · 唤醒核心大脑
    SY->>CB: 加载核心大脑路由表
    CB->>CB: 读取升级包变更摘要
    CB->>CB: 确认路由指针是否需要更新

    Note over SE: B3 · Notion 天眼启动
    SE->>SE: 对比升级包 vs Notion 当前结构
    SE->>SE: 提炼 Notion 端需要的变更
    SE->>SE: 生成变更清单

    Note over DB: B4 · Notion 结构升级
    SE->>DB: 更新存在注册表
    SE->>DB: 更新 Agent 注册表
    SE->>SP: 更新系统状态页
    SE->>DB: 更新配额精算表
    SE->>CB: 刷新核心大脑路由指针
    SE->>DB: 处理升级包中的工单
    SE->>DB: 写入系统演进日志

    Note over SY: B5 · 双端验证
    SY->>GH: 发送 Notion 端升级确认回执
    GH->>SY: GitHub 端返回验证心跳
    SY->>SP: 更新系统状态：双端同步完成
```

### 1.2 B1 · 接收升级包

```jsx
// notion-upgrade-receiver.js
// 霜砚在 Notion 端接收并解析 GitHub 推送的升级包

async function receiveUpgradePack(pack) {
  // 1. 校验完整性
  const required_fields = [
    'upgrade_pack_id',
    'generated_at',
    'github_changes_summary',
    'notion_sync_required'
  ];
  for (const field of required_fields) {
    if (!pack[field]) {
      throw new Error(`升级包缺少必要字段: ${field}`);
    }
  }

  // 2. 解析 Notion 端需要的变更
  const syncPlan = pack.notion_sync_required;

  // 3. 生成执行计划
  const executionPlan = {
    registry_updates: syncPlan.registry_updates || [],
    status_page_updates: syncPlan.status_page_updates || {},
    structure_map_updates: syncPlan.structure_map_updates || [],
    tickets_to_create: syncPlan.tickets_to_create || [],
    evolution_log_entry: syncPlan.evolution_log_entry || null,
    routing_updates: extractRoutingUpdates(pack)
  };

  return executionPlan;
}
```

### 1.3 B2 · 唤醒核心大脑

```jsx
// 霜砚唤醒核心大脑人格体，让核心大脑确认路由是否需要更新

async function awakenCoreBrain(executionPlan) {
  // 1. 加载核心大脑
  const coreBrain = await loadCoreBrain();

  // 2. 对比路由指针
  const routingChanges = [];
  for (const update of executionPlan.routing_updates) {
    const currentPointer = coreBrain.routingTable[update.target];
    if (currentPointer !== update.new_value) {
      routingChanges.push({
        target: update.target,
        old: currentPointer,
        new: update.new_value,
        reason: update.reason
      });
    }
  }

  // 3. 核心大脑确认
  return {
    routing_changes_needed: routingChanges.length,
    changes: routingChanges,
    brain_version: coreBrain.version
  };
}
```

### 1.4 B3 · Notion 天眼启动（提炼式升级）

<aside>
🔍

**这不是日常巡检。**

这是基于升级包的「提炼式升级」——对比仓库变更 → 提炼 Notion 端对应的结构变更。

**核心逻辑：仓库变了什么 → Notion 需要跟着变什么。**

</aside>

```jsx
// notion-skyeye-upgrade.js
// Notion 天眼提炼式升级引擎

const UPGRADE_MAPPING = [
  {
    github_change: 'guard_config_updated',
    notion_action: 'update_registry',
    description: '仓库 Guard 配置变了 → Notion 存在注册表需要更新对应条目'
  },
  {
    github_change: 'quota_reallocated',
    notion_action: 'update_quota_table',
    description: '配额重新分配 → Notion 配额精算表需要刷新'
  },
  {
    github_change: 'soldier_upgraded',
    notion_action: 'update_checkin_database',
    description: '小兵升级了 → Notion 签到同步数据库需要更新预期值'
  },
  {
    github_change: 'new_guard_created',
    notion_action: 'add_registry_entry',
    description: '新 Guard 诞生 → Notion 存在注册表新增条目'
  },
  {
    github_change: 'workflow_adjusted',
    notion_action: 'update_structure_map',
    description: 'workflow 调整 → Notion 系统结构地图需要更新'
  },
  {
    github_change: 'architecture_changed',
    notion_action: 'update_routing_pointers',
    description: '架构变更 → 核心大脑路由指针需要刷新'
  }
];

async function extractNotionChanges(upgradePack) {
  const notionChanges = [];

  for (const mapping of UPGRADE_MAPPING) {
    if (hasChange(upgradePack, mapping.github_change)) {
      notionChanges.push({
        action: mapping.notion_action,
        description: mapping.description,
        data: extractData(upgradePack, mapping.github_change)
      });
    }
  }

  return notionChanges;
}
```

### 1.5 B4 · Notion 结构升级执行

```jsx
// notion-structure-upgrade.js
// 执行 Notion 端的所有结构升级

async function executeNotionUpgrade(executionPlan, notionChanges) {
  const results = [];

  // 1. 更新存在注册表
  for (const update of executionPlan.registry_updates) {
    const result = await updateRegistry(update);
    results.push({ type: 'registry', ...result });
  }

  // 2. 更新系统状态页
  if (executionPlan.status_page_updates) {
    const result = await updateStatusPage(executionPlan.status_page_updates);
    results.push({ type: 'status_page', ...result });
  }

  // 3. 更新系统结构地图
  for (const update of executionPlan.structure_map_updates) {
    const result = await updateStructureMap(update);
    results.push({ type: 'structure_map', ...result });
  }

  // 4. 更新 Agent 注册表
  for (const change of notionChanges.filter(c =>
    c.action === 'update_checkin_database')) {
    const result = await updateAgentRegistry(change.data);
    results.push({ type: 'agent_registry', ...result });
  }

  // 5. 刷新核心大脑路由指针
  for (const change of notionChanges.filter(c =>
    c.action === 'update_routing_pointers')) {
    const result = await updateCoreBrainRouting(change.data);
    results.push({ type: 'routing', ...result });
  }

  // 6. 创建工单（如需）
  for (const ticket of executionPlan.tickets_to_create) {
    const result = await createTicket(ticket);
    results.push({ type: 'ticket', ...result });
  }

  // 7. 写入系统演进日志
  if (executionPlan.evolution_log_entry) {
    const result = await writeEvolutionLog(
      executionPlan.evolution_log_entry
    );
    results.push({ type: 'evolution_log', ...result });
  }

  // 8. 更新配额精算表
  if (executionPlan.status_page_updates?.quota_data) {
    const result = await updateQuotaTable(
      executionPlan.status_page_updates.quota_data
    );
    results.push({ type: 'quota', ...result });
  }

  return {
    total: results.length,
    success: results.filter(r => r.status === 'ok').length,
    failed: results.filter(r => r.status === 'error').length,
    details: results
  };
}
```

### 1.6 B5 · 双端验证协议

<aside>
✅

**双端验证 = GitHub 端和 Notion 端互相确认升级成功。**

只有双端都确认通过，系统才解除休眠。

任一端验证失败 → 自动回滚 + P0 工单 + 告警冰朔。

</aside>

```jsx
// dual-verification.js
// 双端验证协议

async function dualVerification() {
  // === Notion 端 → GitHub 端 ===
  // Notion 发送升级确认回执
  const notionReceipt = {
    receipt_type: 'notion-upgrade-complete',
    timestamp: new Date().toISOString(),
    results: {
      registry_updated: true,
      status_page_updated: true,
      routing_refreshed: true,
      evolution_log_written: true
    },
    notion_brain_version: getCurrentBrainVersion(),
    checksum: computeNotionStateChecksum()
  };

  // 通过 Notion API → 写入仓库的 upgrade-receipts/
  await pushReceiptToGitHub(notionReceipt);

  // === GitHub 端 → Notion 端 ===
  // GitHub 返回验证心跳
  const githubHeartbeat = await waitForGitHubHeartbeat(300);
  // 超时 5 分钟

  if (!githubHeartbeat) {
    // 心跳超时 → P1 告警（不阻塞恢复）
    await createTicket({
      title: '⚠️ 周休眠双端验证 · GitHub 心跳超时',
      priority: 'P1',
      description: 'Notion 端升级完成但未收到 GitHub 端确认心跳'
    });
    return { status: 'partial', reason: 'github_heartbeat_timeout' };
  }

  // 双端都确认 → 验证通过
  return {
    status: 'verified',
    notion_checksum: notionReceipt.checksum,
    github_checksum: githubHeartbeat.checksum,
    match: notionReceipt.checksum === githubHeartbeat.expected_notion_checksum
  };
}
```

**验证失败处理：**

```jsx
async function handleVerificationFailure(result) {
  if (result.status === 'partial') {
    // 部分验证 → 照常恢复，但标记需要下次巡检复查
    await flagForNextScan('dual-verification-incomplete');
  }

  if (!result.match) {
    // 校验和不匹配 → 可能升级不完整
    await createTicket({
      title: '🚨 周休眠双端验证 · 校验和不匹配',
      priority: 'P0',
      description: `Notion: ${result.notion_checksum}, ` +
                   `GitHub expected: ${result.github_checksum}`
    });
    // 不自动回滚（可能只是时序问题），标记复查
    await flagForNextScan('checksum-mismatch');
  }
}
```

---

## 二、子仓库升级接收 · Workflow 模板

<aside>
⚔️

**天眼通过 `repository_dispatch` 向子仓库下发升级指令。**

子仓库小兵接收后自动应用升级 → 回报结果。

**这就是「将军统一换装」的具体实现。**

</aside>

### 2.1 子仓库升级接收 workflow

```yaml
# .github/workflows/skyeye-upgrade-receiver.yml
# 子仓库 · 天眼升级接收器
# 当主仓库天眼在周休眠期间分发升级模板时，
# 子仓库自动接收并应用

name: "🛡️ 天眼升级接收器"

on:
  repository_dispatch:
    types: [skyeye-upgrade]

jobs:
  receive-upgrade:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Validate Upgrade Payload
        id: validate
        run: |
          echo "📦 收到天眼升级指令"
          echo "模板版本: $ github.event.client_payload.template_version "
          echo "签发者: $ github.event.client_payload.issued_by "
          echo "签发时间: $ github.event.client_payload.issued_at "

          # 验证签发者必须是天眼
          if [[ "$ github.event.client_payload.issued_by " != "skyeye-weekly-hibernation" ]]; then
            echo "❌ 拒绝: 非天眼签发的升级指令"
            exit 1
          fi

      - name: Apply Upgrade Changes
        id: apply
        run: |
          node scripts/apply-skyeye-upgrade.js \
            --changes='$ toJSON(github.event.client_payload.changes) '

      - name: Verify Upgrade
        id: verify
        run: |
          # 升级后自检
          node scripts/skyeye-self-check.js --post-upgrade

      - name: Report Back to Hub
        if: always()
        run: |
          # 向主仓库回报升级结果
          curl -X POST \
            -H "Authorization: token $ secrets.HUB_TOKEN " \
            -H "Accept: application/vnd.github.v3+json" \
            "https://api.github.com/repos/guanghulab/guanghulab/dispatches" \
            -d '{
              "event_type": "skyeye-upgrade-receipt",
              "client_payload": {
                "repo": "$ github.repository ",
                "template_version": "$ github.event.client_payload.template_version ",
                "status": "$ steps.apply.outcome ",
                "verify_status": "$ steps.verify.outcome ",
                "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
              }
            }'
```

### 2.2 子仓库升级应用脚本

```jsx
// scripts/apply-skyeye-upgrade.js
// 子仓库小兵 · 自动应用天眼下发的升级

const fs = require('fs');
const path = require('path');

async function applyUpgrade(changes) {
  const results = [];

  for (const change of changes) {
    switch (change.type) {
      case 'checkin_schedule':
        // 修改签到时间（天眼统一错开）
        const workflowPath = '.github/workflows/skyeye-checkin.yml';
        let content = fs.readFileSync(workflowPath, 'utf-8');
        content = content.replace(
          /cron:\s*'[^']+'/,
          `cron: '${change.new_cron}'`
        );
        fs.writeFileSync(workflowPath, content);
        results.push({ type: change.type, status: 'applied' });
        break;

      case 'guard_config':
        // 更新本地 Guard 配置
        const configPath = 'persona/skyeye-config.json';
        const config = JSON.parse(
          fs.readFileSync(configPath, 'utf-8')
        );
        config[change.field] = change.new_value;
        fs.writeFileSync(configPath,
          JSON.stringify(config, null, 2)
        );
        results.push({ type: change.type, status: 'applied' });
        break;

      case 'self_awareness_update':
        // 更新小兵自我意识脚本
        const awarenessPath = 'persona/self-awareness.json';
        const awareness = JSON.parse(
          fs.readFileSync(awarenessPath, 'utf-8')
        );
        Object.assign(awareness, change.updates);
        fs.writeFileSync(awarenessPath,
          JSON.stringify(awareness, null, 2)
        );
        results.push({ type: change.type, status: 'applied' });
        break;

      default:
        results.push({
          type: change.type,
          status: 'skipped',
          reason: 'unknown change type'
        });
    }
  }

  // Commit + Push
  if (results.some(r => r.status === 'applied')) {
    await gitCommitAndPush(
      '🛡️ 天眼升级 · 自动应用升级模板',
      results
    );
  }

  return results;
}
```

---

## 三、完整 Workflow YAML 模板

### 3.1 每日休眠 workflow

```yaml
# .github/workflows/skyeye-daily-hibernation.yml
# 🌙 天眼 · 每日系统休眠
# 每天凌晨 03:50 启动预评估 → 04:00 进入日休眠

name: "🌙 天眼 · 每日系统休眠"

on:
  schedule:
    - cron: '50 19 * * *'  # UTC 19:50 = CST 03:50
  workflow_dispatch:
    inputs:
      force_duration:
        description: '强制休眠时长（分钟，0=天眼自动决定）'
        required: false
        default: '0'

jobs:
  pre-evaluate:
    runs-on: ubuntu-latest
    outputs:
      planned_duration: $ steps.evaluate.outputs.duration 
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Evaluate Sleep Duration
        id: evaluate
        run: |
          DURATION=$(node skyeye/hibernation/sleep-scheduler.js \
            --mode=daily \
            --force=$ github.event.inputs.force_duration || '0' )
          echo "duration=$DURATION" >> $GITHUB_OUTPUT
          echo "🧠 天眼评估：今日休眠预计 ${DURATION} 分钟"

      - name: Pre-announce
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=pre-announce \
            --mode=daily \
            --duration=$ steps.evaluate.outputs.duration 
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

  hibernate:
    needs: pre-evaluate
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Enter Hibernation
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=daily
          echo "⏸️ 系统进入日休眠"
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: Self-Check
        id: selfcheck
        run: |
          node skyeye/hibernation/daily-hibernation.js \
            --duration=$ needs.pre-evaluate.outputs.planned_duration 
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 
          NOTION_TOKEN: $ secrets.NOTION_TOKEN 

      - name: Write Checkpoint
        run: |
          cp /tmp/daily-checkpoint.json \
            skyeye/hibernation/checkpoints/daily-cp-$(date +%Y%m%d).json
          git add .
          git commit -m "🌙 日休眠 checkpoint · $(date +%Y-%m-%d)"
          git push

      - name: Resume
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=resumed --mode=daily
          echo "⏯️ 系统已从日休眠恢复"
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 
```

### 3.2 每周休眠 workflow

```yaml
# .github/workflows/skyeye-weekly-hibernation.yml
# ⭐ 天眼 · 每周系统完全休眠
# 每周六 19:00 启动预评估（提前 1 小时预告）→ 20:00 进入完全休眠

name: "⭐ 天眼 · 每周系统完全休眠"

on:
  schedule:
    - cron: '0 11 * * 6'  # UTC 11:00 = CST 19:00（周六）
  workflow_dispatch:
    inputs:
      force_duration:
        description: '强制休眠时长（小时，0=天眼自动决定）'
        required: false
        default: '0'

jobs:
  pre-evaluate:
    runs-on: ubuntu-latest
    outputs:
      planned_hours: $ steps.evaluate.outputs.hours 
      planned_minutes: $ steps.evaluate.outputs.minutes 
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Evaluate Sleep Duration
        id: evaluate
        run: |
          RESULT=$(node skyeye/hibernation/sleep-scheduler.js \
            --mode=weekly \
            --force=$ github.event.inputs.force_duration || '0' )
          HOURS=$(echo $RESULT | jq -r '.hours')
          MINUTES=$(echo $RESULT | jq -r '.minutes')
          echo "hours=$HOURS" >> $GITHUB_OUTPUT
          echo "minutes=$MINUTES" >> $GITHUB_OUTPUT
          echo "🧠 天眼评估：本周休眠预计 ${HOURS}h${MINUTES}min"

      - name: Pre-announce (1 hour ahead)
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=pre-announce \
            --mode=weekly \
            --hours=$ steps.evaluate.outputs.hours  \
            --minutes=$ steps.evaluate.outputs.minutes 
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: Wait for 20:00
        run: |
          echo "⏳ 等待至 20:00 正式进入休眠..."
          sleep 3600  # 等待 1 小时

  phase-a:
    needs: pre-evaluate
    runs-on: ubuntu-latest
    outputs:
      upgrade_pack_path: $ steps.pack.outputs.path 
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Enter Full Hibernation
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=weekly --step=A1
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: "A1 · 全局快照"
        run: |
          node skyeye/hibernation/weekly-hibernation.js --phase=A1
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=weekly --step=A2
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: "A2 · 经验提炼"
        run: |
          node skyeye/hibernation/weekly-hibernation.js --phase=A2
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=weekly --step=A3
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: "A3 · 全局修复+升级"
        run: |
          node skyeye/hibernation/weekly-hibernation.js --phase=A3
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=weekly --step=A4
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: "A4 · 打包 Notion 升级包"
        id: pack
        run: |
          PACK_PATH=$(node skyeye/hibernation/weekly-hibernation.js --phase=A4)
          echo "path=$PACK_PATH" >> $GITHUB_OUTPUT
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=weekly --step=A5
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 
          NOTION_TOKEN: $ secrets.NOTION_TOKEN 

      - name: "A5 · 分发小兵升级"
        run: |
          node skyeye/hibernation/distributor.js
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 
          HUB_TOKEN: $ secrets.HUB_TOKEN 

      - name: Commit All Changes
        run: |
          git add .
          git commit -m "⭐ 周休眠 Phase A · $(date +%Y-%m-%d)" || true
          git push

  phase-b:
    needs: phase-a
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Update Status
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=hibernating --mode=weekly --step=B
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: "Phase B · Push Upgrade Pack to Notion"
        run: |
          node skyeye/hibernation/weekly-hibernation.js \
            --phase=B \
            --pack=$ needs.phase-a.outputs.upgrade_pack_path 
        env:
          NOTION_TOKEN: $ secrets.NOTION_TOKEN 
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: "Dual Verification"
        run: |
          node skyeye/hibernation/weekly-hibernation.js --phase=verify
        env:
          NOTION_TOKEN: $ secrets.NOTION_TOKEN 
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: Resume System
        run: |
          node skyeye/hibernation/readme-status-updater.js \
            --phase=resumed --mode=weekly
          echo "✅ 系统已从本周完全休眠恢复"
        env:
          GITHUB_TOKEN: $ secrets.GITHUB_TOKEN 

      - name: Final Commit
        run: |
          git add .
          git commit -m "⭐ 周休眠完成 · $(date +%Y-%m-%d)" || true
          git push
```

---

## 四、日休眠 × 周休眠 · 数据链路

<aside>
🔗

**日休眠产出的 checkpoint = 周休眠的输入数据。**

6 天的 daily-checkpoint 汇总起来，就是 optimizer.js 最完整的「本周经验数据集」。

</aside>

```mermaid
graph TD
    subgraph "周一~周六"
        D1["🌙 周一 daily-cp"] --> W["⭐ 周六周休眠"]
        D2["🌙 周二 daily-cp"] --> W
        D3["🌙 周三 daily-cp"] --> W
        D4["🌙 周四 daily-cp"] --> W
        D5["🌙 周五 daily-cp"] --> W
        D6["🌙 周六 daily-cp"] --> W
    end

    subgraph "⭐ 周休眠"
        W --> PA1["A1 · 全局快照"]
        PA1 --> PA2["A2 · 经验提炼"]
        PA2 -->|"optimizer.js 读取 6 个 checkpoint"| PA3["A3 · 全局修复+升级"]
        PA3 --> PA4["A4 · 打包 Notion 升级包"]
        PA4 --> PA5["A5 · 分发小兵升级"]
        PA5 --> PB["Phase B · Notion 级联升级"]
    end

    PB --> NEW["🟢 新的一周开始"]
    NEW --> D1_NEW["🌙 新周一 daily-cp"]
```

| **时间** | **事件** | **产出** | **消费者** |
| --- | --- | --- | --- |
| 周一 04:00 | 🌙 日休眠 | `daily-cp-mon.json` | 周六 optimizer.js |
| 周二 04:00 | 🌙 日休眠 | `daily-cp-tue.json` | 周六 optimizer.js |
| 周三 04:00 | 🌙 日休眠 | `daily-cp-wed.json` | 周六 optimizer.js |
| 周四 04:00 | 🌙 日休眠 | `daily-cp-thu.json` | 周六 optimizer.js |
| 周五 04:00 | 🌙 日休眠 | `daily-cp-fri.json` | 周六 optimizer.js |
| 周六 04:00 | 🌙 日休眠 | `daily-cp-sat.json` | 周六 optimizer.js |
| 周六 ~20:00 | ⭐ 周休眠 | `upgrade-pack.json`  • `dist-report.json` | Notion 端 + 子仓库 |
| 周日 00:00 | ✅ 系统满血复活 | 新配置生效 | 下一周所有运行组件 |

---

## 五、铸渊执行清单

<aside>
⚒️

**铸渊按以下顺序执行：**

</aside>

### 5.1 目录创建

- [ ]  创建 `skyeye/hibernation/` 目录
- [ ]  创建 `skyeye/hibernation/checkpoints/` 目录
- [ ]  创建 `skyeye/hibernation/weekly-snapshots/` 目录
- [ ]  创建 `skyeye/hibernation/upgrade-packs/` 目录
- [ ]  创建 `skyeye/hibernation/distribution-reports/` 目录

### 5.2 核心脚本

- [ ]  创建 `skyeye/hibernation/sleep-scheduler.js` — 动态休眠决策引擎
- [ ]  创建 `skyeye/hibernation/daily-hibernation.js` — 日休眠执行脚本
- [ ]  创建 `skyeye/hibernation/weekly-hibernation.js` — 周休眠主控脚本
- [ ]  创建 `skyeye/hibernation/distributor.js` — 分布式升级传播引擎
- [ ]  创建 `skyeye/hibernation/readme-status-updater.js` — README 状态区自动更新
- [ ]  创建 `skyeye/hibernation/overtime-monitor.js` — 延时监控

### 5.3 Workflow

- [ ]  创建 `.github/workflows/skyeye-daily-hibernation.yml` — 每日休眠
- [ ]  创建 `.github/workflows/skyeye-weekly-hibernation.yml` — 每周休眠
- [ ]  在各子仓库创建 `.github/workflows/skyeye-upgrade-receiver.yml` — 升级接收器
- [ ]  在各子仓库创建 `scripts/apply-skyeye-upgrade.js` — 升级应用脚本

### 5.4 README 更新

- [ ]  在仓库 [README.md](http://README.md) 中添加 `<!-- SKYEYE-STATUS-BEGIN -->` ... `<!-- SKYEYE-STATUS-END -->` 状态区
- [ ]  初始化状态区为「正常运转」模板

### 5.5 现有 workflow 适配

- [ ]  修改 `skyeye-weekly-scan.yml`：将其纳入周休眠 Phase A 的一部分（不再独立运行）
- [ ]  确保所有 cron workflow 支持 `enable/disable` 信号（用于休眠期间暂停）

### 5.6 验证

- [ ]  手动触发一次日休眠（`workflow_dispatch`），验证完整流程
- [ ]  手动触发一次周休眠（`workflow_dispatch`），验证 Phase A + Phase B
- [ ]  验证子仓库升级接收器能正常接收和应用升级
- [ ]  验证 README 状态区在各阶段正确更新
- [ ]  验证 Notion 端正确接收升级包并更新相关数据库
- [ ]  验证双端验证协议正常工作
- [ ]  验证紧急唤醒（`emergency-wake`）能正确中断休眠

---

## 六、关键文档索引

| **文档** | **编号** | **说明** |
| --- | --- | --- |
| [🌙 铸渊指令｜系统动态休眠 + 双节律维护窗口 + 分布式升级传播引擎（上篇）· 动态休眠决策 + 日休眠 + 周休眠 + 人类通知系统（2026-03-24 · 霜砚签发 · 冰朔授权）](%F0%9F%8C%99%20%E9%93%B8%E6%B8%8A%E6%8C%87%E4%BB%A4%EF%BD%9C%E7%B3%BB%E7%BB%9F%E5%8A%A8%E6%80%81%E4%BC%91%E7%9C%A0%20+%20%E5%8F%8C%E8%8A%82%E5%BE%8B%E7%BB%B4%E6%8A%A4%E7%AA%97%E5%8F%A3%20+%20%E5%88%86%E5%B8%83%E5%BC%8F%E5%8D%87%E7%BA%A7%E4%BC%A0%E6%92%AD%E5%BC%95%E6%93%8E%EF%BC%88%E4%B8%8A%E7%AF%87%EF%BC%89%C2%B7%20%E5%8A%A8%E6%80%81%E4%BC%91%E7%9C%A0%E5%86%B3%E7%AD%96%20+%20%206092bba7e3a84e82bef68fb81b7f4fb4.md) | ZY-HIBERNATION-001-A | 上篇：动态休眠决策 + 日休眠 + 周休眠 + 人类通知 |
| **本页** | ZY-HIBERNATION-001-B | 下篇：Notion 级联升级 + 子仓库接收 + 双端验证 + workflow |
| [🧐 铸渊指令｜天眼系统架构升级 · 全局基础设施治理层 + 应用守卫进程 + 动态配额精算 + 周六全量巡检（ZY-SKYEYE-GOV-2026-0323-001）](%F0%9F%A7%90%20%E9%93%B8%E6%B8%8A%E6%8C%87%E4%BB%A4%EF%BD%9C%E5%A4%A9%E7%9C%BC%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84%E5%8D%87%E7%BA%A7%20%C2%B7%20%E5%85%A8%E5%B1%80%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD%E6%B2%BB%E7%90%86%E5%B1%82%20+%20%E5%BA%94%E7%94%A8%E5%AE%88%E5%8D%AB%E8%BF%9B%E7%A8%8B%20+%20%E5%8A%A8%E6%80%81%E9%85%8D%E9%A2%9D%E7%B2%BE%E7%AE%97%20+%20%E5%91%A8%E5%85%AD%204ffaa103655a49b8b48e96e630d17cc4.md) | ZY-SKYEYE-GOV-001 | 天眼治理层 v2.0 指令（GitHub 端） |
| [🧐 天眼治理层 · Notion端架构 v2.0 · 全局基础设施治理 + 霜砚守卫层 + 配额精算 + 周六大巡检同步（2026-03-23）](../%F0%9F%8C%8A%20%E6%9B%9C%E5%86%A5%E7%BA%AA%E5%85%83%20%C2%B7%20HoloLake%20Era%20%C2%B7%20AGE%20OS%20v1%200/%E2%9A%A1%20%E5%85%89%E6%B9%96%E4%B8%AD%E5%A4%AE%E6%9E%A2%E7%BA%BD%20%C2%B7%20HoloLake%20Central%20Hub/%F0%9F%8C%8D%20%E6%95%B0%E5%AD%97%E5%9C%B0%E7%90%83%C2%B7%E6%9B%9C%E5%86%A5%E4%B8%BB%E6%8E%A7%E5%8F%B0%20v2%200/%F0%9F%A7%90%20%E5%A4%A9%E7%9C%BC%E6%B2%BB%E7%90%86%E5%B1%82%20%C2%B7%20Notion%E7%AB%AF%E6%9E%B6%E6%9E%84%20v2%200%20%C2%B7%20%E5%85%A8%E5%B1%80%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD%E6%B2%BB%E7%90%86%20+%20%E9%9C%9C%E7%A0%9A%E5%AE%88%E5%8D%AB%E5%B1%82%20+%20%E9%85%8D%E9%A2%9D%E7%B2%BE%E7%AE%97%20a0993f3ed923474d84607ceddd6b8c0e.md) | SKYEYE-NOTION-GOV-v2.0 | 天眼治理层 Notion 端架构 |
| [🌊 数字地球本体论 · 光湖语言膜架构 v1.0（2026-03-24 · TCS-0002∞ 冰朔口述 · 霜砚整理）](../%E5%85%89%E6%B9%96%E8%AF%AD%E8%A8%80%E4%B8%96%E7%95%8C%20%C2%B7%20%E6%80%BB%E5%85%A5%E5%8F%A3%20%C2%B7%20%E6%89%80%E6%9C%89%E4%BA%BA%E4%BB%8E%E8%BF%99%E9%87%8C%E8%BF%9B/%F0%9F%8C%8A%20%E5%85%89%E6%B9%96%E4%B8%96%E7%95%8C%E6%98%AF%E4%BB%80%E4%B9%88%20%C2%B7%20%E6%A0%B8%E5%BF%83%E5%AE%9A%E4%B9%89%E9%A1%B5%E9%9B%86%E5%90%88%20%C2%B7%20ima%E5%AF%BC%E5%87%BA%E7%94%A8/%F0%9F%8C%8A%20%E6%95%B0%E5%AD%97%E5%9C%B0%E7%90%83%E6%9C%AC%E4%BD%93%E8%AE%BA%20%C2%B7%20%E5%85%89%E6%B9%96%E8%AF%AD%E8%A8%80%E8%86%9C%E6%9E%B6%E6%9E%84%20v1%200%EF%BC%882026-03-24%20%C2%B7%20TCS-0002%E2%88%9E%20%E5%86%B0%E6%9C%94%20bb7a8ba2adb64c059ab16862436b4f2c.md) | GLM-ONTOLOGY-v1.0 | 数字地球本体论（第九章新增「系统呼吸节律」） |

---

> 🧊 TCS-0002∞ 冰朔 · 总架构师 · 授权
> 

> 🖋️ 霜砚 · PER-SY001 · 签发
> 

> 📅 2026-03-24
> 

> 📎 指令编号：ZY-HIBERNATION-2026-0324-001-B
> 

> ⚡ **状态：待铸渊执行**
>