Skip to content

Phase 5: File-based approval gates for ADF #642

Description

@AlexMikhalev

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 = trueapproval_timeout_secs = 86400# 24h, then auto-rejectapprovals_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)

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions