Skip to content

IR-0006 GAP: 证据账本三级保留策略声明位未落盘 governance/policy/ #468

Description

@randypanding

背景(独立验收发现)

IR-0006 spec 条款 BUDGET-02 明确规定:

保留策略声明位:hot(90d)/warm(1y)/digest-only 三级 + checkpoint 月度节奏
声明在 governance/policy/(可 drift 对账、红队可审);调整走 C1。

AC-3 也要求三层(判定/轨迹/丢弃)分离落 schema 并配套保留策略。

实际代码证据(本轮独立核对)

  • governance/policy/ 目录现有 13 个 yaml:automation-limits / butler / contracts / elevation / env-drift / eval-gates / feedback / languages / metrics / patrol / testing / waves —— 完全没有 retention/证据保留相关文件
  • standards/evidence/README.md 只在词表层面提到 retention 词表 30d/90d/180d/1y/3y/forever 与 blob-store.sh 一致,但:
    • 没有将三层的 hot/warm/digest-only 映射成可机读的 policy 声明;
    • 没有声明 checkpoint 的月度节奏(如每月第几天、cron 表达式、SLA 宽限);
    • 无法被 drift-check 对账(GM-4 延伸:声明侧应该有政策文件锚定,不然红队只能靠 README 文本扫,不满足 BUDGET-02「可 drift 对账」)。
  • blob-store.sh 的 sweep 与 retention 词表本身已经通过 test-blob-store.sh(15/15 PASS),但它是执行面脚本;BUDGET-02 要求的是 声明面 policy 文件——这是 C1 治理基线的要求,不等于脚本实现。

影响面

  1. 红队可审性下降:保留策略无结构化文件=红队审计(ADR-0082 / g060 路径)无法机械读取「保留级别 × 层 × 节奏」三要素。
  2. 漂移检测盲区:governance-drift 对 policy 目录的对账无法覆盖证据保留政策——后续调整保留级不能走 C1 PR 流程,存在静默降级风险。
  3. 与 spec 条款字面不符:BUDGET-02 是 IR-0006 spec frontmatter 带的预算条款,AC 收口时应一一对应。

建议交付

governance/policy/retention.yaml(或 evidence-retention.yaml)落盘:

version: 1
# 证据账本保留策略声明(BUDGET-02 C1 文件;调整走 ADR+PR)
tiers:
  adjudication:  # 判定层(archive evidence/)
    tier: hot
    retention: 90d
    storage: archive-jsonl
  trajectory:    # 轨迹层(内网 blob)
    tier: warm
    retention: 1y
    storage: self-cloud-blob
  discard:       # 丢弃层(GitHub 事件面)
    tier: digest-only
    retention: 30d
    storage: github-native
checkpoint:
  cadence: monthly  # BEH-02 月度节奏
  cron: "33 7 1 * *"   # 建议 UTC 每月 1 号 07:33(与 sli-weekly 错峰)
  artifact: evidence/checkpoints/YYYY-MM.json
  verification: scripts/verify_evidence.py 独立复算(链断=红,fail-closed)
enforcement:
  sweep_frequency: daily  # blob-store.sh sweep 建议日度
  growth_soft_cap_mb: 200  # BUDGET-01 判定层年增长软上限(gzip 后)

配套:

  • 将该文件加入 governance/expected-state.json policy 断言面(如已有约定),或在 g060 路径添加最小的"文件在场 + 字段非空"白盒断言。
  • 验收报告 specs/IR-0006/acceptance.md 残留项追加本 issue 引用。

关联意图

  • IR-0006 AC-3 / BUDGET-02 / BEH-02
  • 红队审计 ADR-0082 / g060-guard(治理仓 specs/*/suite 路径)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions