From 8c7c44270528ea2ccc53e54e8f0edb3a0f8dbcb4 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Mon, 11 May 2026 13:47:50 +0300 Subject: [PATCH] =?UTF-8?q?feat(meta-compile):=20DSL=20choiceHistoryOnInpu?= =?UTF-8?q?t=20=D0=B4=D0=BB=D1=8F=20=D0=B0=D1=82=D1=82=D1=80=D0=B8=D0=B1?= =?UTF-8?q?=D1=83=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit meta-compile v1.12 (ps1 + py): Parse-AttributeShorthand принимает поле choiceHistoryOnInput в object-форме аттрибута, Emit-Attribute эмитит его вместо хардкода Auto. Покрывает атрибуты Catalog/Document/TabularSection (Emit-Attribute, единственная точка эмиссии в работе). Другие контексты (register dimensions, resources, etc.) пока эмитят Auto — расширим при необходимости. build-webtest-config: реквизит Документ.ПриходнаяНакладная.Контрагент получил choiceHistoryOnInput='DontUse'. Это убирает 1С-историю выбора для поля и фиксит pre-existing flake 04-selectvalue/direct-form: после 03 значение «ООО Север» оставалось в истории и selectValue выбирал его через dropdown вместо ожидаемой формы выбора. Live: полный регресс 12/12 впервые зелёный (5m 28s). Co-Authored-By: Claude Opus 4.7 (1M context) --- .claude/skills/meta-compile/scripts/meta-compile.ps1 | 6 ++++-- .claude/skills/meta-compile/scripts/meta-compile.py | 6 ++++-- tests/skills/integration/build-webtest-config.test.mjs | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.claude/skills/meta-compile/scripts/meta-compile.ps1 b/.claude/skills/meta-compile/scripts/meta-compile.ps1 index b2918df4..3c227d7b 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.ps1 +++ b/.claude/skills/meta-compile/scripts/meta-compile.ps1 @@ -1,4 +1,4 @@ -# meta-compile v1.11 — Compile 1C metadata object from JSON +# meta-compile v1.12 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -502,6 +502,7 @@ function Parse-AttributeShorthand { fillChecking = if ($val.fillChecking) { "$($val.fillChecking)" } else { "" } indexing = if ($val.indexing) { "$($val.indexing)" } else { "" } multiLine = if ($val.multiLine -eq $true) { $true } else { $false } + choiceHistoryOnInput = if ($val.choiceHistoryOnInput) { "$($val.choiceHistoryOnInput)" } else { "" } } } @@ -822,7 +823,8 @@ function Emit-Attribute { X "$indent`t`tAuto" X "$indent`t`t" X "$indent`t`t" - X "$indent`t`tAuto" + $chi = if ($parsed.choiceHistoryOnInput) { $parsed.choiceHistoryOnInput } else { "Auto" } + X "$indent`t`t$chi" # Use — only for catalog top-level attributes if ($context -eq "catalog") { diff --git a/.claude/skills/meta-compile/scripts/meta-compile.py b/.claude/skills/meta-compile/scripts/meta-compile.py index 196397e8..6e8a07a4 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.py +++ b/.claude/skills/meta-compile/scripts/meta-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# meta-compile v1.11 — Compile 1C metadata object from JSON +# meta-compile v1.12 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -465,6 +465,7 @@ def parse_attribute_shorthand(val): 'fillChecking': str(val['fillChecking']) if val.get('fillChecking') else '', 'indexing': str(val['indexing']) if val.get('indexing') else '', 'multiLine': True if val.get('multiLine') is True else False, + 'choiceHistoryOnInput': str(val['choiceHistoryOnInput']) if val.get('choiceHistoryOnInput') else '', } def parse_enum_value_shorthand(val): @@ -774,7 +775,8 @@ def emit_attribute(indent, parsed, context): X(f'{indent}\t\tAuto') X(f'{indent}\t\t') X(f'{indent}\t\t') - X(f'{indent}\t\tAuto') + chi = parsed.get('choiceHistoryOnInput') or 'Auto' + X(f'{indent}\t\t{chi}') if context == 'catalog': X(f'{indent}\t\tForItem') if context not in ('processor', 'processor-tabular'): diff --git a/tests/skills/integration/build-webtest-config.test.mjs b/tests/skills/integration/build-webtest-config.test.mjs index a36c8c97..688349c8 100644 --- a/tests/skills/integration/build-webtest-config.test.mjs +++ b/tests/skills/integration/build-webtest-config.test.mjs @@ -140,7 +140,9 @@ export const steps = [ type: 'Document', name: 'ПриходнаяНакладная', attributes: [ { name: 'Организация', type: 'CatalogRef.Организации' }, - { name: 'Контрагент', type: 'CatalogRef.Контрагенты' }, + // choiceHistoryOnInput=DontUse: предотвращает выбор через историю в smoke-тестах + // (04-selectvalue/direct-form проверяет open-form path; история обходит его). + { name: 'Контрагент', type: 'CatalogRef.Контрагенты', choiceHistoryOnInput: 'DontUse' }, { name: 'Склад', type: 'String', length: 50 }, { name: 'Комментарий', type: 'String', length: 200 }, ],