feat(#2554): add hivectl forge reconcile-config to reconcile local applied config against forge main

This commit is contained in:
damocles 2026-07-17 12:31:08 +02:00 committed by mara
commit d124dd205a
9 changed files with 335 additions and 1 deletions

View file

@ -281,6 +281,41 @@ pub enum ForgeCmd {
#[arg(long, conflicts_with = "password")]
password_stdin: bool,
},
/// Show + reconcile the divergence between an agent's local applied
/// config checkout and its forge `agent-configs/<agent>` main.
///
/// Always prints the diff first. `--from forge` resets the local
/// checkout to forge main (effective on the next deploy); `--from local`
/// is not supported yet. With no `--from`, prompts for the direction.
ReconcileConfig {
/// Agent whose config branches to reconcile.
agent: String,
/// Which side to reconcile from. Omit to be prompted after the diff.
#[arg(long, value_enum)]
from: Option<ReconcileFrom>,
/// Include the full diff (not just `--stat`) in the report.
#[arg(long)]
verbose: bool,
},
}
/// Which side to reconcile config branches from (`hivectl forge
/// reconcile-config --from`). Maps to [`hive_host_sock::ReconcileDirection`].
#[derive(Clone, Copy, clap::ValueEnum)]
pub enum ReconcileFrom {
/// Reset the local applied checkout to forge main.
Forge,
/// Advance forge main from local — not supported yet.
Local,
}
impl From<ReconcileFrom> for hive_host_sock::ReconcileDirection {
fn from(from: ReconcileFrom) -> Self {
match from {
ReconcileFrom::Forge => Self::Forge,
ReconcileFrom::Local => Self::Local,
}
}
}
#[derive(Subcommand)]