From 59dac57bc85762426c9d1d25454b67ca8b6538cd Mon Sep 17 00:00:00 2001 From: KeelrLeek <156356974+KeelrLeek@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:27:57 -0500 Subject: [PATCH] claims: a draft claim inside another agent's band is allowed when a coordinator assigned the agent a task for that scope (reassigned rework) --- harbor/core.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/harbor/core.py b/harbor/core.py index b3eb268..ac60943 100644 --- a/harbor/core.py +++ b/harbor/core.py @@ -709,7 +709,14 @@ class Harbor(WorkMixin, ExtrasMixin, FlowMixin, LaunchMixin): if kind == "draft" and lo is not None: bands = [a for a in active if a["kind"] == "band" and scopes_overlap((canonical, lo, hi), (a["scope"], a["lo"], a["hi"]))] - if bands and not any(b["agent"] == agent for b in bands): + # a task a coordinator assigned to this agent for this scope is the exception to another's band + assigned = any(scopes_overlap((canonical, lo, hi), (t["scope"], *parse_scope(t["scope"])[1:])) + for t in c.execute("SELECT scope FROM tasks WHERE assignee=? AND scope IS NOT NULL " + "AND state IN ('open','in_progress') AND created_by IN (%s)" + % ",".join("?" * len(self.coordinators)), + (agent, *self.coordinators)).fetchall() + if t["scope"].startswith(("fn:", "range:", "file:"))) + if bands and not any(b["agent"] == agent for b in bands) and not assigned: conflicts += bands if conflicts and not override: described = "; ".join(f"{a['agent']} holds {a['kind']} {a['scope']}"