feat(queue): admit by a self-tuning load band from one limits file

Requirements 072, 073 and 083. The fixed per-kind test slot count gives
way to a utilization band: a job starts while CPU and RAM sit below the
lower limit and its learned footprint keeps them at or below the upper
one; smaller jobs backfill around a waiting head without starving it. An
AIMD target between the limits rises by 2 per poll while the host idles
and falls to the middle on overload, rising memory PSI or swap-out, with
one grant per settle window. RAM footprints are the command's p95 times
a margin learned from past prediction errors, CPU keeps the median.
<council root>/limits.json holds lower, upper, STOP and MAYDAY per CPU,
RAM, swap, disk and PSI for queue and watch (limits.py validates the
order and keeps the last valid copy). Queue override and settings
commands for the hub's Controls tab come along.

MEDUSA: 65 reviewed false positives accepted across the open bundles
(pattern hits such as .key attribute access, PLA in replace, ]]] in
nested type hints, rewrite( of the atomic writers).

🎯 Fix: 90 %
💥 Break: 5 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 86
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-27 19:02:06 +00:00
1 parent c4975d8246
commit a3e1fda7e8
17 files changed
+1708 -184

No files matched your search

+3 -1
View File
@@ -20,6 +20,7 @@ FP = {
}
SLOTS = {"gui-dind": 1, "iteration": 3, "operator": 1, "quality-high": 1, "swarm": 1, "test": 1, "test-nostack": 4}
BUDGET = {"ram": 75, "cpu": 100}
BAND = {"low": BUDGET, "high": BUDGET}
LIMITS = {"cpu_percent": 101, "mem_percent": 85}
EXCLUSIVE = {"quality-high", "test"}
LIGHT = {"test-nostack"}
@@ -152,8 +153,9 @@ def simulate(queue, jobs: list[dict], name: str, branch: bool, events: list | No
j["polled"] = t
entries = active + waiting
load, free = loaded(queue, active, waiting, host["baseline"], t), host["free"](t)
booked = {r: sum(FP[a["kind"]][r] for a in active) for r in BUDGET}
args = (entries, free, FLOOR, "stop" if free < FLOOR else "ok", "ok", False, SLOTS, {j["id"]: FP[j["kind"]] for j in entries},
BUDGET, host["ranks"], host["agents"], load, EXCLUSIVE, LIGHT)
BAND, booked, host["ranks"], host["agents"], load, EXCLUSIVE, LIGHT)
if branch:
verdicts, drain, order = queue.evaluate(*args, data["drain"], t)
data["drain"] = queue.latched(data, drain, t)