fix(meta-edit): modify-property Type — структурный дескриптор типа, guard от порчи

Корневой modify-property Type у ПВХ/Константы расплющивал структурный <Type>
(<v8:Type> + квалификаторы) в скалярный текст, а meta-validate это пропускал.

meta-edit (v1.21): modify-property Type перестраивает дескриптор через готовый
build_value_type_xml (составной тип, квалификаторы, ref-типы); прочие структурные
свойства с дочерними узлами → ошибка до записи файла вместо тихой порчи.

meta-validate (v1.10): корневой <Type> со скалярным текстом без <v8:Type>/<v8:TypeSet>
теперь ошибка (был false negative).

Порты PS1/PY синхронны. Регрессионные кейсы: modify-property-type-pvh (структурный
Type + ref), error-scalar-root-type (детект порчи).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-07-19 15:47:59 +03:00
co-authored by Claude Opus 4.8
parent 6318018bc1
commit fbdf07e18a
15 changed files with 691 additions and 4 deletions
@@ -0,0 +1,6 @@
{
"name": "Валидатор ловит повреждённый корневой <Type> (скалярный текст без структуры, issue #42)",
"setup": "fixture:pvh-scalar-type",
"params": { "objectPath": "ChartsOfCharacteristicTypes/СкалярныйТипПВХ.xml" },
"expectError": true
}
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.17">
<ChartOfCharacteristicTypes uuid="0ad269d9-b659-4fb5-802e-e1b74a98dddf">
<InternalInfo>
<xr:GeneratedType name="ChartOfCharacteristicTypesObject.ТестовыйПВХ" category="Object">
<xr:TypeId>d9fee16f-9c75-4c72-a0ef-fa8258ebadfb</xr:TypeId>
<xr:ValueId>0c1d551b-5478-4938-8529-48bb5c723883</xr:ValueId>
</xr:GeneratedType>
<xr:GeneratedType name="ChartOfCharacteristicTypesRef.ТестовыйПВХ" category="Ref">
<xr:TypeId>4ce215dc-abc7-4092-bc93-d48f47df6509</xr:TypeId>
<xr:ValueId>9d118097-1ab2-4fd0-9ddd-33e4f6137cf0</xr:ValueId>
</xr:GeneratedType>
<xr:GeneratedType name="ChartOfCharacteristicTypesSelection.ТестовыйПВХ" category="Selection">
<xr:TypeId>aee4f6a0-01f9-402a-afee-0b71735cc4e0</xr:TypeId>
<xr:ValueId>3d479bd4-f002-4a0b-8bb7-70607bafb7c5</xr:ValueId>
</xr:GeneratedType>
<xr:GeneratedType name="ChartOfCharacteristicTypesList.ТестовыйПВХ" category="List">
<xr:TypeId>42df357e-e764-4419-96e3-94b697a72fec</xr:TypeId>
<xr:ValueId>60fe9329-bac7-4f34-9a2c-5047036388f3</xr:ValueId>
</xr:GeneratedType>
<xr:GeneratedType name="Characteristic.ТестовыйПВХ" category="Characteristic">
<xr:TypeId>2bbf0425-ca48-4511-9929-f62a59efeab8</xr:TypeId>
<xr:ValueId>a8b0ad63-4778-45f0-a0fa-4910e172662b</xr:ValueId>
</xr:GeneratedType>
<xr:GeneratedType name="ChartOfCharacteristicTypesManager.ТестовыйПВХ" category="Manager">
<xr:TypeId>d756b551-d136-494f-a1c9-d3ab85cd138b</xr:TypeId>
<xr:ValueId>a4d7a754-af57-4ec8-800f-5f44876b9d4d</xr:ValueId>
</xr:GeneratedType>
</InternalInfo>
<Properties>
<Name>ТестовыйПВХ</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Тестовый ПВХ</v8:content>
</v8:item>
</Synonym>
<Comment/>
<UseStandardCommands>true</UseStandardCommands>
<IncludeHelpInContents>false</IncludeHelpInContents>
<CharacteristicExtValues/>
<Type>Boolean + String(20)</Type>
<Hierarchical>false</Hierarchical>
<FoldersOnTop>true</FoldersOnTop>
<CodeLength>9</CodeLength>
<CodeAllowedLength>Variable</CodeAllowedLength>
<DescriptionLength>100</DescriptionLength>
<CodeSeries>WholeCharacteristicKind</CodeSeries>
<CheckUnique>true</CheckUnique>
<Autonumbering>true</Autonumbering>
<DefaultPresentation>AsDescription</DefaultPresentation>
<Characteristics/>
<PredefinedDataUpdate>Auto</PredefinedDataUpdate>
<EditType>InDialog</EditType>
<QuickChoice>false</QuickChoice>
<ChoiceMode>BothWays</ChoiceMode>
<InputByString>
<xr:Field>ChartOfCharacteristicTypes.ТестовыйПВХ.StandardAttribute.Description</xr:Field>
<xr:Field>ChartOfCharacteristicTypes.ТестовыйПВХ.StandardAttribute.Code</xr:Field>
</InputByString>
<CreateOnInput>DontUse</CreateOnInput>
<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<DefaultObjectForm/>
<DefaultFolderForm/>
<DefaultListForm/>
<DefaultChoiceForm/>
<DefaultFolderChoiceForm/>
<AuxiliaryObjectForm/>
<AuxiliaryFolderForm/>
<AuxiliaryListForm/>
<AuxiliaryChoiceForm/>
<AuxiliaryFolderChoiceForm/>
<BasedOn/>
<DataLockFields/>
<DataLockControlMode>Managed</DataLockControlMode>
<FullTextSearch>Use</FullTextSearch>
<ObjectPresentation/>
<ExtendedObjectPresentation/>
<ListPresentation/>
<ExtendedListPresentation/>
<Explanation/>
<DataHistory>DontUse</DataHistory>
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
</Properties>
<ChildObjects/>
</ChartOfCharacteristicTypes>
</MetaDataObject>