fix(delegation): audit-log root follows the registry (Issue #57)

get_logs_dir(registry_dir) resolves the audit-log root as the
delegate_job_logs next to the registry in use when DELEGATE_JOB_LOGS_DIR
is not set; sibling_logs_dir() is the pure sibling rule. Every writer and
reader that knows its registry (registry, engine, publish_event, remote,
job_subscriber, reconcile.sh, the loop runner's fingerprint exclusion)
passes that root instead of falling back to the workspace default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Fable 5.1 committed 2026-10-13 09:55:09 +00:00
1 parent e32c957464
commit b8bed8124e
8 files changed
+46 -28

No files matched your search

+3 -2
View File
@@ -374,13 +374,14 @@ def _flush(notifications, registry_dir) -> None:
Best effort by design: the registry record is already durable, and an audit
write must never be able to fail a transition that has committed.
"""
logs_dir = mqtt_common.get_logs_dir(registry_dir)
for note in notifications:
job_id = note["job_id"]
kind = note["kind"]
try:
if kind == "status_changed":
mqtt_common.update_logged_status(
job_id, note["to"], updated_at=note.get("timestamp"),
job_id, note["to"], logs_dir=logs_dir, updated_at=note.get("timestamp"),
transition_seq=note.get("transition_seq"))
mqtt_common.append_event(job_id, {
"event": "status_changed",
@@ -389,7 +390,7 @@ def _flush(notifications, registry_dir) -> None:
"by": note.get("by"),
"timestamp": note.get("timestamp"),
"transition_seq": note.get("transition_seq"),
})
}, logs_dir=logs_dir)
elif kind == "conflict_refused":
mqtt_common.append_event(job_id, {
"event": "conflict_refused",