Phase 5: File-based approval gates for ADF

未关闭
#642 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust

调研方向

Start with parent issue #637, then review the referenced Paperclip approval schema and service files before designing the new terraphim_orchestrator approvals.rs module and ADF CLI entry points. Done means JSON approval requests, approve/reject/list commands, governed actions that wait for decisions, timeout auto-rejection, and activity log events as listed in the acceptance criteria.

由索引模型根据 Issue 内容生成。

描述

enhancement

Parent Epic

#637

Summary

Add file-based approval gates for high-impact agent actions (PR creation, config changes, deployments).

Changes Required

terraphim_orchestrator
  • New approvals.rs module with ApprovalRequest, ApprovalStatus types
  • Approval requests written to approvals/<uuid>.json
  • Schema: {id, type, requested_by, status: "pending"|"approved"|"rejected", payload, decision_note, decided_at}
  • Orchestrator checks approval status on reconciliation tick
  • Blocked actions wait for approval (with configurable timeout)
ADF CLI
  • adf approve <id> -- approve a pending request
  • adf reject <id> --reason "..." -- reject with reason
  • adf approvals -- list pending approval requests
  • adf approvals --all -- list all (including decided)
Governed Actions (initial set)
  • PR creation by compound review (when create_prs = true)
  • Agent config changes proposed by agents
  • Future: deployment actions, branch force-push
Config
[governance]
enabled = true
approval_timeout_secs = 86400  # 24h, then auto-reject
approvals_dir = "/opt/ai-dark-factory/approvals"

Reference

  • Paperclip approvals: packages/db/src/schema/approvals.ts
  • Paperclip approval service: server/src/services/approvals.ts, server/src/services/issue-approvals.ts

Acceptance Criteria

  • Approval requests created as JSON files
  • CLI commands for approve/reject/list
  • Governed actions blocked until approved
  • Timeout auto-rejects stale requests
  • Activity log events for request/decision (depends on Phase 4)
主要语言
Rust
星标
62
派生
5
平均合并
2 小时 27 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

terraphim/terraphim-ai 的其他 Issue

查看 terraphim/terraphim-ai 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。