Skip to content

Phase 3: Config revisions with rollback for ADF #640

@AlexMikhalev

Description

@AlexMikhalev

Parent Epic

#637

Summary

Version the orchestrator TOML config before each change, with CLI rollback capability.

Changes Required

terraphim_orchestrator

  • New config_history/ directory alongside orchestrator.toml
  • Before applying any config change, snapshot current TOML to config-history/YYYY-MM-DDTHH:MM:SS.toml
  • Keep last N snapshots (configurable, default 10)
  • Prune older snapshots on each save

ADF CLI (bin crate)

  • adf config history -- list available snapshots with timestamps
  • adf config rollback <timestamp> -- restore config from snapshot
  • adf config diff <timestamp> -- show diff between current and snapshot
  • Safety: refuse rollback if agents are actively running (or add --force flag)

Config

[config_history]
max_snapshots = 10
history_dir = "/opt/ai-dark-factory/config-history"

Reference

  • Paperclip config revisions: packages/db/src/schema/agent_config_revisions.ts
  • Paperclip agent service: server/src/services/agents.ts (buildConfigSnapshot, config revision tracking)

Acceptance Criteria

  • Config snapshots saved before each change
  • adf config history lists available snapshots
  • adf config rollback restores from snapshot
  • Old snapshots pruned automatically
  • Rollback blocked when agents running (unless --force)

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