From c6a14a6dbac123fad9bd9715b33fcd90de66aef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=81=D0=B5=D0=BB=D1=8C?= Date: Sun, 15 Nov 2026 22:21:35 +0500 Subject: [PATCH] =?UTF-8?q?PEP-127:=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D0=B0=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B4=D0=B0=D0=BA=D1=82=D0=B0?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=C2=AB=D0=9F=D1=80=D0=B8?= =?UTF-8?q?=D0=BD=D1=8F=D1=82=D1=8C=C2=BB=20=E2=80=94=20=D0=B1=D0=B5=D0=B7?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8,=20=C2=AB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D1=8F=D1=8E=D1=82=D1=81=D1=8F,=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BA=D1=80=D0=BE=D0=B5=D1=82=D1=81=D1=8F=20=D1=81=D0=B0?= =?UTF-8?q?=D0=BC=D0=B0=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.2 --- apps/web/app/(app)/t/[key]/page.tsx | 1 + packages/core/src/story-product.ts | 5 +++++ packages/testkit/test/story-product.test.ts | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/apps/web/app/(app)/t/[key]/page.tsx b/apps/web/app/(app)/t/[key]/page.tsx index fe8e82a6..98f3a2a7 100644 --- a/apps/web/app/(app)/t/[key]/page.tsx +++ b/apps/web/app/(app)/t/[key]/page.tsx @@ -243,6 +243,7 @@ export default async function StoryPage({ params, searchParams }: { params: Prom openQuestions: productQuestions.length, refining, waitsFor: blockers.filter((b) => b.open).map((b) => b.title), + accepted: !!pendingAccept, }); const body = ( diff --git a/packages/core/src/story-product.ts b/packages/core/src/story-product.ts index f8cc0ab2..1147a9a6 100644 --- a/packages/core/src/story-product.ts +++ b/packages/core/src/story-product.ts @@ -7,6 +7,8 @@ export interface StoryProductInput { archived?: boolean; /** tasks.md progress of the story's plan. */ progress?: { done: number; total: number; current: string | null } | null; + /** PEP-127: «Принять» is remembered and being carried through (`getPendingAccept`). */ + accepted?: boolean; /** A live agent is on the story; its name in the team (PEP-75). */ agentWorking: boolean; agentName?: string | null; @@ -33,6 +35,7 @@ export interface StoryProductView { export const STORY_PRODUCT_TEXT = { nothingNeeded: "От вас сейчас ничего не нужно.", + accepted: { now: "Вы приняли работу — изменения обновляются", next: "Когда проверки пройдут, задача закроется сама. Мы сообщим, когда это случится или если что-то не получится." }, answerBelow: "Ответьте на вопрос ниже.", afterAnswer: "После вашего ответа агент продолжит работу.", archived: { now: "Задача в архиве", next: "Работа по ней не идёт. Вернуть задачу на доску можно в «Подробнее»." }, @@ -73,6 +76,8 @@ export function storyProductView(i: StoryProductInput): StoryProductView { const asked = i.openQuestions > 0; if (i.archived) return { ...base, ...T.archived }; if (i.status === "done") return { ...base, ...T.done }; + // PEP-127: accepted already, Peppa carries it to the end itself — nothing to press again. + if (i.accepted && i.status !== "backlog" && i.status !== "blocked") return { ...base, ...T.accepted }; if (i.status === "review") return { ...base, ...T.review, canAccept: true, canFix: true }; if (i.status === "backlog") { if (i.refining === "waiting") return { ...base, ...T.refiningWaiting, need: T.answerBelow }; diff --git a/packages/testkit/test/story-product.test.ts b/packages/testkit/test/story-product.test.ts index 2678a7d8..94ff8221 100644 --- a/packages/testkit/test/story-product.test.ts +++ b/packages/testkit/test/story-product.test.ts @@ -37,6 +37,16 @@ describe("PEP-120: story page in «Продакт» mode", () => { assert.match(v.need!, /«Принять» или «Поправить»/); }); + test("Принято, Peppa доводит до конца (PEP-127): no buttons, nothing needed", () => { + for (const status of ["review", "in_progress"]) { + const v = view({ status, agentWorking: status === "in_progress", accepted: true }); + assert.equal(v.now, "Вы приняли работу — изменения обновляются"); + assert.ok(!v.canAccept && !v.canFix); + assert.equal(v.need, null); + assert.match(v.next, /закроется сама/); + } + }); + test("Текущий шаг с названием файла: no step text", () => { assert.equal(view({ progress: { done: 2, total: 4, current: "Добавить `core/pay.ts` и тест pay.test.ts" } }).stepText, null); for (const t of ["Тест pay.test.ts", "Обновить packages/core", "Вызвать moveTask", "pnpm run ci зелёный", "Миграция users_table", "Запушить и открыть PR"]) assert.equal(core.plainStep(t), null, t);