From 9ec5857e22663cda5f72ebed96274dea38d5498e Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sat, 13 Jun 2026 17:31:56 +0300 Subject: [PATCH] =?UTF-8?q?fix(form-compile):=20GUID.GUID=20=D0=B7=D0=BD?= =?UTF-8?q?=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=E2=86=92=20xr:DesignTim?= =?UTF-8?q?eRef=20(Normalize-ChoiceValue)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Значение параметра выбора (choiceParameters app:value) вида "GUID.GUID" (raw-ссылка по метаданным.значение, оба GUID) эмитилось как xs:string: Normalize-ChoiceValue не распознавал raw-GUID-ссылку → xs:string. Тот же класс, что choiceList DesignTimeRef-GUID (commit 2d326c99), но другой потребитель. Универсальный фикс: ветка GUID.GUID → xr:DesignTimeRef в Normalize-ChoiceValue (всегда ссылка, не строка; named-ссылки Enum.X.Y детектятся ниже). Закрывает choiceParameters и любой др. потребитель Normalize-ChoiceValue; choiceList не затронут (там явный valueType побеждает Normalize). Зеркало py. Форма НастройкиПрямыхВыплатФСС/ФормаЗаписи → match. ps1==py байт-в-байт. Регресс 43/43. Co-Authored-By: Claude Opus 4.8 (1M context) --- .claude/skills/form-compile/scripts/form-compile.ps1 | 8 +++++++- .claude/skills/form-compile/scripts/form-compile.py | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index c2940ad1..2b37509d 100644 --- a/.claude/skills/form-compile/scripts/form-compile.ps1 +++ b/.claude/skills/form-compile/scripts/form-compile.ps1 @@ -1,4 +1,4 @@ -# form-compile v1.168 — Compile 1C managed form from JSON or object metadata +# form-compile v1.169 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -4044,6 +4044,12 @@ function Normalize-ChoiceValue { return @{ XsiType = "xs:dateTime"; Text = $s } } + # Raw-ссылка по GUID (метаданные.значение, оба GUID): "GUID.GUID" → xr:DesignTimeRef + # (всегда ссылка, не строка; named-ссылки Enum.X.Y детектятся ниже). + if ($s -match '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\.[0-9a-fA-F]{8}-[0-9a-fA-F-]+$') { + return @{ XsiType = "xr:DesignTimeRef"; Text = $s } + } + # Try to detect typed reference path: ".[..]" $parts = $s -split '\.' if ($parts.Count -ge 2) { diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 288bec2d..822102e9 100644 --- a/.claude/skills/form-compile/scripts/form-compile.py +++ b/.claude/skills/form-compile/scripts/form-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# form-compile v1.168 — Compile 1C managed form from JSON or object metadata +# form-compile v1.169 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -2247,6 +2247,10 @@ def normalize_choice_value(value): if re.fullmatch(r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}', s): return {"xsi_type": "xs:dateTime", "text": s} + # Raw-ссылка по GUID (метаданные.значение) "GUID.GUID" → xr:DesignTimeRef (всегда ссылка, не строка) + if re.fullmatch(r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\.[0-9a-fA-F]{8}-[0-9a-fA-F-]+', s): + return {"xsi_type": "xr:DesignTimeRef", "text": s} + parts = s.split(".") if len(parts) >= 2: root = parts[0]