fix(delegation): the path rules live in a stdlib-only module; the package imports without paho (Issue #57, Mac F1)
control_plane and status.sh imported sibling_logs_dir from mqtt_common, which imports paho at module level, so create/resume's binding and status died on an interpreter without paho-mqtt (_delegate_py_bin's last fallback is the PATH's python3). The registry/audit-log path rules move to lib_py/delegation/logroot.py (standard library only) and mqtt_common re-exports them. The package's own import chain also reached paho through service -> publish_event -> publisher, so mqtt_common and publisher import paho tolerantly and make_client() refuses with a clear error when a broker is actually needed. control_plane, status.sh, lib.sh's delegate_publish_cmd and delegate_logs_dir, and the wrapper's _logs_dir_abs import from logroot. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
63d816468e
commit
75c004222c
8 files changed
+145
-60
No files matched your search
@@ -25,7 +25,7 @@ import shlex
|
||||
import sys
|
||||
from typing import Dict, Optional
|
||||
|
||||
from lib_py.delegation import mqtt_common
|
||||
from lib_py.delegation.logroot import sibling_logs_dir
|
||||
|
||||
KEYS = ("workspace_root", "agent_sessions_yaml", "mam_jobs_dir", "delegate_job_logs_dir")
|
||||
ENV = {"workspace_root": "WORKSPACE_ROOT", "agent_sessions_yaml": "AGENT_SESSIONS_YAML",
|
||||
@@ -54,7 +54,7 @@ def from_env(env=None) -> Dict[str, str]:
|
||||
# Issue #57: without an explicit DELEGATE_JOB_LOGS_DIR the audit log is
|
||||
# the delegate_job_logs next to the registry in use, not the workspace's.
|
||||
if not (env.get("DELEGATE_JOB_LOGS_DIR") or "").strip():
|
||||
b["delegate_job_logs_dir"] = _abs(mqtt_common.sibling_logs_dir(b["mam_jobs_dir"]))
|
||||
b["delegate_job_logs_dir"] = _abs(sibling_logs_dir(b["mam_jobs_dir"]))
|
||||
return b
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ def forwarded_keys(desc: dict) -> list:
|
||||
when it is the sibling of the registry and so derivable there (Issue #57).
|
||||
An explicit, non-sibling root is forwarded as before."""
|
||||
keys = list(KEYS)
|
||||
if desc.get("delegate_job_logs_dir") == _abs(mqtt_common.sibling_logs_dir(desc["mam_jobs_dir"])):
|
||||
if desc.get("delegate_job_logs_dir") == _abs(sibling_logs_dir(desc["mam_jobs_dir"])):
|
||||
keys.remove("delegate_job_logs_dir")
|
||||
return keys
|
||||
|
||||
|
||||
Reference in new issue
Block a user