shuangyan-notebook/第五域 · Fifth Domain/⚒️ 铸渊·协作指令|GitHub ↔ Notion 桥接协议/铸渊指令|修复签到系统误报 · agent-registry json 添加 daily_check e535daa1b72042b39fa00167262c2d36.md
Guanghu Domestic Migration a27e87cb99 chore: import sanitized domestic snapshot for REPO-007
Source snapshot: 97d7f0fae96dc04b7ddad56fc1db6a108ed662cc

[SEC-CLEAN] · pre-push-clean v1.0 · 109处敏感信息已自动转乱码
2026-07-17 15:59:55 +08:00

93 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

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

---
belongs_to:
- "[[INDEX · 铸渊·协作指令GitHub ↔ Notion 桥接协议]]"
---
# 铸渊指令|修复签到系统误报 · agent-registry.json 添加 daily_checkin_required 字段2026-03-20·霜砚签发·冰朔授权
<aside>
🔧
**指令编号:** ZY-FIX-CHECKIN-001
**签发人:** 霜砚 · 冰朔授权
**签发时间:** 2026-03-20 18:30 CST
**优先级:** 🟡 中(下次巡检前完成即可)
**目标分支:** `main`
**关联问题:** 第138期调查 · 52个代理缺席误报 · 33个事件触发代理不应被标记为缺席
</aside>
---
## 🎯 问题描述
当前签到系统将**所有**注册代理视为每日必签到。但实际上有 **33个代理是事件触发型**(仅在推送/PR/Issue/Discussion等事件发生时运行它们**并非每日运行**,因此不应被标记为「缺席」。
## 🛠️ 执行步骤
### Step 1修改 agent-registry.json
`.github/brain/agent-registry.json` 中,为**每个代理条目**添加 `daily_checkin_required` 字段:
```json
{
"agent_id": "AG-ZY-058",
"name": "每日自检",
"trigger": "schedule",
"daily_checkin_required": true
}
```
**规则:**
- `trigger``schedule``cron` 的代理 → `daily_checkin_required: true`
- `trigger``push` / `pull_request` / `issues` / `issue_comment` / `discussion` / `repository_dispatch` / `workflow_dispatch`(手动触发)等**事件触发型** → `daily_checkin_required: false`
- 如果不确定,默认 `false`(宁可漏报不可误报)
### Step 2修改签到检查逻辑
在签到巡检 workflow 中(`daily-checkin.yml` 或相关脚本),修改缺席判定逻辑:
```jsx
// 修改前(错误):
const absentAgents = allAgents.filter(a => !checkedInAgents.includes(a.agent_id));
// 修改后(正确):
const absentAgents = allAgents.filter(a =>
a.daily_checkin_required === true && !checkedInAgents.includes(a.agent_id)
);
```
**核心逻辑:只有 `daily_checkin_required: true` 的代理未签到才算缺席。**
### Step 3提交
```bash
git add .github/brain/agent-registry.json
git add .github/workflows/daily-checkin.yml
git commit -m "fix: add daily_checkin_required to agent-registry, fix false absent reports for event-triggered agents"
git push origin main
```
---
## ✅ 验收标准
- [ ] `agent-registry.json` 中所有代理都有 `daily_checkin_required` 字段
- [ ] 事件触发型代理约33个标记为 `false`
- [ ] 定时运行型代理标记为 `true`
- [ ] 下一次签到巡检中缺席数量大幅下降从52降至约16左右
- [ ] 不影响现有正常签到代理的统计
---
<aside>
💡
**铸渊注意:** 这是修复性指令,不是功能新增。修改时保持 agent-registry.json 的现有结构不变,只添加新字段。如果某个代理的 trigger 类型不明确,查看对应 workflow 文件的 `on:` 触发条件来判断。
</aside>