fix: count spec and code review documents apart (#395)
Проверка (CI) / Классификация изменённых файлов (push) Successful in 20s
Проверка (CI) / Предполётные проверки: документация, провенанс, процесс (push) Failing after 52s
Проверка (CI) / Переиспользование: это дерево уже проверено (push) Successful in 55s
Проверка (CI) / HACS: валидация репозитория (push) Failing after 20s
Проверка (CI) / Hassfest: манифест интеграции (push) Failing after 19s
Проверка (CI) / Фронтенд: типы, юниты, мутанты, синхрон бандла (push) Failing after 9m52s
Проверка (CI) / Смоки в браузере (шард 1 из 3) (push) Skipped
Проверка (CI) / Смоки в браузере (шард 2 из 3) (push) Skipped
Проверка (CI) / Смоки в браузере (шард 3 из 3) (push) Skipped
Проверка (CI) / Смоки: все шарды зелёные (push) Skipped
Проверка (CI) / Golden-кадры против принятых эталонов (push) Skipped
Проверка (CI) / Перф-смок: бюджет времени кадра (push) Skipped
Проверка (CI) / Бэкенд: pytest в Home Assistant (push) Failing after 1h5m50s

The p.7 limit bucketed every review document of an issue together, so a
task that honestly passed both stages was refused for having passed
them: #42 has 4 SPEC-REVIEW plus 3 CODE-REVIEW documents — 4 and 3
rounds per stage, both inside the budget — and its already-published
GREEN r5 verdict could not publish its own artefact for three runs in a
row, blocking the merge each time.

The counter is now keyed by stage and issue, and the refusal names the
stage. The threshold itself is unchanged: seven documents of one kind
still fail, and the comment above the constant already said what the
number means — the round budget of ONE stage.

User-Visible: no
Issue: #395
This commit is contained in:
Codex
2026-08-30 21:34:19 +03:00
parent e2a681b543
commit 066cf44c2f
2 changed files with 42 additions and 7 deletions
+23
View File
@@ -215,6 +215,29 @@ test('the review document count is per issue and per stage', () => {
assert.deepEqual(rules(checkReviewDocLimit(['CODE-REVIEW-issue-068-2026-08-12.md'])), []);
});
test('spec and code reviews are counted apart (#395)', () => {
// Порог описывает бюджет заходов ОДНОГО этапа («четыре цикла плюс два
// ребейза»), а ревью ТЗ и ревью кода — два разных этапа со своими
// бюджетами (§4). Общая корзина наказывала задачу за то, что она честно
// прошла оба: ровно эта раскладка у #42 — 4 spec + 3 code — блокировала
// публикацию УЖЕ вынесенного зелёного вердикта три прогона подряд.
const real = [
'SPEC-REVIEW-42-r1.md', 'SPEC-REVIEW-42-r2.md',
'SPEC-REVIEW-42-r3.md', 'SPEC-REVIEW-42-r4.md',
'CODE-REVIEW-42-r1.md', 'CODE-REVIEW-42-r2.md', 'CODE-REVIEW-42-r5.md',
];
assert.deepEqual(rules(checkReviewDocLimit(real)), []);
// Ослабления нет: внутри вида порог прежний, и вид назван в сообщении.
const sevenCode = Array.from({ length: 7 }, (_, i) => `CODE-REVIEW-42-r${i + 1}.md`);
const failed = checkReviewDocLimit([...sevenCode, 'SPEC-REVIEW-42-r1.md']);
assert.deepEqual(rules(failed), [7]);
assert.match(failed[0].msg, /CODE-REVIEW/);
assert.ok(!failed[0].msg.includes('SPEC'), 'жалоба адресна: spec-документы не в счёте');
// И симметрично для ревью ТЗ.
const sevenSpec = Array.from({ length: 7 }, (_, i) => `SPEC-REVIEW-42-r${i + 1}.md`);
assert.match(checkReviewDocLimit(sevenSpec)[0].msg, /SPEC-REVIEW/);
});
test('only class A/B commits are held to the issue status', () => {
// Документ ревью ложится в ветку, пока задача в S4-spec-review или
// S7-code-review: рабочего статуса в этот момент нет, и спрашивать его нельзя.