Commit Graph
19 Commits
Author SHA1 Message Date
Nick ShirokovandClaude Opus 4.8 26888a07d5 chore(repo): нормализация EOL к LF + .gitattributes
Приводим авторский контент (.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>
2026-06-24 14:22:45 +03:00
Nick ShirokovandClaude Opus 4.8 8e9f9465b6 fix(cfe-borrow): глубокие пути через ТЧ + DefinedType-тоталы при заимствовании формы
На формах со сложными табличными частями (напр. 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>
2026-06-23 17:50:14 +03:00
Nick ShirokovandClaude Opus 4.8 330f52c6e6 fix(cfe-init,cfe-borrow): наследовать формат-версию MDClasses от базовой конфигурации
При заимствовании форм из конфигураций старого формата (напр. УТ, весь конфиг 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>
2026-06-23 16:28:48 +03:00
Nick ShirokovandClaude Opus 4.8 0dc014dc47 fix(cfe-borrow): не затирать существующий Module.bsl при повторном заимствовании формы
Повторный 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>
2026-06-23 12:57:41 +03:00
Nick ShirokovandClaude Opus 4.8 36c2fd9233 feat(form-validate,cfe-borrow): проверка висячих привязок + идемпотентность re-borrow + добор по Field
Три доработки по форме, полезные модели, использующей навыки.

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>
2026-06-23 12:38:39 +03:00
Nick ShirokovandClaude Opus 4.8 4767800fce fix(cfe-borrow): корректное заимствование формы — все привязки данных + идемпотентность
При заимствовании управляемой формы в расширение скрипт генерировал 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>
2026-06-22 22:54:13 +03:00
Nick ShirokovandClaude Opus 4.6 d155086444 feat(skills): auto-detect XML format version from Configuration.xml
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>
2026-04-06 15:41:53 +03:00
Nick ShirokovandClaude Opus 4.6 f7695a9534 feat(cfe-borrow): add -BorrowMainAttribute for borrowing object attributes with form
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>
2026-03-25 19:56:26 +03:00
Nick ShirokovandClaude Opus 4.6 de7e943de1 fix(cfe-borrow): strip DataPath from AutoCommandBar buttons in borrowed forms
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>
2026-03-11 09:49:50 +03:00
Nick ShirokovandClaude Opus 4.6 7abe26afee fix(cfe-borrow): strip CommandSet, ExcludedCommand and RowPictureDataPath from borrowed forms
ФормаСписка (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>
2026-03-10 22:05:33 +03:00
Nick ShirokovandClaude Opus 4.6 84d078bd05 fix(cfe-borrow,form-edit,cfe-patch-method): fix borrowed form structure to match Configurator
- 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>
2026-03-10 21:40:16 +03:00
Nick ShirokovandClaude Opus 4.6 6df64ae1c1 feat(cfe-borrow): full ChildItems form borrowing with auto-borrow dependencies
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>
2026-03-10 20:18:12 +03:00
Nick ShirokovandClaude Opus 4.6 cf5eae6428 fix(cfe-borrow): generate minimal Form.xml without ChildItems for borrowed forms
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>
2026-03-10 19:19:35 +03:00
Nick ShirokovandClaude Opus 4.6 c72f2210b5 fix(cfe-borrow): strip DataPath, Events and preserve form properties in Borrow-Form
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>
2026-03-10 19:12:24 +03:00
Nick ShirokovandClaude Opus 4.6 6f32e18e37 improve(skills): auto-resolve ConfigPath, auto-register forms, handle LF line endings
- cfe-init, cfe-borrow SKILL.md: auto-resolve ConfigPath from .v8-project.json configSrc
- form-compile: auto-register <Form> in parent ChildObjects from OutputPath convention
- form-compile SKILL.md: document new workflow (form-add no longer required first)
- cfe-borrow: handle LF line endings in OuterXml split (-split "\r?\n")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:22:05 +03:00
Nick ShirokovandClaude Opus 4.6 3565e1c97f fix(cfe): 6 fixes from E2E test — Manager types, borrowed form structure, ConfigPath, guard checks
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>
2026-02-21 16:39:27 +03:00
Nick ShirokovandClaude Opus 4.6 28b967f591 feat(cfe,form): add borrowed form support across 6 skills
- cfe-borrow: borrow forms via Type.Name.Form.FormName, auto-borrow parent,
  generate Form.xml with BaseForm + metadata + empty Module.bsl
- form-edit: formEvents, elementEvents, callType on events/commands,
  auto-detect extension mode (IDs 1000000+)
- form-info: [EXTENSION] marker, callType on events/commands, BaseForm footer
- form-validate: callType value checks, extension ID range warnings,
  BaseForm presence, callType-without-BaseForm detection
- cfe-diff: form-level analysis in Mode A — borrowed/own forms,
  callType interceptors on events and commands
- cfe-patch-method: warn if Form.xml missing for .Form. paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:59:16 +03:00
Nick ShirokovandClaude Opus 4.6 329d94dc55 feat(cfe): add Russian type synonyms to cfe-borrow, improve cfe-diff description
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>
2026-02-16 18:50:13 +03:00
Nick Shirokov b8e3107d14 feat(cfe): add configuration extension skills
Add 5 new skills for 1C configuration extensions (CFE):
- cfe-init: create extension scaffold with Configuration.xml, Languages, Roles
- cfe-borrow: borrow objects from configuration with ObjectBelonging=Adopted
- cfe-patch-method: generate &Перед, &После, &ИзменениеИКонтроль decorators
- cfe-validate: validate extension structure with 9 checks
- cfe-diff: analyze extension and check transfer status

Remove ConfigDumpInfo.xml from cf-init scaffold as it's not required
for 1C configuration source files. Add cfe-guide documentation.
2026-02-15 16:13:55 +03:00