Merge branch 'fix/kvb-org-queue-backfill' into unify/skills-20261114

# Conflicts:
#	skills/kvb-org-queue/SKILL.md
#	skills/kvb-org-queue/scripts/queue.py
This commit is contained in:
Kevin Veen-Birkenbach committed 2026-11-14 21:49:10 +00:00
commit 041851d296
9 files changed
+5017 -197

No files matched your search

+38 -33
View File
@@ -1,12 +1,12 @@
---
name: kvb-org-queue
description: >
Queue every heavy job (gate, deploy, build, swarm), never ask the chair:
hotfix first, then rank.
Queue heavy jobs (gate, deploy, build, swarm) without the chair: hotfix,
then rank; FIFO per worktree.
---
`${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.
`${CLAUDE_SKILL_DIR}/scripts/queue.py` is one queue all waiting agents
evaluate alike, never the chair.
## Run a heavy job
@@ -14,14 +14,14 @@ slots with one queue that every waiting agent evaluates by the same rules.
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.
Background it and end the turn; hold runs the command on grant, exiting 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.
- `--need-gb <N>` overrides 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`):
@@ -32,52 +32,57 @@ through hold with kind `test`, and a light kind refuses it.
## Order and grant
Every 20 s each waiting hold evaluates the queue under one lock:
Every 20 s each waiting hold evaluates the queue, locked:
1. Hotfix jobs first, then the register rank (`rasci.py show`), one place
1. Hotfixes first, then the register rank (`rasci.py show`), one place
earlier per whole hour waited, then arrival; an open `after` task holds a
job.
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.
job. Main first needs Main in `rasci.py agents` (else no tiebreak); a job
aged an hour still passes Main's.
2. A job waits 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 behind an earlier job of its worktree, compose stack
or `INFINITO_INSTANCE` slot; a job passes one that can never start, a
light job one awaiting only the machine, a hotfix all but hotfixes and
running jobs; `exclusive_kinds` run
only beside `light_kinds`.
3. A job fits if its disk need keeps the stop threshold free and its
footprint the running ones within `budget_percent` (alone always), and
passes blocked jobs, but the head (a blocked hotfix, an exclusive job
running jobs keep out, one stuck a minute or an hour old, or for other
lines a Main job whose line runs or awaits the machine) only taking
nothing it lacks, its last slot included, and only light while it is a
hotfix, exclusive or held by queue load.
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`.
running jobs may still take, below `load_limits`; outside load makes no
head and holds no line.
6. A stall escalates itself (`ESCALATION` in queue.py).
## History and learning
Every finished job appends a row to `queue-history.jsonl`, from which disk
need, slot limits and footprints are learned; read `learning.md` next to this
file before changing a seed or a limit.
Finished jobs teach disk need, slot limits and footprints via
`queue-history.jsonl`; read `learning.md` before changing a seed or limit.
## Inspect and cancel
```bash
queue.py list
queue.py list [--json]
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.
`list` shows position, ETA and blocking reason (`--json`: rule trace), `history` the learned values, `cancel` removes your waiting job.
## 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`).
only a stuck queue or 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. A `kvb-org-queue-cleanup`
round deletes only entries whose lock no living process holds.
one down, and `kvb-git-hotfix` may void a gate. `kvb-org-queue-cleanup`
deletes only entries whose lock no living process holds.
- With `queue_enforce: true`, the `block` hook (PreToolUse on Bash) refuses
`heavy_commands`, image builds, `make install|test*|quality*|verify-*`,
tests beyond one unit 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. A waiting hold rereads it every poll
(a broken file keeps the last good one), so a limit change needs no re-hold.
- Without the config, hold exits 2: tell the operator, ask the chair
(`kvb-org-organize`). A waiting hold rereads it every poll
(a broken file keeps the last good one).
File diff suppressed because it is too large. Load diff