Приводим авторский контент (.ps1/.psm1/.py/.mjs/.md/.json, пин .bsl)
к единому LF и закрепляем политикой в .gitattributes. Инструмент правки
всегда пишет LF, поэтому единый LF убирает EOL-шум в диффах, ложные
срабатывания blame и налог на ручную синхронизацию CRLF-файлов.
BOM на .ps1 сохранён (git с eol=lf меняет только CR<->LF, BOM не трогает).
Данные 1С (*.xml) и бинарники под нормализацию не берём.
Гейт: PS-порт 459/459, Python-порт 459/459, web-test E2E 22/22 (с пересборкой стенда).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
На формах со сложными табличными частями (напр. Document.РеализацияТоваровУслуг)
строгий импорт ibcmd падал «Неверный путь к данным» по двум причинам (Designer
/LoadConfigFromFiles это пропускал). Оба корня выверены эталоном Конфигуратора.
1. Глубокие пути через ТЧ: Объект.<ТЧ>.<Колонка>.<Подреквизит>
(Объект.Товары.Номенклатура.ТипНоменклатуры). Сборщик терял 3-й сегмент, а
обработка вообще исключала ТЧ-корни → каталог колонки заимствовался пустой
оболочкой без под-реквизитов. Теперь сборщик хранит SubSubAttr, а общий helper
Borrow-DeepTargetAttrs/borrow_deep_target_attrs заимствует каталог колонки с
под-реквизитами (как Designer: Catalog.Номенклатура с ТипНоменклатуры/ЕдиницаИзмерения).
2. Тоталы колонок: Объект.<ТЧ>.Total<Колонка> → «тип колонки не определён». Колонка
типизирована через DefinedType, а DefinedType заимствовался оболочкой без <Type>.
Теперь Read-SourceObject добывает <Type> DefinedType, Build-BorrowedObjectXml его
эмитит (Designer кладёт полный <Type>, напр. xs:decimal Nonnegative).
Регресс cfe-borrow 6/6 + form-bindings на обоих рантаймах; acc-форма без изменений.
Паритет PS↔PY.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
При заимствовании форм из конфигураций старого формата (напр. УТ, весь конфиг 2.13)
расширение получалось разноверсийным: cfe-init хардкодил version="2.17", а cfe-borrow
писал layout-форму версией исходника (2.13). Платформа на строгом импорте
(ibcmd config import --extension) отвергала: «версия формата файла отличается»
(Designer /LoadConfigFromFiles это пропускал — он лояльнее).
Эталон Конфигуратора подтверждает: расширение должно быть ЕДИНОЙ формат-версии,
а заимствованная форма поднимается до версии корня расширения.
- cfe-init: формат-версия MDClasses теперь читается из базового Configuration.xml
(root @version, дефолт 2.17), а не хардкодится. Формат-версия НЕ функция
CompatibilityMode (УТ: Compat 8_3_17 + формат 2.13). Переиспользует паттерн
Detect-FormatVersion, уже принятый в form-*/meta-*/role-*/subsystem-* навыках.
- cfe-borrow: layout-форма (<Form>/<BaseForm>) пишется версией расширения
($script:formatVersion / format_version), а не версией исходной формы.
Итог: всё расширение единой версией базы. E2E на свежей УТ-базе (2.13): borrow →
ibcmd import чисто, PS и PY. acc (2.17) без изменений. cfe-init/cfe-borrow 6/6 ×2 рантайма.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Повторный borrow формы записывал пустой Module.bsl безусловно → терялся
пользовательский код, добавленный в модуль формы (аналог IngvarConsulting/unica#4,
воспроизведено: 150→3 байта). Теперь пустой модуль создаётся только если файла ещё
нет; существующий сохраняется ("Preserved existing Module.bsl"). Дополняет
идемпотентность re-borrow (форма-обёртка/uuid уже были закрыты в v1.5).
Тест form-bindings усилен: между первым и вторым заимствованием в модуль пишется
код (writeFile), idempotent:true теперь проверяет его сохранность побайтно.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Три доработки по форме, полезные модели, использующей навыки.
form-validate v1.7→v1.8 (5a): Check 5 генерализован с одного <DataPath> на все
8 тегов-привязок (DataPath/TitleDataPath/FooterDataPath/HeaderDataPath/
MultipleValue*DataPath/RowPicture*). Висячая привязка (корень не в <Attributes>)
теперь ловится при validate, а не всплывает на дорогом db-load. Skip-правила
(companion-элементы, базовые элементы id<1000000 в BaseForm, opaque-формы)
сохранены без изменений. Заодно фикс бага Check 12 в py-порте
(type_invalid → type_error_count, краш на невалидном cfg:-типе в config-контексте).
cfe-borrow v1.4→v1.5:
- #4: borrow_form переиспользует uuid обёртки Forms/<Name>.xml, если файл уже
существует, вместо генерации нового → повторное заимствование формы
байт-идемпотентно (агент может ретраить без дрейфа identity).
- #1: collect для -BorrowMainAttribute дополнен сканом <Field>Объект.X</Field>
(поля фильтров/условного оформления/динсписков) — набор заимствованных
реквизитов теперь совпадает с Конфигуратором (добавился УдалитьЮрФизЛицо).
Тесты: form-validate/dangling-binding (фикстура broken-dangling-binding,
expectError+stdoutContains); cfe-borrow/form-bindings + idempotent:true.
Регресс 6/6 cfe-borrow + 11/11 form-validate на обоих рантаймах, E2E-load OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
При заимствовании управляемой формы в расширение скрипт генерировал Form.xml,
который платформа отвергала при загрузке («Неверный путь к данным»), а повторное
заимствование портило объект. Три бага (подтверждены E2E-загрузкой в базу):
1. Висячие привязки. Stripping вырезал только DataPath/TitleDataPath/RowPictureDataPath,
но не FooterDataPath/HeaderDataPath/MultipleValue*DataPath. Поле с множественным
выбором (МеткиОбъекта) оставляло висячую привязку на незаимствованный реквизит.
Введён единый список binding-тегов (выведен по дампам acc/erp/unf, сверен с
form-compile) + helper Strip-FormBindings/strip_form_bindings; сборщик путей для
-BorrowMainAttribute расширен на тот же список.
2. Повторное заимствование дублировало реквизиты (нет дедупа против ChildObjects).
3. Повторный enrich дописывал свойства объекта (DescriptionLength и т.п.) внутрь
каждого <Attribute> (глобальная замена по </ExtendedConfigurationObject>).
Фикс: guard + якорь к Properties объекта (count=1).
Попутно исправлен PS↔PY паритет form-borrow: PY энтити-кодировал кириллицу в
атрибутах самозакрытых элементов (decode_numeric_entities), порядок extraProps
в PS приведён к PY ([ordered]@{}).
Регресс-кейс tests/skills/cases/cfe-borrow/form-bindings.json (form-compile →
двойной borrow → snapshot/normalizeUuids). Регресс 6/6 PS+PY, cfe-validate OK,
E2E-загрузка в базу успешна на обоих рантаймах.
Co-Authored-By: Claude Opus 4.8 (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>
When adding a new attribute to a borrowed form, -BorrowMainAttribute
borrows the form's main attribute ("Объект") and all referenced object
attributes, tabular sections, and their transitive type dependencies.
Two modes: Form (default — only attributes referenced by form DataPath)
and All (all object attributes). Deep paths like Объект.A.B are resolved
transitively. Already-borrowed objects are not overwritten.
Also fixed: CommonPicture auto-borrow from AutoCommandBar, form-attribute
DataPath stripping (keep only Объект.* paths).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ERP catalog forms (e.g. Номенклатура.ФормаЭлемента) have buttons inside
AutoCommandBar with <DataPath>Объект.Ref</DataPath> — causes "Неверный
путь к данным" on load. DataPath was only stripped from form-level
ChildItems but not from AutoCommandBar.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ФормаСписка (list forms) contain elements invalid in extensions:
- <CommandSet><ExcludedCommand>Create</ExcludedCommand></CommandSet> at form root
- <ExcludedCommand> in nested AutoCommandBars within ChildItems
- <RowPictureDataPath> in table elements (e.g. Список.СостояниеДокумента)
All three cause "Неверное имя команды элемента формы" on load.
Verified against Configurator reference dump (ref-ext-dump-6).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- cfe-borrow: keep AutoCommandBar ChildItems (buttons) with CommandName=0
instead of stripping them — Configurator expects buttons to be present
- form-edit: insert Events section after AutoCommandBar, not before —
matches Configurator's element ordering
- cfe-patch-method(py): fix \r\r\n double line endings by using
newline="" in open() calls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
read_source_object returns keys with capital letters (Uuid, Properties),
but auto-borrow sections for CommonPicture, StyleItem, and Enum used
lowercase. E2E tested: Python port loads into BP_DEMO successfully.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Borrow-Form now generates full ChildItems tree (matching Configurator output)
with stripping of DataPath, TitleDataPath, TypeLink, Events, CommandName→0.
Auto-borrows CommonPictures, StyleItems, and Enums+EnumValues referenced by
form elements. Verified loading into BP database with two production forms.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configurator generates borrowed forms with only properties + AutoCommandBar +
empty Attributes — no ChildItems. ChildItems appear only when modifications are
added via form-edit. Copying full ChildItems caused XDTO errors on complex forms
due to unresolvable references (CommonPicture, StyleItem, xr: namespace elements).
Changes:
- Remove ChildItems extraction and output from Borrow-Form
- Strip ChildItems from AutoCommandBar (keep only Autofill property)
- Both main and BaseForm sections now contain only properties + minimal AutoCommandBar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Borrowed forms failed to load with "Неверный путь к данным" and "Событие не было загружено"
errors. Root cause: base form elements contained DataPath and Events referencing attributes
and handlers not present in the extension.
Changes:
- Strip <DataPath> from base elements in both AutoCommandBar and ChildItems
- Strip element-level <Events> from both sections
- Collect form-level properties (AutoTitle, WindowOpeningMode, etc.) and write them
into both main and BaseForm sections
- Update 1c-extension-spec.md with rules 5-7
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>
1. meta-compile + cfe-borrow: add Manager GeneratedType for Report/DataProcessor
2. cfe-borrow: rewrite Form.xml generation — extract only visual elements
(AutoCommandBar + ChildItems), replace CommandName→0, strip Attributes/Events/Parameters
3. cfe-init: add -ConfigPath to auto-resolve Language UUID and CompatibilityMode
4. form-add: guard against overwriting existing Form.xml and Module.bsl
5. docs: update GeneratedType table for Report/DataProcessor
6. docs: rewrite section 5.4.2 with accurate borrowed form structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cfe-borrow silently resolves Russian type names (Справочник→Catalog, etc.)
as a fallback when the model uses the wrong type prefix. cfe-diff description
updated with better trigger words for agent discovery.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>