fix(kvb-org-queue): book a job at its own command's footprint

A command with 5+ runs is booked at its own p90 RAM and CPU share, an unlearned one at its kind's p90. The old rule took the larger of kind and command, and for an unlearned command the largest command of its kind: test-nostack-788 (docker build) sat 90 min at position 1, booked at 42.6 % RAM from a legacy gate.py hold row while test-nostack measures 5.6 %; skills make test (3.3 %) was booked at the test kind's 35 %.

🎯 Fix: 93 %
💥 Break: 5 %
💸 Cost: 99 %
⏱️ Time: 100 %
🛡️ Security: 100 %
🏆 Score: 89
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-11 12:07:13 +00:00
1 parent 45063dc71f
commit 7043cdfd98
3 files changed
+17 -15

No files matched your search

+5 -12
View File
@@ -212,21 +212,14 @@ def footprint(kind: str, name: str, signatures: dict[str, dict], kinds: dict[str
kinds: the kind map of learn().
Returns:
{ram, cpu}: the larger of the kind's p90 share and the signature's, at
least MIN_SHARE_PERCENT; a signature not learned yet takes the largest
learned share of its kind. None while the kind is not learned yet.
{ram, cpu}: the signature's p90 share once learned, else the kind's, at
least MIN_SHARE_PERCENT. None while the kind is not learned yet.
"""
if kind not in kinds or kinds[kind]["ram_share"] is None:
return None
own_kind = kinds[kind]
if name in signatures and signatures[name]["ram_share"] is not None:
peers = [signatures[name]]
else:
peers = [s for s in signatures.values() if kind in s["kinds"] and s["ram_share"] is not None]
return {
resource: max([MIN_SHARE_PERCENT, own_kind[f"{resource}_share"], *(peer[f"{resource}_share"] for peer in peers)])
for resource in RESOURCES
}
own = signatures.get(name)
source = own if own and own["ram_share"] is not None else kinds[kind]
return {resource: max(MIN_SHARE_PERCENT, source[f"{resource}_share"]) for resource in RESOURCES}
def seed_ram(kinds: dict[str, dict]) -> float: