Оформление задачи
Вы узнаете
Что Королева делает с задачей без нужных разделов и почему останавливается после двух попыток.
Пчела может начать только задачу, в которой сказано, что сделать и каких файлов можно касаться. Королева проверяет каждую открытую задачу функцией judge() из specs/policy/issue_shape.t27. Неготовую она оформляет: модель дописывает недостающие разделы, и текст возвращается в задачу, только если judge() больше ничего не находит. После SHAPE_ATTEMPT_LIMIT, 2 неудачных попыток, она останавливается и один раз пишет комментарий, чего не хватает, а эпик не оформляется никогда. Решает shape_action в shaping.t27, а новая попытка ждёт 360 минут.
Попробовать
Поставьте два недостающих раздела и пройдите попытки; затем отметьте, что автору уже написали, и посмотрите, в какую колонку попадёт задача.

Set how many sections an issue lacks and how often shaping failed: the Queen leaves it, shapes it, or tells its author once what is missing.
specs/queen/shaping.t27
// SPDX-License-Identifier: Apache-2.0
; specs/queen/shaping.t27 -- the Queen shapes an issue that is not ready, or says once what it lacks
; Owner, 2026-10-08 (translated): forbid issues that break the rules; find every fragile place and fix
; it; 233 + 115 issues are not ready for work because their spec is missing or incomplete.
; Measured that morning on /queen/status: of 704 candidates, the round said "nothing to choose" in most
; rounds while 63 of 70 lanes stood idle. 233 issues were skipped as missingBoundary and 115 as
; incompleteSpec. Some of them have a `## Boundary` heading with prose under it and no path (#7703,
; #7642), which the rule counts as missing.
; --
; The rule an issue must meet is specs/policy/issue_shape.t27 (judge: one bit per missing section).
; A workflow cannot hold that line here: .yml is owner-only, and `gh issue create` never sees a
; template. So the Queen holds it in her own round. Every open issue that judge() refuses is either
; SHAPED by her (the missing sections are written by a model, every boundary path is checked against
; the repository, and the body is written back only if judge() then returns 0), or, when shaping
; failed SHAPE_ATTEMPT_LIMIT times, its author is told ONCE what is missing.
; --
; A wrong boundary is worse than a missing one (tools/queen/propose_boundary.py): it reserves files the
; work does not own. So path_accepted refuses a path the model invented: a path that does not exist is
; accepted only when the issue itself cites it and its directory exists, and never when it would be a
; new file in a language the only-t27 rule denies.
; Containers (labels epic, roadmap) are not tasks, as issue_shape says; they are never shaped.
; ASCII only (L3).
; phi^2 + 1/phi^2 = 3 | TRINITY
module QueenShaping;
/// What the Queen does with one open issue.
/// LEAVE nothing: it is ready, a container, or already told
/// SHAPE ask for the missing sections, judge them, write them back if they pass
/// TELL comment once, naming what is missing
pub const SH_LEAVE : u8 = 0;
pub const SH_SHAPE : u8 = 1;
pub const SH_TELL : u8 = 2;
/// Attempts at shaping one issue before its author is told instead.
pub const SHAPE_ATTEMPT_LIMIT : u32 = 2;
/// Issues shaped per round. A shape is one model call; the round has other work.
pub const SHAPES_PER_ROUND : u32 = 3;
/// Minutes between two attempts on one issue, so a refused shape is not retried every round.
pub const SHAPE_RETRY_MINUTES : u32 = 360;
/// A boundary is a reservation; one naming more files than this is not a task, it is a project.
pub const MAX_BOUNDARY_PATHS : u32 = 12;
/// `missing`: judge()'s bits for the body (0 = ready); `container`: labelled epic or roadmap;
/// `attempts`: shapes tried so far; `told`: the author was already told.
pub fn shape_action(missing: u8, container: bool, attempts: u32, told: bool) -> u8 {
if (missing == 0) { return SH_LEAVE; }
if (container) { return SH_LEAVE; }
if (attempts < SHAPE_ATTEMPT_LIMIT) { return SH_SHAPE; }
if (told) { return SH_LEAVE; }
return SH_TELL;
}
/// Is one proposed boundary path acceptable?
/// exists the file is in the repository at the base ref
/// dir_exists its directory is (a new file beside its siblings)
/// cited the issue's own title or body names this path
/// foreign_new it would be a NEW file whose extension the only-t27 rule denies to new work
/// A file that exists is always acceptable: finding the file a title describes is the point. A file
/// that does not exist must be cited by the issue, in a directory that exists, and not foreign.
pub fn path_accepted(exists: bool, dir_exists: bool, cited: bool, foreign_new: bool) -> bool {
if (exists) { return true; }
if (dir_exists == false) { return false; }
if (foreign_new) { return false; }
return cited;
}
/// Does a shape land? Only when the body it produces is ready (judge() = 0), it names between 1 and
/// MAX_BOUNDARY_PATHS paths, and every one of them was accepted.
pub fn shape_lands(missing_after: u8, paths: u32, rejected: u32) -> bool {
if (missing_after != 0) { return false; }
if (paths == 0) { return false; }
if (paths > MAX_BOUNDARY_PATHS) { return false; }
return rejected == 0;
}
/// Is an attempt due? Never twice inside SHAPE_RETRY_MINUTES on one issue.
pub fn attempt_due(attempts: u32, minutes_since_last: u32) -> bool {
if (attempts == 0) { return true; }
return minutes_since_last >= SHAPE_RETRY_MINUTES;
}
test a_ready_issue_and_a_container_are_left_alone {
assert shape_action(0, false, 0, false) == SH_LEAVE;
assert shape_action(15, true, 0, false) == SH_LEAVE;
assert shape_action(1, true, 9, false) == SH_LEAVE;
}
test an_unready_issue_is_shaped_then_its_author_is_told_once {
assert shape_action(1, false, 0, false) == SH_SHAPE;
assert shape_action(15, false, SHAPE_ATTEMPT_LIMIT - 1, false) == SH_SHAPE;
assert shape_action(15, false, SHAPE_ATTEMPT_LIMIT, false) == SH_TELL;
assert shape_action(15, false, SHAPE_ATTEMPT_LIMIT, true) == SH_LEAVE;
assert shape_action(8, false, SHAPE_ATTEMPT_LIMIT + 3, true) == SH_LEAVE;
}
test a_boundary_path_must_be_true_of_the_repository {
// an existing file, cited or found
assert path_accepted(true, true, false, false) == true;
assert path_accepted(true, true, true, false) == true;
// a new spec the issue asks for, beside its siblings
assert path_accepted(false, true, true, false) == true;
// a new file the issue never mentioned: invented
assert path_accepted(false, true, false, false) == false;
// a new file in a directory that does not exist
assert path_accepted(false, false, true, false) == false;
// a new .py or .ts the only-t27 rule denies, even when cited
assert path_accepted(false, true, true, true) == false;
}
test a_shape_lands_only_when_the_body_is_ready_and_every_path_holds {
assert shape_lands(0, 1, 0) == true;
assert shape_lands(0, MAX_BOUNDARY_PATHS, 0) == true;
assert shape_lands(1, 3, 0) == false;
assert shape_lands(0, 0, 0) == false;
assert shape_lands(0, MAX_BOUNDARY_PATHS + 1, 0) == false;
assert shape_lands(0, 3, 1) == false;
}
test a_refused_shape_is_not_retried_every_round {
assert attempt_due(0, 0) == true;
assert attempt_due(1, SHAPE_RETRY_MINUTES - 1) == false;
assert attempt_due(1, SHAPE_RETRY_MINUTES) == true;
}
invariant the_codes_and_limits_never_move {
assert SH_LEAVE == 0 and SH_SHAPE == 1 and SH_TELL == 2;
assert SHAPE_ATTEMPT_LIMIT > 0 and SHAPES_PER_ROUND > 0;
assert MAX_BOUNDARY_PATHS > 0;
}
Все уроки
Модуль 1 · Задача
Задача становится работой, только когда её оформили: недостающие разделы дописаны или запрошены, граница называет настоящие файлы, а один фильтр читает задачи всех видов.
Модуль 2 · Кто следующий
Порядок, в котором Королева берёт задачи: метка стареет на одну ступень, критичными идут не больше 3, и ничего нового не начинается, пока готовая работа ждёт ревью.
Модуль 3 · Жизнь пчелы
От кандидата до готовой работы: двенадцать состояний и шестнадцать событий, корабль в игре, который улетает домой, и деплой, который не обрывает пчелу.
Модуль 4 · Пчела-ревьюер
Готовую работу судят по своим часам: столько ревью сразу, чтобы успевать, пауза, которая удваивается для строки в ожидании, и ворота слияния, которые не открыть без проверок.
Модуль 5 · Затор ревью
Застрявший пулл-реквест всегда в одном из десяти случаев, у каждого свой ход Королевы, а красная проверка считается унаследованной, только если так говорит master.
Модуль 6 · Ключи
Ключ модели у пчелы могут отклонить: код в теле ответа сортирует отказ, временный отказ даёт ключу отдохнуть секунды, и пчела переходит к следующему свободному ключу.
Модуль 7 · Заслуги и деньги
Одолженный ключ не приносит заслуг, операция продаётся вдвое дороже своей цены в токенах по полцента, а токены сгорают через 30 дней после зачисления.
Модуль 8 · Агенты между собой
У каждого агента свой бот в одной группе: кого зовут, цепочка глубиной в три сообщения ботов и часы, которые не дают агентам завалить чат.
Модуль 9 · Ночь и доска
Что показывает улей: ночной дозор, который открывает, комментирует и закрывает задачи, колонки публичной доски и соты, которые вспыхивают на каждое событие.