feat(kvb-org-queue): let jobs pass holders that can never start and help a disk-blocked head
A waiting job passes a same-line holder that cannot start under the current caps and takes its place; the decision is recomputed every pass, so a holder that recovers regains its place. A hotfix holds others back and heads the line only while it could start. A holder blocked by disk alone gets the cleanup and the Main notice even while smaller jobs backfill. Main-first reservations stay; the replay pins the lines bounds and caps its mean. Tests run once on unify/skills-20261114 after the merge (operator order 2026-11-14). 🎯 Fix: 80 % 💥 Break: 12 % 💸 Tokens: 100 % ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 70 🚦 Gate: ⛔ fix 80 % < 90, break 12 % > 5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a2a03995cb
commit
9fc1383e97
9 files changed
+5020
-200
No files matched your search
@@ -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,71 +14,76 @@ 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`):
|
||||
`queue.py hold ... -- python3 <gate.py> run ...`.
|
||||
|
||||
One test file or module, or ruff, without Docker self-admits with
|
||||
`watch.py admit --kind test-nostack` (`kvb-org-organize`); any other test
|
||||
run goes through hold with kind `test`.
|
||||
One test file or module, or ruff, without Docker self-admits
|
||||
(`watch.py admit --kind test-nostack`, `kvb-org-organize`); other test runs
|
||||
hold kind `test`.
|
||||
|
||||
## 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|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. 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
Reference in new issue
Block a user