forked from Keelrleek/Harbor
claims: a draft claim inside another agent's band is allowed when a coordinator assigned the agent a task for that scope (reassigned rework)
This commit is contained in:
1 parent
c77ed1a4db
commit
59dac57bc8
1 file changed
+8
-1
+8
-1
@@ -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']}"
|
||||
|
||||
Reference in new issue
Block a user