Files
skills/skills/kvb-org-queue/SKILL.md
T
Kevin Veen-BirkenbachandClaude Opus 5.5 151031ab4a fix(kvb-org-queue): light kinds meet only running and granted jobs, never a reservation
Every entry blocked by budget or disk added its share to the tally of all entries behind it, and a head the host load keeps out counted as granted while a job ran, so test-nostack jobs needing 0 GB and 11 % CPU waited behind 'CPU 170-242 % in use or reserved' (live queue 2026-11-12). Operator pick on the chair's ask: a light_kinds entry is now checked only against running and granted entries; reservations, a load-held head included, hold back heavy kinds alone. resources() returns what a job takes or reserves, so evaluate() keeps both tallies. Heavy-only queues give master's verdicts (skeptic probe: 0 of 40000 random cases differ); a stream of light jobs can delay a heavy head, as the docstring and SKILL.md now state. Tests kill the reviewer's three mutants and fail on master.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:47:26 +00:00

3.7 KiB

name, description
name description
kvb-org-queue Run every heavy job (gate, deploy, build, swarm) through a deterministic queue instead of asking the chair: hotfix first, then register rank.

${CLAUDE_SKILL_DIR}/scripts/queue.py replaces asking the chair for heavy slots with one queue that every waiting agent evaluates by the same rules.

Run a heavy job

queue.py hold --kind <kind> --task <register task> -- <command>

Start it in the background (run_in_background or equivalent) and end the turn: hold runs the command on its grant and exits with its code.

  • <kind>: a key of slot_need_gb in ~/.claude/agents-council/config.json.
  • <register task>: your open kvb-org-rasci task; its rank places you.
  • --hotfix <slug>: the job proves the register row hotfix/<slug> (kvb-git-hotfix) and goes first.
  • --need-gb <N> overrides the learned disk need.
  • Start hold in the job's worktree: its git toplevel is the workdir. Other runtimes add --session <id>.
  • In a worktree the command stays gate.py run|hold (kvb-check-gate): queue.py hold ... -- python3 <gate.py> run ....

Light runs (no Docker, about a minute) self-admit with watch.py admit --kind test-nostack (kvb-org-organize).

Order and grant

Every 20 s each waiting hold evaluates the queue under one lock:

  1. Hotfix jobs first, then the register rank (rasci.py show), one place earlier per whole hour waited, then arrival.
  2. In that order, a job is blocked at disk stage stop or critical, at warn when it needs disk, at memory stage stop, during a radio-silence mayday, while its kind's slots are taken, or while its workdir runs another job; exclusive_kinds run only beside light_kinds.
  3. A job whose disk need would cut below the stop threshold, or whose footprint would push the running ones past budget_percent, reserves it against the jobs behind it but light_kinds, which meet only running and granted jobs, so a stream of light jobs can delay a heavy head; a job alone always fits.
  4. An unblocked job counts as granted for the jobs behind it.
  5. Every job, alone too, needs CPU, and RAM used plus what it and the running jobs may still take, below load_limits.

History and learning

Every finished job appends a row (signature such as <repo>: make <target>, kind, minutes, disk, RAM and CPU) to queue-history.jsonl; the kvb-org-organize watch hook keeps it across reboots.

From the last 30 days, once 5 runs exist:

  • per signature, the disk need is p90 disk taken plus 1 GB;
  • per kind, the slot limit is how many p90 RAM and median CPU shares fit between the median load at the grant and load_limits, at least 1;
  • per job, the footprint is its signature's share, else its kind's.

Until then the seeds hold: slot_need_gb[kind] for disk, 1 slot per kind, the whole budget as footprint. The optional slot_limits {kind: N} only caps a limit from above.

Inspect and cancel

queue.py list
queue.py history
queue.py cancel <id>

list shows each job's position, ETA and blocking reason, history the learned values, cancel removes your own waiting job (its hold exits 3).

Rules

  • Never ask the chair for a heavy slot or announce a grant; the chair handles only exceptions such as a stuck queue or a hung job (capacity.md of kvb-org-organize).
  • A running job is never cut short for the queue; only the operator orders one down, and kvb-git-hotfix may void a gate.
  • With queue_enforce: true, the block hook (PreToolUse on Bash) refuses heavy_commands, image builds, make install|verify-*, tests beyond one file and gate.py run|hold outside queue.py hold.
  • Without the config, hold exits 2: tell the operator and ask the chair (kvb-org-organize) until it exists.