Persist dry-run response plans

This commit is contained in:
Luna 2026-06-13 05:53:48 -07:00
parent 812cf0c836
commit 1a5b6f1d8d
11 changed files with 133 additions and 5 deletions

View file

@ -359,6 +359,9 @@ def _cmd_respond(cfg: Config, action: str, iid: str | None, as_json: bool) -> in
print(f"error: no such incident: {iid}", file=sys.stderr)
return 1
plan = respond.build_plan(bundle, cfg)
artifacts = respond.persist_plan(cfg, plan)
plan = dict(plan)
plan["artifacts"] = artifacts
if as_json:
print(json.dumps(plan, indent=2))
return 0
@ -369,6 +372,8 @@ def _cmd_respond(cfg: Config, action: str, iid: str | None, as_json: bool) -> in
print(f" mode: {plan['mode']} (no commands executed)")
print(f" signatures: {', '.join(summary['signatures']) or ''}")
print(f" snapshots: {summary['snapshot_count']}")
print(f" saved: {artifacts['plan_path']}")
print(f" audit: {artifacts['audit_log']}")
print(" actions:")
for a in plan["actions"]:
cmd = " ".join(a["command"])