Only kinds below their target share are generated and run; one-controller flock guard

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 19:39:37 +02:00
parent 976274d48a
commit 4432ac896c
3 changed files with 44 additions and 11 deletions

View File

@@ -77,3 +77,11 @@ def accepted_task_counts(logs_dir=None):
if k:
out[k] = out.get(k, 0) + 1
return out
def below_target(counts, share=TYPE_SHARE):
"""Kinds whose share of `counts` is below the target for the next item (deficit > 0).
Since 2026-10-05 (Kral + Opus): only these kinds are generated and run; CLAS and FUNC wait until they are at or
below their target share."""
total, ss = sum(counts.values()) + 1, sum(share.values())
return {k for k, v in share.items() if total * v / ss - counts.get(k, 0) > 0}