use std::path::PathBuf;
use std::process::Command;
fn repo_root() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../..")
.canonicalize()
.expect("resolve repo root")
}
const RUNTIME_PATHS: &[&str] = &[
".devflow/state.json",
".devflow/state-07.json",
".devflow/lock-07",
".devflow/lock-project",
".devflow/phase-01-stdout",
".devflow/phase-01-stderr.log",
".devflow/phase-01-exit",
".devflow/phase-01-agent-pid",
".devflow/last-ship.json",
".devflow/cron-instructions.json",
".devflow/cron-instructions-01.json",
".devflow/events.jsonl",
".devflow/gates/probe.json",
".devflow/history/phase-01-state.json",
];
#[test]
fn gitignore_covers_devflow_runtime_state_paths() {
let mut unignored = Vec::new();
for path in RUNTIME_PATHS {
let output = Command::new("git")
.current_dir(repo_root())
.args(["check-ignore", "-q", path])
.output()
.expect("run git check-ignore");
if !output.status.success() {
unignored.push(*path);
}
}
assert!(
unignored.is_empty(),
".gitignore does not cover these DevFlow runtime-state paths, which \
would leak runtime telemetry into git — see 15-REVIEW.md CR-01 and \
17-REVIEW.md WR-07:\n {}",
unignored.join("\n ")
);
}