biscet's picture
Publish the complete dataset and Dataset Viewer configs on main
c1d7ea0 verified
Raw History Blame Contribute Delete
234 kB
{"id": "project-000001", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000267.txt", "source_sha256": "489d3ef4b64efb9ab30c0e47bfff42b0683e94c4f55d09f880ee68ba481fae8d", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_02\nFile: source_000267.txt\nLines: 1-50\n```ts\nimport type { KpiProjectYearIndicator } from '@shared/types/kpi'\n\nexport const MOCK_PROJECT_CODES: ReadonlySet<string> = new Set([\n 'novosibirsk_irkutsk',\n 'yekaterinburg_novosibirsk',\n 'kazan_samara',\n 'yekaterinburg_chelyabinsk',\n 'chelyabinsk_rf_border',\n 'novosibirsk_barnaul',\n 'novosibirsk_tomsk',\n 'novosibirsk_kemerovo',\n 'novosibirsk_novokuznetsk',\n 'samara_saransk',\n 'samara_penza',\n 'khabarovsk_vladivostok',\n])\nexport const isMockProjectCode = (projectCode: string): boolean =>\n MOCK_PROJECT_CODES.has(projectCode)\n\nconst MOCK_PROJECT_KPI_INDICATOR_TEMPLATE: readonly KpiProjectYearIndicator[] = [\n { code: 'kpi__route_length', name: 'Протяженность линии', unit: 'км', data_type: 'float', value: null },\n { code: 'kpi__route_length_rf', name: 'Протяженность линии (РФ)', unit: 'км', data_type: 'float', value: null },\n { code: 'kpi__gdp_added', name: 'Прирост ВВП', unit: 'млрд руб.', data_type: 'float', value: null },\n { code: 'kpi__investment_need', name: 'Потребность в инвестициях', unit: 'млрд руб.', data_type: 'float', value: null },\n { code: 'kpi__passenger_traffic_sm_vsm', name: 'Пассажиропоток', unit: 'млн пасс.', data_type: 'float', value: null },\n { code: 'kpi__covered_population', name: 'Охват населения', unit: 'млн чел.', data_type: 'float', value: null },\n { code: 'kpi__wagon_need', name: 'Потребность в вагонах', unit: 'шт.', data_type: 'int', value: null },\n]\n\nexport const createMissingProjectKpiIndicators = (): KpiProjectYearIndicator[] =>\n MOCK_PROJECT_KPI_INDICATOR_TEMPLATE.map((indicator) => ({ ...indicator }))\n\nexport const getMockProjectKpiIndicatorsByCode = (\n projectCode: string,\n): KpiProjectYearIndicator[] =>\n isMockProjectCode(projectCode) ? createMissingProjectKpiIndicators() : []\n\nexport const isProjectPlaceholderValue = (\n value: string | number | null | undefined,\n): boolean => {\n if (value == null) return true\n if (typeof value === 'number') return value === 0\n\n const normalized = value\n .trim()\n .replace(/[()]/g, '')\n .replace(/\\s/g, '')\n .replace(',', '.')\n\n if (!normalized) return true\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Lifecycle and Dependencies\n\nThis module is a **pure, stateless utility** for working with mock project data in the `project_02` project. It has no side effects, no mutable state, and no external runtime dependencies beyond the type definitions it imports.\n\n### Imports\n\n- `@shared/types/kpi` — provides the `KpiProjectYearIndicator` type (a shape for KPI indicator objects).\n- `source_000267.txt` — this file itself (self-referencing import is fine in TypeScript since it's a constant).\n\n### Exports\n\n1. **`MOCK_PROJECT_CODES`** — a `ReadonlySet<string>` containing 14 project codes (e.g. `'novosibirsk_irkutsk'`, `'yekaterinburg_novosibirsk'`, `'kazan_samara'`, etc.).\n2. **`isMockProjectCode(projectCode: string): boolean`** — a pure predicate that checks whether a given code is in the set.\n3. **`createMissingProjectKpiIndicators()`** — a factory that returns a fresh copy of the KPI template array.\n4. **`getMockProjectKpiIndicatorsByCode", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000002", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000222.txt", "source_sha256": "356cdd06cface8845dfe15955357f9ff9b20d4796e791f40c3d691ee7f106f4c", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_02\nFile: source_000222.txt\nLines: 1-27\n```ts\nimport { useWindowSize } from '@vueuse/core'\nimport { MAP_LOW_HEIGHT_SCREEN_MAX_PX } from '@modules/map/constants/map'\n\nexport const resolveIsLowMapHeightScreen = (): boolean => {\n if (typeof window === 'undefined') {\n return false\n }\n\n return window.innerHeight < MAP_LOW_HEIGHT_SCREEN_MAX_PX\n}\n\nexport const useMapHeightMode = () => {\n const { height } = useWindowSize()\n\n const isLowMapHeightScreen = computed(() => {\n const viewportHeight = height.value\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return resolveIsLowMapHeightScreen()\n }\n\n return viewportHeight < MAP_LOW_HEIGHT_SCREEN_MAX_PX\n })\n\n return {\n isLowMapHeightScreen,\n }\n}\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Goal\n\nSimplify the code while preserving behavior. The current code:\n\n1. Has a standalone `resolveIsLowMapHeightScreen` function that checks `window` exists and compares `window.innerHeight` to a constant.\n2. Has a `useMapHeightMode` composable that uses `useWindowSize` and wraps the check in a `computed`.\n3. Falls back to the standalone function when `height.value` is invalid (not a number, or ≤ 0).\n\nThe behavior is:\n- If `window` is undefined → `false`.\n- If `height.value` is invalid (not a number, or ≤ 0) → same as above.\n- Otherwise → `height.value < MAP_LOW_HEIGHT_SCREEN_MAX_PX`.\n\n## Refactoring\n\nWe can eliminate the redundant standalone function and the `computed` wrapper by making the composable directly return a reactive boolean. The key insight is that `useWindowSize` already gives us a reactive `height` ref, so we can just use it directly in the template or in other composables.\n\nHowever, the user asked for a \"small project_03 refactoring\" and to \"explain it.\" Let's keep it minimal and focused.\n\n### Option A: Remove the", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000003", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000059.txt", "source_sha256": "fc86370741bb97d8686496cd1fbfc5fb37fbb396613147077c2ff4e6327bde69", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_01\nFile: source_000059.txt\nLines: 1-11\n```ts\nimport { SHADCN_PALETTE } from './theme';\n\nexport const SKELETON_APPEARANCE = {\n backgroundColor: SHADCN_PALETTE.neutral[800],\n borderRadius: 8\n} as const;\n\nexport const SKELETON_ANIMATION = {\n durationMs: 800,\n minimumOpacity: 0.45\n} as const;\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to describe the interface and constraints of this TypeScript code, and show a correct usage example of the existing API.\n\nLet me analyze the code:\n\n1. It imports `SHADCN_PALETTE` from a theme file\n2. It exports two constants:\n - `SKELETON_APPEARANCE` - an object with `backgroundColor` and `borderRadius`, typed as `as const`\n - `SKELETON_ANIMATION` - an object with `durationMs` and `minimumOpacity`, typed as `as const`\n\nConstraints:\n- `SKELETON_APPEARANCE` is `as const` - meaning it's a readonly object literal. You can't modify its properties after declaration.\n- `SKELETON_ANIMATION` is also `as const` - same constraint.\n- The `backgroundColor` is derived from `SHADCN_PALETTE.neutral[800]` - it's a specific shade from a theme palette.\n- `borderRadius` is hardcoded to `8`.\n- `durationMs` is hardcoded to `800`.\n- `minimumOpacity` is hardcoded to `0.45`.\n\nUsage example:\n- In", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000004", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000030.txt", "source_sha256": "63444b2271928bdddef2c452eac523c51f9a446af67cf60fa173b2c45861938a", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_01\nFile: source_000030.txt\nLines: 1-42\n```ts\nimport type { UseKycTierUpgradeNoticeAnimationResult } from 'native/types/kyc';\nimport { useMemo } from 'react';\nimport { Easing, Keyframe } from 'react-native-reanimated';\nimport { KYC_TIER_UPGRADE_NOTICE_ANIMATION } from 'native/constants/kyc';\n\nconst createNoticeExitingAnimation = (easing: ReturnType<typeof Easing.bezier>) =>\n new Keyframe({\n 0: {\n opacity: 1,\n transform: [\n {\n translateY: 0\n }\n ]\n },\n 100: {\n easing,\n opacity: KYC_TIER_UPGRADE_NOTICE_ANIMATION.exitOpacity,\n transform: [\n {\n translateY: KYC_TIER_UPGRADE_NOTICE_ANIMATION.exitTranslateY\n }\n ]\n }\n }).duration(KYC_TIER_UPGRADE_NOTICE_ANIMATION.durationMs);\n\nexport const useKycTierUpgradeNoticeAnimation = (): UseKycTierUpgradeNoticeAnimationResult => {\n const noticeExiting = useMemo(() => {\n const easing = Easing.bezier(\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingX1,\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingY1,\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingX2,\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingY2\n );\n\n return createNoticeExitingAnimation(easing);\n }, []);\n\n return {\n noticeExiting\n };\n};\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Lifecycle and Dependencies\n\nThis hook is a **React Native Reanimated** animation utility for a KYC tier-upgrade notice. It produces a single `Keyframe` object that describes an \"exit\" animation (fade out + slide down) and exposes it via a `useMemo` so the animation object is stable across renders.\n\n### Dependencies\n\n- **`react`** – `useMemo` (React hooks)\n- **`react-native-reanimated`** – `Easing.bezier`, `Keyframe` (animation primitives)\n- **`native/types/kyc`** – `UseKycTierUpgradeNoticeAnimationResult` (type definition)\n- **`native/constants/kyc`** – `KYC_TIER_UPGRADE_NOTICE_ANIMATION` (config object with easing params, duration, opacity, translate values)\n\n### Lifecycle\n\n1. **First render** – `useMemo` calls the factory. It reads the easing curve from `KYC_TIER_UPGRADE_NOTICE_ANIMATION` (four bezier coefficients), builds a `Keyframe` with:\n - `0%`: `opacity: 1`, `translateY: 0`\n - `100%`: `opacity: exitOpacity`,", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000005", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000188.txt", "source_sha256": "c2400f165e0a86bade580c6f2910f22ca8ba1f648dedb2609200b6ad399f43a1", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_02\nFile: source_000188.txt\nLines: 90-143\n```vue\n stepSize: props.stepSize,\n }),\n)\n\nconst chartOptions = computed(() => {\n const chartTheme = theme.value\n const textColor = resolveThemeValue(chartTheme.colors.text)\n const secondaryTextColor = resolveThemeValue(chartTheme.colors.secondaryText)\n const mutedTextColor = resolveThemeValue(chartTheme.colors.mutedText)\n const gridColor = resolveThemeValue(chartTheme.colors.grid)\n const chartAreaBorderColor = resolveThemeValue(chartTheme.colors.chartAreaBorder)\n const chartAreaBorderStrongColor = resolveThemeValue(chartTheme.colors.chartAreaBorderStrong)\n const fontFamily = resolveThemeValue(chartTheme.typography.fontFamily)\n const gridDashPattern = chartTheme.grid.dashPattern.map((item) => scalePx(item))\n\n return {\n ...createGroupedBarChartRootcodeOptions({\n customGridLines: {\n verticalSpacing:\n props.verticalGridSpacing != null ? scalePx(props.verticalGridSpacing) : null,\n horizontalSpacing:\n props.horizontalGridSpacing != null ? scalePx(props.horizontalGridSpacing) : null,\n color: gridColor,\n lineWidth: scalePx(chartTheme.grid.lineWidth),\n dashPattern: gridDashPattern,\n },\n chartAreaBorder: {\n color: chartAreaBorderColor,\n lineWidth: scalePx(chartTheme.grid.lineWidth),\n dashPattern: gridDashPattern,\n dashOffset: scalePx(chartTheme.grid.dashOffset),\n solidBottom: true,\n },\n centerSingleGroupedBar: props.centerSingleBarPerCategory\n ? { minVisibleValue: 0 }\n : false,\n structuredTooltip: isTooltipEnabled.value\n ? createComparisonTooltipOptions(chartScaleFactor.value)\n : false,\n }),\n responsive: true,\n maintainAspectRatio: false,\n layout: {\n padding: { top: scalePx(22), right: scalePx(8), bottom: 0, left: scalePx(8) },\n },\n interaction: {\n mode: 'index' as const,\n intersect: false,\n },\n /* НАСТРОЙКА ГРУППИРОВКИ (для grouped bar chart) */\n scales: {\n x: {\n /* НАСТРОЙКА ГОРИЗОНТАЛЬНОЙ ОСИ */\n stacked: false, // Отключить стекирование для группировки\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Refactoring: Extract the `resolveThemeValue` calls into a helper\n\nThe code repeatedly calls `resolveThemeValue(chartTheme.colors.xxx)` for every color. This is repetitive, makes the `computed` block harder to scan, and is a small source of copy-paste errors. A small project_03 helper makes the intent clearer and reduces the number of lines in the main block.\n\n### New helper (placed before the `computed` block)\n\n```js\n// Resolve a theme color value once per call site.\nconst resolveColor = (key: keyof typeof theme.value.colors) =>\n resolveThemeValue(theme.value.colors[key])\n```\n\n### Refactored `computed` block\n\n```js\nconst chartOptions = computed(() => {\n const chartTheme = theme.value\n const textColor = resolveColor('text')\n const secondaryTextColor = resolveColor('secondaryText')\n const mutedTextColor = resolveColor('mutedText')\n const gridColor = resolveColor('grid')\n const chartAreaBorderColor = resolveColor('chartAreaBorder')\n const chartAreaBorderStrongColor = resolveColor('chartAreaBorderStrong')\n const fontFamily = resolveColor('typography.fontFamily')\n const gridDash", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000006", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000012.txt", "source_sha256": "e138df380242ee1119033ec8853e5936081843a6acfb7f75fa1cfd4752e4dc6f", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_01\nFile: source_000012.txt\nLines: 1-50\n```tsx\nimport React from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { useUnit } from 'effector-react';\nimport { EXCHANGE_PIN_COPY, EXCHANGE_PIN_LENGTH } from 'native/constants/exchange';\nimport { exchangeExitRequestedFn } from 'native/models/exchange';\nimport { useExchangeLockCountdown } from 'native/composables/exchange';\nimport { getPropsForInputGroup, usePinInputGroupField } from 'native/composables/ui';\nimport { Button, InputGroup } from 'native/components/ui';\nimport { exchangePinStyles as styles } from 'native/styles/exchange';\n\nconst ignoreLockedPinChange = () => {};\n\nexport const ExchangePinLocked = () => {\n const onExit = useUnit(exchangeExitRequestedFn);\n const countdown = useExchangeLockCountdown();\n const field = usePinInputGroupField({\n accessibilityLabel: EXCHANGE_PIN_COPY.inputAccessibilityLabel,\n clearAccessibilityLabel: EXCHANGE_PIN_COPY.clearAccessibilityLabel,\n disabled: true,\n inputMode: 'numeric',\n keyboardType: 'number-pad',\n length: EXCHANGE_PIN_LENGTH,\n onChangeText: ignoreLockedPinChange,\n value: ''\n });\n\n return (\n <ScrollView contentContainerStyle={styles.lockContainer} showsVerticalScrollIndicator={false} style={styles.scroll}>\n <Text accessibilityRole=\"header\" style={styles.lockTitle}>\n {EXCHANGE_PIN_COPY.lockedTitle}\n </Text>\n <Text style={styles.lockBody}>{EXCHANGE_PIN_COPY.lockedBody}</Text>\n\n <View style={styles.lockTimerCard}>\n <Text style={styles.lockTimerLabel}>{EXCHANGE_PIN_COPY.tryAgainIn}</Text>\n <Text style={styles.lockTimer}>{countdown}</Text>\n </View>\n\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" style={styles.lockedInputGroup}>\n <InputGroup {...getPropsForInputGroup(field)} dotsContainerStyle={styles.lockedDots} variant=\"dots\" />\n </View>\n\n <View style={styles.lockAction}>\n <Button onPress={onExit} size=\"lg\" style={styles.lockActionButton} variant=\"outline\">\n {EXCHANGE_PIN_COPY.gotIt}\n </Button>\n </View>\n </ScrollView>\n );\n};\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain the lifecycle and dependencies of this React Native component, specifically addressing asynchronous work, cleanup, and repeated calls when present.\n\nLet me analyze the code:\n\n1. **Dependencies:**\n - `react` - React framework\n - `react-native` - ScrollView, Text, View\n - `effector-react` - `useUnit` hook\n - `native/constants/exchange` - `EXCHANGE_PIN_COPY`, `EXCHANGE_PIN_LENGTH`\n - `native/models/exchange` - `exchangeExitRequestedFn`\n - `native/composables/exchange` - `useExchangeLockCountdown`\n - `native/composables/ui` - `getPropsForInputGroup`, `usePinInputGroupField`\n - `native/components/ui` - Button, InputGroup\n - `native/styles/exchange` - `exchangePinStyles` (imported as `styles`)\n\n2. **Lifecycle:**\n - `useUnit(exchangeExitRequestedFn)` - This is an Effector hook that returns a function. It's called when the user presses the \"Got It\" button. This is the exit handler.\n - `useExchangeLockCountdown()` - Returns a countdown value", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000007", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000238.txt", "source_sha256": "12d9ef0fc19405ec60a1a28e1b464e0be974110084e6a085e83200d6262da0bd", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_02\nFile: source_000238.txt\nLines: 121-176\n```ts\n recoverySettingsVersion.value = null\n needsReload.value = false\n }\n catch (error) {\n if (requestGeneration !== generation || requestId !== editorRequestId) return\n captureConflict(error)\n paramsError.value = errorMessage(error)\n }\n finally {\n if (requestGeneration === generation && requestId === editorRequestId) isParamsLoading.value = false\n }\n }\n\n const closeParams = () => {\n if (isCalculating.value) return\n editorRequestId++\n isParamsOpen.value = false\n isParamsLoading.value = false\n editor.clear()\n }\n\n const refreshResult = async (id: number, requestGeneration: number) => {\n try {\n const currentResult = await opmService.getResult(id)\n if (requestGeneration === generation) result.value = currentResult\n }\n catch (error) {\n if (requestGeneration === generation) loadError.value = errorMessage(error)\n }\n }\n\n const calculate = async () => {\n const id = projectId.value\n const currentSettings = editor.settings\n if (id === null || !currentSettings || isBusy.value || isParamsLoading.value || needsReload.value) return\n if (editor.revealInvalidField()) return\n const requestGeneration = generation\n isCalculating.value = true\n paramsError.value = ''\n try {\n const response = await opmService.calculate(id, {\n base_version: currentSettings.base_version,\n settings_version: currentSettings.settings_version,\n schema_version: currentSettings.schema_version,\n changes: editor.changes,\n })\n if (requestGeneration !== generation) return\n settings.value = response.settings\n result.value = response.result\n recoverySettingsVersion.value = null\n loadError.value = ''\n if (editor.schema) editor.load(editor.schema, response.settings)\n await refreshResult(id, requestGeneration)\n if (requestGeneration !== generation) return\n isParamsOpen.value = false\n if (!resultError.value) {\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Interface and Constraints\n\nThis excerpt is a Vue 3 store (using `ref`/`reactive`) for an \"OPM\" (Open Project Management) module. It manages the lifecycle of a parameter calculation request: opening the params panel, loading parameters, calculating results, and handling errors.\n\n### Key State Variables\n- `isParamsOpen` – whether the params panel is visible\n- `isParamsLoading` – whether parameter values are being fetched\n- `isCalculating` – whether the calculation is in progress\n- `needsReload` – whether the result needs to be re-fetched\n- `paramsError` / `resultError` / `loadError` – error messages for each phase\n- `recoverySettingsVersion` – tracks the last successful settings version\n- `generation` / `editorRequestId` – concurrency guards to prevent stale updates from overwriting newer ones\n- `result` / `settings` / `schema` – the computed result, settings, and schema\n- `editor` – a reference to the editor instance (for clearing and loading schema)\n\n### Constraints & Guards\n1. **Stale-request guard**: In the `catch` block of `loadParams`, if `requestGeneration !== generation ||", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000008", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000096.txt", "source_sha256": "4253d2dc543abf57c98f3d3c6e3c95610afa5791b4a6780a681bad23ffa5756c", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_01\nFile: source_000096.txt\nLines: 9-38\n```ts\n} from 'native/types/transactions';\nimport { combine, createDomain } from 'effector';\nimport { getAllTransactionsPage } from 'native/adapters/api/transactions';\nimport { resolveAllTransactionGroups, resolveDashboardTransactionDetailsPage } from 'native/lib/transactions';\nimport { $authSessionIdentity } from 'native/models/auth';\n\nconst transactionsHistoryDomain = createDomain('transactions.history');\n\nexport const getAllTransactionsPageFx = transactionsHistoryDomain.createEffect<\n AllTransactionsPageAttempt,\n AllTransactionsPageResponse\n>(({ requestId: _requestId, ...request }) => getAllTransactionsPage(request));\n\nexport const allTransactionsOpenedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsOpeningAcceptedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsBackRequestedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsClosedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsLoadMoreRequestedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsRetryRequestedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsTransactionPressedFn = transactionsHistoryDomain.createEvent<DashboardTransaction>();\nexport const allTransactionsSelectionClearedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsSelectionAcceptedFn = transactionsHistoryDomain.createEvent<DashboardTransaction>();\nexport const allTransactionsLoadRequestedFn = transactionsHistoryDomain.createEvent<AllTransactionsLoadReason>();\nexport const allTransactionsBatchPreparedFn = transactionsHistoryDomain.createEvent<AllTransactionsPageAttempt[]>();\n\nexport const allTransactionsPageCandidateFn =\n transactionsHistoryDomain.createEvent<AllTransactionsPageAttempt | null>();\n\nexport const allTransactionsPageAcceptedFn = transactionsHistoryDomain.createEvent<AllTransactionsPageAccepted>();\nexport const allTransactionsPageRejectedFn = transactionsHistoryDomain.createEvent<AllTransactionsPageAttempt>();\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to simplify this code while preserving behavior. Let me analyze what's happening:\n\n1. It's an Effector domain for transactions history\n2. It creates a domain called 'transactions.history'\n3. It exports several effects and events\n\nLet me look at what can be simplified:\n\n1. The `getAllTransactionsPageFx` effect - it uses a destructuring pattern `{ requestId: _requestId, ...request }` where `_requestId` is unused. This is a minor style issue but not really a simplification opportunity.\n\n2. The events are all created separately with `createEvent()` or `createEvent<T>()`. This is verbose but it's the Effector API pattern - you need to declare the event type separately to get proper type inference. However, we could potentially use `createEvent` without a type parameter for events that don't carry data, and use `createEvent<T>` only when needed.\n\nWait, let me re-read the code more carefully:\n\n- `allTransactionsOpenedFn` - no type parameter (no data)\n- `allTransactionsOpeningAcceptedFn` - no type parameter\n- `allTransactionsBackRequestedFn` - no type parameter\n- `allTransactionsClosedFn` -", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000009", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000263.txt", "source_sha256": "0e79bdcaa2b9cee767d850e76b51ff8855837724f14f17502455b92d3eab5d6b", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_02\nFile: source_000263.txt\nLines: 26-74\n```ts\n const dragDistancePx = ref<number>(0)\n const isTimelineDragging = ref<boolean>(false)\n const isClickSuppressed = ref<boolean>(false)\n const dragThumbLeft = ref<string | null>(null)\n const dragActiveFillWidth = ref<string | null>(null)\n let isBodySelectionLocked = false\n let bodyUserSelectBeforeDrag = ''\n let bodyCursorBeforeDrag = ''\n let isWindowPointerListenersBound = false\n let clickSuppressionTimeoutId: ReturnType<typeof setTimeout> | null = null\n\n const getTimelineRootElement = (): HTMLElement | null => timelineRootElementRef.value\n const getTimelineTrackElement = (): HTMLElement | null => timelineTrackElementRef.value\n\n const getYearButtonByYear = (year: number): HTMLButtonElement | null =>\n getTimelineRootElement()?.querySelector<HTMLButtonElement>(`[data-timeline-year=\"${year}\"]`) ?? null\n\n const resolveNearestSelectableYear = (pointerClientX: number): number | null => {\n if (!selectableYears.value.length) return null\n\n let nearestYear: number | null = null\n let nearestDistance = Number.POSITIVE_INFINITY\n\n for (const selectableYear of selectableYears.value) {\n const yearButton = getYearButtonByYear(selectableYear)\n if (!yearButton || yearButton.disabled) continue\n\n const yearRect = yearButton.getBoundingClientRect()\n const yearCenterX = yearRect.left + (yearRect.width / 2)\n const distance = Math.abs(yearCenterX - pointerClientX)\n if (distance < nearestDistance) {\n nearestDistance = distance\n nearestYear = selectableYear\n }\n }\n\n return nearestYear\n }\n\n const resolveTrackPointerOffset = (pointerClientX: number): number | null => {\n const timelineTrackElement = getTimelineTrackElement()\n if (!timelineTrackElement) return null\n\n const trackRect = timelineTrackElement.getBoundingClientRect()\n if (trackRect.width <= 0) return null\n\n const halfLabelPx = timelineHalfLabelWidthPx()\n const minOffsetPx = Math.min(halfLabelPx, trackRect.width / 2)\n const maxOffsetPx = Math.max(trackRect.width - halfLabelPx, minOffsetPx)\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let me analyze this code to find a good refactoring opportunity that preserves behavior.\n\nLooking at the code, I notice several things:\n\n1. The `resolveNearestSelectableYear` function iterates through all selectable years and finds the nearest one. This is fine but could be simplified.\n\n2. The `resolveTrackPointerOffset` function has a somewhat convoluted calculation for `minOffsetPx` and `maxOffsetPx`:\n```ts\nconst halfLabelPx = timelineHalfLabelWidthPx()\nconst minOffsetPx = Math.min(halfLabelPx, trackRect.width / 2)\nconst maxOffsetPx = Math.max(trackRect.width - halfLabelPx, minOffsetPx)\n```\n\nWait, let me think about this. `minOffsetPx` is `Math.min(halfLabelPx, trackRect.width / 2)`. Then `maxOffsetPx` is `Math.max(trackRect.width - halfLabelPx, minOffsetPx)`.\n\nSince `trackRect.width / 2` is always ≤ `trackRect.width - halfLabelPx` (assuming `halfLabelPx ≤ trackRect.width / 2`), the `Math.max(trackRect.width - halfLabelPx, minOffsetPx)` would just be", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000010", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000194.txt", "source_sha256": "b44824d4bf23287b69e40c1b7b1758acdd93aab54f5ca1d742e5b39b5dee5650", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_02\nFile: source_000194.txt\nLines: 1-65\n```ts\nconst DEFAULT_COMPARISON_TABLE_FRAME_WIDTH_REM = 87\nconst ULTRA_WIDE_BREAKPOINT_PX = 2560\n\nconst getRootFontSizePx = (): number => {\n if (typeof window === 'undefined') return 16\n\n const rootFontSize = Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)\n return Number.isFinite(rootFontSize) && rootFontSize > 0 ? rootFontSize : 16\n}\n\nexport const useConstructorComparisonTableFrameWidth = () => {\n const comparisonTableElementRef = ref<HTMLElement | null>(null)\n const frameWidthPx = ref<number | null>(null)\n\n const getBaseFrameWidthPx = (): number => DEFAULT_COMPARISON_TABLE_FRAME_WIDTH_REM * getRootFontSizePx()\n\n const updateFrameWidth = () => {\n if (typeof window === 'undefined') return\n\n if (window.innerWidth < ULTRA_WIDE_BREAKPOINT_PX) {\n frameWidthPx.value = null\n return\n }\n\n const comparisonTableElement = comparisonTableElementRef.value\n if (!comparisonTableElement) return\n\n const frameHostElement = comparisonTableElement.parentElement ?? comparisonTableElement\n const nextFrameWidth = Math.max(frameHostElement.clientWidth, getBaseFrameWidthPx())\n frameWidthPx.value = Number.isFinite(nextFrameWidth) ? nextFrameWidth : null\n }\n\n let comparisonResizeObserver: ResizeObserver | null = null\n\n onMounted(() => {\n updateFrameWidth()\n window.addEventListener('resize', updateFrameWidth)\n\n if (typeof ResizeObserver === 'undefined') return\n\n comparisonResizeObserver = new ResizeObserver(() => {\n updateFrameWidth()\n })\n\n const targetElement = comparisonTableElementRef.value?.parentElement ?? comparisonTableElementRef.value\n if (targetElement) {\n comparisonResizeObserver.observe(targetElement)\n }\n })\n\n onUnmounted(() => {\n window.removeEventListener('resize', updateFrameWidth)\n comparisonResizeObserver?.disconnect()\n comparisonResizeObserver = null\n })\n\n const comparisonTableFrameStyle = computed(() => {\n if (frameWidthPx.value === null) return undefined\n\n return {\n '--comparison-frame-width': `${frameWidthPx.value}px`,\n }\n })\n\n return {\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain the lifecycle and dependencies of this Vue composable, specifically addressing asynchronous work, cleanup, and repeated calls. Let me analyze the code carefully.\n\nLet me trace through the code:\n\n1. **Constants**: `DEFAULT_COMPARISON_TABLE_FRAME_WIDTH_REM = 87` and `ULTRA_WIDE_BREAKPOINT_PX = 2560`\n\n2. **`getRootFontSizePx()`**: Gets the root font size from CSS. Handles SSR (window undefined) by returning 16. Falls back to 16 if the parsed value is not finite or not > 0.\n\n3. **`useConstructorComparisonTableFrameWidth()`**: Returns an object with:\n - `comparisonTableElementRef`: ref to the comparison table element\n - `frameWidthPx`: reactive ref for the frame width in px\n - `getBaseFrameWidthPx()`: calculates base width as 87rem * root font size\n - `updateFrameWidth()`: the main logic\n - `comparisonResizeObserver`: a ResizeObserver instance\n - `comparisonTableFrameStyle`: computed style object\n\n4. **`onMounted()`**:\n - Calls `updateFrameWidth()` immediately", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000011", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000137.txt", "source_sha256": "4478e970a779b5c96ab3c8de9a0262b1114e3b1e93860efeb0e89767f279b36b", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nReview the correctness of this code. Identify the most substantial supported risk, or explain why the excerpt does not establish one.\n\nProject: project_01\nFile: source_000137.txt\nLines: 1-6\n```ts\nimport type { AppStackParamList } from 'native/types/routing';\nimport type { NativeStackScreenProps } from '@react-navigation/native-stack';\n\nexport type KycTierUpgradeScreenProps = NativeStackScreenProps<AppStackParamList, 'kycTierUpgrade'>;\n\nexport type VerificationScreenProps = NativeStackScreenProps<AppStackParamList, 'verification'>;\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to review the correctness of this TypeScript code and identify the most substantial supported risk, or explain why the excerpt does not establish one.\n\nLet me analyze the code:\n\n1. It imports `AppStackParamList` from `'native/types/routing'`\n2. It imports `NativeStackScreenProps` from `'@react-navigation/native-stack'`\n3. It defines two type aliases:\n - `KycTierUpgradeScreenProps` - a type alias for `NativeStackScreenProps<AppStackParamList, 'kycTierUpgrade'>`\n - `VerificationScreenProps` - a type alias for `NativeStackScreenProps<AppStackParamList, 'verification'>`\n\nNow, let me think about what risks or issues exist:\n\n1. **Type aliasing instead of type definition**: The code uses `export type` (type aliases) instead of `export interface` or `export type`. This means:\n - `KycTierUpgradeScreenProps` is just a type alias, not a distinct type. If someone does `KycTierUpgradeScreenProps extends SomeOtherType`, it would work because type aliases are transparent.\n - More importantly, if `NativeStackScreenProps` changes its", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000012", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000116.txt", "source_sha256": "cf3aa13d3474be7ad6fc186a76b1c261b1eadf56b4eb28fe451b04d513388a3a", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_01\nFile: source_000116.txt\nLines: 43-112\n```ts\n },\n amountCardInputShell: {\n flex: 1,\n minWidth: 0,\n position: 'relative'\n },\n amountInputContainer: {\n flex: 1\n },\n amountInputField: {\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n borderRadius: 0,\n borderWidth: 0,\n minHeight: 50,\n paddingHorizontal: 0,\n paddingVertical: 0\n },\n amountCardValueRow: {\n alignItems: 'center',\n flex: 1,\n flexDirection: 'row',\n minWidth: 0\n },\n amountCardValue: {\n fontFamily: SHADCN_TYPOGRAPHY['data-large-value'].fontFamily,\n fontSize: 36,\n fontWeight: '600',\n lineHeight: 42,\n color: SHADCN_PALETTE.neutral[100],\n flex: 1,\n fontVariant: ['tabular-nums'],\n paddingVertical: 4\n },\n amountCardFooter: {\n gap: 4,\n minHeight: 34\n },\n amountCardBalance: {\n ...(SHADCN_TYPOGRAPHY['body-reg-12'] as TextStyle),\n color: SHADCN_PALETTE.neutral[300],\n fontVariant: ['tabular-nums']\n },\n amountCardBalanceInvalid: {\n color: SHADCN_PALETTE.error[100]\n },\n amountPair: {\n position: 'relative'\n },\n currencyChip: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: 8,\n minHeight: 44,\n paddingLeft: 8\n },\n currencyChipPressed: {\n opacity: 0.7,\n transform: [{ scale: 0.97 }]\n },\n currencyChipCode: {\n ...(SHADCN_TYPOGRAPHY['body-med-16'] as TextStyle),\n color: SHADCN_PALETTE.neutral[100],\n fontVariant: ['tabular-nums']\n },\n swapRow: {\n alignItems: 'center',\n height: 28,\n justifyContent: 'center',\n marginVertical: -5,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to describe the interface and constraints of this code excerpt, and show a correct usage example of the existing API.\n\nLet me analyze the code:\n\nThis is a TypeScript file (`money.ts`) from a project called `project_01`. It's in the `apps/native/src/styles/exchange/` directory. It defines a set of style objects (likely for a React Native or similar mobile app using a styling system like Tamagui or similar).\n\nThe objects defined are:\n- `amountCardInputShell` - flex: 1, minWidth: 0, position: 'relative'\n- `amountInputContainer` - flex: 1\n- `amountInputField` - transparent background/border, no border radius, no border width, minHeight: 50, no padding\n- `amountCardValueRow` - alignItems: 'center', flex: 1, flexDirection: 'row', minWidth: 0\n- `amountCardValue` - uses SHADCN typography and palette, fontSize: 36, fontWeight: '600', lineHeight: 42, color: neutral[100], flex: 1, fontVariant: ['tabular-nums'], paddingVertical: 4", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000013", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000196.txt", "source_sha256": "a020b4351638d8d4465e37fd02284217a311bb8b821145ba4d528ab0d5f13cb2", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_02\nFile: source_000196.txt\nLines: 73-139\n```ts\n ),\n )\n\n const constructorSkeletonShape = computed<ConstructorSkeletonProps>(() => ({\n comparisonRowCount: comparisonTableRows.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_COMPARISON_ROW_COUNT,\n ganttProjectCount: implementationProjects.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_GANTT_PROJECT_COUNT,\n ganttYearCount: implementationYears.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_GANTT_YEAR_COUNT,\n indicatorCount: indicators.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_INDICATOR_COUNT,\n projectCount: projects.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_PROJECT_COUNT,\n }))\n\n const constructorTabs: TabItem[] = [{\n label: 'Параметры',\n value: 'scenario-params',\n }, {\n label: 'Сравнение',\n value: 'scenario-comparison',\n }]\n\n const changeComparisonMode = async (tabValue: string | undefined) => {\n if (!tabValue) return\n if (tabValue !== 'scenario-params' && tabValue !== 'scenario-comparison') return\n\n const shouldEnableComparison = tabValue === 'scenario-comparison'\n if (shouldEnableComparison === isComparisonMode.value) return\n\n await constructorStore.compareScenarios(shouldEnableComparison)\n }\n\n const activeTab = computed<ConstructorModeTab>({\n get: () => (isComparisonMode.value ? 'scenario-comparison' : 'scenario-params'),\n set: (tab) => {\n changeComparisonMode(tab)\n },\n })\n\n const shouldShowModeTabs = computed(() => canShowComparisonControls.value)\n\n const selectScenario = (scenarioId: number) => {\n if (isComparisonMode.value) {\n constructorStore.compareScenarios(false)\n }\n constructorStore.selectScenario(scenarioId)\n }\n\n const addScenario = () => {\n if (isComparisonMode.value) {\n constructorStore.compareScenarios(false)\n }\n constructorStore.addScenario()\n }\n\n const onScenarioCardClick = (scenarioId: number) => {\n if (isComparisonMode.value) {\n constructorStore.toggleScenarioComparison(scenarioId)\n return\n }\n\n selectScenario(scenarioId)\n }\n\n const { getGroupedBarChartYMax } = useGroupedBarChartYMax()\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let's analyze the code to find opportunities for simplification while preserving behavior.\n\nLooking at the code, I notice several patterns:\n\n1. **Repeated `if (isComparisonMode.value)` checks** - The `selectScenario`, `addScenario`, and `onScenarioCardClick` functions all start with the same guard:\n```ts\nif (isComparisonMode.value) {\n constructorStore.compareScenarios(false)\n}\n```\nThis is a repeated pattern that could be extracted.\n\n2. **The `changeComparisonMode` function** - It has a guard for `!tabValue` and then checks against two specific values. The logic is:\n - If no tab value → return\n - If tab value is neither 'scenario-params' nor 'scenario-comparison' → return\n - Otherwise, if the new tab is 'scenario-comparison' and we're already in comparison mode → return\n - Otherwise, enable/disable comparison\n\n3. **The `constructorTabs` array** - This is a static array that's defined inline. It could be extracted as a constant.\n\n4. **The `constructorSkeletonShape` computed** - Uses `||` (falsy check) instead of `??`", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000014", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000146.txt", "source_sha256": "0b9544df18057fd4788349dd5054cb42a6afb8ea711a30fcbccf5737f2276846", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_02\nFile: source_000146.txt\nLines: 1-25\n```scss\n@use 'sass:math';\n\n$rem-base: 16px !default;\n\n/// Converts a pixel value from Figma to rem.\n@function rem($pixels) {\n @if math.is-unitless($pixels) {\n $pixels: $pixels * 1px;\n }\n\n @if not math.compatible($pixels, 1px) {\n @error 'rem() expects a pixel value or a unitless pixel count.';\n }\n\n @return math.div($pixels, $rem-base) * 1rem;\n}\n\n/// Converts a Figma inner spacing to rem and compensates for a 1px CSS border.\n@function rem-inner($pixels) {\n @if math.is-unitless($pixels) {\n $pixels: $pixels * 1px;\n }\n\n @return rem($pixels - 1px);\n}\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Interface and Constraints\n\nThis SCSS file defines two utility functions for converting Figma pixel values to CSS `rem` units:\n\n### `rem($pixels)`\n- **Input:** A pixel value (e.g., `16px`, `24px`) or a unitless number (e.g., `16`).\n- **Behavior:**\n - If the input is unitless, it's treated as pixels.\n - If the input is not compatible with `1px` (e.g., a non-numeric value), it throws an error.\n - Returns the value divided by `$rem-base` (16px) and multiplied by `1rem`.\n- **Output:** A `rem` value (e.g., `1rem`, `1.5rem`).\n\n### `rem-inner($pixels)`\n- **Input:** A pixel value or unitless number.\n- **Behavior:** Subtracts 1px from the input (to compensate for a CSS border) and passes it to `rem()`.\n- **Output:** A `rem` value adjusted for a 1px border.\n\n---\n\n## Correct Usage Example\n\n```scss\n// In a Figma design, a card has a", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000015", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000157.txt", "source_sha256": "4a2504822779145eabe3c2e63c24a3e26c1206777ee7803ab3717fa0a69c6ef5", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_02\nFile: source_000157.txt\nLines: 76-145\n```vue\n </div>\n </section>\n</template>\n\n<style scoped lang=\"scss\">\n.report-preview {\n width: 100%;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n user-select: none;\n\n &__frame {\n width: 100%;\n height: 100%;\n min-height: 0;\n border-radius: 1.25rem;\n border: 1px solid var(--color-border-primary);\n background: var(--color-bg-primary);\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n &__tabs {\n width: 100%;\n flex-shrink: 0;\n }\n\n &__image {\n display: block;\n width: 100%;\n min-width: 0;\n height: auto;\n max-width: 100%;\n object-fit: initial;\n background: #fff;\n }\n\n &__placeholder {\n width: 100%;\n height: 100%;\n padding: 1rem;\n display: grid;\n place-items: center;\n text-align: center;\n color: var(--color-text-secondary);\n }\n\n &__placeholder-title,\n &__placeholder-text {\n margin: 0;\n }\n\n &__actions {\n display: grid;\n grid-template-columns: 1fr;\n gap: 0.75rem;\n\n :deep(.ui-button) {\n width: 100%;\n min-height: 3.5rem;\n }\n }\n\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain the lifecycle and dependencies of this Vue component, addressing asynchronous work, cleanup, and repeated calls. Let me analyze the code carefully.\n\nLooking at the code, this is a Vue component called `ReportPreviewModal.vue` (lines 76-145). It's a modal for previewing reports. Let me look at what's actually shown:\n\n1. The template section (ends around line 76)\n2. The `<style scoped lang=\"scss\">` section with CSS for `.report-preview` class\n\nThe code is truncated - it only shows the template and style. I don't see the `<script>` section which would contain the actual logic (lifecycle hooks, async work, cleanup, repeated calls).\n\nWait, the user says \"Explain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\" and points to lines 76-145. But the code shown is only the template and style. The actual logic would be in the `<script>` section which isn't shown.\n\nLet me re-read the prompt. It says \"Explain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\"", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000016", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000083.txt", "source_sha256": "3004df4ee051876a468445eb3971f3710c811986a2dc97bbd4c80a75b32dad23", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_01\nFile: source_000083.txt\nLines: 1-63\n```ts\nimport { sample } from 'effector';\nimport { createDiagnosticReport } from 'native/lib/diagnostics';\nimport { $diagnosticJournal, $diagnosticOverlaySaveState, recordDiagnosticEventFn } from '..';\nimport { diagnosticReportSaveRequestedFn, resetDiagnosticReportStatusFx, saveDiagnosticReportFx } from './index';\n\n$diagnosticOverlaySaveState\n .on(saveDiagnosticReportFx, (currentSaveState, { requestId }) =>\n requestId > currentSaveState.requestId\n ? {\n requestId,\n status: 'saving' as const\n }\n : currentSaveState\n )\n .on(saveDiagnosticReportFx.done, (currentSaveState, { params, result }) => {\n if (currentSaveState.requestId !== params.requestId) {\n return currentSaveState;\n }\n\n return {\n requestId: params.requestId,\n status: result.status === 'saved' ? ('success' as const) : ('idle' as const)\n };\n })\n .on(saveDiagnosticReportFx.fail, (currentSaveState, { params }) =>\n currentSaveState.requestId === params.requestId\n ? {\n requestId: params.requestId,\n status: 'error' as const\n }\n : currentSaveState\n )\n .on(resetDiagnosticReportStatusFx.doneData, (currentSaveState, requestId) =>\n currentSaveState.requestId === requestId && currentSaveState.status !== 'saving'\n ? {\n requestId,\n status: 'idle' as const\n }\n : currentSaveState\n );\n\nsample({\n clock: diagnosticReportSaveRequestedFn,\n source: {\n journal: $diagnosticJournal,\n saveState: $diagnosticOverlaySaveState\n },\n filter: ({ saveState }) => saveState.status !== 'saving',\n fn: ({ journal, saveState }) => ({\n report: createDiagnosticReport(journal),\n requestId: saveState.requestId + 1\n }),\n target: saveDiagnosticReportFx\n});\n\nsample({\n clock: saveDiagnosticReportFx.done,\n source: $diagnosticOverlaySaveState,\n filter: (saveState, { params, result }) => saveState.requestId === params.requestId && result.status === 'saved',\n fn: (_, { params, result }) => ({\n category: 'app' as const,\n details: {\n characters: params.report.length,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain how to simplify this code while preserving behavior. Let me analyze the code carefully.\n\nThis is an Effector (a state management library) setup for a diagnostic report feature. Let me break down what's happening:\n\n1. **State machine for `$diagnosticOverlaySaveState`**: It's a reactive store that tracks save state with `requestId` and `status`.\n - On `saveDiagnosticReportFx` (action dispatched): If the new requestId > current requestId, update to `{ requestId, status: 'saving' }`. Otherwise, keep current.\n - On `saveDiagnosticReportFx.done`: If the requestId matches, update to `{ requestId, status: 'success' }` if result.status === 'saved', otherwise `{ requestId, status: 'idle' }`.\n - On `saveDiagnosticReportFx.fail`: If the requestId matches, update to `{ requestId, status: 'error' }`. Otherwise, keep current.\n - On `resetDiagnosticReportStatusFx.doneData`: If the requestId matches AND current status is not 'saving', update to `{ requestId, status: 'idle' }`.\n\n2. **Sample 1**: When `diagnosticReportSaveRequestedFn` fires (", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000017", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000022.txt", "source_sha256": "199d22ad4be21cad8b35c569c59d8321e0c4a8614ccde24851e6507b8bebda86", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_01\nFile: source_000022.txt\nLines: 4-52\n```tsx\nimport { DASHBOARD_WALLET_OVERVIEW_COPY, DASHBOARD_WALLET_OVERVIEW_LAYOUT } from 'native/constants/wallets';\nimport { SHADCN_PALETTE } from 'native/constants/ui';\nimport { DashboardWalletChevronRightSVG } from 'native/components/icons/wallets';\nimport { DashboardCurrencyIcon } from 'native/components/ui';\nimport { walletOverviewStyles as styles } from 'native/styles/wallets';\nimport { DashboardFlag } from '../DashboardFlag';\nimport { DashboardWalletRowsSkeleton } from './DashboardWalletRowsSkeleton';\n\nexport const DashboardWalletsCard = ({\n isLoading = false,\n isOverviewVisible,\n onWalletPress,\n wallets\n}: DashboardWalletsCardNativeProps) => (\n <View\n accessibilityLabel={isLoading ? DASHBOARD_WALLET_OVERVIEW_COPY.loadingAccessibilityLabel : undefined}\n accessibilityRole={isLoading ? 'progressbar' : undefined}\n accessibilityState={isLoading ? { busy: true } : undefined}\n accessible={isLoading || undefined}\n style={styles.walletCard}\n >\n <Text style={[styles.walletsTitle, isOverviewVisible ? styles.walletsTitleOverview : undefined]}>\n {DASHBOARD_WALLET_OVERVIEW_COPY.title}\n </Text>\n\n {isLoading ? (\n <DashboardWalletRowsSkeleton />\n ) : (\n wallets.map((wallet) => (\n <Pressable\n accessibilityLabel={`${DASHBOARD_WALLET_OVERVIEW_COPY.openWalletAccessibilityLabel} ${wallet.currency}`}\n accessibilityRole=\"button\"\n disabled={!isOverviewVisible || !onWalletPress}\n key={wallet.id}\n onPress={() => onWalletPress?.(wallet)}\n style={({ pressed }) => [\n styles.walletRow,\n isOverviewVisible ? styles.walletRowOverview : undefined,\n pressed ? styles.walletRowPressed : undefined\n ]}\n >\n <View style={styles.walletCurrencyRow}>\n <View style={styles.walletFlag}>\n <DashboardFlag code={wallet.flag} />\n </View>\n\n <View style={styles.walletValue}>\n <Text style={styles.walletCurrency}>{wallet.currency}</Text>\n <View style={styles.walletAmountRow}>\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let me analyze the lifecycle and dependencies of this React Native component, focusing on async work, cleanup, and repeated calls.\n\n## Component Overview\n\n`DashboardWalletsCard` is a card component that displays a list of wallets in a dashboard. It takes props including `isLoading`, `isOverviewVisible`, `onWalletPress`, and `wallets`.\n\n## Dependencies\n\n**Imports:**\n- `DASHBOARD_WALLET_OVERVIEW_COPY`, `DASHBOARD_WALLET_OVERVIEW_LAYOUT` — constants for copy strings and layout config\n- `SHADCN_PALETTE` — UI color palette\n- `DashboardWalletChevronRightSVG` — icon (imported but not used in the visible code)\n- `DashboardCurrencyIcon` — imported but not used in the visible code\n- `walletOverviewStyles` — styled-components styles for wallet cards\n- `DashboardFlag` — child component for displaying currency flags\n- `DashboardWalletRowsSkeleton` — child component for loading state\n\n**Props:**\n- `isLoading` (default `false`) — shows skeleton UI\n- `isOverviewVisible` — controls whether the card is in \"overview\" mode\n- `onWalletPress` — callback when a wallet row is pressed\n- `wallet", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000018", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000076.txt", "source_sha256": "69235d5f2e6d5b722643eba62c0affd2a0ef927f02c1dd83476aee6a4d9a3bc7", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_01\nFile: source_000076.txt\nLines: 105-174\n```ts\n maxAmountMinor,\n maxSendableMinor,\n minAmountMinor,\n minorUnitExponent,\n sendable,\n status\n };\n\n return hasConsistentLimits(wallet) ? wallet : null;\n};\n\nconst isUnsupportedCurrencyRow = (value: Record<string, unknown>) => {\n if (typeof value.currency !== 'string') {\n return false;\n }\n\n const normalizedCurrency = value.currency.trim().toUpperCase();\n\n const isIsoCurrencyCode =\n value.currency === normalizedCurrency && TRANSFER_CURRENCY_CODE_PATTERN.test(normalizedCurrency);\n\n return isIsoCurrencyCode && !isTransferSourceWalletCurrency(normalizedCurrency);\n};\n\nexport const resolveTransferSourceWalletsResponse = (value: unknown): TransferSourceWallet[] | null => {\n if (!isRecord(value) || !Array.isArray(value.wallets)) {\n return null;\n }\n\n const wallets: TransferSourceWallet[] = [];\n const currencies = new Set<TransferSourceWallet['currency']>();\n\n for (const row of value.wallets) {\n if (!isRecord(row)) {\n return null;\n }\n\n if (isUnsupportedCurrencyRow(row)) {\n continue;\n }\n\n const wallet = resolveTransferSourceWallet(row);\n\n if (wallet === null || currencies.has(wallet.currency)) {\n return null;\n }\n\n currencies.add(wallet.currency);\n wallets.push(wallet);\n }\n\n return wallets;\n};\n\nexport const resolveTransferSourceWalletOptions = (\n wallets: readonly TransferSourceWallet[] | null\n): readonly DashboardWallet[] => {\n if (wallets === null) {\n return [];\n }\n\n const options: DashboardWallet[] = [];\n\n for (const wallet of wallets) {\n const presentation = TRANSFER_SOURCE_WALLET_METADATA.find(({ currency }) => currency === wallet.currency);\n\n if (presentation) {\n const amount =\n wallet.availableMinor === 0\n ? TRANSFER_SOURCE_WALLET_BALANCE_FALLBACK\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let's look at the code and identify opportunities for simplification while preserving behavior.\n\nKey observations:\n\n1. **`isUnsupportedCurrencyRow`** - This function checks if a currency row is unsupported. The logic is:\n - If `currency` is not a string → return false\n - Normalize to uppercase\n - Check if it's a valid ISO currency code AND not a transfer source wallet currency\n - Return true if unsupported\n\n2. **`resolveTransferSourceWalletsResponse`** - The main loop:\n - Validates input is a record with an array of wallets\n - For each row, checks if it's a record, if currency is unsupported, resolves the wallet\n - If wallet is null or currency already seen → return null\n - Otherwise, add to wallets array\n\n3. **`resolveTransferSourceWalletOptions`** - Maps wallets to dashboard options, with a fallback for zero balance.\n\nLet me think about what's the most impactful and clear refactoring:\n\n**Refactoring 1: Extract the \"already seen currency\" check into the loop more clearly.**\n\nThe current code:\n```ts\nconst currencies = new Set<TransferSourceWallet['currency']>();\n// ...\n", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000019", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000165.txt", "source_sha256": "a07e60b8aafdcc34e52ad8f935d8fc84cf1c571d2008be3bbdba267945dffecb", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nReview the correctness of this code. Identify the most substantial supported risk, or explain why the excerpt does not establish one.\n\nProject: project_02\nFile: source_000165.txt\nLines: 1-25\n```ts\nimport {\n HOME_ROUTE_PATH,\n NETWORK_ROUTE_PATH,\n PROJECTS_ROUTE_PATH,\n} from '@shared'\n\nexport const APP_ROUTES_WITH_TIMELINE = new Set([\n HOME_ROUTE_PATH,\n])\n\nexport const APP_MAP_PRELOAD_ROUTE_PATHS = new Set([\n HOME_ROUTE_PATH,\n NETWORK_ROUTE_PATH,\n PROJECTS_ROUTE_PATH,\n])\n\nexport const APP_MAP_PRELOAD_IDLE_TIMEOUT_MS = 3000\nexport const APP_MAP_PRELOAD_FALLBACK_DELAY_MS = 1000\n\nexport const APP_MAIN_TOASTER_CONFIG = {\n position: 'top-right',\n expand: true,\n duration: 5000,\n class: 'app-main-toast-viewport',\n} as const\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to review the correctness of this TypeScript code and identify the most substantial supported risk, or explain why the excerpt does not establish one.\n\nLet me analyze the code carefully:\n\n1. It imports three route paths from `@shared`\n2. It creates `APP_ROUTES_WITH_TIMELINE` as a Set containing only `HOME_ROUTE_PATH`\n3. It creates `APP_MAP_PRELOAD_ROUTE_PATHS` as a Set containing all three route paths\n4. It exports constants for preload timeout and fallback delay\n5. It exports a toaster configuration\n\nLet me think about what risks or issues exist:\n\n1. **The `as const` assertion on `APP_MAIN_TOASTER_CONFIG`**: This is a significant issue. The object literal `{ position: 'top-right', expand: true, duration: 5000, class: 'app-main-toast-viewport' }` is cast with `as const`. In TypeScript, `as const` is a type-level assertion that doesn't actually enforce anything at runtime. It's purely a type-level construct. This means:\n - At runtime, the object is just a plain object.\n - If someone changes the shape of the object (e.g., adds a", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000020", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000003.txt", "source_sha256": "e4884dfec0e83bc7265c75cf37bfa15e88b2da0b5a6ce1f9a4d67aae3e7f42af", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the data flow and responsibilities in this excerpt. Refer to concrete functions and state; do not invent missing behavior.\n\nProject: project_01\nFile: source_000003.txt\nLines: 33-102\n```ts\n name,\n recordDiagnostic = recordDiagnosticEvent\n}: StorageOperationQueueOptions) => {\n let pendingOperation = Promise.resolve();\n let pendingOperationCount = 0;\n let nextOperationId = 1;\n\n return <Result>(operation: () => Promise<Result>) => {\n const operationId = nextOperationId;\n const operationsAhead = pendingOperationCount;\n const queuedAt = Date.now();\n let startedAt = queuedAt;\n\n nextOperationId += 1;\n pendingOperationCount += 1;\n\n const runOperation = () => {\n startedAt = Date.now();\n\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'started', {\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n\n try {\n const operationResult = operation();\n\n void operationResult.then(\n () => {\n pendingOperationCount -= 1;\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'succeeded', {\n durationMs: Date.now() - startedAt,\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n },\n (error) => {\n pendingOperationCount -= 1;\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'failed', {\n durationMs: Date.now() - startedAt,\n error,\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n }\n );\n\n return operationResult;\n } catch (error) {\n pendingOperationCount -= 1;\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'failed', {\n durationMs: Date.now() - startedAt,\n error,\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n\n throw error;\n }\n };\n\n const result = pendingOperation.then(runOperation, runOperation);\n\n pendingOperation = result.then(\n () => {},\n () => {}\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Data Flow and Responsibilities\n\nThis file implements a **serial execution queue** for storage operations. It ensures that storage operations run one at a time, in the order they are submitted, and that the queue is always ready to accept the next operation.\n\n### Core State (lines 35–37)\n\n- `pendingOperation`: a `Promise` that represents the currently running operation. Initialized to `Promise.resolve()` so the queue is immediately ready.\n- `pendingOperationCount`: number of operations currently in the queue (including the one in flight).\n- `nextOperationId`: monotonically increasing counter for assigning unique IDs to operations.\n\n### The Returned Function (line 40)\n\n```ts\nreturn <Result>(operation: () => Promise<Result>) => {\n```\n\nThis is a **factory function** that returns a `Result`-typed function. When you call it with an `operation` (a function that returns a `Promise`), it:\n\n1. Assigns the next `operationId`.\n2. Records a `\"started\"` diagnostic event.\n3. Runs the operation via `runOperation`.\n4. Updates `pendingOperationCount` when the operation settles (success or failure).\n5.", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000021", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000182.txt", "source_sha256": "8deae9981f43d4098d83dceec89d2480b817367b116dd842ecfeb5ee17067a11", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_02\nFile: source_000182.txt\nLines: 4-56\n```ts\n DEFAULT_PASSWORD_SETUP_MODE,\n SET_PASSWORD_SETUP_MODE,\n SUCCESS_REDIRECT_DELAY_MS,\n} from '@modules/auth/constants/reset-password'\nimport { useResetPasswordStore } from '@modules/auth/stores/reset-password'\nimport type { PasswordSetupMode } from '@modules/auth/types/reset-password'\nimport { AUTH_ROUTE_PATH, useproject_03Toast, type ToastType } from '@shared'\n\nconst isPasswordSetupMode = (value: unknown): value is PasswordSetupMode => {\n return value === DEFAULT_PASSWORD_SETUP_MODE || value === SET_PASSWORD_SETUP_MODE\n}\n\nexport const useResetPasswordPage = () => {\n const authStore = useAuthStore()\n const resetPasswordStore = useResetPasswordStore()\n const route = useRoute()\n const router = useRouter()\n const { add: showToastAdd } = useproject_03Toast()\n\n const {\n isValidating,\n isSubmitting,\n maxPasswordLength,\n passwordSetupConfig,\n passwordSchema,\n isReadyForForm,\n } = storeToRefs(resetPasswordStore)\n\n const passwordSetupMode = computed(() => {\n return isPasswordSetupMode(route.meta.passwordSetupMode)\n ? route.meta.passwordSetupMode\n : DEFAULT_PASSWORD_SETUP_MODE\n })\n\n const { handleSubmit, errors, meta, submitCount } = useForm({ validationSchema: passwordSchema })\n const { value: password, meta: passwordMeta } = useField<string>('password')\n const { value: confirmPassword, meta: confirmPasswordMeta } = useField<string>('confirmPassword')\n\n const hasPasswordInput = computed(() => Boolean(password.value?.length))\n const shouldShowRequirementErrors = computed(() => hasPasswordInput.value || submitCount.value > 0)\n\n const showPasswordError = computed(() => {\n return Boolean(errors.value.password) && (passwordMeta.dirty || submitCount.value > 0)\n })\n\n const showConfirmPasswordError = computed(() => {\n return Boolean(errors.value.confirmPassword) && (confirmPasswordMeta.dirty || submitCount.value > 0)\n })\n\n const passwordFieldErrorText = computed(() => {\n return resetPasswordStore.getRequiredFieldErrorText(showPasswordError.value, password.value, 'Введите пароль')\n })\n\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let me analyze this Vue 3 composable for a reset password page. I'll cover the lifecycle, dependencies, async work, cleanup, and repeated calls.\n\n## Lifecycle\n\nThis is a Vue 3 composable (`useResetPasswordPage`) that runs once per component instance. The key lifecycle points:\n\n1. **Setup (component mount)**: The store references are created via `storeToRefs(resetPasswordStore)`. This is a one-time operation that happens when the composable is first called. The `useForm` and `useField` calls also happen here, setting up the form state.\n\n2. **Reactivity**: The `computed` properties (`passwordSetupMode`, `hasPasswordInput`, `shouldShowRequirementErrors`, `showPasswordError`, `showConfirmPasswordError`, `passwordFieldErrorText`) are reactive. They automatically re-evaluate whenever their dependencies change. This means if `route.meta.passwordSetupMode` changes (e.g., navigating to a different route), the `passwordSetupMode` computed will update, and any UI bound to it will react.\n\n3. **Form submission**: `handleSubmit` is the main async entry point. It's called when the user submits the form.\n\n## Dependencies\n\nThe com", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000022", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000050.txt", "source_sha256": "45c005a58c175c23647b3033722bbc1ec48e6260f285b1297bf3224af0a297a5", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the data flow and responsibilities in this excerpt. Refer to concrete functions and state; do not invent missing behavior.\n\nProject: project_01\nFile: source_000050.txt\nLines: 9-63\n```ts\n authSessionTimeoutWarning: 'auth.sessionTimeoutWarning',\n authTwoFactor: 'auth.twoFactor',\n beneficiariesCreationSaveError: 'beneficiaries.creationSaveError',\n beneficiariesDetailsActions: 'beneficiaries.detailsActions',\n beneficiariesSelectionActions: 'beneficiaries.selectionActions',\n kycCredentialExit: 'kyc.credentialExit',\n profileCredentialExit: 'profile.credentialExit',\n supportTicketAction: 'support.ticketAction',\n supportAttachments: 'support.attachments',\n supportAttachmentPicker: 'support.attachmentPicker',\n transfersAmountLimits: 'transfers.amountLimits',\n transfersDuplicate: 'transfers.duplicate',\n transfersPinLocked: 'transfers.pinLocked',\n transfersSourceWalletSelect: 'transfers.sourceWalletSelect'\n} as const satisfies Record<string, ModalKind>;\n\nexport const MODAL_OWNER_KEYS = {\n authLogout: 'auth.logout',\n authSessionTimeout: 'auth.sessionTimeout',\n authSignIn: 'auth.signIn',\n authSignUp: 'auth.signUp',\n authStart: 'auth.start',\n authTwoFactor: 'auth.twoFactor',\n beneficiariesCreation: 'beneficiaries.creation',\n beneficiariesDetails: 'beneficiaries.details',\n beneficiariesDirectory: 'beneficiaries.directory',\n kycCredentialSetup: 'kyc.credentialSetup',\n kycVerification: 'kyc.verification',\n profile: 'profile',\n profileCredential: 'profile.credential',\n support: 'support',\n transfersSendMoney: 'transfers.sendMoney'\n} as const satisfies Record<string, ModalOwnerKey>;\n\nexport const MODAL_PRIORITY = {\n blocking: 100,\n standard: 0\n} as const;\n\nconst STANDARD_MODAL_METADATA = {\n dimsBackground: true,\n dismissibleByAndroidBack: true,\n dismissibleByBackdrop: true,\n priority: MODAL_PRIORITY.standard\n} as const satisfies ModalKindMetadata;\n\nconst UNDIMMED_STANDARD_MODAL_METADATA = {\n ...STANDARD_MODAL_METADATA,\n dimsBackground: false\n} as const satisfies ModalKindMetadata;\n\nexport const MODAL_KIND_METADATA = {\n [MODAL_KINDS.authCredentialLocked]: STANDARD_MODAL_METADATA,\n [MODAL_KINDS.authLogout]: STANDARD_MODAL_METADATA,\n [MODAL_KINDS.authPasskeyPrompt]: STANDARD_MODAL_METADATA,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain the data flow and responsibilities in this TypeScript file. Let me analyze the code carefully.\n\nThis is a file from the \"project_01\" project, specifically `source_000050.txt`. It defines constants for modal kinds, owners, priorities, and metadata.\n\nLet me break down what's here:\n\n1. **`MODAL_KINDS`** (lines 9-63): A const object mapping string keys to string values. The keys are modal kind names (like `auth.sessionTimeoutWarning`, `auth.twoFactor`, etc.) and the values are the same strings. It uses `as const satisfies Record<string, ModalKind>` to ensure type safety.\n\n2. **`MODAL_OWNER_KEYS`** (lines 65-79): A const object mapping modal owner keys to string values. These are like `auth.logout`, `auth.signIn`, `beneficiaries.creation`, etc. Uses `as const satisfies Record<string, ModalOwnerKey>`.\n\n3. **`MODAL_PRIORITY`** (lines 81-83): A const object with `blocking: 100` and `standard: 0`. This is a priority system where higher numbers mean", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000023", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000099.txt", "source_sha256": "513830d6ea1c4f7be6b6e0337b12dfcf357f2228e6d5683dfcf1afff5c742770", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_01\nFile: source_000099.txt\nLines: 25-88\n```tsx\n\nexport const AppRouter = ({ onReady }: AppRouterNativeProps) => {\n const navigationRef = useNavigationContainerRef<AppStackParamList>();\n const [isNavigationReady, setIsNavigationReady] = useState(false);\n\n const [authColdStartSessionNavigationRoute, consumeAuthColdStartSessionNavigationRoute, syncAppRouting] = useUnit([\n $authColdStartSessionNavigationRoute,\n authColdStartSessionNavigationRouteConsumedFn,\n syncAppRoutingFromNavigationFn\n ]);\n\n const [authColdStartInitialState] = useState<InitialState | undefined>(() =>\n authColdStartSessionNavigationRoute\n ? createAuthColdStartNavigationState(authColdStartSessionNavigationRoute)\n : undefined\n );\n\n const hasAuthColdStartInitialState = authColdStartInitialState !== undefined;\n\n const { style: modalBottomSafeAreaStyle } = useScreenFooterSpacing({\n bottomGap: 0,\n includeSafeAreaInset: Platform.OS === 'ios'\n });\n\n const handleNavigationStateChange = useCallback(\n (state?: AppNavigationState) => {\n syncAppRouting(resolveAppRoutingFromNavigationState(state));\n },\n [syncAppRouting]\n );\n\n const completeAuthColdStartNavigation = useCallback(\n (route: AppAuthColdStartDestination) => {\n if (!hasAuthColdStartInitialState) {\n navigationRef.resetRoot(createAuthColdStartNavigationState(route));\n }\n\n consumeAuthColdStartSessionNavigationRoute();\n },\n [consumeAuthColdStartSessionNavigationRoute, hasAuthColdStartInitialState, navigationRef]\n );\n\n const handleNavigationReady = useCallback(() => {\n handleNavigationStateChange(navigationRef.getRootState());\n\n if (authColdStartSessionNavigationRoute) {\n completeAuthColdStartNavigation(authColdStartSessionNavigationRoute);\n }\n\n setIsNavigationReady(true);\n onReady?.();\n }, [\n authColdStartSessionNavigationRoute,\n completeAuthColdStartNavigation,\n handleNavigationStateChange,\n navigationRef,\n onReady\n ]);\n\n useEffect(() => {\n if (!isNavigationReady || !authColdStartSessionNavigationRoute) {\n return;\n }\n\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let me analyze this code to find a safe, behavior-preserving simplification.\n\nLooking at the code, I notice a few things:\n\n1. The `completeAuthColdStartNavigation` callback has a dependency on `hasAuthColdStartInitialState` which is derived from `authColdStartSessionNavigationRoute`. This is a bit redundant since `hasAuthColdStartInitialState` is just a boolean check on the same route.\n\n2. The `useUnit` hook is used to manage the auth cold start session navigation route. The `authColdStartSessionNavigationRoute` is a state value that gets consumed.\n\n3. The `completeAuthColdStartNavigation` function checks `!hasAuthColdStartInitialState` before calling `navigationRef.resetRoot(...)`. But `hasAuthColdStartInitialState` is derived from `authColdStartSessionNavigationRoute` which is also in the dependency array. This is fine but slightly redundant.\n\nLet me think about what's the most impactful and safe simplification...\n\nActually, the most clear and safe simplification I can see is in the `completeAuthColdStartNavigation` callback. The `hasAuthColdStartInitialState` is just `authColdStartSessionNavigationRoute !== undefined`. We can simplify this by directly checking the", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000024", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000073.txt", "source_sha256": "1c3ac6a882140e4d9c46c19e442b041d4a3c724fe811caf56ebebfa7d92eab18", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_01\nFile: source_000073.txt\nLines: 1-5\n```ts\nimport type { AppIntegrityProvider } from 'native/types/adapters';\nimport { APP_INTEGRITY_PROVIDERS } from 'native/constants/security';\n\nexport const isAppIntegrityProvider = (value: unknown): value is AppIntegrityProvider =>\n typeof value === 'string' && APP_INTEGRITY_PROVIDERS.includes(value as AppIntegrityProvider);\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to describe the interface and constraints of this code excerpt, and show a correct usage example of the existing API.\n\nLet me analyze the code:\n\n1. It imports `AppIntegrityProvider` type from `'native/types/adapters'`\n2. It imports `APP_INTEGRITY_PROVIDERS` constant from `'native/constants/security'`\n3. It exports a function `isAppIntegrityProvider` that takes an `unknown` value and returns a boolean\n4. The function checks if `value` is a string AND if that string is included in `APP_INTEGRITY_PROVIDERS`\n\nConstraints:\n- The parameter `value` is typed as `unknown`\n- The return type is `boolean`\n- The function only accepts string values (it checks `typeof value === 'string'`)\n- It uses `APP_INTEGRITY_PROVIDERS` as a whitelist of valid provider names\n- The `value as AppIntegrityProvider` cast is used to narrow the type for the `includes` check\n\nNow let me think about what the interface and constraints are:\n\n**Interface:**\n- `isAppIntegrityProvider(value: unknown): boolean` - a type guard function that checks if a value is", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000025", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000011.txt", "source_sha256": "42eb9e16b34ba9782c0443e532b9a66fd741d9f58dd74509a9b30a7efb223fdc", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nReview the correctness of this code. Identify the most substantial supported risk, or explain why the excerpt does not establish one.\n\nProject: project_01\nFile: source_000011.txt\nLines: 1-59\n```tsx\nimport type { DiagnosticsOverlayViewportNativeProps } from 'native/types/diagnostics';\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport Reanimated from 'react-native-reanimated';\nimport { useDiagnosticsOverlay } from 'native/composables/diagnostics';\nimport { DIAGNOSTIC_OVERLAY_ACCESSIBILITY_LABEL } from 'native/constants/diagnostics';\nimport { diagnosticsOverlayStyles as styles } from 'native/styles/diagnostics';\n\nexport const DiagnosticsOverlayViewport = ({\n interactionBlocked = false,\n layer = 'root'\n}: DiagnosticsOverlayViewportNativeProps) => {\n const {\n buttonBaseStyle,\n buttonPositionStyle,\n dragPanHandlers,\n handleButtonLayout,\n handleSave,\n handleTouchStart,\n isVisible,\n label,\n status\n } = useDiagnosticsOverlay({ layer });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <View\n accessibilityElementsHidden={interactionBlocked}\n importantForAccessibility={interactionBlocked ? 'no-hide-descendants' : 'auto'}\n pointerEvents={interactionBlocked ? 'none' : 'box-none'}\n style={[styles.viewport, interactionBlocked ? styles.blockedViewport : undefined]}\n >\n <Reanimated.View\n {...dragPanHandlers}\n onLayout={handleButtonLayout}\n onTouchStart={handleTouchStart}\n style={[styles.buttonContainer, buttonBaseStyle, buttonPositionStyle]}\n >\n <Pressable\n accessibilityLabel={DIAGNOSTIC_OVERLAY_ACCESSIBILITY_LABEL}\n accessibilityRole=\"button\"\n disabled={interactionBlocked || status === 'saving'}\n onPress={handleSave}\n style={({ pressed }) => [\n styles.button,\n status === 'success' ? styles.buttonSuccess : undefined,\n status === 'error' ? styles.buttonError : undefined,\n pressed ? styles.buttonPressed : undefined\n ]}\n >\n <Text style={styles.buttonText}>{label}</Text>\n </Pressable>\n </Reanimated.View>\n </View>\n );\n};\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "Let me analyze this code carefully for correctness issues and risks.\n\nLooking at the component:\n\n1. **Props destructuring**: `useDiagnosticsOverlay({ layer })` - this is a hook that presumably returns an object with `buttonBaseStyle`, `buttonPositionStyle`, `dragPanHandlers`, `handleButtonLayout`, `handleSave`, `handleTouchStart`, `isVisible`, `label`, `status`.\n\n2. **The `interactionBlocked` prop**: It's used to:\n - Set `pointerEvents={interactionBlocked ? 'none' : 'box-none'}`\n - Set `accessibilityElementsHidden={interactionBlocked}`\n - Set `importantForAccessibility={interactionBlocked ? 'no-hide-descendants' : 'auto'}`\n - Set `disabled={interactionBlocked || status === 'saving'}`\n\n3. **The `status` prop**: Used to conditionally apply `styles.buttonSuccess` or `styles.buttonError`.\n\nNow let me think about what's wrong:\n\n**The most substantial issue I see:**\n\nThe `interactionBlocked` prop is a boolean that controls whether the overlay is interactive. When `interactionBlocked` is `true`, the component sets `pointerEvents={interactionBlocked ? 'none", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000026", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000158.txt", "source_sha256": "f41cb6103c75a25b7639415fcc28a347b9f6c9a28df04dbc7e1b843da0968349", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nAnalyze error handling and edge cases. Suggest one small improvement and show the relevant code.\n\nProject: project_02\nFile: source_000158.txt\nLines: 104-173\n```vue\n height: rem(260);\n padding: rem(20);\n border-radius: var(--radius-3xl);\n background: var(--background-primary);\n border: rem(1) solid var(--modal-stroke);\n box-shadow: var(--shadow-drawer-outer);\n contain: layout style;\n\n &--expanded {\n width: min(95vw, 140rem);\n height: 92vh;\n }\n\n &__body {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding: 0;\n border-radius: 0;\n background: transparent;\n border: 0;\n box-sizing: border-box;\n box-shadow: none;\n }\n\n &__headline {\n position: absolute;\n top: rem(20);\n right: rem(20);\n z-index: 1;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n min-height: rem(44);\n }\n\n &__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex: 1;\n gap: rem(8);\n min-height: 0;\n }\n\n &__icon-group {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: rem(28);\n }\n\n &__icon {\n width: rem(48);\n height: rem(48);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n\n svg {\n width: rem(48);\n height: rem(48);\n }\n\n &--loading {\n background: transparent;\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to analyze error handling and edge cases in the provided Vue component code, suggest one small improvement, and show the relevant code.\n\nLet me look at the code carefully. This is a CSS/SCSS section of a Vue component (VDownloadModal.vue). Let me analyze what's here:\n\n1. The component has a `&--expanded` modifier that sets `width: min(95vw, 140rem)` and `height: 92vh`.\n2. The `&__body` has `box-sizing: border-box` and `border: 0`.\n3. The `&__content` has `flex: 1` and `min-height: 0`.\n4. The `&__icon-group` has `gap: rem(28)`.\n5. The `&__icon` has `flex-shrink: 0`.\n\nNow, let me think about error handling and edge cases in this CSS/SCSS context:\n\n1. **Viewport overflow with `&--expanded`**: When the modal is expanded, it uses `width: min(95vw, 140rem)` and `height: 92vh`. On very small", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000027", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000197.txt", "source_sha256": "e1f35512f4355c3d00d93df990bf594a0ec6eab19da3bd5938ec0bf69f7724ee", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_02\nFile: source_000197.txt\nLines: 1-59\n```ts\nimport { gantBadgeColors, gantConfig } from '@modules/constructor/constants/gant'\nimport type { GantConfig } from '@modules/constructor/types/gant'\n\nexport function useGant() {\n const store = useGantStore()\n const { projects } = storeToRefs(store)\n\n const config = computed<GantConfig>(() => {\n const projectStartYears = projects.value.map((project) => project.startDate.getFullYear())\n const projectEndYears = projects.value.map((project) => project.endDate.getFullYear())\n\n return {\n ...gantConfig,\n startYear: Math.min(gantConfig.startYear, ...projectStartYears),\n endYear: Math.max(gantConfig.endYear, ...projectEndYears),\n }\n })\n\n const years = computed<number[]>(() => {\n const result: number[] = []\n for (let y = config.value.startYear; y <= config.value.endYear; y++) {\n result.push(y)\n }\n return result\n })\n\n const totalWidth = computed(() => years.value.length * config.value.yearWidth)\n\n function calculatePosition(date: Date): number {\n const startOfTimeline = new Date(config.value.startYear, 0, 1)\n const msPerYear = 365.25 * 24 * 60 * 60 * 1000\n const yearsFromStart = (date.getTime() - startOfTimeline.getTime()) / msPerYear\n return (yearsFromStart / years.value.length) * 100\n }\n\n function calculateWidth(startDate: Date, endDate: Date): number {\n const msPerYear = 365.25 * 24 * 60 * 60 * 1000\n const durationYears = (endDate.getTime() - startDate.getTime()) / msPerYear\n return (durationYears / years.value.length) * 100\n }\n\n function formatDateRange(startDate: Date, endDate: Date): string {\n const format = (d: Date) =>\n `${String(d.getDate()).padStart(2, '0')}.${String(d.getMonth() + 1).padStart(2, '0')}.${d.getFullYear()}`\n return `${format(startDate)} – ${format(endDate)}`\n }\n\n function getBadgeColor(phaseName: string): string {\n return gantBadgeColors[phaseName] ?? ''\n }\n\n return {\n config,\n projects,\n years,\n totalWidth,\n toggleProject: store.toggleProject,\n toggleSection: store.toggleSection,\n expandAll: store.expandAll,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Interface and Constraints\n\nThis composable (`useGant`) exposes a reactive Gantt chart state for a Vue 3 project. Its public API consists of:\n\n- **`config`** – a `computed` object of type `GantConfig` that merges the base `gantConfig` with the earliest start year and latest end year found in `projects.value`.\n- **`projects`** – a `ref` (via `storeToRefs`) to the underlying store's `projects` array.\n- **`years`** – a `computed` array of integers from `config.startYear` to `config.endYear` inclusive.\n- **`totalWidth`** – a `computed` number: `years.length * config.yearWidth`.\n- **`toggleProject`**, **`toggleSection`**, **`expandAll`** – methods on the store for controlling visibility/expand state.\n\n### Constraints and assumptions\n\n1. **`projects` must be an array of objects with `startDate` and `endDate` fields.** The `map` calls assume each project has these properties. If a project is missing `startDate` or `endDate`, `getFullYear()` will throw.\n2. **`config.startYear`", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000028", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000229.txt", "source_sha256": "ee07f0d76a83d1387a9f8fcf307b15006f43184d370704548795811240f6c796", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain the lifecycle and dependencies here. Address asynchronous work, cleanup, and repeated calls when they are present.\n\nProject: project_02\nFile: source_000229.txt\nLines: 1-29\n```vue\n<script setup lang=\"ts\">\ndefineProps<{\n modelValue: boolean\n label: string\n disabled?: boolean\n}>()\ndefineEmits<{ 'update:modelValue': [value: boolean] }>()\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"vsm-editor-visibility\"\n :class=\"{ 'vsm-editor-visibility--hidden': !modelValue }\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-pressed=\"modelValue\"\n :title=\"label\"\n @click=\"$emit('update:modelValue', !modelValue)\"\n >\n <VIcon :name=\"modelValue ? 'eye' : 'eye-off'\" aria-hidden=\"true\" />\n </button>\n</template>\n\n<style\n scoped\n src=\"@/app/assets/styles/components/network/VsmEditorVisibilityButton.scss\"\n lang=\"scss\"\n></style>\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Lifecycle and Dependencies\n\nThis component is a small Vue 3 button that toggles a boolean (`modelValue`) and emits an `update:modelValue` event. It has no external JS dependencies beyond Vue 3 itself. The only asset it references is a SCSS file (`@/app/assets/styles/components/network/VsmEditorVisibilityButton.scss`), which is scoped to the component via the `<style scoped>` tag.\n\n## Lifecycle\n\n- **Mount / render**: The component renders a `<button>` with a `VIcon` (an icon from the Vuetify icon library). The `:class` binding applies `vsm-editor-visibility--hidden` when `modelValue` is `false`.\n- **Click**: `@click` emits `update:modelValue` with the negated value (`!modelValue`). This is a two-way binding pattern — the parent passes `modelValue` in and listens for `update:modelValue` to update it.\n- **Disabled state**: If `disabled` is `true`, the button is disabled and won't respond to clicks.\n\n## Asynchronous Work\n\nThere is no asynchronous work in this component. The click handler is synchronous: it simply emits an event. The parent is responsible for updating the", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000029", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000160.txt", "source_sha256": "9e272a55a5ebfb3583d42be7ab24fc59a3a0f06ce1fb21afea4418b4bf546c06", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_02\nFile: source_000160.txt\nLines: 15-84\n```ts\n]\n\nconst runTask = async ({ run }: BootstrapTask): Promise<void> => {\n try {\n await run()\n }\n catch {\n // Swallow bootstrap failures — the app shell still mounts and individual\n // stores fall back to their pristine state.\n }\n}\n\nconst runTasks = async (tasks: BootstrapTask[]): Promise<void> => {\n await Promise.all(tasks.map((task) => runTask(task)))\n}\n\n// Module-level state shared between all composable consumers.\nconst isReady = ref(false)\nconst isMapPrewarmed = ref(false)\nconst isBootstrapComplete = ref(false)\nlet bootstrapPromise: Promise<void> | null = null\nlet resolveMapPrewarm: (() => void) | null = null\n\nconst resolveMapPrewarmWaiters = () => {\n resolveMapPrewarm?.()\n resolveMapPrewarm = null\n}\n\nexport function useAppBootstrap() {\n const runBootstrap = (): Promise<void> => {\n if (bootstrapPromise) return bootstrapPromise\n\n bootstrapPromise = (async () => {\n try {\n await runTasks(BOOTSTRAP_BLOCKING_TASKS)\n isBootstrapComplete.value = true\n isReady.value = true\n }\n catch {\n isBootstrapComplete.value = true\n isReady.value = true\n }\n })()\n\n return bootstrapPromise\n }\n\n const markMapPrewarmed = () => {\n if (isMapPrewarmed.value) return\n\n isMapPrewarmed.value = true\n resolveMapPrewarmWaiters()\n }\n\n const resetBootstrap = () => {\n bootstrapPromise = null\n resolveMapPrewarm = null\n isBootstrapComplete.value = false\n isMapPrewarmed.value = false\n isReady.value = false\n }\n\n return {\n isReady,\n isBootstrapComplete,\n isMapPrewarmed,\n runBootstrap,\n markMapPrewarmed,\n resetBootstrap,\n }\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Interface and Constraints\n\nThis composable exposes a small bootstrap lifecycle API with the following contract:\n\n| API | Purpose |\n|---|---|\n| `runBootstrap()` | Starts the bootstrap sequence. Returns a `Promise<void>` that resolves when all `BOOTSTRAP_BLOCKING_TASKS` complete. If the promise is already in-flight, it returns the same promise (idempotent call). |\n| `markMapPrewarmed()` | Marks the map as prewarmed. If already marked, it's a no-op. Otherwise it sets the flag and calls any registered waiters. |\n| `resetBootstrap()` | Resets all internal state (`isReady`, `isBootstrapComplete`, `isMapPrewarmed`) and clears the in-flight promise and waiter. After this, the next call to `runBootstrap()` will re-execute the full bootstrap. |\n| `isReady` | `ref(false)` → `true` once bootstrap is complete. |\n| `isBootstrapComplete` | `ref(false)` → `true` once the blocking tasks finish (even on failure). |\n| `isMapPrewarmed` | `ref(false)` → `true` once the map is prewarmed. |", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000030", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000087.txt", "source_sha256": "11050d8f46d2c577bb2af6aff68b5d909aaa6d1f7d9fbb066c11fd402ca323eb", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_01\nFile: source_000087.txt\nLines: 33-85\n```ts\n/// ///////////////////////////////////////////////////////////\n\nimport './modal/Controller/init';\nimport './feedback/init';\nimport './project_03ization/init';\nimport './diagnostics/init';\nimport './diagnostics/Report/init';\nimport './diagnostics/NativeInstallation/init';\nimport './security/AppIntegrity/init';\nimport './security/RiskMonitoring/init';\nimport './security/SecureStoreDiagnostics/init';\nimport './network/Check/init';\nimport './network/ConnectionState/init';\nimport './network/OfflineRecovery/init';\nimport './network/Monitor/init';\n\n/// ///////////////////////////////////////////////////////////\n// ============== AUTHENTICATION FLOWS ====================== //\n/// ///////////////////////////////////////////////////////////\n\nimport './auth/RequestLifecycle/init';\nimport './auth/TwoFactor/init';\nimport './auth/CredentialContinuation/init';\nimport './auth/Passkey/Availability/init';\nimport './auth/Passkey/SessionCompletion/init';\nimport './auth/LoginContinuation/init';\nimport './auth/Session/Account/init';\nimport './auth/Session/LoginSessionPersistence/init';\nimport './auth/Session/SessionRefresh/init';\nimport './auth/Session/Logout/init';\nimport './auth/Session/Expiration/init';\nimport './auth/Session/Kyc/init';\nimport './auth/Session/PasswordRecovery/init';\nimport './auth/Session/VerifiedEmail/init';\nimport './auth/Passkey/init';\nimport './auth/Passkey/Registration/init';\nimport './auth/SignIn/LoginOptions/init';\nimport './auth/SignIn/PreferenceEnrollment/init';\nimport './auth/SignIn/PhoneCountry/init';\nimport './auth/SignIn/OtpDispatch/init';\nimport './auth/SignIn/OtpVerification/init';\nimport './auth/SignUp/PhoneCountry/init';\nimport './auth/SignUp/OtpDispatch/init';\nimport './auth/SignUp/OtpVerification/init';\nimport './auth/SignUp/Account/init';\nimport './auth/SignUp/Welcome/init';\nimport './auth/Start/RememberedPhone/init';\nimport './auth/Start/Credential/init';\nimport './auth/Start/ForgotPassword/init';\nimport './auth/Start/Password/init';\nimport './auth/Start/Pin/init';\nimport './auth/Start/Completion/init';\nimport './auth/ForgotPassword/Flow/init';\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "The code you've shared is a large import file that bootstraps many modules in an app called `project_01`. It's essentially a \"registry\" or \"init\" file that imports and initializes a bunch of feature modules.\n\nLet me explain how to simplify this while preserving behavior, and show a small project_03 refactoring.\n\n## What's happening here\n\nThis file:\n\n1. Imports several top-level modules (modal, feedback, project_03ization, diagnostics, security, network)\n2. Imports a large set of auth-related modules organized by flow (authentication flows, session management, sign-in flows, sign-up flows, forgot password)\n\nThe key observation is that this is a **flat list of imports** — there's no logic, no conditionals, no exports. It's purely a side-effect import file.\n\n## Simplification strategy\n\nSince this is just a list of imports with no logic, the main simplification opportunities are:\n\n1. **Group related imports** — instead of a single long list, organize by feature area (modal, feedback, project_03ization, diagnostics, security, network, auth)\n2. **Use a barrel export pattern** — if other files need to import from this module, expose a clean API rather than relying on", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000031", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_01", "source_path": "source_000014.txt", "source_sha256": "3a904ab0b7910d32dec4e4d2c380c0adf3672582beced4d214ab6c5acbed5748", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nExplain how to simplify this code while preserving behavior. Show a small project_03 refactoring and explain it.\n\nProject: project_01\nFile: source_000014.txt\nLines: 1-16\n```tsx\nimport type { NativeSvgIconProps } from 'native/types/ui';\nimport React from 'react';\nimport Svg, { Path } from 'react-native-svg';\n\nexport const CircleCloseIcon = ({ color = '#FDA4AF', size = 24 }: NativeSvgIconProps) => (\n <Svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n d=\"M3 12C3 13.1819 3.23279 14.3522 3.68508 15.4442C4.13738 16.5361 4.80031 17.5282 5.63604 18.364C6.47177 19.1997 7.46392 19.8626 8.55585 20.3149C9.64778 20.7672 10.8181 21 12 21C13.1819 21 14.3522 20.7672 15.4442 20.3149C16.5361 19.8626 17.5282 19.1997 18.364 18.364C19.1997 17.5282 19.8626 16.5361 20.3149 15.4442C20.7672 14.3522 21 13.1819 21 12C21 10.8181 20.7672 9.64778 20.3149 8.55585C19.8626 7.46392 19.1997 6.47177 18.364 5.63604C17.5282 4.80031 16.5361 4.13738 15.4442 3.68508C14.3522 3.23279 13.1819 3 12 3C10.8181 3 9.64778 3.23279 8.55585 3.68508C7.46392 4.13738 6.47177 4.80031 5.63604 5.63604C4.80031 6.47177 4.13738 7.46392 3.68508 8.55585C3.23279 9.64778 3 10.8181 3 12Z\"\n stroke={color}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n />\n <Path d=\"M10 10L14 14M14 10L10 14\" stroke={color} strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} />\n </Svg>\n);\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Goal\n\nSimplify the code while preserving behavior. The component renders a 24×24 circle with an \"X\" (close) icon. It uses two `<Path>` elements inside a `<Svg>` with `fill=\"none\"`.\n\n## Observations\n\n1. **The two paths are nearly identical in style** — same `color`, `strokeLinecap`, `strokeLinejoin`, `strokeWidth`. The only difference is the `d` attribute.\n2. **The first path is a circle** (the outer ring).\n3. **The second path is an X** (two crossing lines).\n4. **The `size` prop is used for both `width` and `height`**, so the viewBox is always 24×24 regardless of the actual rendered size. This is fine but slightly redundant.\n5. **The `color` default is `#FDA4AF`** — a specific pinkish color. This is a design choice, not a bug.\n6. **The `viewBox=\"0 0 24 24\"` is hardcoded** — matches the default size.\n\n## Refactoring\n\nThe main simplification opportunity is to **merge the two paths into a", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000032", "stage": "project", "split": "eval", "language": "en", "domain": "project_replay", "project": "project_02", "source_path": "source_000264.txt", "source_sha256": "8749bd2de91115a4dd0b7a7ad9b3beba56fb81bad0c894a58ac64ebd657b01e6", "sampling_group": "project_replay/en", "prompt": "<|im_start|>system\nYou help develop this project. Use only the supplied source. Think and answer in English.<|im_end|>\n<|im_start|>user\nDescribe the interface and constraints of this excerpt. Show a correct usage example of the existing API.\n\nProject: project_02\nFile: source_000264.txt\nLines: 1-67\n```ts\nexport const DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\nexport const DOCX_VALUE_FRACTION_DIGITS = 2\n\n/** Макеты 842 × 595: геометрия в pt, в OOXML переводится в twips. */\nexport const DOCX_PAPERS = {\n A4: { width: 841.9, height: 595.3 },\n A3: { width: 1190.6, height: 841.9 },\n} as const\nexport const DOCX_LAYOUT = {\n margin: 34,\n headerMargin: 14,\n font: 'Onest',\n bodySize: 10,\n headingSize: 14,\n headerSize: 8,\n tablePadding: 9,\n labelColumnWidth: 232,\n dataColumnsPerPage: 5,\n cardColumns: 3,\n chartHeight: 244,\n graphicGap: 14,\n rasterScale: 4,\n ganttRowHeight: 28,\n ganttYearsPerPage: 12,\n} as const\nexport const DOCX_COLORS = {\n text: '1C3A73', muted: '667085', border: 'E4E5E8',\n panel: 'F8F8F9', stripe: 'F2F3F5', white: 'FFFFFF', accent: '6172F3',\n palette: ['A4ABF5', 'EFA1B7', '8DBFF7', '87D99C', 'FEB273', 'B2A0F4'],\n gantt: { project: 'E99342', section: 'E99342', design: '8DBFF7', construction: 'B2A0F4', commissioning: '87C990' },\n} as const\nexport const DOCX_CHART_CATEGORIES = { line: 18, grouped: 12, single: 24 } as const\nexport const DOCX_FONT_FILES = {\n regular: 'fonts/docx/Onest-Regular.ttf',\n bold: 'fonts/docx/Onest-Bold.ttf',\n} as const\n\nexport const DOCX_TABLE_LAYOUT = {\n projectsPerPage: 4,\n rankingRowsPerPage: 10,\n cellPadding: 16,\n matrixRowHeight: 52,\n rankingRowHeight: 42,\n rankingMatrixRowHeight: 40,\n rankingMatrixGroupHeight: 30,\n rankingMatrixCellPadding: 10,\n rankingMatrixHeaderHeight: 74,\n panelPadding: 12,\n headingHeight: 34,\n headerHeight: 36,\n badgeHeaderHeight: 58,\n} as const\n\nexport const DOCX_CARD_LAYOUT = {\n columns: 3,\n gap: 12,\n headingHeight: 28,\n metricHeight: 88,\n projectHeight: 56,\n projectsWithMetrics: 9,\n} as const\n\nexport const DOCX_BADGE_COLORS = {\n vsm: 'E99342',\n 'vsm-inter': 'F7E28C',\n sm: '6555E8',\n} as const\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to describe the interface and constraints of this TypeScript file, and show a correct usage example of the existing API.\n\nLet me analyze the file:\n\n1. It's a constants file (`source_000264.txt`) for a project called \"project_02\"\n2. It exports several constants related to DOCX (OpenXML Word document) formatting\n3. All exports are `as const` - meaning they are compile-time constants\n4. The values are typed as strings (hex colors, dimensions, etc.)\n5. The structure is a flat set of named constants\n\nLet me think about what to describe:\n- The interface: flat set of named constants, all `as const`, typed as strings/dimensions\n- Constraints: all values are string literals (no computed values), the `as const` assertion means they're compile-time constants, the structure is a flat object with named exports\n- Usage example: show how to import and use these constants in a component or service\n\nLet me write a clear, well-structured response in English.\n</think>\n\n## Interface and Constraints\n\nThis file is a **flat constants module** for a DOCX (OpenXML Word) document-generation pipeline. Every export is a compile", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000033", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000096.txt", "source_sha256": "e9ffe45d88370c6e8cb78be2f726a44ee4d42eab9ac479c875dcbea668afe261", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_01\nFile: source_000096.txt\nLines: 9-38\n```ts\n} from 'native/types/transactions';\nimport { combine, createDomain } from 'effector';\nimport { getAllTransactionsPage } from 'native/adapters/api/transactions';\nimport { resolveAllTransactionGroups, resolveDashboardTransactionDetailsPage } from 'native/lib/transactions';\nimport { $authSessionIdentity } from 'native/models/auth';\n\nconst transactionsHistoryDomain = createDomain('transactions.history');\n\nexport const getAllTransactionsPageFx = transactionsHistoryDomain.createEffect<\n AllTransactionsPageAttempt,\n AllTransactionsPageResponse\n>(({ requestId: _requestId, ...request }) => getAllTransactionsPage(request));\n\nexport const allTransactionsOpenedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsOpeningAcceptedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsBackRequestedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsClosedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsLoadMoreRequestedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsRetryRequestedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsTransactionPressedFn = transactionsHistoryDomain.createEvent<DashboardTransaction>();\nexport const allTransactionsSelectionClearedFn = transactionsHistoryDomain.createEvent();\nexport const allTransactionsSelectionAcceptedFn = transactionsHistoryDomain.createEvent<DashboardTransaction>();\nexport const allTransactionsLoadRequestedFn = transactionsHistoryDomain.createEvent<AllTransactionsLoadReason>();\nexport const allTransactionsBatchPreparedFn = transactionsHistoryDomain.createEvent<AllTransactionsPageAttempt[]>();\n\nexport const allTransactionsPageCandidateFn =\n transactionsHistoryDomain.createEvent<AllTransactionsPageAttempt | null>();\n\nexport const allTransactionsPageAcceptedFn = transactionsHistoryDomain.createEvent<AllTransactionsPageAccepted>();\nexport const allTransactionsPageRejectedFn = transactionsHistoryDomain.createEvent<AllTransactionsPageAttempt>();\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain how to safely simplify this code while preserving behavior, show a small project_03 refactoring, and explain it in Russian.\n\nLet me analyze the code:\n\n1. It imports `AllTransactionsPageAttempt` and `AllTransactionsPageResponse` from `'native/types/transactions'`\n2. It imports `combine` and `createDomain` from `'effector'`\n3. It imports `getAllTransactionsPage` from `'native/adapters/api/transactions'`\n4. It imports `resolveAllTransactionGroups` and `resolveDashboardTransactionDetailsPage` from `'native/lib/transactions'`\n5. It imports `$authSessionIdentity` from `'native/models/auth'`\n\nThen it creates a domain `transactionsHistoryDomain` and defines:\n- An effect `getAllTransactionsPageFx` that calls `getAllTransactionsPage`\n- Multiple events for various transaction history actions (opening, accepting, back, closing, load more, retry, transaction pressed, selection cleared, selection accepted, load requested, batch prepared)\n- An event for page candidate\n- Events for page accepted/rejected\n\nNow, what can be simplified?\n\nLooking at the code, I notice:\n1. The imports of `combine`, `", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000034", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000146.txt", "source_sha256": "26bc9241bbb5670cd46b89d9db1ff2c2296335cba02b2bcaacf40001034783f6", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_02\nFile: source_000146.txt\nLines: 1-25\n```scss\n@use 'sass:math';\n\n$rem-base: 16px !default;\n\n/// Converts a pixel value from Figma to rem.\n@function rem($pixels) {\n @if math.is-unitless($pixels) {\n $pixels: $pixels * 1px;\n }\n\n @if not math.compatible($pixels, 1px) {\n @error 'rem() expects a pixel value or a unitless pixel count.';\n }\n\n @return math.div($pixels, $rem-base) * 1rem;\n}\n\n/// Converts a Figma inner spacing to rem and compensates for a 1px CSS border.\n@function rem-inner($pixels) {\n @if math.is-unitless($pixels) {\n $pixels: $pixels * 1px;\n }\n\n @return rem($pixels - 1px);\n}\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Интерфейс и ограничения\n\n**Функции:**\n\n- `rem($pixels)` — конвертирует значение из Figma (px) в rem.\n- `rem-inner($pixels)` — конвертирует внутренний отступ из Figma в rem, компенсируя 1px CSS-границу.\n\n**Ограничения:**\n\n- `rem()` требует либо px-значения, либо безразмерного числа (количества px).\n- `rem-inner()` требует либо px-значения, либо безразмерного числа.\n- `rem-inner()` использует `rem()` и subtracts 1px, поэтому результат может быть отрицательным для значений < 1px.\n- `rem()` возвращает `math.div($pixels, $rem-base) * 1rem`, т.е. результат всегда имеет размерность rem.\n\n## Пример корректного использования\n\n```scss\n// Пример 1: Конверсия из Figma (16px)\n$font-size: rem(16); // → 1rem\n\n// Пример 2: Конверсия из Figma (24px)\n$heading-size: rem(24); // → 1.5rem", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000035", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000137.txt", "source_sha256": "a3adc35eacf1970bc3aef637c66e0eef0aa7f4794142b08a8d5aaf4c334bb109", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nПроведи краткий обзор корректности этого кода. Выбери наиболее существенный реальный риск либо обоснуй, почему по этому фрагменту его нельзя установить.\n\nProject: project_01\nFile: source_000137.txt\nLines: 1-6\n```ts\nimport type { AppStackParamList } from 'native/types/routing';\nimport type { NativeStackScreenProps } from '@react-navigation/native-stack';\n\nexport type KycTierUpgradeScreenProps = NativeStackScreenProps<AppStackParamList, 'kycTierUpgrade'>;\n\nexport type VerificationScreenProps = NativeStackScreenProps<AppStackParamList, 'verification'>;\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to review the correctness of this TypeScript code, identify the most significant real risk, or explain why it can't be installed. Let me analyze this carefully.\n\nThe code is a simple type definition file for a React Native app using React Navigation. Let me look at what's happening:\n\n1. It imports `AppStackParamList` from `'native/types/routing'`\n2. It imports `NativeStackScreenProps` from `'@react-navigation/native-stack'`\n3. It defines two type aliases:\n - `KycTierUpgradeScreenProps` - a type for a screen with param list `AppStackParamList` and screen name `'kycTierUpgrade'`\n - `VerificationScreenProps` - a type for a screen with param list `AppStackParamList` and screen name `'verification'`\n\nLet me think about what's wrong here:\n\n1. **The `type` keyword usage**: In TypeScript, `type` is used for type-level constructs. Using `type` for type aliases is valid in TypeScript. However, the issue here is more subtle.\n\n2. **The real problem**: The code uses `type` for type aliases. In TypeScript, `type` is a", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000036", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000012.txt", "source_sha256": "2bae784fb22094ab0c21c38ce96013dc6abe5fe71362a148ced0ab4da3d76488", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_01\nFile: source_000012.txt\nLines: 1-50\n```tsx\nimport React from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { useUnit } from 'effector-react';\nimport { EXCHANGE_PIN_COPY, EXCHANGE_PIN_LENGTH } from 'native/constants/exchange';\nimport { exchangeExitRequestedFn } from 'native/models/exchange';\nimport { useExchangeLockCountdown } from 'native/composables/exchange';\nimport { getPropsForInputGroup, usePinInputGroupField } from 'native/composables/ui';\nimport { Button, InputGroup } from 'native/components/ui';\nimport { exchangePinStyles as styles } from 'native/styles/exchange';\n\nconst ignoreLockedPinChange = () => {};\n\nexport const ExchangePinLocked = () => {\n const onExit = useUnit(exchangeExitRequestedFn);\n const countdown = useExchangeLockCountdown();\n const field = usePinInputGroupField({\n accessibilityLabel: EXCHANGE_PIN_COPY.inputAccessibilityLabel,\n clearAccessibilityLabel: EXCHANGE_PIN_COPY.clearAccessibilityLabel,\n disabled: true,\n inputMode: 'numeric',\n keyboardType: 'number-pad',\n length: EXCHANGE_PIN_LENGTH,\n onChangeText: ignoreLockedPinChange,\n value: ''\n });\n\n return (\n <ScrollView contentContainerStyle={styles.lockContainer} showsVerticalScrollIndicator={false} style={styles.scroll}>\n <Text accessibilityRole=\"header\" style={styles.lockTitle}>\n {EXCHANGE_PIN_COPY.lockedTitle}\n </Text>\n <Text style={styles.lockBody}>{EXCHANGE_PIN_COPY.lockedBody}</Text>\n\n <View style={styles.lockTimerCard}>\n <Text style={styles.lockTimerLabel}>{EXCHANGE_PIN_COPY.tryAgainIn}</Text>\n <Text style={styles.lockTimer}>{countdown}</Text>\n </View>\n\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" style={styles.lockedInputGroup}>\n <InputGroup {...getPropsForInputGroup(field)} dotsContainerStyle={styles.lockedDots} variant=\"dots\" />\n </View>\n\n <View style={styles.lockAction}>\n <Button onPress={onExit} size=\"lg\" style={styles.lockActionButton} variant=\"outline\">\n {EXCHANGE_PIN_COPY.gotIt}\n </Button>\n </View>\n </ScrollView>\n );\n};\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to analyze the lifecycle and dependencies of this React Native component, focusing on async behavior, resource cleanup, and repeated calls. Let me analyze the code carefully.\n\nLet me go through the code:\n\n1. **Imports**: React, React Native components, effector-react, native constants/models/composables\n2. **`ignoreLockedPinChange`**: A no-op function that ignores any change to the pin input\n3. **`ExchangePinLocked` component**:\n - `useUnit(exchangeExitRequestedFn)` - gets a function to request exit\n - `useExchangeLockCountdown()` - gets a countdown value\n - `usePinInputGroupField({...})` - creates a pin input field with specific props\n - Returns a JSX structure with ScrollView, Text, View, InputGroup, Button\n\nNow let me think about lifecycle, async behavior, resource cleanup, and repeated calls:\n\n**Lifecycle:**\n- This is a functional component with hooks\n- `useUnit` - this is an effector hook that returns a function. It's called once per render (since it's a function, it's stable)\n- `useExchangeLockCountdown()` - this is a composable hook that likely returns a", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000037", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000083.txt", "source_sha256": "3f75c28879598ff1017b443c5b554214cf767536307bad66f98854827cfc995c", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_01\nFile: source_000083.txt\nLines: 1-63\n```ts\nimport { sample } from 'effector';\nimport { createDiagnosticReport } from 'native/lib/diagnostics';\nimport { $diagnosticJournal, $diagnosticOverlaySaveState, recordDiagnosticEventFn } from '..';\nimport { diagnosticReportSaveRequestedFn, resetDiagnosticReportStatusFx, saveDiagnosticReportFx } from './index';\n\n$diagnosticOverlaySaveState\n .on(saveDiagnosticReportFx, (currentSaveState, { requestId }) =>\n requestId > currentSaveState.requestId\n ? {\n requestId,\n status: 'saving' as const\n }\n : currentSaveState\n )\n .on(saveDiagnosticReportFx.done, (currentSaveState, { params, result }) => {\n if (currentSaveState.requestId !== params.requestId) {\n return currentSaveState;\n }\n\n return {\n requestId: params.requestId,\n status: result.status === 'saved' ? ('success' as const) : ('idle' as const)\n };\n })\n .on(saveDiagnosticReportFx.fail, (currentSaveState, { params }) =>\n currentSaveState.requestId === params.requestId\n ? {\n requestId: params.requestId,\n status: 'error' as const\n }\n : currentSaveState\n )\n .on(resetDiagnosticReportStatusFx.doneData, (currentSaveState, requestId) =>\n currentSaveState.requestId === requestId && currentSaveState.status !== 'saving'\n ? {\n requestId,\n status: 'idle' as const\n }\n : currentSaveState\n );\n\nsample({\n clock: diagnosticReportSaveRequestedFn,\n source: {\n journal: $diagnosticJournal,\n saveState: $diagnosticOverlaySaveState\n },\n filter: ({ saveState }) => saveState.status !== 'saving',\n fn: ({ journal, saveState }) => ({\n report: createDiagnosticReport(journal),\n requestId: saveState.requestId + 1\n }),\n target: saveDiagnosticReportFx\n});\n\nsample({\n clock: saveDiagnosticReportFx.done,\n source: $diagnosticOverlaySaveState,\n filter: (saveState, { params, result }) => saveState.requestId === params.requestId && result.status === 'saved',\n fn: (_, { params, result }) => ({\n category: 'app' as const,\n details: {\n characters: params.report.length,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain how to safely simplify this code while preserving behavior. Let me analyze the code carefully.\n\nThis is an Effector (a state management library) setup for a mobile app's diagnostics feature. Let me break down what's happening:\n\n1. **State management**: `$diagnosticOverlaySaveState` is a reactive store that tracks the current save state (requestId, status).\n\n2. **Effect handlers on `$diagnosticOverlaySaveState`**:\n - `saveDiagnosticReportFx`: Updates the save state when a save is requested (only if the new requestId > current requestId)\n - `saveDiagnosticReportFx.done`: On success, updates status to 'success' or 'idle'\n - `saveDiagnosticReportFx.fail`: On failure, updates status to 'error'\n - `resetDiagnosticReportStatusFx.doneData`: Resets to 'idle' when data is ready\n\n3. **Sample (clock-driven)**: When `diagnosticReportSaveRequestedFn` fires, it creates a new report and increments the requestId.\n\nNow, let me think about what can be simplified:\n\n**Key observations for simplification:**\n\n1. **The `sample` for `diagnosticReportSaveRequestedFn`", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000038", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000267.txt", "source_sha256": "f7f782189dc1c494f0bf9a2a7ca355e1304d58a243665ff1d9c37e747700a922", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_02\nFile: source_000267.txt\nLines: 1-50\n```ts\nimport type { KpiProjectYearIndicator } from '@shared/types/kpi'\n\nexport const MOCK_PROJECT_CODES: ReadonlySet<string> = new Set([\n 'novosibirsk_irkutsk',\n 'yekaterinburg_novosibirsk',\n 'kazan_samara',\n 'yekaterinburg_chelyabinsk',\n 'chelyabinsk_rf_border',\n 'novosibirsk_barnaul',\n 'novosibirsk_tomsk',\n 'novosibirsk_kemerovo',\n 'novosibirsk_novokuznetsk',\n 'samara_saransk',\n 'samara_penza',\n 'khabarovsk_vladivostok',\n])\nexport const isMockProjectCode = (projectCode: string): boolean =>\n MOCK_PROJECT_CODES.has(projectCode)\n\nconst MOCK_PROJECT_KPI_INDICATOR_TEMPLATE: readonly KpiProjectYearIndicator[] = [\n { code: 'kpi__route_length', name: 'Протяженность линии', unit: 'км', data_type: 'float', value: null },\n { code: 'kpi__route_length_rf', name: 'Протяженность линии (РФ)', unit: 'км', data_type: 'float', value: null },\n { code: 'kpi__gdp_added', name: 'Прирост ВВП', unit: 'млрд руб.', data_type: 'float', value: null },\n { code: 'kpi__investment_need', name: 'Потребность в инвестициях', unit: 'млрд руб.', data_type: 'float', value: null },\n { code: 'kpi__passenger_traffic_sm_vsm', name: 'Пассажиропоток', unit: 'млн пасс.', data_type: 'float', value: null },\n { code: 'kpi__covered_population', name: 'Охват населения', unit: 'млн чел.', data_type: 'float', value: null },\n { code: 'kpi__wagon_need', name: 'Потребность в вагонах', unit: 'шт.', data_type: 'int', value: null },\n]\n\nexport const createMissingProjectKpiIndicators = (): KpiProjectYearIndicator[] =>\n MOCK_PROJECT_KPI_INDICATOR_TEMPLATE.map((indicator) => ({ ...indicator }))\n\nexport const getMockProjectKpiIndicatorsByCode = (\n projectCode: string,\n): KpiProjectYearIndicator[] =>\n isMockProjectCode(projectCode) ? createMissingProjectKpiIndicators() : []\n\nexport const isProjectPlaceholderValue = (\n value: string | number | null | undefined,\n): boolean => {\n if (value == null) return true\n if (typeof value === 'number') return value === 0\n\n const normalized = value\n .trim()\n .replace(/[()]/g, '')\n .replace(/\\s/g, '')\n .replace(',', '.')\n\n if (!normalized) return true\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Жизненный цикл и зависимости\n\n**Библиотеки/модули:**\n- `@shared/types/kpi` — тип `KpiProjectYearIndicator` (данные для KPI-индикаторов проекта по годам).\n\n**Функции и константы:**\n- `MOCK_PROJECT_CODES` — набор кодов проектов (буквальное название: \"mock\" = имитация, \"projects\" = проекты).\n- `isMockProjectCode` — проверка, что код проекта является \"mock\".\n- `createMissingProjectKpiIndicators` — создаёт пустые KPI-индикаторов (коды, названия, единицы измерения, тип данных — всё из шаблона).\n- `getMockProjectKpiIndicatorsByCode` — если проект — \"mock\", возвращает пустые индикаторы; в противном случае — пустой массив.\n- `isProjectPlaceholderValue` — проверяет, является ли значение \"место для заполнения\" (null, undefined, 0, пустая строка, строка с только скобками/комас/буквами).\n\n## Асинхронность\n\nВ этом файле", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000039", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000022.txt", "source_sha256": "449209e94721dab0c9ad7067fb8f132af2d7934ee32c4e4a09c26b7ea22c98e3", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_01\nFile: source_000022.txt\nLines: 4-52\n```tsx\nimport { DASHBOARD_WALLET_OVERVIEW_COPY, DASHBOARD_WALLET_OVERVIEW_LAYOUT } from 'native/constants/wallets';\nimport { SHADCN_PALETTE } from 'native/constants/ui';\nimport { DashboardWalletChevronRightSVG } from 'native/components/icons/wallets';\nimport { DashboardCurrencyIcon } from 'native/components/ui';\nimport { walletOverviewStyles as styles } from 'native/styles/wallets';\nimport { DashboardFlag } from '../DashboardFlag';\nimport { DashboardWalletRowsSkeleton } from './DashboardWalletRowsSkeleton';\n\nexport const DashboardWalletsCard = ({\n isLoading = false,\n isOverviewVisible,\n onWalletPress,\n wallets\n}: DashboardWalletsCardNativeProps) => (\n <View\n accessibilityLabel={isLoading ? DASHBOARD_WALLET_OVERVIEW_COPY.loadingAccessibilityLabel : undefined}\n accessibilityRole={isLoading ? 'progressbar' : undefined}\n accessibilityState={isLoading ? { busy: true } : undefined}\n accessible={isLoading || undefined}\n style={styles.walletCard}\n >\n <Text style={[styles.walletsTitle, isOverviewVisible ? styles.walletsTitleOverview : undefined]}>\n {DASHBOARD_WALLET_OVERVIEW_COPY.title}\n </Text>\n\n {isLoading ? (\n <DashboardWalletRowsSkeleton />\n ) : (\n wallets.map((wallet) => (\n <Pressable\n accessibilityLabel={`${DASHBOARD_WALLET_OVERVIEW_COPY.openWalletAccessibilityLabel} ${wallet.currency}`}\n accessibilityRole=\"button\"\n disabled={!isOverviewVisible || !onWalletPress}\n key={wallet.id}\n onPress={() => onWalletPress?.(wallet)}\n style={({ pressed }) => [\n styles.walletRow,\n isOverviewVisible ? styles.walletRowOverview : undefined,\n pressed ? styles.walletRowPressed : undefined\n ]}\n >\n <View style={styles.walletCurrencyRow}>\n <View style={styles.walletFlag}>\n <DashboardFlag code={wallet.flag} />\n </View>\n\n <View style={styles.walletValue}>\n <Text style={styles.walletCurrency}>{wallet.currency}</Text>\n <View style={styles.walletAmountRow}>\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Жизненный цикл и зависимости\n\n**ДепENDENCIES:**\n- `DASHBOARD_WALLET_OVERVIEW_COPY`, `DASHBOARD_WALLET_OVERVIEW_LAYOUT` — constants\n- `SHADCN_PALETTE` — UI constants\n- `DashboardWalletChevronRightSVG` — icon\n- `DashboardCurrencyIcon` — icon\n- `walletOverviewStyles` — styles\n- `DashboardFlag` — component\n- `DashboardWalletRowsSkeleton` — component\n\n**LIFECYCLE:**\n- `isLoading` — показывающий скелетон\n- `isOverviewVisible` — показывающий видимость\n- `onWalletPress` — функция, вызванная при выборе\n- `wallets` — массив объектов wallets\n\n**ОБРАТНЫЕ ВЫЗОВЫ:**\n- `onWalletPress?.(wallet)` — optional, если undefined, не вызывается\n- `isOverviewVisible` — если false, все строки disabled\n\n**Очистка ресурсов:**\n- `accessibilityLabel` — только при loading или при выборке\n- `accessibilityRole` — 'progressbar' при loading, undefined при успешном состоянии\n- `accessibilityState` — { busy:", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000040", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000014.txt", "source_sha256": "1550d5fac169a74e4f01aecaaa3e53d3c6ab1cc7e46f797cde245b7fec402b2e", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_01\nFile: source_000014.txt\nLines: 1-16\n```tsx\nimport type { NativeSvgIconProps } from 'native/types/ui';\nimport React from 'react';\nimport Svg, { Path } from 'react-native-svg';\n\nexport const CircleCloseIcon = ({ color = '#FDA4AF', size = 24 }: NativeSvgIconProps) => (\n <Svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n d=\"M3 12C3 13.1819 3.23279 14.3522 3.68508 15.4442C4.13738 16.5361 4.80031 17.5282 5.63604 18.364C6.47177 19.1997 7.46392 19.8626 8.55585 20.3149C9.64778 20.7672 10.8181 21 12 21C13.1819 21 14.3522 20.7672 15.4442 20.3149C16.5361 19.8626 17.5282 19.1997 18.364 18.364C19.1997 17.5282 19.8626 16.5361 20.3149 15.4442C20.7672 14.3522 21 13.1819 21 12C21 10.8181 20.7672 9.64778 20.3149 8.55585C19.8626 7.46392 19.1997 6.47177 18.364 5.63604C17.5282 4.80031 16.5361 4.13738 15.4442 3.68508C14.3522 3.23279 13.1819 3 12 3C10.8181 3 9.64778 3.23279 8.55585 3.68508C7.46392 4.13738 6.47177 4.80031 5.63604 5.63604C4.80031 6.47177 4.13738 7.46392 3.68508 8.55585C3.23279 9.64778 3 10.8181 3 12Z\"\n stroke={color}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n />\n <Path d=\"M10 10L14 14M14 10L10 14\" stroke={color} strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} />\n </Svg>\n);\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Рефакторинг: упростить и сделать код более читабельным\n\nВот небольшой локальный рефакторинг с сохранением поведения:\n\n```tsx\nimport type { NativeSvgIconProps } from 'native/types/ui';\nimport React from 'react';\nimport Svg, { Path } from 'react-native-svg';\n\nexport const CircleCloseIcon = ({ color = '#FDA4AF', size = 24 }: NativeSvgIconProps) => (\n <Svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n d=\"M3 12C3 13.1819 3.23279 14.3522 3.68508 15.4442C4.13738 16.5361 4.80031 17.5282 5.63604 18.364C6.47177 19.1997 7.46392 19.8", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000041", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000073.txt", "source_sha256": "c469cb71abe9e681153cce47e61679cadd34362a28b2d42d189c6da6191858c4", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_01\nFile: source_000073.txt\nLines: 1-5\n```ts\nimport type { AppIntegrityProvider } from 'native/types/adapters';\nimport { APP_INTEGRITY_PROVIDERS } from 'native/constants/security';\n\nexport const isAppIntegrityProvider = (value: unknown): value is AppIntegrityProvider =>\n typeof value === 'string' && APP_INTEGRITY_PROVIDERS.includes(value as AppIntegrityProvider);\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "We need answer in Russian. Need analyze code snippet. User asks: \"Опиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\" Project: project_01, file security/appIntegrity.ts, lines 1-5. Need describe interface and limitations of this fragment. Show example of correct usage of existing API.\n\nNeed be careful: code only defines a type guard function isAppIntegrityProvider. It imports type AppIntegrityProvider from native/types/adapters, and constant APP_INTEGRITY_PROVIDERS from native/constants/security. It checks if value is string and included in array. Limitations: only accepts strings, not objects, not instances, not other types. It doesn't validate actual provider implementation, only string membership. It may be used to check if a value is a valid provider name before passing to adapter? Need maybe mention TypeScript type narrowing. Example: const provider = \"google\" as AppIntegrityProvider; if (isAppIntegrityProvider(provider)) { /* use */ } or const p: AppIntegrityProvider | null = isAppIntegrityProvider(value) ? value : null. But since value unknown, can't cast directly? TypeScript can narrow to string, but not to App", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000042", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000263.txt", "source_sha256": "5923c15a1496e30ef355ccb0bfe95b5f6974a68d46476ab0b2d1f1ebbf522d9e", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_02\nFile: source_000263.txt\nLines: 26-74\n```ts\n const dragDistancePx = ref<number>(0)\n const isTimelineDragging = ref<boolean>(false)\n const isClickSuppressed = ref<boolean>(false)\n const dragThumbLeft = ref<string | null>(null)\n const dragActiveFillWidth = ref<string | null>(null)\n let isBodySelectionLocked = false\n let bodyUserSelectBeforeDrag = ''\n let bodyCursorBeforeDrag = ''\n let isWindowPointerListenersBound = false\n let clickSuppressionTimeoutId: ReturnType<typeof setTimeout> | null = null\n\n const getTimelineRootElement = (): HTMLElement | null => timelineRootElementRef.value\n const getTimelineTrackElement = (): HTMLElement | null => timelineTrackElementRef.value\n\n const getYearButtonByYear = (year: number): HTMLButtonElement | null =>\n getTimelineRootElement()?.querySelector<HTMLButtonElement>(`[data-timeline-year=\"${year}\"]`) ?? null\n\n const resolveNearestSelectableYear = (pointerClientX: number): number | null => {\n if (!selectableYears.value.length) return null\n\n let nearestYear: number | null = null\n let nearestDistance = Number.POSITIVE_INFINITY\n\n for (const selectableYear of selectableYears.value) {\n const yearButton = getYearButtonByYear(selectableYear)\n if (!yearButton || yearButton.disabled) continue\n\n const yearRect = yearButton.getBoundingClientRect()\n const yearCenterX = yearRect.left + (yearRect.width / 2)\n const distance = Math.abs(yearCenterX - pointerClientX)\n if (distance < nearestDistance) {\n nearestDistance = distance\n nearestYear = selectableYear\n }\n }\n\n return nearestYear\n }\n\n const resolveTrackPointerOffset = (pointerClientX: number): number | null => {\n const timelineTrackElement = getTimelineTrackElement()\n if (!timelineTrackElement) return null\n\n const trackRect = timelineTrackElement.getBoundingClientRect()\n if (trackRect.width <= 0) return null\n\n const halfLabelPx = timelineHalfLabelWidthPx()\n const minOffsetPx = Math.min(halfLabelPx, trackRect.width / 2)\n const maxOffsetPx = Math.max(trackRect.width - halfLabelPx, minOffsetPx)\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Рефакторинг: упростить `resolveNearestSelectableYear` и `resolveTrackPointerOffset`\n\n### 1. `resolveNearestSelectableYear`\n\n**Проблема:** цикл `for` с `continue` и `Math.abs` можно заменить на `Math.min` с `reduce` или `find`, но более чистым и безопасным способом — это использовать `Math.min` с `Math.abs` и `reduce`/`find`.\n\n**Вариант 1 — с `reduce`:**\n\n```ts\nconst resolveNearestSelectableYear = (pointerClientX: number): number | null => {\n if (!selectableYears.value.length) return null\n\n const yearButtons = selectableYears.value\n .map(year => getYearButtonByYear(year))\n .filter((btn): btn is HTMLButtonElement | null => btn && !btn.disabled)\n\n if (!yearButtons.length) return null\n\n return yearButtons.reduce<{ nearestYear: number | null; nearestDistance: number }>({\n nearestYear: null,\n nearestDistance: Number.POSITIVE_INFINITY,\n }, (acc, yearButton) => {\n const rect = yearButton", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000043", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000030.txt", "source_sha256": "fcd7581a94c482701dc77baa2d64e8d8dc625868e1b9e94467dc5723a43e4909", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_01\nFile: source_000030.txt\nLines: 1-42\n```ts\nimport type { UseKycTierUpgradeNoticeAnimationResult } from 'native/types/kyc';\nimport { useMemo } from 'react';\nimport { Easing, Keyframe } from 'react-native-reanimated';\nimport { KYC_TIER_UPGRADE_NOTICE_ANIMATION } from 'native/constants/kyc';\n\nconst createNoticeExitingAnimation = (easing: ReturnType<typeof Easing.bezier>) =>\n new Keyframe({\n 0: {\n opacity: 1,\n transform: [\n {\n translateY: 0\n }\n ]\n },\n 100: {\n easing,\n opacity: KYC_TIER_UPGRADE_NOTICE_ANIMATION.exitOpacity,\n transform: [\n {\n translateY: KYC_TIER_UPGRADE_NOTICE_ANIMATION.exitTranslateY\n }\n ]\n }\n }).duration(KYC_TIER_UPGRADE_NOTICE_ANIMATION.durationMs);\n\nexport const useKycTierUpgradeNoticeAnimation = (): UseKycTierUpgradeNoticeAnimationResult => {\n const noticeExiting = useMemo(() => {\n const easing = Easing.bezier(\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingX1,\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingY1,\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingX2,\n KYC_TIER_UPGRADE_NOTICE_ANIMATION.easingY2\n );\n\n return createNoticeExitingAnimation(easing);\n }, []);\n\n return {\n noticeExiting\n };\n};\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Разбор жизненного цикла и зависимостей\n\n**Файл:** `source_000030.txt`\n\n**Проект:** `project_01`\n\n**Библиотеки/модули:**\n- `react` — `useMemo`\n- `react-native-reanimated` — `Easing.bezier`, `Keyframe`\n- `native/types/kyc` — тип `UseKycTierUpgradeNoticeAnimationResult`\n- `native/constants/kyc` — константа `KYC_TIER_UPGRADE_NOTICE_ANIMATION`\n\n**Логика:**\n1. `createNoticeExitingAnimation` — функция, которая возвращает `Keyframe` с анимацией выхода (fade-out + translate down).\n2. `useKycTierUpgradeNoticeAnimation` — React-композабл, который:\n - Внутри `useMemo` создаёт easing-функцию из константы `KYC_TIER_UPGRADE_NOTICE_ANIMATION`.\n - Возвращает объект с свойством `noticeExiting`, содержащую анимацию.\n - `useMemo` кэширует результат, так что easing и", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000044", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000050.txt", "source_sha256": "6f3b51efd61569b392f3344c98056620de6a70c563fef3e21bc7f31314fa9b72", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни поток данных и ответственность этого фрагмента. Укажи конкретные функции и состояния, не выдумывай отсутствующие детали.\n\nProject: project_01\nFile: source_000050.txt\nLines: 9-63\n```ts\n authSessionTimeoutWarning: 'auth.sessionTimeoutWarning',\n authTwoFactor: 'auth.twoFactor',\n beneficiariesCreationSaveError: 'beneficiaries.creationSaveError',\n beneficiariesDetailsActions: 'beneficiaries.detailsActions',\n beneficiariesSelectionActions: 'beneficiaries.selectionActions',\n kycCredentialExit: 'kyc.credentialExit',\n profileCredentialExit: 'profile.credentialExit',\n supportTicketAction: 'support.ticketAction',\n supportAttachments: 'support.attachments',\n supportAttachmentPicker: 'support.attachmentPicker',\n transfersAmountLimits: 'transfers.amountLimits',\n transfersDuplicate: 'transfers.duplicate',\n transfersPinLocked: 'transfers.pinLocked',\n transfersSourceWalletSelect: 'transfers.sourceWalletSelect'\n} as const satisfies Record<string, ModalKind>;\n\nexport const MODAL_OWNER_KEYS = {\n authLogout: 'auth.logout',\n authSessionTimeout: 'auth.sessionTimeout',\n authSignIn: 'auth.signIn',\n authSignUp: 'auth.signUp',\n authStart: 'auth.start',\n authTwoFactor: 'auth.twoFactor',\n beneficiariesCreation: 'beneficiaries.creation',\n beneficiariesDetails: 'beneficiaries.details',\n beneficiariesDirectory: 'beneficiaries.directory',\n kycCredentialSetup: 'kyc.credentialSetup',\n kycVerification: 'kyc.verification',\n profile: 'profile',\n profileCredential: 'profile.credential',\n support: 'support',\n transfersSendMoney: 'transfers.sendMoney'\n} as const satisfies Record<string, ModalOwnerKey>;\n\nexport const MODAL_PRIORITY = {\n blocking: 100,\n standard: 0\n} as const;\n\nconst STANDARD_MODAL_METADATA = {\n dimsBackground: true,\n dismissibleByAndroidBack: true,\n dismissibleByBackdrop: true,\n priority: MODAL_PRIORITY.standard\n} as const satisfies ModalKindMetadata;\n\nconst UNDIMMED_STANDARD_MODAL_METADATA = {\n ...STANDARD_MODAL_METADATA,\n dimsBackground: false\n} as const satisfies ModalKindMetadata;\n\nexport const MODAL_KIND_METADATA = {\n [MODAL_KINDS.authCredentialLocked]: STANDARD_MODAL_METADATA,\n [MODAL_KINDS.authLogout]: STANDARD_MODAL_METADATA,\n [MODAL_KINDS.authPasskeyPrompt]: STANDARD_MODAL_METADATA,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to explain the data flow and responsibility of this TypeScript code fragment. Let me analyze what's actually here and what's missing.\n\nLet me look at the code carefully:\n\n1. `ModalKind` type (lines 9-63) - A const object mapping string keys to `ModalKind` values. It's typed as `Record<string, ModalKind>` with `as const`.\n\n2. `MODAL_OWNER_KEYS` - A const object mapping string keys to `ModalOwnerKey` values. Typed as `Record<string, ModalOwnerKey>` with `as const`.\n\n3. `MODAL_PRIORITY` - A const object with `blocking: 100` and `standard: 0`. Typed as `Record<string, ModalPriority>` with `as const`.\n\n4. `STANDARD_MODAL_METADATA` - A const object with `dimsBackground: true`, `dismissibleByAndroidBack: true`, `dismissibleByBackdrop: true`, `priority: MODAL_PRIORITY.standard`. Typed as `ModalKindMetadata`.\n\n5. `UNDIMMED_STANDARD_MODAL_METADATA` - A const object that spreads `STANDARD_MODAL_METADATA` and overrides `dimsBackground: false`. Typed as `ModalKindMetadata`.\n\n", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000045", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000165.txt", "source_sha256": "ad2b521eb82266ff00767cbe4f3645dc10b32e0a0ad37428fb36a18debf659e2", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nПроведи краткий обзор корректности этого кода. Выбери наиболее существенный реальный риск либо обоснуй, почему по этому фрагменту его нельзя установить.\n\nProject: project_02\nFile: source_000165.txt\nLines: 1-25\n```ts\nimport {\n HOME_ROUTE_PATH,\n NETWORK_ROUTE_PATH,\n PROJECTS_ROUTE_PATH,\n} from '@shared'\n\nexport const APP_ROUTES_WITH_TIMELINE = new Set([\n HOME_ROUTE_PATH,\n])\n\nexport const APP_MAP_PRELOAD_ROUTE_PATHS = new Set([\n HOME_ROUTE_PATH,\n NETWORK_ROUTE_PATH,\n PROJECTS_ROUTE_PATH,\n])\n\nexport const APP_MAP_PRELOAD_IDLE_TIMEOUT_MS = 3000\nexport const APP_MAP_PRELOAD_FALLBACK_DELAY_MS = 1000\n\nexport const APP_MAIN_TOASTER_CONFIG = {\n position: 'top-right',\n expand: true,\n duration: 5000,\n class: 'app-main-toast-viewport',\n} as const\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to review a TypeScript file for a project called \"project_02\". They want me to identify the most significant real risk or explain why this fragment cannot be installed. Let me analyze the code carefully.\n\nLooking at the code:\n\n1. It imports three constants from `@shared`: `HOME_ROUTE_PATH`, `NETWORK_ROUTE_PATH`, `PROJECTS_ROUTE_PATH`\n2. It exports:\n - `APP_ROUTES_WITH_TIMELINE` - a Set containing only `HOME_ROUTE_PATH`\n - `APP_MAP_PRELOAD_ROUTE_PATHS` - a Set containing all three route paths\n - `APP_MAP_PRELOAD_IDLE_TIMEOUT_MS` - 3000\n - `APP_MAP_PRELOAD_FALLBACK_DELAY_MS` - 1000\n - `APP_MAIN_TOASTER_CONFIG` - a const object with toast configuration\n\nLet me think about what the most significant real risk is:\n\n1. **The `as const` assertion on `APP_MAIN_TOASTER_CONFIG`**: This is a `const` object with a type assertion. In TypeScript, `as const` is a type-level assertion that doesn't actually enforce immutability at runtime. However, the bigger issue is that `", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000046", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000160.txt", "source_sha256": "2b984489ddda05d9a4e9b0bfceb3806ab58f42613bf6de33858105f52a919af8", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_02\nFile: source_000160.txt\nLines: 15-84\n```ts\n]\n\nconst runTask = async ({ run }: BootstrapTask): Promise<void> => {\n try {\n await run()\n }\n catch {\n // Swallow bootstrap failures — the app shell still mounts and individual\n // stores fall back to their pristine state.\n }\n}\n\nconst runTasks = async (tasks: BootstrapTask[]): Promise<void> => {\n await Promise.all(tasks.map((task) => runTask(task)))\n}\n\n// Module-level state shared between all composable consumers.\nconst isReady = ref(false)\nconst isMapPrewarmed = ref(false)\nconst isBootstrapComplete = ref(false)\nlet bootstrapPromise: Promise<void> | null = null\nlet resolveMapPrewarm: (() => void) | null = null\n\nconst resolveMapPrewarmWaiters = () => {\n resolveMapPrewarm?.()\n resolveMapPrewarm = null\n}\n\nexport function useAppBootstrap() {\n const runBootstrap = (): Promise<void> => {\n if (bootstrapPromise) return bootstrapPromise\n\n bootstrapPromise = (async () => {\n try {\n await runTasks(BOOTSTRAP_BLOCKING_TASKS)\n isBootstrapComplete.value = true\n isReady.value = true\n }\n catch {\n isBootstrapComplete.value = true\n isReady.value = true\n }\n })()\n\n return bootstrapPromise\n }\n\n const markMapPrewarmed = () => {\n if (isMapPrewarmed.value) return\n\n isMapPrewarmed.value = true\n resolveMapPrewarmWaiters()\n }\n\n const resetBootstrap = () => {\n bootstrapPromise = null\n resolveMapPrewarm = null\n isBootstrapComplete.value = false\n isMapPrewarmed.value = false\n isReady.value = false\n }\n\n return {\n isReady,\n isBootstrapComplete,\n isMapPrewarmed,\n runBootstrap,\n markMapPrewarmed,\n resetBootstrap,\n }\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Интерфейс и ограничения\n\n### Что делает этот composable\n\nЭто `useAppBootstrap` — это composable (Vue 3) для управления фазированного приложения. Он:\n\n1. **Запускает bootstrap-задачи** (`BOOTSTRAP_BLOCKING_TASKS`) в строгой последовательности.\n2. **Управляет фазы приложения:**\n - `isBootstrapComplete` — bootstrap-задачи завершены (включая ошибки).\n - `isReady` — приложение готово (включая ошибки).\n - `isMapPrewarmed` — map-карта предварительно загружена.\n3. **Управляет \"prewarm\" (предварительной загрузки) карты:**\n - `markMapPrewarmed()` — запускает prewarm-загрузку и notifies all waiters.\n - `resolveMapPrewarmWaiters()` — завершает prewarm-загрузку (только если не уже завершена).\n4. **Сбрасывает все фазы** через `resetBootstrap()`.\n\n### Ограничения\n\n- **`bootstrapPromise` — один, и он не может быть перезаписан.**", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000047", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000157.txt", "source_sha256": "6d96f2a83227db08c423276fa2bf7b50893df6794ced98e7f25caf1e6b598dfe", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_02\nFile: source_000157.txt\nLines: 76-145\n```vue\n </div>\n </section>\n</template>\n\n<style scoped lang=\"scss\">\n.report-preview {\n width: 100%;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n user-select: none;\n\n &__frame {\n width: 100%;\n height: 100%;\n min-height: 0;\n border-radius: 1.25rem;\n border: 1px solid var(--color-border-primary);\n background: var(--color-bg-primary);\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n &__tabs {\n width: 100%;\n flex-shrink: 0;\n }\n\n &__image {\n display: block;\n width: 100%;\n min-width: 0;\n height: auto;\n max-width: 100%;\n object-fit: initial;\n background: #fff;\n }\n\n &__placeholder {\n width: 100%;\n height: 100%;\n padding: 1rem;\n display: grid;\n place-items: center;\n text-align: center;\n color: var(--color-text-secondary);\n }\n\n &__placeholder-title,\n &__placeholder-text {\n margin: 0;\n }\n\n &__actions {\n display: grid;\n grid-template-columns: 1fr;\n gap: 0.75rem;\n\n :deep(.ui-button) {\n width: 100%;\n min-height: 3.5rem;\n }\n }\n\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to analyze a Vue component's lifecycle and dependencies, focusing on async operations, resource cleanup, and repeated calls. Let me look at the code carefully.\n\nThe code shown is only the template and style sections (lines 76-145). I don't see the `<script>` section which would contain the actual lifecycle hooks, methods, and logic. But let me analyze what IS visible.\n\nWait - the user says \"Разбери жизненный цикл и зависимости этого кода\" (Analyze the lifecycle and dependencies of this code). But the code provided is only the template and style. The actual logic (lifecycle hooks, methods, data, computed, watch) would be in the `<script>` section which isn't shown.\n\nLet me re-read the prompt: \"Ты помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.\" (You help develop this project. Use only the provided code. Discuss and answer in Russian.)\n\nThe provided code is only the template and style. I need to be honest about what I can analyze from just this. But let me look more carefully at what's visible:\n\n1. **Template structure**: \n", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000048", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000116.txt", "source_sha256": "ea271109d7937d1cbb97587869811f9a0da11574694444f17cb0ab75cb416c92", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_01\nFile: source_000116.txt\nLines: 43-112\n```ts\n },\n amountCardInputShell: {\n flex: 1,\n minWidth: 0,\n position: 'relative'\n },\n amountInputContainer: {\n flex: 1\n },\n amountInputField: {\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n borderRadius: 0,\n borderWidth: 0,\n minHeight: 50,\n paddingHorizontal: 0,\n paddingVertical: 0\n },\n amountCardValueRow: {\n alignItems: 'center',\n flex: 1,\n flexDirection: 'row',\n minWidth: 0\n },\n amountCardValue: {\n fontFamily: SHADCN_TYPOGRAPHY['data-large-value'].fontFamily,\n fontSize: 36,\n fontWeight: '600',\n lineHeight: 42,\n color: SHADCN_PALETTE.neutral[100],\n flex: 1,\n fontVariant: ['tabular-nums'],\n paddingVertical: 4\n },\n amountCardFooter: {\n gap: 4,\n minHeight: 34\n },\n amountCardBalance: {\n ...(SHADCN_TYPOGRAPHY['body-reg-12'] as TextStyle),\n color: SHADCN_PALETTE.neutral[300],\n fontVariant: ['tabular-nums']\n },\n amountCardBalanceInvalid: {\n color: SHADCN_PALETTE.error[100]\n },\n amountPair: {\n position: 'relative'\n },\n currencyChip: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: 8,\n minHeight: 44,\n paddingLeft: 8\n },\n currencyChipPressed: {\n opacity: 0.7,\n transform: [{ scale: 0.97 }]\n },\n currencyChipCode: {\n ...(SHADCN_TYPOGRAPHY['body-med-16'] as TextStyle),\n color: SHADCN_PALETTE.neutral[100],\n fontVariant: ['tabular-nums']\n },\n swapRow: {\n alignItems: 'center',\n height: 28,\n justifyContent: 'center',\n marginVertical: -5,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to describe the interface and constraints of this code fragment, and show an example of correct usage of the existing API. Let me analyze the code carefully.\n\nThis is a TypeScript file (from a project called \"project_01\") that defines style objects for a money/exchange input component. It's not a functional component or a class - it's a set of style constants/objects. Let me look at what's defined:\n\n1. `amountCardInputShell` - flex: 1, minWidth: 0, position: 'relative'\n2. `amountInputContainer` - flex: 1\n3. `amountInputField` - transparent background/border, no border radius, no padding, minHeight: 50\n4. `amountCardValueRow` - center alignment, flex: 1, row direction, minWidth: 0\n5. `amountCardValue` - uses SHADCN typography and palette, large value font, tabular nums, color neutral[100], flex: 1, paddingVertical: 4\n6. `amountCardFooter` - gap: 4, minHeight: 34\n7. `amountCardBalance` - uses SHADCN body-reg-", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000049", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000196.txt", "source_sha256": "fdb3058caa66c4abb2a7e99e8c0f6bc8543e3439ad6b3c90e64ec993a02dd9bf", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_02\nFile: source_000196.txt\nLines: 73-139\n```ts\n ),\n )\n\n const constructorSkeletonShape = computed<ConstructorSkeletonProps>(() => ({\n comparisonRowCount: comparisonTableRows.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_COMPARISON_ROW_COUNT,\n ganttProjectCount: implementationProjects.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_GANTT_PROJECT_COUNT,\n ganttYearCount: implementationYears.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_GANTT_YEAR_COUNT,\n indicatorCount: indicators.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_INDICATOR_COUNT,\n projectCount: projects.value.length\n || CONSTRUCTOR_SKELETON_DEFAULT_PROJECT_COUNT,\n }))\n\n const constructorTabs: TabItem[] = [{\n label: 'Параметры',\n value: 'scenario-params',\n }, {\n label: 'Сравнение',\n value: 'scenario-comparison',\n }]\n\n const changeComparisonMode = async (tabValue: string | undefined) => {\n if (!tabValue) return\n if (tabValue !== 'scenario-params' && tabValue !== 'scenario-comparison') return\n\n const shouldEnableComparison = tabValue === 'scenario-comparison'\n if (shouldEnableComparison === isComparisonMode.value) return\n\n await constructorStore.compareScenarios(shouldEnableComparison)\n }\n\n const activeTab = computed<ConstructorModeTab>({\n get: () => (isComparisonMode.value ? 'scenario-comparison' : 'scenario-params'),\n set: (tab) => {\n changeComparisonMode(tab)\n },\n })\n\n const shouldShowModeTabs = computed(() => canShowComparisonControls.value)\n\n const selectScenario = (scenarioId: number) => {\n if (isComparisonMode.value) {\n constructorStore.compareScenarios(false)\n }\n constructorStore.selectScenario(scenarioId)\n }\n\n const addScenario = () => {\n if (isComparisonMode.value) {\n constructorStore.compareScenarios(false)\n }\n constructorStore.addScenario()\n }\n\n const onScenarioCardClick = (scenarioId: number) => {\n if (isComparisonMode.value) {\n constructorStore.toggleScenarioComparison(scenarioId)\n return\n }\n\n selectScenario(scenarioId)\n }\n\n const { getGroupedBarChartYMax } = useGroupedBarChartYMax()\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Рефакторинг: упростить `changeComparisonMode` и `activeTab`\n\n### 1. `changeComparisonMode` — упростить логику\n\n```ts\nconst changeComparisonMode = async (tabValue: string | undefined) => {\n if (!tabValue) return\n if (tabValue !== 'scenario-params' && tabValue !== 'scenario-comparison') return\n\n const shouldEnableComparison = tabValue === 'scenario-comparison'\n if (shouldEnableComparison === isComparisonMode.value) return\n\n await constructorStore.compareScenarios(shouldEnableComparison)\n}\n```\n\n**Что можно упростить:**\n\n- `tabValue !== 'scenario-params' && tabValue !== 'scenario-comparison'` — это проверка \"не валидный значение\". Можно заменить на:\n\n```ts\nconst validValues = ['scenario-params', 'scenario-comparison']\nif (!validValues.includes(tabValue)) return\n```\n\n- `shouldEnableComparison === isComparisonMode.value` — это проверка \"уже в этом режиме\". Можно заменить на:\n\n```ts\nif (isComparisonMode.value === (tabValue === 'scenario-comparison')) return\n```\n\n- `", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000050", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000229.txt", "source_sha256": "4a0ad5019b51712bc53f53207403b0cd4156a8c6ccd0fad364b51f702065ba19", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_02\nFile: source_000229.txt\nLines: 1-29\n```vue\n<script setup lang=\"ts\">\ndefineProps<{\n modelValue: boolean\n label: string\n disabled?: boolean\n}>()\ndefineEmits<{ 'update:modelValue': [value: boolean] }>()\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"vsm-editor-visibility\"\n :class=\"{ 'vsm-editor-visibility--hidden': !modelValue }\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-pressed=\"modelValue\"\n :title=\"label\"\n @click=\"$emit('update:modelValue', !modelValue)\"\n >\n <VIcon :name=\"modelValue ? 'eye' : 'eye-off'\" aria-hidden=\"true\" />\n </button>\n</template>\n\n<style\n scoped\n src=\"@/app/assets/styles/components/network/VsmEditorVisibilityButton.scss\"\n lang=\"scss\"\n></style>\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Жизненный цикл и зависимости\n\n### 1. Пропсы (props)\n- `modelValue: boolean` — значение, отображаемое на кнопке (вкл/выкл).\n- `label: string` — текст кнопки (используется для `aria-label` и `title`).\n- `disabled?: boolean` — опционально, кнопка может быть заблокирована.\n\n### 2. Эмиттеры (emits)\n- `update:modelValue` — высылается при клике, передаёт новое значение (вкл/выкл).\n\n### 3. Шаблон (template)\n- Кнопка с классы `vsm-editor-visibility` и `vsm-editor-visibility--hidden` (когда `modelValue` — `false`).\n- `:disabled` — блокирует кнопку.\n- `:aria-label` и `:title` — текст для скрин-читеров и тултипа.\n- `:aria-pressed` — индикатор состояния (вкл/выкл).\n- `@click` — при клике высылает `update:modelValue` с новым значением.\n- `VIcon` — отобра", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000051", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000194.txt", "source_sha256": "9f14b2115598e0750c35d0b7ccc8c31656aa6c38c3df39195d2409b47fdb8123", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_02\nFile: source_000194.txt\nLines: 1-65\n```ts\nconst DEFAULT_COMPARISON_TABLE_FRAME_WIDTH_REM = 87\nconst ULTRA_WIDE_BREAKPOINT_PX = 2560\n\nconst getRootFontSizePx = (): number => {\n if (typeof window === 'undefined') return 16\n\n const rootFontSize = Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)\n return Number.isFinite(rootFontSize) && rootFontSize > 0 ? rootFontSize : 16\n}\n\nexport const useConstructorComparisonTableFrameWidth = () => {\n const comparisonTableElementRef = ref<HTMLElement | null>(null)\n const frameWidthPx = ref<number | null>(null)\n\n const getBaseFrameWidthPx = (): number => DEFAULT_COMPARISON_TABLE_FRAME_WIDTH_REM * getRootFontSizePx()\n\n const updateFrameWidth = () => {\n if (typeof window === 'undefined') return\n\n if (window.innerWidth < ULTRA_WIDE_BREAKPOINT_PX) {\n frameWidthPx.value = null\n return\n }\n\n const comparisonTableElement = comparisonTableElementRef.value\n if (!comparisonTableElement) return\n\n const frameHostElement = comparisonTableElement.parentElement ?? comparisonTableElement\n const nextFrameWidth = Math.max(frameHostElement.clientWidth, getBaseFrameWidthPx())\n frameWidthPx.value = Number.isFinite(nextFrameWidth) ? nextFrameWidth : null\n }\n\n let comparisonResizeObserver: ResizeObserver | null = null\n\n onMounted(() => {\n updateFrameWidth()\n window.addEventListener('resize', updateFrameWidth)\n\n if (typeof ResizeObserver === 'undefined') return\n\n comparisonResizeObserver = new ResizeObserver(() => {\n updateFrameWidth()\n })\n\n const targetElement = comparisonTableElementRef.value?.parentElement ?? comparisonTableElementRef.value\n if (targetElement) {\n comparisonResizeObserver.observe(targetElement)\n }\n })\n\n onUnmounted(() => {\n window.removeEventListener('resize', updateFrameWidth)\n comparisonResizeObserver?.disconnect()\n comparisonResizeObserver = null\n })\n\n const comparisonTableFrameStyle = computed(() => {\n if (frameWidthPx.value === null) return undefined\n\n return {\n '--comparison-frame-width': `${frameWidthPx.value}px`,\n }\n })\n\n return {\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to analyze the lifecycle and dependencies of this Vue composable code. Let me look at it carefully and identify issues, especially around async behavior, resource cleanup, and repeated calls.\n\nLet me go through the code:\n\n1. **`getBaseFrameWidthPx()`** - This is a computed value that's called every time. It depends on `getRootFontSizePx()` which reads from `document.documentElement`. This is fine for a computed property.\n\n2. **`updateFrameWidth()`** - This is the main logic:\n - Returns early if `window` is undefined\n - If `window.innerWidth < ULTRA_WIDE_BREAKPOINT_PX`, sets `frameWidthPx.value = null` and returns\n - Gets the comparison table element from the ref\n - If not found, returns\n - Gets the \"frame host\" element (parent or self)\n - Calculates `nextFrameWidth = Math.max(frameHostElement.clientWidth, getBaseFrameWidthPx())`\n - Sets `frameWidthPx.value` to the result if finite, else null\n\n3. **Lifecycle hooks:**\n - `onMounted()`: Calls `updateFrameWidth()`, adds resize listener, creates ResizeObserver\n ", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000052", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000238.txt", "source_sha256": "c5ac7078abc4147d18693ab14b0908d9cd504ea6c4198ab69a579eaa5594bb3b", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_02\nFile: source_000238.txt\nLines: 121-176\n```ts\n recoverySettingsVersion.value = null\n needsReload.value = false\n }\n catch (error) {\n if (requestGeneration !== generation || requestId !== editorRequestId) return\n captureConflict(error)\n paramsError.value = errorMessage(error)\n }\n finally {\n if (requestGeneration === generation && requestId === editorRequestId) isParamsLoading.value = false\n }\n }\n\n const closeParams = () => {\n if (isCalculating.value) return\n editorRequestId++\n isParamsOpen.value = false\n isParamsLoading.value = false\n editor.clear()\n }\n\n const refreshResult = async (id: number, requestGeneration: number) => {\n try {\n const currentResult = await opmService.getResult(id)\n if (requestGeneration === generation) result.value = currentResult\n }\n catch (error) {\n if (requestGeneration === generation) loadError.value = errorMessage(error)\n }\n }\n\n const calculate = async () => {\n const id = projectId.value\n const currentSettings = editor.settings\n if (id === null || !currentSettings || isBusy.value || isParamsLoading.value || needsReload.value) return\n if (editor.revealInvalidField()) return\n const requestGeneration = generation\n isCalculating.value = true\n paramsError.value = ''\n try {\n const response = await opmService.calculate(id, {\n base_version: currentSettings.base_version,\n settings_version: currentSettings.settings_version,\n schema_version: currentSettings.schema_version,\n changes: editor.changes,\n })\n if (requestGeneration !== generation) return\n settings.value = response.settings\n result.value = response.result\n recoverySettingsVersion.value = null\n loadError.value = ''\n if (editor.schema) editor.load(editor.schema, response.settings)\n await refreshResult(id, requestGeneration)\n if (requestGeneration !== generation) return\n isParamsOpen.value = false\n if (!resultError.value) {\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Интерфейс и ограничения\n\n### Основные переменные (state)\n- `projectId` — ID проекта (число или `null`)\n- `editor` — объект редактора (с `settings`, `changes`, `schema`, `revealInvalidField()`, `clear()`, `load()`)\n- `result` — результат (объект/`null`)\n- `loadError` — ошибка при загрузке (строка)\n- `resultError` — ошибка при результате (строка)\n- `paramsError` — ошибка при параметрах (строка)\n- `isCalculating` — флаг \"загрузка/расчет\"\n- `isParamsOpen` — флаг \"окно параметров открыто\"\n- `isParamsLoading` — флаг \"загрузка параметров\"\n- `needsReload` — флаг \"нужно перезагрузить\"\n- `generation` — генератор запроса (число, увеличивается при каждом новом запросе)\n- `editorRequestId` — ID редактора (для отбросить старых запросов)\n- `recoverySettingsVersion` — версия recovery (число или `null`)\n\n### Методы\n- `fetchParams", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000053", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000011.txt", "source_sha256": "4e207c7869aab8d42471516bd19ede91995c707ee22bb28e5d1c680d6c0b878b", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nПроведи краткий обзор корректности этого кода. Выбери наиболее существенный реальный риск либо обоснуй, почему по этому фрагменту его нельзя установить.\n\nProject: project_01\nFile: source_000011.txt\nLines: 1-59\n```tsx\nimport type { DiagnosticsOverlayViewportNativeProps } from 'native/types/diagnostics';\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport Reanimated from 'react-native-reanimated';\nimport { useDiagnosticsOverlay } from 'native/composables/diagnostics';\nimport { DIAGNOSTIC_OVERLAY_ACCESSIBILITY_LABEL } from 'native/constants/diagnostics';\nimport { diagnosticsOverlayStyles as styles } from 'native/styles/diagnostics';\n\nexport const DiagnosticsOverlayViewport = ({\n interactionBlocked = false,\n layer = 'root'\n}: DiagnosticsOverlayViewportNativeProps) => {\n const {\n buttonBaseStyle,\n buttonPositionStyle,\n dragPanHandlers,\n handleButtonLayout,\n handleSave,\n handleTouchStart,\n isVisible,\n label,\n status\n } = useDiagnosticsOverlay({ layer });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <View\n accessibilityElementsHidden={interactionBlocked}\n importantForAccessibility={interactionBlocked ? 'no-hide-descendants' : 'auto'}\n pointerEvents={interactionBlocked ? 'none' : 'box-none'}\n style={[styles.viewport, interactionBlocked ? styles.blockedViewport : undefined]}\n >\n <Reanimated.View\n {...dragPanHandlers}\n onLayout={handleButtonLayout}\n onTouchStart={handleTouchStart}\n style={[styles.buttonContainer, buttonBaseStyle, buttonPositionStyle]}\n >\n <Pressable\n accessibilityLabel={DIAGNOSTIC_OVERLAY_ACCESSIBILITY_LABEL}\n accessibilityRole=\"button\"\n disabled={interactionBlocked || status === 'saving'}\n onPress={handleSave}\n style={({ pressed }) => [\n styles.button,\n status === 'success' ? styles.buttonSuccess : undefined,\n status === 'error' ? styles.buttonError : undefined,\n pressed ? styles.buttonPressed : undefined\n ]}\n >\n <Text style={styles.buttonText}>{label}</Text>\n </Pressable>\n </Reanimated.View>\n </View>\n );\n};\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Краткий обзор\n\nКод выглядит чистым и соответствует паттернам React Native / Reanimated. Однако есть **один существенный риск** — **`onPress={handleSave}` is not guarded against double-tap / rapid taps**.\n\n## Почему это риск\n\n`handleSave` is called on every press. If the user taps the button twice in quick succession (which is common on mobile — e.g. they tap once, see no feedback, tap again), `handleSave` fires twice. In a diagnostics overlay this means:\n\n- Two save operations are dispatched.\n- If `handleSave` triggers a network call or state mutation, the second call may overwrite or duplicate data.\n- The `status` flag (`'success'` / `'error'`) is only updated after the save completes, so the second tap may still trigger a save while the first is in flight.\n\nThe code does guard against `interactionBlocked` and `status === 'saving'` for the `disabled` prop, but it does **not** guard against the `onPress` handler itself.\n\n## Подходящий паттерн\n\n```tsx\n<Pressable\n disabled={interactionBlocked || status === 'saving'}\n ", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000054", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000197.txt", "source_sha256": "644409e3cb39f6e8d209c34440c420b43aacf150842643c4bbcb05b1d594d399", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_02\nFile: source_000197.txt\nLines: 1-59\n```ts\nimport { gantBadgeColors, gantConfig } from '@modules/constructor/constants/gant'\nimport type { GantConfig } from '@modules/constructor/types/gant'\n\nexport function useGant() {\n const store = useGantStore()\n const { projects } = storeToRefs(store)\n\n const config = computed<GantConfig>(() => {\n const projectStartYears = projects.value.map((project) => project.startDate.getFullYear())\n const projectEndYears = projects.value.map((project) => project.endDate.getFullYear())\n\n return {\n ...gantConfig,\n startYear: Math.min(gantConfig.startYear, ...projectStartYears),\n endYear: Math.max(gantConfig.endYear, ...projectEndYears),\n }\n })\n\n const years = computed<number[]>(() => {\n const result: number[] = []\n for (let y = config.value.startYear; y <= config.value.endYear; y++) {\n result.push(y)\n }\n return result\n })\n\n const totalWidth = computed(() => years.value.length * config.value.yearWidth)\n\n function calculatePosition(date: Date): number {\n const startOfTimeline = new Date(config.value.startYear, 0, 1)\n const msPerYear = 365.25 * 24 * 60 * 60 * 1000\n const yearsFromStart = (date.getTime() - startOfTimeline.getTime()) / msPerYear\n return (yearsFromStart / years.value.length) * 100\n }\n\n function calculateWidth(startDate: Date, endDate: Date): number {\n const msPerYear = 365.25 * 24 * 60 * 60 * 1000\n const durationYears = (endDate.getTime() - startDate.getTime()) / msPerYear\n return (durationYears / years.value.length) * 100\n }\n\n function formatDateRange(startDate: Date, endDate: Date): string {\n const format = (d: Date) =>\n `${String(d.getDate()).padStart(2, '0')}.${String(d.getMonth() + 1).padStart(2, '0')}.${d.getFullYear()}`\n return `${format(startDate)} – ${format(endDate)}`\n }\n\n function getBadgeColor(phaseName: string): string {\n return gantBadgeColors[phaseName] ?? ''\n }\n\n return {\n config,\n projects,\n years,\n totalWidth,\n toggleProject: store.toggleProject,\n toggleSection: store.toggleSection,\n expandAll: store.expandAll,\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Интерфейс и ограничения\n\n### Что возвращает `useGant()`\n\n```ts\n{\n config: ComputedRef<GantConfig>,\n projects: Ref<RefArray<GantProject>>,\n years: ComputedRef<number[]>,\n totalWidth: ComputedRef<number>,\n toggleProject: (project: GantProject) => void,\n toggleSection: (section: string) => void,\n expandAll: () => void,\n}\n```\n\n- **`config`** — объект с `startYear`, `endYear`, `yearWidth` и прочим.\n- **`projects`** — `RefArray` (объект-обёртка `ref` для массива) с проектами.\n- **`years`** — массив всех годов, от `startYear` до `endYear`.\n- **`totalWidth`** — ширина всего ганта в процентах (100% = 100% ширины контейнера).\n- **`toggleProject`** — функция для сгруппировки/разгруппировки проекта.\n- **`toggleSection`** — функция для сгруппировки", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000055", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000087.txt", "source_sha256": "898446cae0e0c77c1e5108560cbd8cafaf2d16c7c7ec3da647e3f5a93b7071bb", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_01\nFile: source_000087.txt\nLines: 33-85\n```ts\n/// ///////////////////////////////////////////////////////////\n\nimport './modal/Controller/init';\nimport './feedback/init';\nimport './project_03ization/init';\nimport './diagnostics/init';\nimport './diagnostics/Report/init';\nimport './diagnostics/NativeInstallation/init';\nimport './security/AppIntegrity/init';\nimport './security/RiskMonitoring/init';\nimport './security/SecureStoreDiagnostics/init';\nimport './network/Check/init';\nimport './network/ConnectionState/init';\nimport './network/OfflineRecovery/init';\nimport './network/Monitor/init';\n\n/// ///////////////////////////////////////////////////////////\n// ============== AUTHENTICATION FLOWS ====================== //\n/// ///////////////////////////////////////////////////////////\n\nimport './auth/RequestLifecycle/init';\nimport './auth/TwoFactor/init';\nimport './auth/CredentialContinuation/init';\nimport './auth/Passkey/Availability/init';\nimport './auth/Passkey/SessionCompletion/init';\nimport './auth/LoginContinuation/init';\nimport './auth/Session/Account/init';\nimport './auth/Session/LoginSessionPersistence/init';\nimport './auth/Session/SessionRefresh/init';\nimport './auth/Session/Logout/init';\nimport './auth/Session/Expiration/init';\nimport './auth/Session/Kyc/init';\nimport './auth/Session/PasswordRecovery/init';\nimport './auth/Session/VerifiedEmail/init';\nimport './auth/Passkey/init';\nimport './auth/Passkey/Registration/init';\nimport './auth/SignIn/LoginOptions/init';\nimport './auth/SignIn/PreferenceEnrollment/init';\nimport './auth/SignIn/PhoneCountry/init';\nimport './auth/SignIn/OtpDispatch/init';\nimport './auth/SignIn/OtpVerification/init';\nimport './auth/SignUp/PhoneCountry/init';\nimport './auth/SignUp/OtpDispatch/init';\nimport './auth/SignUp/OtpVerification/init';\nimport './auth/SignUp/Account/init';\nimport './auth/SignUp/Welcome/init';\nimport './auth/Start/RememberedPhone/init';\nimport './auth/Start/Credential/init';\nimport './auth/Start/ForgotPassword/init';\nimport './auth/Start/Password/init';\nimport './auth/Start/Pin/init';\nimport './auth/Start/Completion/init';\nimport './auth/ForgotPassword/Flow/init';\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Что можно упростить здесь\n\nВ этом файле нет логики — это только **импорты**. Но импорты всё-таки можно упростить, если:\n\n1. **Убрать пустые строки и комментарии** — они не добавляют ничего.\n2. **Сгруппировать импорты по модулю** — так читается, что модуль `auth` содержит 20+ строк, а `network` 4.\n3. **Убрать `/// ///////////////////////////////////////////////////////////`** — это не стандартный TypeScript, а просто визуальный разделитель, который можно заменить по необходимости.\n4. **Убрать `// ============== ... =====================`** — тоже визуальный разделитель.\n\nНо самое важное: **не удалять ни одного импорта**, потому что каждый из них запускает `init()` и/или регистрирует модуль.\n\n---\n\n## Локальный рефакторинг\n\n```ts\nimport './modal/Controller/init';\nimport './feedback/init';\nimport './project_03ization/init';\nimport './diagnostics/init';\nimport './diagnostics/Report/init';\nimport './diagnostics/NativeInstallation/init';\nimport './security/AppIntegrity/init';", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000056", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000099.txt", "source_sha256": "ac12e07ff3eb0b45bff4cf61bd2c723ad08d5625597f21b0b318252581b1fe01", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_01\nFile: source_000099.txt\nLines: 25-88\n```tsx\n\nexport const AppRouter = ({ onReady }: AppRouterNativeProps) => {\n const navigationRef = useNavigationContainerRef<AppStackParamList>();\n const [isNavigationReady, setIsNavigationReady] = useState(false);\n\n const [authColdStartSessionNavigationRoute, consumeAuthColdStartSessionNavigationRoute, syncAppRouting] = useUnit([\n $authColdStartSessionNavigationRoute,\n authColdStartSessionNavigationRouteConsumedFn,\n syncAppRoutingFromNavigationFn\n ]);\n\n const [authColdStartInitialState] = useState<InitialState | undefined>(() =>\n authColdStartSessionNavigationRoute\n ? createAuthColdStartNavigationState(authColdStartSessionNavigationRoute)\n : undefined\n );\n\n const hasAuthColdStartInitialState = authColdStartInitialState !== undefined;\n\n const { style: modalBottomSafeAreaStyle } = useScreenFooterSpacing({\n bottomGap: 0,\n includeSafeAreaInset: Platform.OS === 'ios'\n });\n\n const handleNavigationStateChange = useCallback(\n (state?: AppNavigationState) => {\n syncAppRouting(resolveAppRoutingFromNavigationState(state));\n },\n [syncAppRouting]\n );\n\n const completeAuthColdStartNavigation = useCallback(\n (route: AppAuthColdStartDestination) => {\n if (!hasAuthColdStartInitialState) {\n navigationRef.resetRoot(createAuthColdStartNavigationState(route));\n }\n\n consumeAuthColdStartSessionNavigationRoute();\n },\n [consumeAuthColdStartSessionNavigationRoute, hasAuthColdStartInitialState, navigationRef]\n );\n\n const handleNavigationReady = useCallback(() => {\n handleNavigationStateChange(navigationRef.getRootState());\n\n if (authColdStartSessionNavigationRoute) {\n completeAuthColdStartNavigation(authColdStartSessionNavigationRoute);\n }\n\n setIsNavigationReady(true);\n onReady?.();\n }, [\n authColdStartSessionNavigationRoute,\n completeAuthColdStartNavigation,\n handleNavigationStateChange,\n navigationRef,\n onReady\n ]);\n\n useEffect(() => {\n if (!isNavigationReady || !authColdStartSessionNavigationRoute) {\n return;\n }\n\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Объяснение рефакторинга\n\n### 1. Упрощение `completeAuthColdStartNavigation`\n\n**Проблема:**\n```tsx\nconst completeAuthColdStartNavigation = useCallback(\n (route: AppAuthColdStartDestination) => {\n if (!hasAuthColdStartInitialState) {\n navigationRef.resetRoot(createAuthColdStartNavigationState(route));\n }\n\n consumeAuthColdStartSessionNavigationRoute();\n },\n [consumeAuthColdStartSessionNavigationRoute, hasAuthColdStartInitialState, navigationRef]\n);\n```\n\nЗдесь `hasAuthColdStartInitialState` — это `authColdStartInitialState !== undefined`, а `authColdStartInitialState` — это `authColdStartSessionNavigationRoute ? createAuthColdStartNavigationState(route) : undefined`.\n\nВ `completeAuthColdStartNavigation` мы проверяем `hasAuthColdStartInitialState` (то есть `authColdStartSessionNavigationRoute !== undefined`), а затем в `handleNavigationReady` мы проверяем `authColdStartSessionNavigationRoute` (тоже `!== undefined`).\n\n**Риски:**\n- `hasAuthColdStartInitialState` и `authColdStartSessionNavigationRoute` —", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000057", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000003.txt", "source_sha256": "c7b9bb84d3c0d57dddca99034fc5637aef6392749e199aa43d475624a409bf87", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни поток данных и ответственность этого фрагмента. Укажи конкретные функции и состояния, не выдумывай отсутствующие детали.\n\nProject: project_01\nFile: source_000003.txt\nLines: 33-102\n```ts\n name,\n recordDiagnostic = recordDiagnosticEvent\n}: StorageOperationQueueOptions) => {\n let pendingOperation = Promise.resolve();\n let pendingOperationCount = 0;\n let nextOperationId = 1;\n\n return <Result>(operation: () => Promise<Result>) => {\n const operationId = nextOperationId;\n const operationsAhead = pendingOperationCount;\n const queuedAt = Date.now();\n let startedAt = queuedAt;\n\n nextOperationId += 1;\n pendingOperationCount += 1;\n\n const runOperation = () => {\n startedAt = Date.now();\n\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'started', {\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n\n try {\n const operationResult = operation();\n\n void operationResult.then(\n () => {\n pendingOperationCount -= 1;\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'succeeded', {\n durationMs: Date.now() - startedAt,\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n },\n (error) => {\n pendingOperationCount -= 1;\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'failed', {\n durationMs: Date.now() - startedAt,\n error,\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n }\n );\n\n return operationResult;\n } catch (error) {\n pendingOperationCount -= 1;\n recordStorageOperationQueueDiagnostic(recordDiagnostic, name, 'failed', {\n durationMs: Date.now() - startedAt,\n error,\n operationId,\n operationsAhead,\n waitDurationMs: startedAt - queuedAt\n });\n\n throw error;\n }\n };\n\n const result = pendingOperation.then(runOperation, runOperation);\n\n pendingOperation = result.then(\n () => {},\n () => {}\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Поток данных и ответственность\n\n### 1. Структура\n\nФайл `operationQueue.ts` реализует **очередку (queue) операций** для `StorageOperationQueue`. Он не содержит логики самой операции — только **управление последовательности** и **статистика**.\n\n### 2. Переменные состояния\n\n| Переменная | Тип | Описание |\n|---|---|---|\n| `pendingOperation` | `Promise` | \"Операция, которая в данный момент выполняется или уже в очереди\". Начинает с `Promise.resolve()` — т.е. очередь пустая. |\n| `pendingOperationCount` | `number` | Количество операций, которые **в очереди или выполняются**. |\n| `nextOperationId` | `number` | **ID последовательной операции**. Начинает с 1 и увеличивается на 1 для каждой новой операции. |\n\n### 3. Функция `operationQueue` — что она возвращает\n\n```ts\nreturn <Result>(operation: () => Promise<Result>) => {\n```\n\nЭто **функция, которая возвращает функцию** (currying). Ты передаёшь `operation` — функцию, что возвращает `", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000058", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000182.txt", "source_sha256": "195649884a8c901592e7a31d320c1ffd165ae8a9a77ca4345850ee2ac2f0e930", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nРазбери жизненный цикл и зависимости этого кода. Обрати внимание на асинхронность, очистку ресурсов и повторные вызовы, если они здесь есть.\n\nProject: project_02\nFile: source_000182.txt\nLines: 4-56\n```ts\n DEFAULT_PASSWORD_SETUP_MODE,\n SET_PASSWORD_SETUP_MODE,\n SUCCESS_REDIRECT_DELAY_MS,\n} from '@modules/auth/constants/reset-password'\nimport { useResetPasswordStore } from '@modules/auth/stores/reset-password'\nimport type { PasswordSetupMode } from '@modules/auth/types/reset-password'\nimport { AUTH_ROUTE_PATH, useproject_03Toast, type ToastType } from '@shared'\n\nconst isPasswordSetupMode = (value: unknown): value is PasswordSetupMode => {\n return value === DEFAULT_PASSWORD_SETUP_MODE || value === SET_PASSWORD_SETUP_MODE\n}\n\nexport const useResetPasswordPage = () => {\n const authStore = useAuthStore()\n const resetPasswordStore = useResetPasswordStore()\n const route = useRoute()\n const router = useRouter()\n const { add: showToastAdd } = useproject_03Toast()\n\n const {\n isValidating,\n isSubmitting,\n maxPasswordLength,\n passwordSetupConfig,\n passwordSchema,\n isReadyForForm,\n } = storeToRefs(resetPasswordStore)\n\n const passwordSetupMode = computed(() => {\n return isPasswordSetupMode(route.meta.passwordSetupMode)\n ? route.meta.passwordSetupMode\n : DEFAULT_PASSWORD_SETUP_MODE\n })\n\n const { handleSubmit, errors, meta, submitCount } = useForm({ validationSchema: passwordSchema })\n const { value: password, meta: passwordMeta } = useField<string>('password')\n const { value: confirmPassword, meta: confirmPasswordMeta } = useField<string>('confirmPassword')\n\n const hasPasswordInput = computed(() => Boolean(password.value?.length))\n const shouldShowRequirementErrors = computed(() => hasPasswordInput.value || submitCount.value > 0)\n\n const showPasswordError = computed(() => {\n return Boolean(errors.value.password) && (passwordMeta.dirty || submitCount.value > 0)\n })\n\n const showConfirmPasswordError = computed(() => {\n return Boolean(errors.value.confirmPassword) && (confirmPasswordMeta.dirty || submitCount.value > 0)\n })\n\n const passwordFieldErrorText = computed(() => {\n return resetPasswordStore.getRequiredFieldErrorText(showPasswordError.value, password.value, 'Введите пароль')\n })\n\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Жизненный цикл и зависимости\n\n### 1. Импорты и константы\n- `DEFAULT_PASSWORD_SETUP_MODE`, `SET_PASSWORD_SETUP_MODE`, `SUCCESS_REDIRECT_DELAY_MS` — режимы настройки пароля и задержка после успешного сохранения.\n- `useResetPasswordStore` — стор, который хранит состояние формы (пароль, подтверждение, ошибки, статусы).\n- `PasswordSetupMode` — тип для режима (создание / изменение).\n- `AUTH_ROUTE_PATH`, `useproject_03Toast`, `ToastType` — маршруты и локальные уведомления.\n\n### 2. Функция `isPasswordSetupMode`\nПроверяет, является ли значение `DEFAULT_PASSWORD_SETUP_MODE` или `SET_PASSWORD_SETUP_MODE`.\n\n### 3. `useResetPasswordPage` — основной composable\n- **Создание сторов:** `authStore`, `resetPasswordStore`.\n- **Маршрут:** `route`, `router`.\n- **Уведнения:** `showToastAdd`.\n- **Связи с сторами:** `storeToRefs(resetPasswordStore)` — разворачивает стор в реактивные переменные.\n- **Режим пароля", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000059", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000158.txt", "source_sha256": "a6c4edab7340c4805328665972af1ed9ea074fb3d1f29ebabaf5a25d7e648b9f", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nПроанализируй обработку ошибок и пограничные случаи. Предложи одно небольшое улучшение и покажи соответствующий фрагмент кода.\n\nProject: project_02\nFile: source_000158.txt\nLines: 104-173\n```vue\n height: rem(260);\n padding: rem(20);\n border-radius: var(--radius-3xl);\n background: var(--background-primary);\n border: rem(1) solid var(--modal-stroke);\n box-shadow: var(--shadow-drawer-outer);\n contain: layout style;\n\n &--expanded {\n width: min(95vw, 140rem);\n height: 92vh;\n }\n\n &__body {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding: 0;\n border-radius: 0;\n background: transparent;\n border: 0;\n box-sizing: border-box;\n box-shadow: none;\n }\n\n &__headline {\n position: absolute;\n top: rem(20);\n right: rem(20);\n z-index: 1;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n min-height: rem(44);\n }\n\n &__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex: 1;\n gap: rem(8);\n min-height: 0;\n }\n\n &__icon-group {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: rem(28);\n }\n\n &__icon {\n width: rem(48);\n height: rem(48);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n\n svg {\n width: rem(48);\n height: rem(48);\n }\n\n &--loading {\n background: transparent;\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to analyze error handling and edge cases in the provided Vue component code (lines 104-173), then propose one small improvement and show the corresponding code fragment.\n\nLet me look at what's actually in this code. It's a CSS/SCSS section of a Vue component called `VDownloadModal`. Let me analyze what's here:\n\n1. It's a modal component with:\n - A fixed height of 260px (or expanded to 92vh)\n - A body with flex layout\n - An absolute-positioned headline\n - An icon group with loading state\n\nNow, the user asks me to \"analyze error handling and edge cases.\" But looking at the code, this is purely a CSS/SCSS section. There's no JavaScript logic, no error handling, no data processing. The code is just styling.\n\nWait, let me re-read the prompt. \"Проанализируй обработку ошибок и пограничные случаи. Предложи одно небольшое улучшение и покажи соответствующий фрагмент кода.\"\n\nThe user is asking me to analyze error handling and edge cases in this code. But this code is just CSS/SCSS. There's no", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000060", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000222.txt", "source_sha256": "91ca22b932e13fbdabd3448b087ea0d6ee7b323fe9fa62930179afb7e5b42da8", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_02\nFile: source_000222.txt\nLines: 1-27\n```ts\nimport { useWindowSize } from '@vueuse/core'\nimport { MAP_LOW_HEIGHT_SCREEN_MAX_PX } from '@modules/map/constants/map'\n\nexport const resolveIsLowMapHeightScreen = (): boolean => {\n if (typeof window === 'undefined') {\n return false\n }\n\n return window.innerHeight < MAP_LOW_HEIGHT_SCREEN_MAX_PX\n}\n\nexport const useMapHeightMode = () => {\n const { height } = useWindowSize()\n\n const isLowMapHeightScreen = computed(() => {\n const viewportHeight = height.value\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return resolveIsLowMapHeightScreen()\n }\n\n return viewportHeight < MAP_LOW_HEIGHT_SCREEN_MAX_PX\n })\n\n return {\n isLowMapHeightScreen,\n }\n}\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Рефакторинг: упростить `resolveIsLowMapHeightScreen`\n\n### Сокращенный код\n\n```ts\nimport { useWindowSize } from '@vueuse/core'\nimport { MAP_LOW_HEIGHT_SCREEN_MAX_PX } from '@modules/map/constants/map'\n\nexport const useMapHeightMode = () => {\n const { height } = useWindowSize()\n\n const isLowMapHeightScreen = computed(() => {\n const viewportHeight = height.value\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return false\n }\n\n return viewportHeight < MAP_LOW_HEIGHT_SCREEN_MAX_PX\n })\n\n return {\n isLowMapHeightScreen,\n }\n}\n```\n\n### Что я изменил\n\n1. **Удален `resolveIsLowMapHeightScreen`** — функция была только для проверки `window` и сравнения с константой. Поскольку `computed` уже работает в Vue 3 и `height.value` is a reactive reference, the `window` check is unnecessary in a Vue app context. If you truly need SSR safety, you can keep it as a small helper, but for a frontend-only module it", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000061", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000188.txt", "source_sha256": "1d0d284e6e08e0a884a06d6b1cf13a3bd16df1490f28fb9aeac29ce8da49dbf5", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_02\nFile: source_000188.txt\nLines: 90-143\n```vue\n stepSize: props.stepSize,\n }),\n)\n\nconst chartOptions = computed(() => {\n const chartTheme = theme.value\n const textColor = resolveThemeValue(chartTheme.colors.text)\n const secondaryTextColor = resolveThemeValue(chartTheme.colors.secondaryText)\n const mutedTextColor = resolveThemeValue(chartTheme.colors.mutedText)\n const gridColor = resolveThemeValue(chartTheme.colors.grid)\n const chartAreaBorderColor = resolveThemeValue(chartTheme.colors.chartAreaBorder)\n const chartAreaBorderStrongColor = resolveThemeValue(chartTheme.colors.chartAreaBorderStrong)\n const fontFamily = resolveThemeValue(chartTheme.typography.fontFamily)\n const gridDashPattern = chartTheme.grid.dashPattern.map((item) => scalePx(item))\n\n return {\n ...createGroupedBarChartRootcodeOptions({\n customGridLines: {\n verticalSpacing:\n props.verticalGridSpacing != null ? scalePx(props.verticalGridSpacing) : null,\n horizontalSpacing:\n props.horizontalGridSpacing != null ? scalePx(props.horizontalGridSpacing) : null,\n color: gridColor,\n lineWidth: scalePx(chartTheme.grid.lineWidth),\n dashPattern: gridDashPattern,\n },\n chartAreaBorder: {\n color: chartAreaBorderColor,\n lineWidth: scalePx(chartTheme.grid.lineWidth),\n dashPattern: gridDashPattern,\n dashOffset: scalePx(chartTheme.grid.dashOffset),\n solidBottom: true,\n },\n centerSingleGroupedBar: props.centerSingleBarPerCategory\n ? { minVisibleValue: 0 }\n : false,\n structuredTooltip: isTooltipEnabled.value\n ? createComparisonTooltipOptions(chartScaleFactor.value)\n : false,\n }),\n responsive: true,\n maintainAspectRatio: false,\n layout: {\n padding: { top: scalePx(22), right: scalePx(8), bottom: 0, left: scalePx(8) },\n },\n interaction: {\n mode: 'index' as const,\n intersect: false,\n },\n /* НАСТРОЙКА ГРУППИРОВКИ (для grouped bar chart) */\n scales: {\n x: {\n /* НАСТРОЙКА ГОРИЗОНТАЛЬНОЙ ОСИ */\n stacked: false, // Отключить стекирование для группировки\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Рефакторинг: упростить `computed` и его зависимости\n\nВ коде есть много повторяющихся `resolveThemeValue(...)` и `scalePx(...)` — это 10+ строк, которые можно уместить в 2-3 строк.\n\n### 1. Упростить `chartOptions`\n\n```vue\nconst chartOptions = computed(() => {\n const chartTheme = theme.value\n const textColor = resolveThemeValue(chartTheme.colors.text)\n const secondaryTextColor = resolveThemeValue(chartTheme.colors.secondaryText)\n const mutedTextColor = resolveThemeValue(chartTheme.colors.mutedText)\n const gridColor = resolveThemeValue(chartTheme.colors.grid)\n const chartAreaBorderColor = resolveThemeValue(chartTheme.colors.chartAreaBorder)\n const chartAreaBorderStrongColor = resolveThemeValue(chartTheme.colors.chartAreaBorderStrong)\n const fontFamily = resolveThemeValue(chartTheme.typography.fontFamily)\n const gridDashPattern = chartTheme.grid.dashPattern.map((item) => scalePx(item))\n\n return {\n ...createGroupedBarChartRootcodeOptions({\n customGridLines: {\n verticalSpacing:\n props.verticalGridSpacing !=", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000062", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000076.txt", "source_sha256": "a569451446e6a91cef2185e1f4324c5cfe5e815efcb9ebd63d91049f8415b035", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОбъясни, как безопасно упростить этот код с сохранением поведения. Покажи небольшой локальный рефакторинг и объясни его.\n\nProject: project_01\nFile: source_000076.txt\nLines: 105-174\n```ts\n maxAmountMinor,\n maxSendableMinor,\n minAmountMinor,\n minorUnitExponent,\n sendable,\n status\n };\n\n return hasConsistentLimits(wallet) ? wallet : null;\n};\n\nconst isUnsupportedCurrencyRow = (value: Record<string, unknown>) => {\n if (typeof value.currency !== 'string') {\n return false;\n }\n\n const normalizedCurrency = value.currency.trim().toUpperCase();\n\n const isIsoCurrencyCode =\n value.currency === normalizedCurrency && TRANSFER_CURRENCY_CODE_PATTERN.test(normalizedCurrency);\n\n return isIsoCurrencyCode && !isTransferSourceWalletCurrency(normalizedCurrency);\n};\n\nexport const resolveTransferSourceWalletsResponse = (value: unknown): TransferSourceWallet[] | null => {\n if (!isRecord(value) || !Array.isArray(value.wallets)) {\n return null;\n }\n\n const wallets: TransferSourceWallet[] = [];\n const currencies = new Set<TransferSourceWallet['currency']>();\n\n for (const row of value.wallets) {\n if (!isRecord(row)) {\n return null;\n }\n\n if (isUnsupportedCurrencyRow(row)) {\n continue;\n }\n\n const wallet = resolveTransferSourceWallet(row);\n\n if (wallet === null || currencies.has(wallet.currency)) {\n return null;\n }\n\n currencies.add(wallet.currency);\n wallets.push(wallet);\n }\n\n return wallets;\n};\n\nexport const resolveTransferSourceWalletOptions = (\n wallets: readonly TransferSourceWallet[] | null\n): readonly DashboardWallet[] => {\n if (wallets === null) {\n return [];\n }\n\n const options: DashboardWallet[] = [];\n\n for (const wallet of wallets) {\n const presentation = TRANSFER_SOURCE_WALLET_METADATA.find(({ currency }) => currency === wallet.currency);\n\n if (presentation) {\n const amount =\n wallet.availableMinor === 0\n ? TRANSFER_SOURCE_WALLET_BALANCE_FALLBACK\n```<|im_end|>\n<|im_start|>assistant\n<think>\n</think>\n\n", "completion": "## Общее\n\nКод — это \"чистый\" (pure) resolver: данные в, данные out. Он делает три вещи:\n1. `resolveTransferSourceWalletsResponse` — парсит сырые строки/объекты из API и возвращает массив `TransferSourceWallet[]` или `null`.\n2. `resolveTransferSourceWalletOptions` — превращает массив `TransferSourceWallet` в массив `DashboardWallet` (с fallback-балансом и metadata-картами).\n3. `isUnsupportedCurrencyRow` — проверяет, не является ли строка \"неправильной\" (не-ISO или не-переводимой).\n\n## Основная проблема\n\nВ `resolveTransferSourceWalletsResponse` есть **silent failure**: если *любая* строка в `value.wallets` не-`Record` или имеет \"неправильную\" валюту, функция возвращает `null` — то есть **весь** массив, включая wallets, которые были успешно распarsed. Это не \"якорь\" (fail-fast), это \"якорь-в-пустую\": один плохой элемент отбрасывает всё.\n\nВ `resolveTransferSourceWalletOptions` же", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000063", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_02", "source_path": "source_000264.txt", "source_sha256": "543bb1bc697a6f70e66fe0906e11d7d8e0867909480ade0235399954f2e47772", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_02\nFile: source_000264.txt\nLines: 1-67\n```ts\nexport const DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\nexport const DOCX_VALUE_FRACTION_DIGITS = 2\n\n/** Макеты 842 × 595: геометрия в pt, в OOXML переводится в twips. */\nexport const DOCX_PAPERS = {\n A4: { width: 841.9, height: 595.3 },\n A3: { width: 1190.6, height: 841.9 },\n} as const\nexport const DOCX_LAYOUT = {\n margin: 34,\n headerMargin: 14,\n font: 'Onest',\n bodySize: 10,\n headingSize: 14,\n headerSize: 8,\n tablePadding: 9,\n labelColumnWidth: 232,\n dataColumnsPerPage: 5,\n cardColumns: 3,\n chartHeight: 244,\n graphicGap: 14,\n rasterScale: 4,\n ganttRowHeight: 28,\n ganttYearsPerPage: 12,\n} as const\nexport const DOCX_COLORS = {\n text: '1C3A73', muted: '667085', border: 'E4E5E8',\n panel: 'F8F8F9', stripe: 'F2F3F5', white: 'FFFFFF', accent: '6172F3',\n palette: ['A4ABF5', 'EFA1B7', '8DBFF7', '87D99C', 'FEB273', 'B2A0F4'],\n gantt: { project: 'E99342', section: 'E99342', design: '8DBFF7', construction: 'B2A0F4', commissioning: '87C990' },\n} as const\nexport const DOCX_CHART_CATEGORIES = { line: 18, grouped: 12, single: 24 } as const\nexport const DOCX_FONT_FILES = {\n regular: 'fonts/docx/Onest-Regular.ttf',\n bold: 'fonts/docx/Onest-Bold.ttf',\n} as const\n\nexport const DOCX_TABLE_LAYOUT = {\n projectsPerPage: 4,\n rankingRowsPerPage: 10,\n cellPadding: 16,\n matrixRowHeight: 52,\n rankingRowHeight: 42,\n rankingMatrixRowHeight: 40,\n rankingMatrixGroupHeight: 30,\n rankingMatrixCellPadding: 10,\n rankingMatrixHeaderHeight: 74,\n panelPadding: 12,\n headingHeight: 34,\n headerHeight: 36,\n badgeHeaderHeight: 58,\n} as const\n\nexport const DOCX_CARD_LAYOUT = {\n columns: 3,\n gap: 12,\n headingHeight: 28,\n metricHeight: 88,\n projectHeight: 56,\n projectsWithMetrics: 9,\n} as const\n\nexport const DOCX_BADGE_COLORS = {\n vsm: 'E99342',\n 'vsm-inter': 'F7E28C',\n sm: '6555E8',\n} as const\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "The user wants me to describe the interface and constraints of this code fragment, and show an example of correct usage of the existing API. Let me analyze the code carefully.\n\nThis is a TypeScript constants file (`source_000264.txt`) for a project called \"project_02\". It exports a set of constants related to DOCX (Microsoft Word Open XML) document generation, specifically for what appears to be a CV/Resume (PRIVATE_LABEL_007) document template.\n\nLet me identify the interface and constraints:\n\n1. **Type safety**: All objects use `as const` assertions, making them readonly and preventing mutation.\n2. **MIME type**: Only one specific DOCX MIME type is supported.\n3. **Paper sizes**: Only A4 and A3 are defined (A3 is 1190.6 × 841.9 pt).\n4. **Layout constants**: All layout values are numeric and have specific semantic meanings (margins, font sizes, heights).\n5. **Color constants**: Colors are hex strings (6 chars, no # prefix), and the palette is a fixed array.\n6. **Font files**: Only two font files are referenced (regular and bold).\n7. **Chart categories", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}
{"id": "project-000064", "stage": "project", "split": "eval", "language": "ru", "domain": "project_replay", "project": "project_01", "source_path": "source_000059.txt", "source_sha256": "44a6702e60340859dc10b64888af22c267498d6cff6a023fc9d2ace8d245a3ce", "sampling_group": "project_replay/ru", "prompt": "<|im_start|>system\nТы помогаешь разрабатывать этот проект. Используй только предоставленный код. Рассуждай и отвечай по-русски.<|im_end|>\n<|im_start|>user\nОпиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\n\nProject: project_01\nFile: source_000059.txt\nLines: 1-11\n```ts\nimport { SHADCN_PALETTE } from './theme';\n\nexport const SKELETON_APPEARANCE = {\n backgroundColor: SHADCN_PALETTE.neutral[800],\n borderRadius: 8\n} as const;\n\nexport const SKELETON_ANIMATION = {\n durationMs: 800,\n minimumOpacity: 0.45\n} as const;\n```<|im_end|>\n<|im_start|>assistant\n<think>\n", "completion": "We need answer in Russian. User asks: \"Опиши интерфейс и ограничения этого фрагмента. Покажи пример корректного использования существующего API.\" Project: project_01, File: source_000059.txt, Lines: 1-11. Need describe interface and limitations of this fragment. Show example of correct usage of existing API.\n\nNeed analyze code. It's a TypeScript file exporting two constants: SKELETON_APPEARANCE and SKELETON_ANIMATION. They are as const objects. SKELETON_APPEARANCE has backgroundColor from SHADCN_PALETTE.neutral[800], borderRadius 8. SKELETON_ANIMATION has durationMs 800, minimumOpacity 0.45.\n\nNeed likely explain: interface? It's not a TypeScript interface, just exported constants. But user says \"интерфейс\" maybe means API surface. Need describe: SKELETON_APPEARANCE is a frozen object literal with two properties: backgroundColor (color from theme neutral 800) and borderRadius (8). SKELETON_ANIMATION is frozen object with durationMs (800 ms) and minimumOpacity (0.45). Usage example:", "post_training_anonymized": true, "eligible_for_original_loader": true, "source_kind": "private_project"}