Source snapshot: 97d7f0fae96dc04b7ddad56fc1db6a108ed662cc [SEC-CLEAN] · pre-push-clean v1.0 · 109处敏感信息已自动转乱码
93 lines
2.9 KiB
Markdown
93 lines
2.9 KiB
Markdown
---
|
||
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> |