fix(delegation): the sibling rule pairs with the registry's real path (Issue #57, Mac R2)
A registry directory that is itself a symlink got two audit logs: submit resolved --registry-dir with pwd -P and wrote next to the target, while logs derived the sibling from the link path. sibling_logs_dir() now takes the registry's realpath; an explicit DELEGATE_JOB_LOGS_DIR still wins. Also: forwarded_keys() normalises both sides of its comparison, and the design doc's status row lists the audit log next to the registry. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c598bb546
commit
a7cb90e63a
4 files changed
+45
-5
No files matched your search
@@ -79,7 +79,8 @@ 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(sibling_logs_dir(desc["mam_jobs_dir"])):
|
||||
logs = desc.get("delegate_job_logs_dir")
|
||||
if logs and _abs(logs) == _abs(sibling_logs_dir(desc["mam_jobs_dir"])):
|
||||
keys.remove("delegate_job_logs_dir")
|
||||
return keys
|
||||
|
||||
|
||||
@@ -39,9 +39,16 @@ def default_registry_dir() -> str:
|
||||
|
||||
|
||||
def sibling_logs_dir(registry_dir: str) -> str:
|
||||
"""The audit-log root that pairs with ``registry_dir``: its sibling
|
||||
``delegate_job_logs``. Pure; reads no environment. Issue #57."""
|
||||
return os.path.join(os.path.dirname(os.path.abspath(registry_dir)), "delegate_job_logs")
|
||||
"""The audit-log root that pairs with ``registry_dir``: the
|
||||
``delegate_job_logs`` next to it. Pure; reads no environment. Issue #57.
|
||||
|
||||
The registry is taken by its real path: a registry directory that is itself
|
||||
a symlink pairs with the audit log next to its target, which is what the
|
||||
wrapper (``pwd -P``) and the control-plane binding (``realpath``) already
|
||||
see, so submit and logs agree (Mac review R2). A relative registry resolves
|
||||
against the cwd, as registry.py opens it.
|
||||
"""
|
||||
return os.path.join(os.path.dirname(os.path.realpath(registry_dir)), "delegate_job_logs")
|
||||
|
||||
|
||||
def get_logs_dir(registry_dir: Optional[str] = None) -> str:
|
||||
|
||||
Reference in new issue
Block a user