Компилятор выводил тег <ChoiceButton> только для значения false; при choiceButton:true
он не эмитился, и у нессылочного поля (например строкового с обработчиком НачалоВыбора)
кнопка выбора не отрисовывалась — документированный паттерн (SKILL.md: choiceButton:true
+ on:['StartChoice']) фактически не работал.
Теперь true эмитится, но узко: только когда у поля есть обработчик StartChoice — чтобы
не раздувать вывод по ссылочным полям (у них choiceButton=true стоит по умолчанию,
а кнопка платформенная). Порты ps1+py синхронны. Снапшот file-dialog обновлён,
31/31 кейс зелёные на обоих портах.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PictureField, привязанный к булеву/числу, без ValuesPicture не рисует
иконку. Добавлены ключи DSL:
- valuesPicture: ref картинки значения (StdPicture.*, CommonPicture.*)
→ <ValuesPicture><xr:Ref>…</xr:Ref></ValuesPicture>
- loadTransparent: true → <xr:LoadTransparent>true</xr:LoadTransparent>
(выводится только при true)
Реализовано в обоих портах (ps1 + py, v1.22), добавлены в whitelist
свойств. Регресс: новый кейс picture-field (picField + ValuesPicture +
CheckBoxField + событие Selection), эталон зелёный на ps1 и py, плюс
платформенная form-validate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v1.20 → v1.21 (ps1 + py).
Добавлен ключ DSL `textEdit` для элемента input. Эмитит
`<TextEdit>false</TextEdit>` после AutoMarkIncomplete (значение
true — дефолт платформы, не эмитируется). Закрывает блокер для
03-fillfields/direct-edit-form в синтетике web-test: поле с
запрещённым ручным вводом → выбор только через pick-кнопку/F4.
Snapshot-тест: tests/skills/cases/form-compile/text-edit-flag.json
(2 поля, проверяет наличие TextEdit только на втором). 30/30
form-compile зелёные обоих runtime'ов.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Новый DSL-ключ columnGroup со значением-ориентацией horizontal/vertical/inCell
для элемента <ColumnGroup> внутри columns таблицы. Поддерживает вложение,
showTitle/showInHeader/width, тихие синонимы ColumnGroup и ГруппаКолонок.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Добавлен ключ collapsed (для group=collapsible) → <Collapsed>true</Collapsed>:
группа создаётся уже свёрнутой. Раньше DSL умел только включать
сворачиваемое поведение, но начальное состояние задать было нельзя.
Также уточнено описание united: оно про выравнивание левого края полей
ввода (сквозное/локальное), а не про объединение рамок группы.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Добавлены численные maxWidth/maxHeight (XML <MaxWidth>/<MaxHeight>) —
типичный приём для ограничения растяжения поля при autoMaxWidth: false.
До этого DSL знал только булев autoMaxWidth, и ограничить ширину
числом было невозможно.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Кнопки внутри cmdBar/autoCmdBar/popup автоматически получают
CommandBarButton (или CommandBarHyperlink при type="hyperlink") —
указывать вид вручную не нужно. Резолвер прощающий: принимает и
короткие DSL-формы, и XML-имена в любом контексте.
Пример «Диалог загрузки файла» в SKILL.md и тест-кейс file-dialog
переведены на нативный паттерн с autoCmdBar вместо отдельной
горизонтальной группы кнопок внизу формы.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Поле переключателя с RadioButtonType (Auto/RadioButtons/Tumbler) и
ChoiceList (массив value+presentation). Толерантно к написанию модели:
русские имена тегов (ПолеПереключателя, RadioButtonField),
ВидПереключателя по-русски (Авто/Переключатель/Тумблер),
Перечисление.X.Y без EnumValue, синоним title для presentation,
автогенерация презентации из имени значения.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
В реальных формах ERP/БП у ~60% многострочных полей ввода явно стоит
АвтоМаксимальнаяШирина=Ложь. Теперь form-compile проставляет это
автоматически при multiLine: true, если пользователь не задал
autoMaxWidth явно.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document/InformationRegister/AccumulationRegister List-генераторы теперь
прописывают `Список.DefaultPicture` (как делает ERP/БП в 594/600 форм
списка документов). Плюс fallback в эвристике DynamicList-таблицы:
если у главного реквизита есть `settings.mainTable`, поле
подставляется автоматически и для ручного DSL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Реквизиты формы, команды, страницы, попапы и декорации теперь получают Title,
сгенерированный из CamelCase-имени, если в DSL он не задан явно. Поля с path
и кнопки с command по-прежнему опускают Title — синоним подхватится платформой.
Главные реквизиты (Объект/Список/Запись с main=true) исключены.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Когда у формы задан Title (через defn.title или properties.title), эмитим
AutoTitle=false если пользователь явно его не указал. Иначе платформа
добавляет суффикс синонима и получается двойной заголовок (Номенклатура:
Номенклатура). В выгрузках ERP так делает ~95% форм с form-level Title.
Снапшоты form-compile/form-compile-from-object обновлены под новое поведение.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Платформенный default TitleLocation для CheckBoxField — Left, что почти
никогда не соответствует UX-ожиданиям. В acc 8.3.27 для CheckBoxField:
Right (явно): 811, без тега (=Left): 406, None: 140, Left: 14, Top: 3 —
доминирующий паттерн «заголовок справа от флажка».
Эмитим <TitleLocation>Right</TitleLocation> по умолчанию для check.
Переопределяется через titleLocation: 'Left' / 'None' / 'Top' / 'Bottom'.
v1.11. Обновил 5 snapshot'ов.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Без <SavedData>true</SavedData> платформа не маркирует форму как modified
при изменении главного реквизита — confirmation dialog при Esc не появляется,
canonical flow «изменил → Esc → Да» сломан.
Правило выведено из реальной выгрузки acc 8.3.27: SavedData ставится только
для редактируемых форм с типом *Object.X (Catalog/Document/ChartOf…/
ExchangePlan/BusinessProcess/Task) или *RecordManager.X. DynamicList/Report/
DataProcessor/ConstantsSet/RecordSet — не трогаем, отдаём решение DSL через
явный savedData: true.
Поднял версию до v1.10. Обновил 5 snapshot'ов (формы элементов/документа).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- HorizontalAlign не эмитится, если не задан явно через autoCmdBar.horizontalAlign.
Раньше был хардкод Right; платформенный дефолт — Left, эталонные формы
типовых (Бригады/ФормаСписка) тег вообще не содержат.
- horizontalAlign принимает Left/Center/Right.
- SKILL.md: убран раздел «Эвристики компилятора» (внутренняя кухня скрипта),
сжато описание autoCmdBar и main — модель пишет DSL явно, помощь
компилятора видна в [INFO]/[WARN]-логе.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Эвристика главной АКП: без cmdBar/autoCmdBar остаётся Autofill=true
(как в Конфигураторе), с cmdBar — Autofill=false (обратная совместимость).
- Новый элемент autoCmdBar для наполнения главной АКП кастомными кнопками.
- Тихие синонимы commandBar↔cmdBar, autoCommandBar↔autoCmdBar.
- Инференс main-реквизита по типу (*Object.*, *RecordSet.*, DynamicList,
ConstantsSet) — единственный кандидат проставляется молча с [INFO].
- Эвристика DynamicList → таблица: tableAutofill=false +
commandBarLocation=None для привязанной таблицы (соответствие ERP).
- Косметика: <Autofill>true</Autofill> не эмитится явно.
Snapshot'ы form-* также обновлены до актуального состояния cf-init
(Ext/ClientApplicationInterface.xml).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Раньше тип `cfg:CatalogObject.X` мимо regex попадал в fallback и получал
второй `cfg:` поверх → `cfg:cfg:...`, db-load-xml падал. Теперь
Resolve-TypeStr срезает ведущий `cfg:` сразу, обе формы записи валидны.
Заодно сообщение об ошибке FormDataStructure согласовано с примером —
без префикса.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- form-compile.py: rewrite generate_chart_of_accounts_item_dsl and
generate_chart_of_accounts_folder_dsl from dict-format to list-format
(array of OrderedDict), matching PS1 canonical output
- meta-compile.py/ps1: extract flag['name'] from AccountingFlags and
ExtDimensionAccountingFlags dicts instead of stringifying the whole object
- Update snapshots with clean flag names (Валютный/Количественный)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixed IR List and AccumReg List PY generators:
- columns: OrderedDict → list of OrderedDict (matching PS1 array format)
- table element: use 'table' key (not 'element'), 'tableAutofill' (not 'autoCommandBar'), 'None' (not 'none')
- elements: list (not OrderedDict wrapper)
PY tests: 10/12 (2 remaining CoA failures — PY CoA Item generator needs deeper rewrite from dict to list format)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: new generators (IR, AccumReg, CoA, CCOCT/EP wrappers) used
OrderedDict for elements/columns, but PS1 compiler expects array format.
ConvertTo-Json→ConvertFrom-Json wraps dict into single PSCustomObject,
not iterable array — so ChildItems were empty.
Converted all new generators to array format matching existing
Document/Catalog patterns: elements=@(), columns=@().
Also fixed CCOCT/EP wrapper inject logic to iterate array elements
instead of dict keys.
PS1: 12/12, PY: 8/12 (minor case/autofill differences in PY port).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Port PS1 bugfixes to Python:
- Document List: add Номер + Дата as first columns
- Hidden Ref: userVisible=false instead of visible=false (both Catalog and Document lists)
- Emitter: support <UserVisible><xr:Common>false</xr:Common></UserVisible>
- Add userVisible to KNOWN_KEYS
Note: new_field_element calls in Python were already correct (no Bug 1 equivalent).
Python snapshots updated.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three bugs fixed in --from-object PS1 generators:
1. New-FieldElement called with wrong positional args in IR Record and CoA Item
generators — hashtable passed as attrName instead of individual fields.
Result: elements became "System.Collections.Hashtable" → compiler dropped them
→ empty forms. Fixed with named parameters.
2. Document List form missing Number/Date standard columns — only custom
attributes were shown. Added Номер + Дата as first two columns.
3. Hidden Ref column used Visible=false (element completely hidden from
"Customize form"). Changed to UserVisible=false so users can enable Ref
and add sub-columns via dot notation. Matches ERP Контрагенты pattern.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add InformationRegister (Record/List), AccumulationRegister (List),
ChartOfCharacteristicTypes (Item/Folder/List/Choice via Catalog delegation),
ExchangePlan (Item/List/Choice via Catalog delegation),
ChartOfAccounts (Item/Folder/List/Choice with AccountingFlags + ExtDimensionTypes).
Generalize extractAttrs → extractFields with tag parameter.
Add preset defaults and erp-standard.json keys for all new types.
Bump version to v1.6 in both PS1 and PY.
Also: form-add now supports AccumulationRegister (PS1+PY).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ValueStorage is a non-displayable type that cannot be bound to form
elements. Filter it out in all generators: catalog item, catalog/document
list columns, document item (unclaimed + footer).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Read 1C object XML (Document/Catalog), apply ERP preset, generate Form.xml
automatically. Supports Item/List/Choice/Folder purposes with auto-resolve
of object path and purpose from OutputPath convention. Also extends DSL
with DynamicList Settings, Table choiceMode/initialTreeView/enableDrag.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
KNOWN_INVALID_TYPES (FormDataStructure, FormDataCollection, FormDataTree,
etc.) was checked but only produced a Write-Warning/print warning — the
script still emitted the bad <v8:Type> into Form.xml, which XDTO later
rejected with a cryptic load-time error. Turn the warning into a hard
throw so misuse is caught at compile time with the correct hint.
Reveals two broken test cases that shipped invalid forms:
- form-compile/catalog-form: main attribute was FormDataStructure, fixed
to CatalogObject.Товары (what ERP's reference catalog forms actually
use with the cfg: prefix).
- form-info/overview: preRun form-compile used the same wrong type, fixed
the same way; snapshot regenerated.
Bumps form-compile to v1.4 on both runtimes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Third victim of the d155086 single-quote regression that 037062c
missed. Both <Form> header emissions at lines 1130 and 1140 used
`X '...version="$($script:formatVersion)"...'` — single-quoted, so
the literal text `$($script:formatVersion)` landed in the output
XML instead of the detected version number.
The bug was masked for a week because:
1. form-compile runner tests weren't rerun against the broken script
after d155086 (snapshots still showed the pre-regression
`version="2.17"` hardcode)
2. verify-snapshots was already red on form-compile for other reasons
(P2 XDTO errors in some cases), so nobody noticed the wholesale
script breakage
3. The .py port uses an f-string and was never broken
Found while auditing whether 037062c was complete — the earlier grep
for `'...\$formatVersion...'` single-line patterns had missed this
because `$($script:formatVersion)` is a subexpression-in-string form
that wasn't in the grep pattern.
Fix: convert both X calls to double-quoted strings with backtick-
escaped inner quotes, matching the 037062c pattern for
role-compile/subsystem-compile. Same approach, same precedent.
Bumped form-compile.ps1 v1.2→v1.3.
Verification:
- runner --filter form-compile (PS1): 0/10 → 10/10
- runner --filter form-compile --runtime python: 10/10 (dual-port clean)
- verify-snapshots --skill form-compile: surfaced from fully-masked
to 9/10 (only catalog-form still fails — real P2 XDTO issue, not
\$formatVersion)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When working with existing configs dumped from newer platforms (8.3.27+),
XML files use version="2.20" instead of "2.17". Skills now detect the
version from the nearest Configuration.xml walking up the directory tree,
falling back to "2.17" if not found. This prevents format version mismatch
errors during LoadConfigFromFiles.
Updated skills (11): meta-compile, form-compile, form-add, template-add,
cfe-borrow, epf-add-form, help-add, role-compile, subsystem-compile,
interface-edit. Also fixed form-validate to accept version 2.20.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
form-compile now warns when model uses runtime types like
FormDataStructure that don't exist in XML schema. Expanded cfg:
regex to cover all 25 known prefixes.
form-validate adds Check 12 — validates all <v8:Type> values:
ERROR for known-invalid types, WARN for unrecognized bare types,
pass-through for unknown namespaced types (future-proof).
Updated SKILL.md with full type reference and invalid type warning.
Updated docs/1c-form-spec.md with missing type groups.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Resolve-TypeStr/resolve_type_str to form-compile and form-edit (PS+PY)
that silently normalizes Russian type names (Строка→string, Число→decimal,
Булево→boolean, etc.), Number→decimal alias, and Russian reference prefixes
(СправочникСсылка→CatalogRef, etc.). Also accept + as composite type
separator alongside |. This makes form skills more forgiving when the model
uses meta-compile DSL conventions instead of form-specific ones.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without reconfiguring stderr, Cyrillic error messages appear garbled
on Windows (cp1251 default). Mirrors the existing stdout fix.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Python on Windows defaults to cp1251 for piped stdout, which cannot
handle Unicode box-drawing characters used in info/analysis output.
Added sys.stdout.reconfigure(encoding="utf-8") to all 59 Python scripts.
Tested on real config data: epf-init, epf-validate, cf-info, cf-validate,
meta-info, form-info, role-info, skd-info, subsystem-info — all passing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add cross-platform Python alternatives alongside existing PowerShell
scripts. PS1 remains the default runtime; Python is opt-in via switch
scripts. All parameters are identical between runtimes.
New files:
- 58 Python scripts in .claude/skills/*/scripts/*.py
- scripts/switch-to-python.py and switch-to-powershell.py
- docs/python-porting-guide.md
- __pycache__/ added to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- stdCommand dot syntax: "Товары.Add" → Form.Item.Товары.StandardCommand.Add
- Event name validation: warn on unknown events per element type (13 types, ~60 events)
- Form-level event validation (19 known events)
- Document events reference and popup element in SKILL.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
form-compile: warn about unknown DSL keys in element definitions,
document stdCommand/command button keys and EPF-specific notes.
form-validate: check that form-level Title uses multilingual XML,
not plain text (which causes XDTO errors at build time).
form-add: warn about duplicate element names, clarify after-not-found
message when using into+after together.
form-info: show Title in header instead of Properties line, display
commands as DSL-friendly format (-> Name [cmd], -> Close [std])
instead of raw Form.Command/Form.StandardCommand paths.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename DSL keys to match 1C property names (Visible, Enabled):
- form-compile/form-add: accept "visible": false and "enabled": false
as primary keys, keep hidden/disabled as synonyms
- form-info: output [visible:false] and [enabled:false] flags
- Update SKILL.md docs and form-guide.md
Improves round-trip consistency: form-info output now directly maps
to form-compile/form-add input keys.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
form-add: Scan column IDs (same pool as attribute IDs) to prevent
duplicate ID collisions. Use XPath .//*[@id] instead of ChildItems
recursion to capture companion element IDs (ExtendedTooltip, ContextMenu).
form-compile: Extract title from properties and route through Emit-MLText
instead of generic Emit-Properties, which produced plain text <Title>
rejected by 1C XDTO schema.
Found during E2E testing of full pipeline (epf-init → form-compile →
form-add → epf-build).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>