#!/usr/bin/env python3
"""Append a NON-SECRET status line to the orchestrator status file. Refuses obvious secrets."""
import json, sys, datetime
msg = sys.argv[1] if len(sys.argv) > 1 else ""
step = sys.argv[2] if len(sys.argv) > 2 else ""
line = {
    "ts": datetime.datetime.now().astimezone().isoformat(),
    "task": "agent-ms-totp",
    "status": msg,
    "step": step,
}
with open("/tmp/orchestrator-status.jsonl", "a") as f:
    f.write(json.dumps(line) + "\n")
print("STATUS_OK")
