PEP-123: tests follow the reworded messages

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Асель 2026-11-15 18:14:17 +05:00
parent ef846c51a6
commit 3635140503
12 changed files with 16 additions and 16 deletions

View File

@ -1,7 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/dev/types/root-params.d.ts";
import "./.next/types/routes.d.ts";
import "./.next/types/root-params.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@ -374,7 +374,7 @@ const EVENT_TEXT: Record<string, (p: P) => { text: string; important?: boolean;
};
const RELEASE_ICON: Record<string, string> = { deploying: "⏳", healthy: "🚀", rolled_back: "↩️", failed: "❌", removed: "🧹" };
const RELEASE_RU: Record<string, string> = { deploying: "выкатывается", healthy: "работает", rolled_back: "не прошла проверку — возвращена прежняя", failed: "не выкатилась", removed: "убрана" };
const RELEASE_RU: Record<string, string> = { deploying: "обновляется", healthy: "работает", rolled_back: "не прошла проверку — возвращена прежняя", failed: "не обновилась", removed: "убрана" };
// PEP-111: what a release is, in words for a product manager.
const ENV_RU: Record<string, string> = { preview: "Версия для проверки задачи", staging: "Версия для проверки", prod: "Рабочая версия продукта" };
const INCIDENT_RU: Record<string, string> = { new: "новая", open: "открыта", pending: "ждёт решения", task: "заведена задача", ignored: "игнорируем", resolved: "исправлена", regressed: "вернулась" };

View File

@ -265,7 +265,7 @@ describe("staleness and reliability", () => {
const m = await messageFor(q.id);
execFileSync("tmux", ["-L", process.env.PEPPA_TMUX_SOCKET!, "kill-session", "-t", `=${(await p.session(sid)).tmuxName}`]);
tg.userSends(PM, "используй v2", m.message_id);
await waitFor("down notice", async () => lastReplyTo(PM.chatId)?.text.includes("сессия сейчас не запущена"));
await waitFor("down notice", async () => lastReplyTo(PM.chatId)?.text.includes("Агент сейчас не работает"));
assert.equal((await core.getQuestion(db, q.id)).answer, "используй v2");
});
});
@ -350,10 +350,10 @@ describe("Стори из сообщения боту", () => {
// Silence → nothing to create.
tg.userSendsVoice(PM, Buffer.from("ogg-opus-noise"));
await botMsg(/Не разобрал ни слова/);
// Wrong key → the service error is shown, no draft.
// Wrong key → a plain message without the service code, no draft.
process.env.PEPPA_TRANSCRIBE_KEY = "wrong";
tg.userSendsVoice(PM, MockTranscribe.speech("что-то"));
await botMsg(/Не получилось расшифровать голосовое \(расшифровка не удалась: 401/);
await botMsg(/Не получилось расшифровать голосовое\. Напишите задачу текстом/);
} finally {
delete process.env.PEPPA_TRANSCRIBE_URL;
delete process.env.PEPPA_TRANSCRIBE_KEY;

View File

@ -71,7 +71,7 @@ describe("Превышение бюджета ставит стори на па
assert.deepEqual(q.options, [runner.BUDGET_EXTEND, runner.BUDGET_UNLIMIT, runner.BUDGET_STOP]);
const s = await core.getSession(db, sid);
assert.ok(tmuxAlive(s.tmuxName), "the runner process is not killed");
await assert.rejects(runner.startSession(db, p.taskKey), /Бюджет стори исчерпан/);
await assert.rejects(runner.startSession(db, p.taskKey), /Бюджет задачи исчерпан/);
assert.equal(await runner.budgetTick(db), 0, "asked once");
const ev = (await core.listJournal(db, { taskId: task.id })).find((e) => e.type === "budget_paused");
assert.ok(ev, "budget_paused event on the story");

View File

@ -131,7 +131,7 @@ describe("Красные проверки возвращаются агенту"
const q = (await core.pendingQuestions(db, t.proj.id)).find((x) => x.kind === "question");
assert.ok(q, "PM got a question");
assert.equal(q.taskId, (await t.ref()).task.id);
assert.match(q.text, new RegExp(`красные 3 раза подряд[\\s\\S]*Лог: ${gitea.url}/`));
assert.match(q.text, new RegExp(`не проходят 3 раза подряд[\\s\\S]*Подробности: ${gitea.url}/`));
await t.p.waitLog("runner told to wait", (e) => e.ev === "prompt" && String(e.prompt).includes("жди ответа PM"));
// The agent's prompts (the "wait" paste included) don't close the PM's question…
await new Promise((r) => setTimeout(r, 1500));

View File

@ -179,7 +179,7 @@ describe("Мерж руками закрывает стори", () => {
assert.equal((await t.ref()).task.status, "done");
const closed = await core.getQuestion(db, q.id);
assert.ok(closed.answeredAt);
assert.match(closed.answer!, /смержен в Gitea/);
assert.match(closed.answer!, /Изменения приняты в код проекта/);
// A redelivery does nothing.
assert.equal(action(await t.hook("pull_request", { action: "closed", number: t.pr, pull_request: pull, sender: { login: "mock-pm" } })), "none");
});

View File

@ -371,7 +371,7 @@ describe("Политика инцидентов проекта", () => {
assert.equal(i.taskId, null);
assert.equal((await tasksOf(c)).filter((t) => t.title.startsWith("Ошибка:")).length, 5);
const m = await waitPm("TypeError: limit 6");
assert.match(m.text, /Суточный предел стори из ошибок \(5\) исчерпан/);
assert.match(m.text, /Суточный предел задач из ошибок \(5\) исчерпан/);
assert.equal(buttons(m).length, 3);
// The PM's own decision isn't capped.
const r = await runner.decideIncident(db, i.id, "backlog", "mock-pm");

View File

@ -102,7 +102,7 @@ describe("Продакт и аналитик", () => {
const all = await core.listTasks(db, { projectId: p.id });
assert.deepEqual(all.map((t) => t.title).sort(), ["Каталог: список товаров", "Оплата картой", "Тележка"]);
assert.equal((await core.getIntakeState(db, ref.task.id))!.stage, "done");
assert.match((await core.storyComments(db, ref.task.id))[0]!.text, /Разделил на стори: эта и MIN\w-2, MIN\w-3/);
assert.match((await core.storyComments(db, ref.task.id))[0]!.text, /Разделил на задачи: эта и MIN\w-2, MIN\w-3/);
// The split stories skip the product manager: the analyst takes them on the next tick.
await tick();
for (const t of all) assert.equal((await core.getIntakeState(db, t.id))!.stage, "done");
@ -122,7 +122,7 @@ describe("Продакт и аналитик", () => {
assert.equal(gaveUp.stage, "done");
assert.match(gaveUp.note!, /не по формату/);
assert.equal((await story(broken.key)).description ?? "", "", "the story goes on as written");
assert.match((await core.storyComments(db, broken.task.id)).at(-1)!.text, /стори идёт в работу как написана/);
assert.match((await core.storyComments(db, broken.task.id)).at(-1)!.text, /задача идёт в работу как написана/);
setScenario({});
// Roles never hold a story waiting for the PM; taking it to work afterwards changes nothing.

View File

@ -122,7 +122,7 @@ describe("Отключение", () => {
try {
const text = await runner.recordLimit(db, await sess(sid), "Usage limit reached, resets 5pm");
assert.equal((await sess(sid)).resumeAt, null);
assert.match(text ?? "", /упёрлась в лимит/);
assert.match(text ?? "", /упёрся в лимит/);
} finally {
delete process.env.PEPPA_LIMIT_AUTORESUME;
}

View File

@ -257,7 +257,7 @@ describe("Дайджест", () => {
assert.match(msg!, /<b>Что нового<\/b>/);
assert.match(msg!, new RegExp(`Сделано: ${pep.key}-159, ${pep.key}-161`));
assert.match(msg!, /<b>Сейчас<\/b>/);
assert.match(msg!, /Раннеров: 2/);
assert.match(msg!, /Агентов за работой: 2/);
assert.match(msg!, /Вопросов: 1/);
assert.equal(await core.platformDigestTick(db, { now: day(10) }), null, "раз в сутки");
} finally {

View File

@ -55,7 +55,7 @@ describe("PEP-111: the project's product", () => {
await core.syncChats(db);
const chat = await core.ensureProjectChat(db, p.id);
const texts = (await core.chatMessagesView(db, chat.id, {})).map((m) => m.text);
assert.deepEqual(texts, ["❌ Черновой стенд стори: не выкатилась", "🚀 Версия для проверки: работает · стори: Y-1", "🚀 Рабочая версия продукта: работает · стори: Y-1"]);
assert.deepEqual(texts, ["❌ Версия для проверки задачи: не обновилась", "🚀 Версия для проверки: работает · задачи: Y-1", "🚀 Рабочая версия продукта: работает · задачи: Y-1"]);
assert.ok(texts.every((t) => !/[0-9a-f]{7}/.test(t)), "no commit hashes for a product manager");
});

View File

@ -61,7 +61,7 @@ describe("Переезд на подписку другого провайдер
const ev = (await typeEvents(runner.SWITCH_EVENT)).find((e) => e.sessionId === sid)!.payload as Record<string, unknown>;
assert.deepEqual({ from: ev.fromProvider, to: ev.toProvider, carried: ev.carried }, { from: "claude", to: "codex", carried: "fresh" });
const [msg] = await outboxTexts(`rot:${sid}:g2:`);
assert.match(msg!, /переехал с подписки «Cross A» на «Cross C».*ChatGPT \(Codex\) — начал заново с контекстом из стори/);
assert.match(msg!, /переехал с подписки «Cross A» на «Cross C».*ChatGPT \(Codex\) — начал заново по описанию задачи/);
await runner.stopSession(db, sid);
});