fix(control-plane): forward only what the pane cannot derive - the sibling audit-log root stays on the row (Issue #57)

A worktree creator's binding always differs from its --workspace default,
so prefix() put DELEGATE_JOB_LOGS_DIR=<control root>/.mam/delegate_job_logs
into every such pane for good, and the env-first rule then kept an
experiment's --registry-dir from moving its audit log. forwarded_keys()
leaves that key out when it equals the sibling of mam_jobs_dir; a
non-sibling (explicit) root is forwarded as before. describe(), the forward
and whitespace checks and the row's four keys are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Fable 5.1 committed 2026-10-14 13:11:29 +00:00
1 parent c982616188
commit c57e7667aa
2 files changed
+18 -4

No files matched your search

+15 -1
View File
@@ -5,6 +5,10 @@ WORKSPACE_ROOT, AGENT_SESSIONS_YAML, MAM_JOBS_DIR, DELEGATE_JOB_LOGS_DIR.
create/resume persist it on the row (`control_plane`) and forward it to the
pane only when it differs from what `--workspace` alone would imply, through
the leading `K=V` tokens lib.sh's new-session already turns into `--env`.
The audit-log root is recorded but not forwarded when it is derivable from
the registry (its sibling delegate_job_logs, Issue #57): in the pane the
registry alone then decides where the audit log goes, so `--registry-dir`
moves both.
CLI (used by lib.sh):
python -m lib_py.control_plane json <workspace> [<row control_plane JSON>]
@@ -70,10 +74,20 @@ def describe(workspace: str, row: Optional[dict] = None) -> dict:
"whitespace": any(any(c.isspace() for c in v) for v in b.values()), "source": source}
def forwarded_keys(desc: dict) -> list:
"""The binding keys the pane receives: all four, minus the audit-log root
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"])):
keys.remove("delegate_job_logs_dir")
return keys
def prefix(desc: dict) -> str:
if not desc.get("forward"):
return ""
return "".join(f"{ENV[k]}={shlex.quote(desc[k])} " for k in KEYS)
return "".join(f"{ENV[k]}={shlex.quote(desc[k])} " for k in forwarded_keys(desc))
def main(argv=None) -> int: