feat: event.schema v1.1——补 6 类治理审计事件(ADR-0016) - #47
Conversation
…et/team/judge,红队 #20,ADR-0016) AR-7 事件流是 AR-6/AR-8/AR-9 的审计支柱,但 v1 仅 5 类基础事件: handoff 交接、审批流、凭据使用、预算消耗、团队生命周期、仲裁全部不可追溯。 枚举只增不改,v1 消费方向后兼容。
|
Warning Review limit reached
Next review available in: 28 minutes Limit details: You’ve used all 3 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
PR Summary by QodoExtend event schema with governance audit events
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
回应 qodo 三条意见: 1. payload 定义从未参与校验:根 schema 原为泛化 payload:object,六类治理 事件可带任意载荷或缺省通过。现以 allOf/if/then 按 event 常量绑定 $defs: 六类 v1.1 新事件 payload 必填;五类基础事件 payload 可缺省(v1 存量记录 后兼容),出现即须匹配对应 $def。 2. 载荷接受空对象:六个新 $def 补 required 数组,并加条件必填—— status=failed→reason、ok=false→reason、pool=per_card→card、 transition=destroyed→handoff_ref。 3. handoff_step.item 收敛为 team.schema lifecycle.handoff 同枚举(10 值, 注释声明两处同步维护),未知交接项不再能计为已完成。 验证:Draft202012Validator 17 项正反用例全过(缺 payload/空 payload/ 未知 item/条件缺字段均拒绝;v1 基础事件缺省 payload 兼容通过)。
与 PR #48 的 GOVERNANCE flows.step4 对齐:handoff_done 只表达 team 侧 完成(销毁前置);stewardship 侧异步完成态由 handoff_step(side= stewardship_side) 事件逐项审计——单一布尔不承载双侧完成态。
qodo 意见:step 4 仍审计 handoff_done,但该布尔表达"全部 handoff 完成", 无法在 stewardship 侧异步工作未完时证明 team 侧前置已满足。 修复:run_finished.handoff_done 仅表达 team 侧销毁前置完成; stewardship 侧完成态由 handoff_step(side=stewardship_side) 事件逐项 留痕(event.schema v1.1,PR #47)——append-only 事件流可分别回放 双侧完成态,消除单一布尔的语义过载。
* fix: AR-6 handoff 销毁前置措辞对齐单一真源——team 侧阻塞/stewardship 侧异步(红队 #18,ADR-0016) team.schema 与 GOVERNANCE 声称"handoff 全部完成才允许销毁",但单一真源 team-collaboration.yaml 规定销毁前置=after-handoff(team_side);adr-write/ memory-distill 等由 curator 异步消费归档资产执行、不阻塞销毁。措辞错位 制造"owner 依赖项卡死归档"的假想死锁(红队 #18 内核)。 * fix: flows.step4 完成态审计明确双侧信号(review 修复) qodo 意见:step 4 仍审计 handoff_done,但该布尔表达"全部 handoff 完成", 无法在 stewardship 侧异步工作未完时证明 team 侧前置已满足。 修复:run_finished.handoff_done 仅表达 team 侧销毁前置完成; stewardship 侧完成态由 handoff_step(side=stewardship_side) 事件逐项 留痕(event.schema v1.1,PR #47)——append-only 事件流可分别回放 双侧完成态,消除单一布尔的语义过载。 --------- Co-authored-by: randypanding <randypanding@users.noreply.github.com> Co-authored-by: randypanding <66171646@users.noreply.github.com>
ADR-0016(决策 4,解决 agent-registry #20)
问题(复核属实):event.schema v1 仅 5 类事件。而治理体系多处声明依赖事件流审计:
修复:v1.1 新增 6 类事件(顶层枚举 5→11,只增不改,v1 消费方向后兼容):
红队建议的 requested/granted/denied 三型拆分并入
approval.decision枚举——顶层类型爆炸无审计收益。schema 落盘本仓(L0)、issue 报在 agent-registry(#20,L1)——治理分工见 REPOS.yaml。本地验证:YAML 解析通过(11 events / 11 defs)。