fix(consistency): preserve repository domain in briefs
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a02b22-9638-76d2-bbff-b7ea1770b118
This commit is contained in:
tegwick 2026-08-23 13:57:22 +02:00
parent b91b8705d1
commit fae2816199
3 changed files with 72 additions and 4 deletions

View file

@ -2547,10 +2547,10 @@ def _write_custodian_brief(api_base: str, repo_slug: str, repo_path: str) -> boo
return False
repo_id: str = repo.get("id", "")
domain_slug: str = ""
domain_slug = str(repo.get("domain_slug") or "")
# Resolve domain slug: prefer active workstreams, fall back to any workstream
# so that a fully-finished repo doesn't degrade to "(unknown)".
# The repository projection owns domain identity. Retain the workplan/topic
# lookup only for compatibility with older API responses that omitted it.
workstreams: list[dict] = []
for status in OPEN_WORKSTREAM_STATUSES:
rows = _api_get(api_base, "/workplans", {"repo_id": repo_id, "status": status}) or []
@ -2560,7 +2560,7 @@ def _write_custodian_brief(api_base: str, repo_slug: str, repo_path: str) -> boo
if not _ws_for_domain:
all_ws = _api_get(api_base, "/workplans", {"repo_id": repo_id}) or []
_ws_for_domain = all_ws if isinstance(all_ws, list) else []
if _ws_for_domain:
if not domain_slug and _ws_for_domain:
topic = _api_get(api_base, f"/topics/{_ws_for_domain[0].get('topic_id', '')}")
if topic:
domain_slug = topic.get("domain_slug", "")