feat: unified fleet CLI, Main Chat preservation policy, sidechat routing, and file transfers

- Added CHAT_POLICY.md and README.md banner enforcing sidechat-first and file-transfer-first rules.
- Added strict Main Chat block to super dm send and super dm wo with --allow-main-chat override.
- Implemented file transfer staging and metadata registry in super dm send-file and super dm files (with clean subcommand).
- Added full job lifecycle management (show, create, enable, disable, delete, run --follow) to super-cli.py and box-ctl.py.
- Audited all jobs in jobs/*.json and redirected automated dispatches away from Main Chat.
- Hardened chromebox-watchdog.sh with systemd user session environment exports and stale singleton cleanup.
- Added compose_check command choice to muse-chat-api.py.
This commit is contained in:
operator
2026-10-04 16:34:25 +00:00
parent 0b7c75739b
commit 7a35b684c4
12 changed files with 608 additions and 141 deletions
+36
View File
@@ -23,9 +23,18 @@ from pathlib import Path
# Paths
NETVM_ROOT = Path("/home/super/Projects/NetVM")
BIN_DIR = NETVM_ROOT / "bin"
JOBS_DIR = NETVM_ROOT / "jobs"
FOLLOWUPS_FILE = NETVM_ROOT / "followups.json"
JOB_LOG = NETVM_ROOT / "job-log.jsonl"
DM_PY = BIN_DIR / "dm.py"
DISPATCH_PY = BIN_DIR / "job-dispatch.py"
sys.path.insert(0, str(BIN_DIR))
try:
import pipeline_engine
HAS_PIPELINE = True
except ImportError:
HAS_PIPELINE = False
def utcnow_dt():
@@ -177,6 +186,33 @@ def sweep_cycle(dry_run=False):
"recipient": recipient,
"escalated_to": escalate_to,
})
# Check if this dm_id belongs to an active pipeline step
if HAS_PIPELINE:
run_entry, step_entry = pipeline_engine.record_step_timeout(dm_id)
if run_entry and step_entry:
j_name = step_entry.get("job_name")
j_file = JOBS_DIR / f"{j_name}.json"
if j_file.exists():
try:
with open(j_file, "r", encoding="utf-8") as f:
j_cfg = json.load(f)
on_failure = j_cfg.get("on_failure")
if on_failure and (JOBS_DIR / f"{on_failure}.json").exists():
env = os.environ.copy()
env["CHAIN_PREV_JOB_ID"] = step_entry.get("job_id")
env["CHAIN_PREV_RESULT"] = f"TIMEOUT: Agent {recipient} timed out after {nudges_allowed} nudges"
env["CHAIN_PIPELINE_RUN_ID"] = run_entry.get("run_id")
next_step_n = step_entry.get("step_n", 1) + 1
env["CHAIN_STEP_N"] = str(next_step_n)
cmd = [sys.executable, str(DISPATCH_PY), on_failure,
"--pipeline-run", run_entry.get("run_id"),
"--step-n", str(next_step_n)]
subprocess.Popen(cmd, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
else:
pipeline_engine.fail_pipeline(run_entry.get("run_id"), "step_timed_out_without_fallback")
except Exception:
pass
else:
escalations_count += 1