feat(frontend): drop demo labels from the product screens

This commit is contained in:
shira committed 2026-10-10 10:26:11 +03:00
1 parent c836d02ea3
commit 90ff71735a
44 files changed
+165 -376

No files matched your search

@@ -18,12 +18,12 @@ async function renderPath(path: string, demo: boolean): Promise<string> {
}
describe("demonstration stand routes", () => {
it("serves the jury guide and the banner only in a demo build", async () => {
it("serves the jury guide only in a demo build", async () => {
expect(await renderPath("/demo", true)).toMatch(/<h1[^>]*>Гид для жюри<\/h1>/);
expect(await renderPath("/demo", false)).toMatch(/<h1[^>]*>Страница не найдена<\/h1>/);
expect(await renderPath("/", true)).toContain("Демонстрационный стенд.");
expect(await renderPath("/", false)).not.toContain("Демонстрационный стенд.");
expect(await renderPath("/", true)).not.toContain("Демонстрационный стенд");
expect(await renderPath("/", false)).not.toContain("Демонстрационный стенд");
});
it("links the jury guide from the landing page only in a demo build", async () => {
+1 -1
View File
@@ -237,7 +237,7 @@ describe("product readiness", () => {
const html = await renderHtml("/candidate/assessment");
expect(html).toContain("Сначала выберите специализацию");
expect(html).toContain("Начать демонстрацию");
expect(html).toContain("Пройти экспресс-тест");
expect(html).not.toContain("Начать полную проверку");
});
+1 -1
View File
@@ -46,7 +46,7 @@ import { SupportRoute } from "./support-route";
export function createRoutes(stand: StandMode = standMode): RouteObject[] {
return [
{
element: <RootLayout demoStand={stand.demo} />,
element: <RootLayout />,
errorElement: <RouteErrorPage />,
children: [
{
+1 -8
View File
@@ -1,17 +1,10 @@
import { Outlet, ScrollRestoration } from "react-router-dom";
import { DemoStandBanner } from "../../widgets/demo-stand-banner";
type RootLayoutProps = {
/** True only in a demo build; the banner marks synthetic data on every page. */
demoStand?: boolean;
};
/** Top route element shared by every route group. */
export function RootLayout({ demoStand = false }: RootLayoutProps) {
export function RootLayout() {
return (
<>
<ScrollRestoration />
{demoStand ? <DemoStandBanner /> : null}
<Outlet />
</>
);
@@ -47,7 +47,7 @@ export function methodLabel(mode: AssessmentMode): string {
case "demo_basic":
return "Базовая проверка по фиксированному набору заданий";
case "demo_express":
return "Демонстрационный экспресс-запуск";
return "Экспресс-тест";
}
}
@@ -37,13 +37,11 @@ describe("result fixtures", () => {
describe("describeAssessmentResult for a demo_basic result", () => {
const view = describeAssessmentResult(demoBasicAssigned(), options);
it("shows the category, date, method, and the provisional status", () => {
it("shows the category, date, and method", () => {
expect(fact(view, categoryLabel)).toBe("Backend, Middle (присвоена этим результатом)");
expect(fact(view, "Дата решения")).toBe("8 октября 2026 г. в 09:30 UTC");
expect(fact(view, "Метод")).toBe("Базовая проверка по фиксированному набору заданий");
expect(fact(view, "Статус")).toBe("предварительный, пороги не калибровались");
expect(fact(view, "Происхождение решения")).toBe("синтетическая демонстрация стенда");
expect(view.isProvisional).toBe(true);
expect(view.facts.map((item) => item.label)).toEqual([categoryLabel, "Дата решения", "Метод"]);
});
it("states the method limitation and invents no percentile or estimate", () => {
@@ -53,9 +51,8 @@ describe("describeAssessmentResult for a demo_basic result", () => {
expect(view.uncertaintyNote).toBeNull();
expect(view.strength).toBeNull();
expect(view.score).toBe("17 из 20, проходной балл 14");
expect(view.limitations).toContain(
"Результат получен на небольшом проверенном демонстрационном банке заданий.",
);
// The bank and calibration codes of the server are not listed as screen text.
expect(view.limitations).toEqual(["Проверка пройдена онлайн без наблюдения."]);
});
});
@@ -113,7 +110,7 @@ describe("describeAssessmentResult for an adaptive result", () => {
expect(view.uncertainty?.pGrade).toBe("0,50");
});
it("calls calibrated thresholds calibrated only when the server says so", () => {
it("lists no status row for calibrated thresholds", () => {
const view = describeAssessmentResult(
adaptiveConfirmed({
calibration_status: "calibrated",
@@ -124,8 +121,7 @@ describe("describeAssessmentResult for an adaptive result", () => {
}),
options,
);
expect(view.isProvisional).toBe(false);
expect(fact(view, "Статус")).toBe("пороги откалиброваны");
expect(view.facts.map((item) => item.label)).not.toContain("Статус");
});
});
@@ -263,18 +259,15 @@ describe("describeAssessmentResult for old and unassigned results", () => {
describe("describeAssessmentResult for an express result", () => {
const view = describeAssessmentResult(expressFixture(), options);
it("is a demonstration without a category, estimate, or next steps", () => {
it("is an express test without a category, estimate, or next steps", () => {
expect(view.isExpress).toBe(true);
expect(fact(view, "Категория")).toBe("не присваивается");
expect(fact(view, "Статус")).toBe("демонстрация");
expect(view.expressSummary).toBe("Вы ответили на три учебных задания.");
expect(view.uncertainty).toBeNull();
expect(view.score).toBeNull();
expect(view.nextSteps).toEqual([]);
expect(view.nextStepsNote).toBeNull();
expect(view.limitations).toEqual([
"Запуск служит демонстрацией механики и не является квалификационной оценкой.",
]);
expect(view.limitations).toEqual(["Экспресс-тест не является квалификационной оценкой."]);
});
});
@@ -46,11 +46,10 @@ export type AssessmentResultPresentation = {
readonly summary: AssessmentResultSummary;
/** The server feedback text of an express run, otherwise null. */
readonly expressSummary: string | null;
/** Category, date, method, and the provisional status as label-value rows. */
/** Category, date, and method as label-value rows. */
readonly facts: readonly ResultFact[];
/** Extra sentence about the category, or null when the summary says it all. */
readonly categoryNote: string | null;
readonly isProvisional: boolean;
/** Plain statement about what the method does and does not measure. */
readonly methodLimitation: string;
readonly limitations: readonly string[];
@@ -74,13 +73,15 @@ export type ResultPresentationOptions = {
readonly timeZone?: string;
};
const limitationLabels: Readonly<Record<AssessmentLimitation | "demonstration_only", string>> = {
uncalibrated_thresholds: "Пороги пока не проверены на пилотной выборке.",
demo_bank: "Результат получен на небольшом проверенном демонстрационном банке заданий.",
// Codes without a label are not listed on the result screen.
const limitationLabels: Readonly<
Record<AssessmentLimitation | "demonstration_only", string | null>
> = {
uncalibrated_thresholds: null,
demo_bank: null,
practice_not_included: "В попытке не было кодовой практики: песочница не была включена.",
unproctored: "Проверка пройдена онлайн без наблюдения.",
demonstration_only:
"Запуск служит демонстрацией механики и не является квалификационной оценкой.",
demonstration_only: "Экспресс-тест не является квалификационной оценкой.",
};
const strengthLabels = {
@@ -179,7 +180,7 @@ function failedWithoutGradeNote(result: RealResult): string | null {
function methodLimitationText(result: AssessmentResult): string {
if (result.kind === "demo_express") {
return "Экспресс-запуск показывает механику проверки. Он не создает категорию, перцентиль, оценку неопределенности и квалификационные доказательства.";
return "Экспресс-тест не создает категорию, перцентиль, оценку неопределенности и квалификационные доказательства.";
}
if (result.mode === "demo_basic") {
return "Базовая проверка считает только баллы по фиксированному набору заданий и сравнивает их с проходным баллом. Перцентиль, оценка способности, интервал, вероятность P_G и сила подтверждения не рассчитываются.";
@@ -187,14 +188,6 @@ function methodLimitationText(result: AssessmentResult): string {
return "Адаптивная проверка оценивает способность на шкале специализации. Оценка способности, интервал и вероятность P_G не являются баллом или перцентилем.";
}
function isProvisional(result: AssessmentResult): boolean {
if (result.kind === "demo_express") return true;
return (
result.calibration_status === "uncalibrated" ||
result.category_decision?.calibration_status === "uncalibrated"
);
}
function uncertaintyView(result: RealResult): ResultUncertaintyView | null {
const value = result.uncertainty;
if (!value) return null;
@@ -251,7 +244,10 @@ function nextStepView(
}
function limitationList(result: AssessmentResult): string[] {
return result.limitations.map((code) => limitationLabels[code]);
return result.limitations.flatMap((code) => {
const label = limitationLabels[code];
return label ? [label] : [];
});
}
function expressPresentation(
@@ -262,7 +258,7 @@ function expressPresentation(
isExpress: true,
attemptId: result.attempt_id,
title: methodLabel("demo_express"),
kindLabel: "Демонстрация без реального грейда",
kindLabel: "Экспресс-тест без грейда",
decidedDay: formatResultDay(result.decided_at, options.timeZone),
summary: assessmentResultSummary(result),
expressSummary: result.summary,
@@ -270,10 +266,8 @@ function expressPresentation(
{ label: "Категория", value: "не присваивается" },
{ label: "Дата", value: formatResultDate(result.decided_at, options.timeZone) },
{ label: "Метод", value: methodLabel("demo_express") },
{ label: "Статус", value: "демонстрация" },
],
categoryNote: null,
isProvisional: true,
methodLimitation: methodLimitationText(result),
limitations: limitationList(result),
score: null,
@@ -308,21 +302,11 @@ export function describeAssessmentResult(
): AssessmentResultPresentation {
if (result.kind === "demo_express") return expressPresentation(result, options);
const decision = result.category_decision;
const facts: ResultFact[] = [
{ label: "Категория после этого результата", value: categoryFact(result) },
{ label: "Дата решения", value: formatResultDate(result.decided_at, options.timeZone) },
{ label: "Метод", value: methodLabel(result.mode) },
{
label: "Статус",
value: isProvisional(result)
? "предварительный, пороги не калибровались"
: "пороги откалиброваны",
},
];
if (decision?.source === "synthetic_demo") {
facts.push({ label: "Происхождение решения", value: "синтетическая демонстрация стенда" });
}
const uncertainty = uncertaintyView(result);
const basic = result.basic_score;
@@ -337,7 +321,6 @@ export function describeAssessmentResult(
expressSummary: null,
facts,
categoryNote: failedWithoutGradeNote(result),
isProvisional: isProvisional(result),
methodLimitation: methodLimitationText(result),
limitations: limitationList(result),
score: basic
@@ -50,11 +50,11 @@ describe("assessmentResultSummary", () => {
}),
);
expect(summary.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(summary.reason).toBe("Это демонстрационная категория: пороги не калибровались.");
expect(summary.isDemonstration).toBe(false);
expect(summary.reason).toBeNull();
expect(summary.isExpress).toBe(false);
});
it("names the demonstration bank only when the server lists it", () => {
it("reads a confirmed grade the same way whatever bank the server lists", () => {
const summary = assessmentResultSummary(
result({
outcome: "confirmed",
@@ -63,9 +63,8 @@ describe("assessmentResultSummary", () => {
category_decision: decision("assigned", { current_confirmed_grade: "middle" }),
}),
);
expect(summary.reason).toBe(
"Это демонстрационная категория: пороги не калибровались, банк заданий демонстрационный.",
);
expect(summary.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(summary.reason).toBeNull();
});
it("keeps the higher grade when a reviewed result does not change the category", () => {
@@ -81,12 +80,10 @@ describe("assessmentResultSummary", () => {
}),
);
expect(summary.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(summary.reason).toBe(
"Прежний подтвержденный уровень Senior сохраняется. Это демонстрационная категория: пороги не калибровались.",
);
expect(summary.reason).toBe("Прежний подтвержденный уровень Senior сохраняется.");
});
it("adds no demonstration note when neither calibration nor the bank says so", () => {
it("adds no note to a confirmed grade", () => {
const summary = assessmentResultSummary(
result({
outcome: "confirmed",
@@ -102,34 +99,18 @@ describe("assessmentResultSummary", () => {
expect(summary.reason).toBeNull();
});
it("describes an adaptive result only by the flags the server set", () => {
const decision_ = decision("assigned", { current_confirmed_grade: "middle" });
const uncalibratedOnly = assessmentResultSummary(
result({
mode: "adaptive",
outcome: "confirmed",
confirmed_grade: "middle",
limitations: ["unproctored"],
category_decision: decision_,
}),
);
expect(uncalibratedOnly.reason).toBe("Результат предварительный: пороги не калибровались.");
expect(uncalibratedOnly.reason).not.toContain("демонстрационн");
it("adds no note to an adaptive result with an uncalibrated or demo-bank flag", () => {
const withBank = assessmentResultSummary(
result({
mode: "adaptive",
outcome: "confirmed",
confirmed_grade: "middle",
calibration_status: "calibrated",
limitations: ["demo_bank"],
category_decision: decision("assigned", {
current_confirmed_grade: "middle",
calibration_status: "calibrated",
}),
limitations: ["unproctored", "demo_bank"],
category_decision: decision("assigned", { current_confirmed_grade: "middle" }),
}),
);
expect(withBank.reason).toBe("Результат предварительный: банк заданий демонстрационный.");
expect(withBank.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(withBank.reason).toBeNull();
});
it("says that the threshold was reached but no category was assigned", () => {
@@ -146,7 +127,7 @@ describe("assessmentResultSummary", () => {
);
expect(summary.text).toBe("Порог пройден, категория не присвоена: Backend, Middle.");
expect(summary.text).not.toContain("Уровень подтвержден");
expect(summary.reason).toContain("отключены");
expect(summary.reason).toContain("нет подтверждения оператора");
});
it("does not claim a grade for a result stored before category decisions", () => {
@@ -173,7 +154,7 @@ describe("assessmentResultSummary", () => {
expect(summary.reason).toBe("Время попытки истекло до завершения заданий.");
});
it("marks express training as a demonstration", () => {
it("marks an express test as one that never confirms a grade", () => {
const summary = assessmentResultSummary(
result({
kind: "demo_express",
@@ -185,7 +166,8 @@ describe("assessmentResultSummary", () => {
limitations: ["demonstration_only"],
}),
);
expect(summary.isDemonstration).toBe(true);
expect(summary.text).toBe("Экспресс-тест завершен.");
expect(summary.isExpress).toBe(true);
expect(summary.reason).toBeNull();
});
});
@@ -6,8 +6,8 @@ export type AssessmentResultSummary = {
readonly text: string;
/** Why no decision was made, or what stays in force; null when nothing to add. */
readonly reason: string | null;
/** True for training results that never confirm a grade. */
readonly isDemonstration: boolean;
/** True for express results that never confirm a grade. */
readonly isExpress: boolean;
};
type NotDeterminedReason = NonNullable<
@@ -24,7 +24,7 @@ const notDeterminedReasons: Readonly<Record<NotDeterminedReason, string>> = {
/** Plain words for a passed threshold without an assigned category. */
function noCategoryReason(status: string | undefined): string {
if (status === "not_eligible") {
return "Демонстрационные категории на этом стенде отключены или для этой проверки нет подтверждения оператора, поэтому уровень не присваивается.";
return "Для этой проверки нет подтверждения оператора, поэтому уровень не присваивается.";
}
return "Результат сохранен без решения о категории, поэтому уровень не присваивается.";
}
@@ -36,12 +36,12 @@ function noCategoryReason(status: string | undefined): string {
export function assessmentResultSummary(result: AssessmentResult): AssessmentResultSummary {
if (result.kind === "demo_express") {
return {
text: "Демонстрационный экспресс-запуск завершен.",
text: "Экспресс-тест завершен.",
reason: null,
isDemonstration: true,
isExpress: true,
};
}
const isDemonstration = false;
const isExpress = false;
const specialization = specializationLabels[result.specialization];
const keptGrade = result.previous_confirmed_grade
@@ -61,36 +61,20 @@ export function assessmentResultSummary(result: AssessmentResult): AssessmentRes
return {
text: `Порог пройден, категория не присвоена: ${specialization}, ${gradeLabels[result.target_grade]}.`,
reason: noCategoryReason(decisionStatus),
isDemonstration,
isExpress,
};
}
const flags = [
result.category_decision?.calibration_status === "uncalibrated" ||
result.calibration_status === "uncalibrated"
? "пороги не калибровались"
: null,
result.limitations.includes("demo_bank") ? "банк заданий демонстрационный" : null,
].filter(Boolean);
// Only the basic method yields a demonstration category; other methods
// are described by the flags the server actually set.
const caveat =
flags.length === 0
? null
: `${result.mode === "demo_basic" ? "Это демонстрационная категория" : "Результат предварительный"}: ${flags.join(", ")}.`;
const reason = [decisionStatus === "unchanged" ? keptGrade : null, caveat]
.filter(Boolean)
.join(" ");
return {
text: `${outcomeLabels.confirmed}: ${specialization}, ${gradeLabels[result.confirmed_grade]}.`,
reason: reason === "" ? null : reason,
isDemonstration,
reason: decisionStatus === "unchanged" ? keptGrade : null,
isExpress,
};
}
case "not_confirmed":
return {
text: `${outcomeLabels.not_confirmed}: ${specialization}, ${gradeLabels[result.target_grade]}.`,
reason: keptGrade,
isDemonstration,
isExpress,
};
case "not_determined": {
const why = result.not_determined_reason
@@ -99,7 +83,7 @@ export function assessmentResultSummary(result: AssessmentResult): AssessmentRes
return {
text: `${outcomeLabels.not_determined}: ${specialization}, ${gradeLabels[result.target_grade]}.`,
reason: [why, keptGrade].filter(Boolean).join(" ") || null,
isDemonstration,
isExpress,
};
}
}
@@ -41,16 +41,6 @@
overflow-wrap: anywhere;
}
.badges {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.badges:empty {
display: none;
}
.summary {
color: var(--color-text-strong);
font-family: var(--font-mono);
@@ -22,13 +22,14 @@ function render(result: AssessmentResult): string {
describe("AssessmentResultView for demo_basic", () => {
const html = render(demoBasicAssigned());
it("shows the category, date, method, and provisional status", () => {
it("shows the category, date, and method without a demo or calibration marker", () => {
expect(html).toContain("Уровень подтвержден: Backend, Middle.");
expect(html).toContain("Backend, Middle (присвоена этим результатом)");
expect(html).toContain("8 октября 2026 г. в 09:30 UTC");
expect(html).toContain("Базовая проверка по фиксированному набору заданий");
expect(html).toContain("Предварительный результат");
expect(html).toContain("предварительный, пороги не калибровались");
for (const text of ["Предварительный", "Демо", "демонстрацион", "калибр", "Синтетическ"]) {
expect(html).not.toContain(text);
}
});
it("names the method limitation and shows no estimate rows", () => {
@@ -52,7 +53,7 @@ describe("AssessmentResultView for an adaptive result", () => {
expect(html).toContain("от −0,19 до 1,03");
expect(html).toContain("Базы данных");
expect(html).toContain("Доступно с 12 ноября 2026 г. в 10:00 UTC.");
expect(html).toContain("остается предварительной оценкой");
expect(html).not.toContain("предварительной оценкой");
});
it("draws no estimate and no zeros once the fields are removed", () => {
@@ -94,11 +95,10 @@ describe("AssessmentResultView for a failed attempt", () => {
describe("AssessmentResultView for an express result", () => {
const html = render(expressFixture());
it("is marked as a demonstration without a grade", () => {
expect(html).toContain("Демонстрация без реального грейда");
expect(html).toContain(
"Демонстрация завершена. Она не подтверждает квалификацию и не присваивает грейд.",
);
it("is named an express test without a grade", () => {
expect(html).toContain("Экспресс-тест без грейда");
expect(html).toContain("Экспресс-тест не присваивает грейд.");
expect(html).not.toContain("емонстрац");
expect(html).toContain("Вы ответили на три учебных задания.");
expect(html).toContain("не присваивается");
expect(html).not.toContain("Подтвержденный уровень");
@@ -1,7 +1,7 @@
import { useId, type ReactNode } from "react";
import type { AssessmentResult } from "../../../shared/api/schemas";
import { paths } from "../../../shared/config/paths";
import { ButtonLink, Mono, Tag } from "../../../shared/ui";
import { ButtonLink, Mono } from "../../../shared/ui";
import { describeAssessmentResult } from "../model/result-presentation";
import styles from "./assessment-result-view.module.css";
@@ -33,7 +33,7 @@ function Block({ title, level, children }: BlockProps) {
* Stored result of one attempt. Every value is a restatement of a server
* field: an absent estimate is not drawn, a lower-grade offer is text and
* never a control that changes the category, and an express run is marked as
* a demonstration without a grade.
* an express test without a grade.
*/
export function AssessmentResultView({
result,
@@ -53,23 +53,13 @@ export function AssessmentResultView({
<Heading id={titleId} className={styles.title}>
{view.title}
</Heading>
<p className={styles.badges}>
{view.isExpress ? <Tag tone="accent">Демонстрация</Tag> : null}
{!view.isExpress && view.isProvisional ? (
<Tag tone="neutral" dot>
Предварительный результат
</Tag>
) : null}
</p>
</header>
<p className={styles.summary}>{view.summary.text}</p>
{view.summary.reason ? <p>{view.summary.reason}</p> : null}
{view.isExpress ? (
<>
<p className={styles.demo}>
Демонстрация завершена. Она не подтверждает квалификацию и не присваивает грейд.
</p>
<p className={styles.demo}>Экспресс-тест не присваивает грейд.</p>
{view.expressSummary ? <p>{view.expressSummary}</p> : null}
</>
) : null}
@@ -134,12 +124,7 @@ export function AssessmentResultView({
</div>
) : null}
</dl>
<p className={styles.note}>
Значения даны на шкале специализации.
{view.isProvisional
? " Пока пороги не откалиброваны, вероятность остается предварительной оценкой, а не измеренной долей."
: ""}
</p>
<p className={styles.note}>Значения даны на шкале специализации.</p>
</Block>
) : null}
{!view.uncertainty && view.strength ? (
@@ -177,7 +162,7 @@ export function AssessmentResultView({
{view.isExpress ? (
<Block title="Следующий шаг" level={blockLevel}>
<p>Категорию дает только полная проверка. Демонстрация ее не заменяет.</p>
<p>Категорию дает только полная проверка.</p>
<ButtonLink to={paths.candidate.assessment}>Перейти к полной проверке</ButtonLink>
</Block>
) : (
@@ -5,7 +5,6 @@ export {
describeAccessOrganization,
describePublicationClosure,
evidenceBasisLabels,
evidenceCalibrationLabels,
buildSearchStatusSubmission,
buildPublicationSubmission,
currentC2State,
@@ -50,7 +50,7 @@ describe("candidate card presentation", () => {
{
specialization: "Backend",
grade: "Junior",
strength: "Демонстрационное подтверждение",
strength: "Стандартное подтверждение",
},
]);
expect(result?.selfAssessments).toEqual([
@@ -143,8 +143,7 @@ describe("candidate card presentation", () => {
trust: "partial",
trustLabel: "Онлайн-результат без подтверждения личности",
observedYear: 2026,
basisLabel: "Синтетическая демонстрация, не проверенное измерение",
calibrationLabel: "Пороги не откалиброваны",
basisLabel: "Результат теста",
},
]);
});
@@ -6,7 +6,6 @@ import type {
CardSelfAssessment,
CandidateExperienceBand,
EvidenceBasis,
EvidenceCalibrationStatus,
EvidenceSkillCode,
CandidateSalaryCompatibility,
CandidateWorkFormat,
@@ -214,7 +213,6 @@ export type EvidencePresentation = {
trustLabel: string;
observedYear: number;
basisLabel: string;
calibrationLabel: string;
};
export type CandidateViewPresentation = {
@@ -232,9 +230,7 @@ export type CandidateViewPresentation = {
evidence: readonly EvidencePresentation[] | null;
};
// A demonstration basis is named as one, never as a standard confirmation.
function confirmationLabelOf(category: CardCategory): string {
if (category.basis === "synthetic_demo") return "Демонстрационное подтверждение";
return category.strength === "strong" ? "Сильное подтверждение" : "Стандартное подтверждение";
}
@@ -278,11 +274,7 @@ const evidenceTrust: Readonly<Record<number, EvidenceTrustView>> = {
};
export const evidenceBasisLabels: Readonly<Record<EvidenceBasis, string>> = {
synthetic_demo: "Синтетическая демонстрация, не проверенное измерение",
};
export const evidenceCalibrationLabels: Readonly<Record<EvidenceCalibrationStatus, string>> = {
uncalibrated: "Пороги не откалиброваны",
synthetic_demo: "Результат теста",
};
function evidencePresentation(fact: OrganizationEvidenceFact): EvidencePresentation {
@@ -293,7 +285,6 @@ function evidencePresentation(fact: OrganizationEvidenceFact): EvidencePresentat
trustLabel: trust.label,
observedYear: fact.observed_year,
basisLabel: evidenceBasisLabels[fact.basis],
calibrationLabel: evidenceCalibrationLabels[fact.calibration_status],
};
}
@@ -76,7 +76,7 @@ describe("employer card preview", () => {
it("states the confirmation of each specialization separately", () => {
const markup = render(published());
expect(markup).toContain("Backend: Middle, демонстрационное подтверждение");
expect(markup).toContain("Backend: Middle, стандартное подтверждение");
expect(markup.match(/Грейд подтвержден/g)).toHaveLength(1);
expect(markup.match(/Грейд не подтвержден/g)).toHaveLength(2);
expect(markup).toContain("Заявлено: Junior");
@@ -121,13 +121,15 @@ describe("employer card preview", () => {
expect(markup).toContain("Для опубликованных категорий нет видимого подтверждающего факта.");
});
it("labels the evidence basis and calibration the way the server states them", () => {
it("labels the evidence basis and shows no demo or calibration wording", () => {
const markup = render(published());
expect(markup).toContain("Подтверждающие факты оценки");
expect(markup).toContain("Онлайн-результат без подтверждения личности");
expect(markup).toContain("Синтетическая демонстрация, не проверенное измерение");
expect(markup).toContain("Пороги не откалиброваны");
expect(markup).toContain("Результат теста");
expect(markup).not.toContain("демонстрац");
expect(markup).not.toContain("откалиброван");
expect(markup).not.toContain("Калибровка");
expect(markup).toContain("2026");
});
@@ -37,8 +37,6 @@ function EvidenceItem({ item }: { item: EvidencePresentation }) {
<dd>{item.observedYear}</dd>
<dt>Основа</dt>
<dd>{item.basisLabel}</dd>
<dt>Калибровка</dt>
<dd>{item.calibrationLabel}</dd>
</dl>
</li>
);
@@ -40,7 +40,7 @@ export function presentCard(card: AnonymousCardContent): CardDetails {
card.categories?.map((category) => ({
specialization: specializationLabels[category.specialization],
grade: gradeLabels[category.grade],
strength: confirmationLabel(category.basis, category.strength),
strength: confirmationLabel(category.strength),
})) ?? null,
selfAssessments:
card.self_assessment?.map((item) => ({
@@ -63,7 +63,6 @@ export type EvidenceFact = {
trustLabel: string;
observedYear: number;
basisLabel: string;
calibrationLabel: string;
};
const skillLabels: Readonly<Record<EvidenceSkillCode, string>> = {
@@ -78,7 +77,7 @@ const trustViews: Readonly<Record<number, { level: TrustLevelValue; label: strin
3: { level: "confirmed", label: "Очная проверка" },
};
/** Facts of the evidence section as the server lists them, with its basis and calibration. */
/** Facts of the evidence section as the server lists them, with its basis. */
export function presentEvidence(evidence: OrganizationEvidence): EvidenceFact[] {
return evidence.items.map((fact) => {
const trust = trustViews[fact.trust] ?? trustViews[0]!;
@@ -87,8 +86,7 @@ export function presentEvidence(evidence: OrganizationEvidence): EvidenceFact[]
trust: trust.level,
trustLabel: trust.label,
observedYear: fact.observed_year,
basisLabel: "Синтетическая демонстрация, не проверенное измерение",
calibrationLabel: "Пороги не откалиброваны",
basisLabel: "Результат теста",
};
});
}
+3 -6
View File
@@ -1,7 +1,6 @@
import type {
CandidateExperienceBand,
CandidateSalaryCompatibility,
EvidenceBasis,
GradeCode,
MatchEvidenceCode,
MatchEvidenceState,
@@ -77,12 +76,10 @@ export const strengthLabels: Readonly<Record<MatchStrength, string>> = {
};
/**
* Words for how a confirmed category was established. A demonstration basis is
* named as one, because it is not a measurement and never a standard
* confirmation; only a category with another basis gets its strength label.
* Words for how a confirmed category was established. Every test basis reads
* as the strength label of the confirmation.
*/
export function confirmationLabel(basis: EvidenceBasis, strength: MatchStrength): string {
if (basis === "synthetic_demo") return "Демонстрационное подтверждение";
export function confirmationLabel(strength: MatchStrength): string {
return strengthLabels[strength];
}
@@ -181,8 +181,6 @@ export function CandidateCardDetails({
<dd>{fact.observedYear}</dd>
<dt>Основа</dt>
<dd>{fact.basisLabel}</dd>
<dt>Калибровка</dt>
<dd>{fact.calibrationLabel}</dd>
</dl>
</li>
))}
@@ -132,7 +132,7 @@ export function MatchCardView({
<dt>Подтвержденная категория</dt>
<dd>
{card.category && card.strength
? `${specializationLabels[card.category.specialization]}, ${gradeLabels[card.category.grade]}. ${confirmationLabel(card.category.basis, card.strength)}`
? `${specializationLabels[card.category.specialization]}, ${gradeLabels[card.category.grade]}. ${confirmationLabel(card.strength)}`
: "Нет"}
</dd>
</div>
@@ -49,8 +49,8 @@ export function SignalNoticeContent({ headingLevel }: ContentProps) {
Адреса и токены сессий не хранятся: для них есть только односторонние отпечатки. Во время
теста сбор ничего не показывает и не блокирует: ввод, вставка и отправка ответов работают
как обычно. Браузерные сигналы легко исказить, а ложные срабатывания возможны, например при
случайном переключении окна, поэтому это только подсказка. Демонстрационный запуск сигналы
не собирает.
случайном переключении окна, поэтому это только подсказка. Экспресс-тест сигналы не
собирает.
</p>
<p>
Подтверждение хранится на сервере. Оно не заменяет согласие C3, которое управляется отдельно
@@ -74,12 +74,12 @@ function isTerminal(attempt: AssessmentAttempt): boolean {
}
function attemptName(attempt: AssessmentAttempt): string {
if (attempt.kind === "demo_express") return "Демонстрационный экспресс-запуск";
if (attempt.kind === "demo_express") return "Экспресс-тест";
return `${attempt.specialization ? specializationLabels[attempt.specialization] : "Проверка"} - ${attempt.target_grade ? gradeLabels[attempt.target_grade] : ""}`;
}
function attemptTag(attempt: AssessmentAttempt): string {
if (attempt.kind === "demo_express") return "Демонстрация";
if (attempt.kind === "demo_express") return "Экспресс-тест";
const parts = [
attempt.specialization ? specializationLabels[attempt.specialization] : "Проверка",
attempt.target_grade ? gradeLabels[attempt.target_grade] : null,
@@ -562,12 +562,8 @@ function AssessmentAttemptContent({ attemptId }: { attemptId: string }) {
return (
<Page
title={attempt.kind === "demo_express" ? "Демонстрационная проверка" : "Полная проверка"}
lead={
attempt.kind === "demo_express"
? "Учебный режим на 3-5 минут. Он не подтверждает квалификацию и не присваивает грейд."
: undefined
}
title={attempt.kind === "demo_express" ? "Экспресс-тест" : "Полная проверка"}
lead={attempt.kind === "demo_express" ? "Учебный режим на 3-5 минут." : undefined}
width="wide"
>
<div className={attemptStyles.layout}>
@@ -603,7 +599,7 @@ function AssessmentAttemptContent({ attemptId }: { attemptId: string }) {
) : null}
{resumedExpress && attempt.kind === "demo_express" && !terminal ? (
<Notice tone="info" title="Незавершенная демонстрация продолжена">
<Notice tone="info" title="Незавершенный экспресс-тест продолжен">
<p>
Это тот же запуск: время идет с момента его начала, ответы сохранены на сервере.
</p>
@@ -433,18 +433,18 @@ export function AssessmentPage() {
if (error instanceof ExpressRunElsewhereError) {
setPendingCreate(null);
setExpressNote(
"Незавершенная демонстрация открыта в другой вкладке или браузере. Продолжите ее там или подождите: она закончится сама не позже чем через 5 минут после начала.",
"Незавершенный экспресс-тест открыт в другой вкладке или браузере. Продолжите его там или подождите: он закончится сам не позже чем через 5 минут после начала.",
);
return;
}
if (isOutcomeAmbiguous(error)) {
setExpressNote(
"Не удалось подтвердить начало демонстрации. Повторная отправка использует тот же ключ.",
"Не удалось подтвердить начало экспресс-теста. Повторная отправка использует тот же ключ.",
);
return;
}
setPendingCreate(null);
setExpressNote("Сервер не начал демонстрацию. Обновите страницу и повторите действие.");
setExpressNote("Сервер не начал экспресс-тест. Обновите страницу и повторите действие.");
} finally {
requestInFlight.current = false;
setCreateBusy(false);
@@ -641,14 +641,13 @@ export function AssessmentPage() {
<Card tone="raised" className={styles.express}>
<p className={styles.kicker}>Учебный режим</p>
<h2 id="assessment-express-title" className={styles["block-title"]}>
Демонстрационный экспресс-запуск
Экспресс-тест
</h2>
<p className={styles.duration}>
<Mono strong>3-5</Mono> <span>минут</span>
</p>
<p className={styles["block-lead"]}>
Это демонстрация на 3-5 минут. Она не подтверждает квалификацию, не присваивает грейд
и не влияет на доступность полной проверки.
Экспресс-тест не присваивает грейд и не влияет на доступность полной проверки.
</p>
<p className={styles["express-note"]}>
Незавершенный запуск этой вкладки продолжается той же кнопкой.
@@ -661,8 +660,8 @@ export function AssessmentPage() {
{createBusy
? "Создаем запуск..."
: pendingCreate?.body.kind === "demo_express"
? "Повторить начало демонстрации"
: "Начать демонстрацию"}
? "Повторить начало экспресс-теста"
: "Пройти экспресс-тест"}
</Button>
{expressNote ? (
<div role="status">
+6 -16
View File
@@ -35,11 +35,11 @@ export const guideRoles: readonly GuideRole[] = [
link: { label: "Открыть вход", to: paths.login },
},
{
text: "На странице проверки нажмите «Начать демонстрацию». Экспресс-запуск занимает 3-5 минут и состоит из трех заданий. Итог не присваивает уровень: на экране есть пометка «Демонстрация без реального грейда», а результат не попадает в историю реальных проверок.",
text: "На странице проверки нажмите «Пройти экспресс-тест». Он занимает 3-5 минут и состоит из трех заданий. Итог не присваивает уровень и не попадает в историю результатов.",
link: { label: "Открыть проверку знаний", to: paths.candidate.assessment },
},
{
text: "На той же странице посмотрите полную проверку Backend, Junior, Go: 25 заданий, срок 72 часа, без практики. Кнопка «Начать полную проверку» видна, но ее можно не нажимать: запуск создает попытку на стенде.",
text: "На той же странице посмотрите полную проверку Backend, Junior, Go: 25 заданий, срок 72 часа, без практики. Кнопка «Начать полную проверку» видна, но ее можно не нажимать: запуск создает попытку.",
link: { label: "Открыть полную проверку", to: paths.candidate.assessment },
},
],
@@ -49,15 +49,15 @@ export const guideRoles: readonly GuideRole[] = [
account: `prepared-1@${demoAccountDomain}`,
steps: [
{
text: "Войдите как prepared-1. В профиле нет ФСП ID: профиль заполнен вручную, а строка опыта помечена как синтетический профиль.",
text: "Войдите как prepared-1. В профиле нет ФСП ID: профиль заполнен вручную.",
link: { label: "Открыть профиль", to: paths.candidate.profile },
},
{
text: "В результатах полный тест Backend, Junior, Go уже пройден. Категория помечена как демонстрационная: происхождение решения - синтетическая демонстрация стенда, пороги не калиброваны.",
text: "В результатах полный тест Backend, Junior, Go уже пройден: категория подтверждена тестом.",
link: { label: "Открыть результаты", to: paths.candidate.results },
},
{
text: "В настройках приватности карточка опубликована. Предпросмотр показывает доказательство навыка с пометкой «Демонстрационное подтверждение».",
text: "В настройках приватности карточка опубликована. Предпросмотр показывает подтвержденную категорию и факт оценки.",
link: { label: "Открыть настройки приватности", to: paths.candidate.privacy },
},
],
@@ -113,7 +113,7 @@ export const guideAccounts: readonly GuideAccount[] = [
{
login: `candidate@${demoAccountDomain}`,
role: "Кандидат без попыток",
purpose: "Экспресс-запуск и полная проверка",
purpose: "Экспресс-тест и полная проверка",
},
{
login: `prepared-1@${demoAccountDomain} - prepared-6@${demoAccountDomain}`,
@@ -132,16 +132,6 @@ export const guideAccounts: readonly GuideAccount[] = [
},
];
/** Items that only simulate the product; each one is named as a simulation. */
export const demonstrationItems: readonly string[] = [
"Все люди на стенде синтетические: кандидаты, компании и их описания вымышлены. Адреса на домене demo.lincodex.test никогда не получают почту.",
"Подготовленные полные результаты созданы командой demo-seed обычными операциями попытки. Ответы выбраны заранее, а проходила их команда стенда, а не кандидат.",
"Категория «Демонстрационное подтверждение» (источник synthetic_demo) не калибрована и не измеряет навык. Банк заданий синтетический и предметной проверки не проходил.",
"Экспресс-запуск показывает механику проверки. Он не присваивает грейд, не создает категорию и не дает доказательства навыка.",
"ML на стенде не вызывается: смысловая близость нейтральна (0,50), а карточки помечены «смысловой анализ недоступен». ФСП не подключен ни в каком режиме, профиль заполняется вручную.",
"На стенде нет видеоматериалов: экран показывает работающий интерфейс на синтетических данных, а не запись.",
];
/** Behaviour that is real code on the stand, not a simulation. */
export const workingItems: readonly string[] = [
"Регистрация, вход, согласия C1-C5, профиль, анкета, настройки приватности и обращения в поддержку работают как в рабочей сборке.",
@@ -17,12 +17,12 @@ function hrefs(html: string): string[] {
}
describe("jury guide page", () => {
it("renders one heading with the demonstration eyebrow and the memo title", () => {
it("renders one heading with the jury eyebrow and the memo title", () => {
const html = render();
expect(html.match(/<h1[\s>]/g)?.length).toBe(1);
expect(html).toMatch(/<h1[^>]*>Гид для жюри<\/h1>/);
expect(html).toContain("Демонстрационный стенд");
expect(html).toContain("Маршрут для жюри");
});
it("explains the product in the first section", () => {
@@ -32,18 +32,13 @@ describe("jury guide page", () => {
expect(html).toContain("Заявленный уровень в анкете остается самооценкой");
});
it("separates the demonstration simulations from the working functionality", () => {
it("lists what works without simulation and carries no demonstration wording", () => {
const html = render();
const simulations = html.indexOf("Что здесь демонстрационное");
const working = html.indexOf("Что работает без имитации");
expect(simulations).toBeGreaterThan(0);
expect(working).toBeGreaterThan(simulations);
expect(html).toContain("синтетические");
expect(html).toContain("не калибрована");
expect(html).toContain("смысловой анализ недоступен");
expect(html).toContain("ФСП не подключен");
expect(html).toContain("Экспресс-запуск показывает механику проверки");
expect(html).toContain("Что работает без имитации");
expect(html).not.toContain("Что здесь демонстрационное");
expect(html).not.toContain("Демонстрационн");
expect(html).not.toContain("демонстрационн");
});
it("numbers the route across the role blocks in one continuous sequence", () => {
@@ -1,11 +1,5 @@
import { Card, Page, Section, TextLink } from "../../../shared/ui";
import {
demonstrationItems,
guideAccounts,
guideLimits,
guideRoles,
workingItems,
} from "../model/guide";
import { guideAccounts, guideLimits, guideRoles, workingItems } from "../model/guide";
import styles from "./jury-guide-page.module.css";
/** Step numbers run on across the role blocks, so the whole route reads as eight to thirteen steps. */
@@ -20,10 +14,10 @@ function firstStepNumbers(): number[] {
}
/**
* Memo for a jury member who opens the isolated demonstration stand without a
* briefing. It lists the route with the screens to open, the accounts, and the
* parts of the stand that are simulations. The route is shown only in a demo
* build (see routes), so nothing here reaches a production build.
* Memo for a jury member who opens the isolated stand without a briefing. It
* lists the route with the screens to open, the accounts, and what works on
* the stand. The route is shown only in a demo build (see routes), so nothing
* here reaches a production build.
*/
export function JuryGuidePage() {
const starts = firstStepNumbers();
@@ -31,8 +25,8 @@ export function JuryGuidePage() {
return (
<Page
title="Гид для жюри"
eyebrow="Демонстрационный стенд"
lead="Короткий маршрут на синтетических данных: около восьми минут и две роли. Сначала прочитайте раздел «Что здесь демонстрационное»: он отделяет имитации от работающего функционала."
eyebrow="Маршрут для жюри"
lead="Короткий маршрут по продукту: около восьми минут и две роли."
width="wide"
>
<Section title="Что такое Lincodex">
@@ -69,17 +63,6 @@ export function JuryGuidePage() {
</ol>
</Section>
<Section
title="Что здесь демонстрационное"
description="Имитации и подготовленные данные. Они показывают механику, но не измеряют навык человека."
>
<ul className={styles.list}>
{demonstrationItems.map((item) => (
<li key={item}>{item}</li>
))}
</ul>
</Section>
<Section title="Что работает без имитации">
<ul className={styles.list}>
{workingItems.map((item) => (
@@ -15,7 +15,7 @@ const cabinets = [
summary: "Профиль и анкета, тест на подтверждение уровня, результаты и настройки видимости.",
features: [
"Заявленный уровень из анкеты показан отдельно от подтвержденной категории.",
"Категория появляется только по результату теста. Демонстрационный результат помечен как демонстрационный.",
"Категория появляется только по результату теста.",
"Приглашения компаний: условия, принятие с выбором контактов и отказ.",
"Согласия, публикация карточки, статус поиска, уведомления и обращения в поддержку.",
],
@@ -91,8 +91,7 @@ export function WelcomePage({ demoStand = false }: { demoStand?: boolean }) {
Для жюри
</h2>
<p className={styles["jury-text"]}>
Этот стенд показывает продукт на синтетических данных. Гид описывает маршрут на восемь
минут двумя ролями и отделяет имитации от работающего функционала.
Гид описывает маршрут по продукту на восемь минут двумя ролями.
</p>
<div>
<ButtonLink to={paths.demoGuide} variant="secondary">
@@ -101,7 +101,7 @@ describe("AssessmentHistory", () => {
expect(html).toContain("Backend, Middle");
expect(html).toContain(`href="${paths.candidate.result(firstId)}"`);
expect(html).toContain(`href="${paths.candidate.result(secondId)}"`);
expect(html).toContain("Демонстрационные запуски сюда не попадают");
expect(html).toContain("Экспресс-тест сюда не попадает и категорию не меняет");
expect(html).not.toContain("Показать еще");
});
@@ -104,7 +104,7 @@ export function AssessmentHistory({ actor, queryClient }: AssessmentHistoryProps
return (
<EmptyState
title="Результатов пока нет"
description="Здесь появятся завершенные реальные проверки. Демонстрационные запуски в историю не входят."
description="Здесь появятся завершенные проверки."
action={<ButtonLink to={paths.candidate.assessment}>К проверкам</ButtonLink>}
/>
);
@@ -113,8 +113,7 @@ export function AssessmentHistory({ actor, queryClient }: AssessmentHistoryProps
return (
<div className={styles.root}>
<p className={styles.note}>
В истории только завершенные реальные проверки. Демонстрационные запуски сюда не попадают и
категорию не меняют.
В истории только завершенные проверки. Экспресс-тест сюда не попадает и категорию не меняет.
</p>
{history.isRefetchError && !history.isFetchNextPageError ? (
<ErrorState
@@ -1 +0,0 @@
export { DemoStandBanner } from "./ui/demo-stand-banner";
@@ -1,32 +0,0 @@
/* A slim strip above the header: the red dot is the design system's "live"
* marker; the bold label states the meaning in words. */
.banner {
padding: var(--space-2) var(--gutter);
border-bottom: var(--line-thin) solid var(--color-divider);
color: var(--color-text-secondary);
font-size: var(--font-size-xs);
line-height: var(--line-height-snug);
background: var(--color-surface);
}
.banner p {
max-width: var(--content-width-wide);
margin: 0 auto;
}
.label {
color: var(--color-text-strong);
font-family: var(--font-mono);
font-weight: var(--font-weight-medium);
}
.label::before {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
margin-right: var(--space-2);
border-radius: 50%;
content: "";
background: var(--color-attention);
vertical-align: 0.05em;
}
@@ -1,19 +0,0 @@
import styles from "./demo-stand-banner.module.css";
/**
* Marks every page of the demonstration stand: the data is synthetic and the
* results are prepared for showing, not measured. It is rendered only by a
* demo build (see app routes), and it has no link, so the first link of a
* page stays the skip link.
*/
export function DemoStandBanner() {
return (
<aside className={styles.banner} aria-label="Статус стенда">
<p>
<strong className={styles.label}>Демонстрационный стенд.</strong> Все данные синтетические,
подготовленные результаты не подтверждают квалификацию. Гид для жюри есть на главной
странице.
</p>
</aside>
);
}
@@ -52,7 +52,7 @@ describe("match list", () => {
expect(html).toContain("Подтвержденная категория");
expect(html).toContain("Заявленный кандидатом грейд");
expect(html).toContain("Грейд подтвержден: Middle");
expect(html).toContain("Backend, Middle. Демонстрационное подтверждение");
expect(html).toContain("Backend, Middle. Сильное подтверждение");
});
it("offers a specialization switch when the result holds several specializations", () => {