mind-body: brake hold stops the exact units unit() names, and the stop path is pinned

stop_args now builds each name through unit(), the one name path start and
alive use, so the stop argv cannot disagree with the units that run (the
:* glob matched none of them on real systemd). A launch test ties stop_args
to what start passes systemctl for several instances; two binary tests run
mind-control brake hold with a fake systemctl first on PATH, so main's
stopper wiring is pinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-12 06:43:48 +02:00
commit bcda08b8cd
3 changed files with 76 additions and 22 deletions

View file

@ -19,10 +19,11 @@ use std::str::FromStr;
use anyhow::{Context, Result, anyhow, bail};
use chrono::{DateTime, Utc};
use eureka_pipeline::Slug;
use eureka_pipeline::{RunTurn, Slug};
use rust_decimal::Decimal;
use crate::control::{BurnRate, ControlWriter, FileSource, control_path, derive, load_state};
use crate::launch::unit;
const USAGE: &str =
"usage: mind-control [--root <dir>] --instance <slug> show | brake hold | brake release | dial set --heat H --base-cooldown-s S --base-run-usd U";
@ -63,7 +64,7 @@ pub fn run(
let stopped = stop_units(&instance);
match (written, stopped) {
(Ok(()), Ok(())) => {
writeln!(out, "units: stopped mind-self@{0}:* mind-persona@{0}:*", instance.0)?;
writeln!(out, "units: stopped {} {}", unit(&instance, RunTurn::SelfRun)?, unit(&instance, RunTurn::PersonaTurn)?)?;
Ok(())
}
(Err(write), Ok(())) => Err(write.context("the brake was not written; the units were stopped")),