From d34ddd41ff745a174afb4efcf1160b51cb3b120c Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sat, 11 Apr 2026 18:00:12 +0300 Subject: [PATCH] fix(meta-compile): strip FillFrom/FillValue/DataHistory for non-Info register attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Custom attributes on AccumulationRegister, AccountingRegister and CalculationRegister do NOT support FillFromFillingValue, FillValue or DataHistory — platform logs "Неверное свойство объекта метаданных" and silently drops them. InformationRegister DOES support these properties (verified against erp_8.3.24 dump for both variants). Split the single "register" Emit-Attribute context into: - register-info → emits the three properties (InformationRegister) - register-other → skips them (Accum/Acc/Calc) Chart* context already handled by 3ba6072 remains as-is. Extended the exclusion list in Emit-Attribute to cover register-other symmetrically for FillFromFillingValue, FillValue and DataHistory. Updated snapshots: - accounting-register: removed the 3 bad lines on Содержание attribute - accumulation-register/calculation-register: added test attributes to exercise the register-other path and regenerate snapshots cleanly Closes the silent-rejection class #4 from upload/form-baseline/gotchas.md, now caught by verify-snapshots -StrictLog on the E2E platform load. Bumped meta-compile.ps1 + .py to v1.8. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../meta-compile/scripts/meta-compile.ps1 | 20 ++++++---- .../meta-compile/scripts/meta-compile.py | 17 +++++--- .../meta-compile/accumulation-register.json | 3 +- .../meta-compile/calculation-register.json | 3 +- .../AccountingRegisters/Хозрасчетный.xml | 3 -- .../AccumulationRegisters/ОстаткиТоваров.xml | 40 +++++++++++++++++++ .../CalculationRegisters/Начисления.xml | 40 +++++++++++++++++++ 7 files changed, 107 insertions(+), 19 deletions(-) diff --git a/.claude/skills/meta-compile/scripts/meta-compile.ps1 b/.claude/skills/meta-compile/scripts/meta-compile.ps1 index 02298d5a..200e5a96 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.ps1 +++ b/.claude/skills/meta-compile/scripts/meta-compile.ps1 @@ -1,4 +1,4 @@ -# meta-compile v1.7 — Compile 1C metadata object from JSON +# meta-compile v1.8 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -789,13 +789,14 @@ function Emit-Attribute { X "$indent`t`t" X "$indent`t`t" - # FillFromFillingValue — not for tabular/processor/chart (Chart* types don't support these) - if ($context -notin @("tabular", "processor", "chart")) { + # FillFromFillingValue — not for tabular/processor/chart/register-other + # (Chart*, AccumulationRegister/AccountingRegister/CalculationRegister don't support these) + if ($context -notin @("tabular", "processor", "chart", "register-other")) { X "$indent`t`tfalse" } - # FillValue — not for tabular/processor/chart - if ($context -notin @("tabular", "processor", "chart")) { + # FillValue — same restriction + if ($context -notin @("tabular", "processor", "chart", "register-other")) { Emit-FillValue "$indent`t`t" $typeStr } @@ -828,8 +829,8 @@ function Emit-Attribute { X "$indent`t`t$indexing" X "$indent`t`tUse" - # DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes) - if ($context -ne "chart") { + # DataHistory — not for Chart* types and non-InformationRegister register family + if ($context -notin @("chart", "register-other")) { X "$indent`t`tUse" } } @@ -2732,8 +2733,11 @@ if ($objType -in @("InformationRegister","AccumulationRegister","AccountingRegis foreach ($d in $dims) { Emit-Dimension "`t`t`t" $d $objType } + # InformationRegister.Attribute supports FillFromFillingValue/FillValue/DataHistory; + # AccumulationRegister/AccountingRegister/CalculationRegister.Attribute do NOT. + $regCtx = if ($objType -eq "InformationRegister") { "register-info" } else { "register-other" } foreach ($a in $regAttrs) { - Emit-Attribute "`t`t`t" $a "register" + Emit-Attribute "`t`t`t" $a $regCtx } X "`t`t" } else { diff --git a/.claude/skills/meta-compile/scripts/meta-compile.py b/.claude/skills/meta-compile/scripts/meta-compile.py index 9589efc8..bade38a8 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.py +++ b/.claude/skills/meta-compile/scripts/meta-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# meta-compile v1.7 — Compile 1C metadata object from JSON +# meta-compile v1.8 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -747,9 +747,11 @@ def emit_attribute(indent, parsed, context): X(f'{indent}\t\tfalse') X(f'{indent}\t\t') X(f'{indent}\t\t') - if context not in ('tabular', 'processor', 'chart'): + # FillFromFillingValue / FillValue — not for tabular/processor/chart/register-other + # (Chart*, AccumulationRegister/AccountingRegister/CalculationRegister don't support these) + if context not in ('tabular', 'processor', 'chart', 'register-other'): X(f'{indent}\t\tfalse') - if context not in ('tabular', 'processor', 'chart'): + if context not in ('tabular', 'processor', 'chart', 'register-other'): emit_fill_value(f'{indent}\t\t', type_str) fill_checking = 'DontCheck' if 'req' in parsed.get('flags', []): @@ -777,8 +779,8 @@ def emit_attribute(indent, parsed, context): indexing = parsed['indexing'] X(f'{indent}\t\t{indexing}') X(f'{indent}\t\tUse') - # DataHistory — not for Chart* types (ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes) - if context != 'chart': + # DataHistory — not for Chart* types and non-InformationRegister register family + if context not in ('chart', 'register-other'): X(f'{indent}\t\tUse') X(f'{indent}\t') X(f'{indent}') @@ -2385,8 +2387,11 @@ if obj_type in ('InformationRegister', 'AccumulationRegister', 'AccountingRegist emit_resource('\t\t\t', r, obj_type) for d in dims: emit_dimension('\t\t\t', d, obj_type) + # InformationRegister.Attribute supports FillFromFillingValue/FillValue/DataHistory; + # AccumulationRegister/AccountingRegister/CalculationRegister.Attribute do NOT. + reg_ctx = 'register-info' if obj_type == 'InformationRegister' else 'register-other' for a in reg_attrs: - emit_attribute('\t\t\t', a, 'register') + emit_attribute('\t\t\t', a, reg_ctx) X('\t\t') else: X('\t\t') diff --git a/tests/skills/cases/meta-compile/accumulation-register.json b/tests/skills/cases/meta-compile/accumulation-register.json index ead3e88f..e06dff52 100644 --- a/tests/skills/cases/meta-compile/accumulation-register.json +++ b/tests/skills/cases/meta-compile/accumulation-register.json @@ -5,7 +5,8 @@ "name": "ОстаткиТоваров", "registerType": "Balance", "dimensions": ["Номенклатура: CatalogRef.Номенклатура", "Склад: CatalogRef.Склады"], - "resources": ["Количество: Number(15,3)"] + "resources": ["Количество: Number(15,3)"], + "attributes": ["Комментарий: String(200)"] }, "validatePath": "AccumulationRegisters/ОстаткиТоваров", "expect": { diff --git a/tests/skills/cases/meta-compile/calculation-register.json b/tests/skills/cases/meta-compile/calculation-register.json index bc7b37ad..a51b2132 100644 --- a/tests/skills/cases/meta-compile/calculation-register.json +++ b/tests/skills/cases/meta-compile/calculation-register.json @@ -6,7 +6,8 @@ "chartOfCalculationTypes": "ChartOfCalculationTypes.ВидыНачислений", "periodicity": "Month", "dimensions": ["Сотрудник: CatalogRef.Сотрудники"], - "resources": ["Результат: Number(15,2)", "ОтработаноДней: Number(5,0)"] + "resources": ["Результат: Number(15,2)", "ОтработаноДней: Number(5,0)"], + "attributes": ["Комментарий: String(200)"] }, "validatePath": "CalculationRegisters/Начисления", "expect": { diff --git a/tests/skills/cases/meta-compile/snapshots/accounting-register/AccountingRegisters/Хозрасчетный.xml b/tests/skills/cases/meta-compile/snapshots/accounting-register/AccountingRegisters/Хозрасчетный.xml index 3eb1c72a..81c294a9 100644 --- a/tests/skills/cases/meta-compile/snapshots/accounting-register/AccountingRegisters/Хозрасчетный.xml +++ b/tests/skills/cases/meta-compile/snapshots/accounting-register/AccountingRegisters/Хозрасчетный.xml @@ -288,8 +288,6 @@ false - false - DontCheck Items @@ -301,7 +299,6 @@ Auto DontIndex Use - Use diff --git a/tests/skills/cases/meta-compile/snapshots/accumulation-register/AccumulationRegisters/ОстаткиТоваров.xml b/tests/skills/cases/meta-compile/snapshots/accumulation-register/AccumulationRegisters/ОстаткиТоваров.xml index a256b156..ca8e7b23 100644 --- a/tests/skills/cases/meta-compile/snapshots/accumulation-register/AccumulationRegisters/ОстаткиТоваров.xml +++ b/tests/skills/cases/meta-compile/snapshots/accumulation-register/AccumulationRegisters/ОстаткиТоваров.xml @@ -271,6 +271,46 @@ true + + + Комментарий + + + ru + Комментарий + + + + + xs:string + + 200 + Variable + + + false + + + + false + + false + false + + + DontCheck + Items + + + Auto + Auto + + + Auto + DontIndex + Use + + diff --git a/tests/skills/cases/meta-compile/snapshots/calculation-register/CalculationRegisters/Начисления.xml b/tests/skills/cases/meta-compile/snapshots/calculation-register/CalculationRegisters/Начисления.xml index cee46588..da2c690f 100644 --- a/tests/skills/cases/meta-compile/snapshots/calculation-register/CalculationRegisters/Начисления.xml +++ b/tests/skills/cases/meta-compile/snapshots/calculation-register/CalculationRegisters/Начисления.xml @@ -330,6 +330,46 @@ Use + + + Комментарий + + + ru + Комментарий + + + + + xs:string + + 200 + Variable + + + false + + + + false + + false + false + + + DontCheck + Items + + + Auto + Auto + + + Auto + DontIndex + Use + +