fix(meta-compile): fix String/Number length loss, RegisterRecords format, CommonModule prefix

- Parse-AttributeShorthand: combine type + length/precision from separate
  JSON fields (String→String(N), Number→Number(D,F)) — fixes SDBL error
  "Строка без спецификации длины недопустима"
- Constant valueType: same length combination fix
- DefinedType: accept both valueType (singular) and valueTypes (plural)
- ChartOfCharacteristicTypes: default String length 0→100
- Document RegisterRecords: <xr:Record> → <xr:Item xsi:type="xr:MDObjectRef">
- ScheduledJob.MethodName, EventSubscription.Handler: auto-prepend CommonModule. prefix
- meta-validate check 13: support 3-part method format (CommonModule.Module.Proc)

E2E verified: 18 types (21 objects) pass cf-init → meta-compile → LoadConfigFromFiles → UpdateDBCfg

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-08 11:05:29 +03:00
parent 87dc18b120
commit dbb39b7a3e
4 changed files with 88 additions and 16 deletions
@@ -1181,12 +1181,20 @@ if ($propsNode -and $mdType -in @("EventSubscription","ScheduledJob") -and $scri
if ($methodRef) {
$parts = $methodRef.Split('.')
if ($parts.Count -ne 2) {
Report-Error "13. ${mdType}.${propLabel} = '$methodRef': expected format 'CommonModuleName.ProcedureName'"
$check13Ok = $false
} else {
# Format: CommonModule.ModuleName.ProcedureName (3 parts) or ModuleName.ProcedureName (2 parts, legacy)
if ($parts.Count -eq 3 -and $parts[0] -eq "CommonModule") {
$cmName = $parts[1]
$procName = $parts[2]
} elseif ($parts.Count -eq 2) {
$cmName = $parts[0]
$procName = $parts[1]
} else {
Report-Error "13. ${mdType}.${propLabel} = '$methodRef': expected format 'CommonModule.ModuleName.ProcedureName'"
$check13Ok = $false
$cmName = $null
$procName = $null
}
if ($cmName) {
$cmXml = Join-Path (Join-Path $script:configDir "CommonModules") "$cmName.xml"
if (-not (Test-Path $cmXml)) {
Report-Error "13. ${mdType}.${propLabel}: CommonModule '$cmName' not found (expected $cmXml)"
@@ -1106,12 +1106,19 @@ if props_node is not None and md_type in ("EventSubscription", "ScheduledJob") a
if method_ref:
parts = method_ref.split(".")
if len(parts) != 2:
report_error(f"13. {md_type}.{prop_label} = '{method_ref}': expected format 'CommonModuleName.ProcedureName'")
check13_ok = False
else:
# Format: CommonModule.ModuleName.ProcedureName (3 parts) or ModuleName.ProcedureName (2 parts, legacy)
if len(parts) == 3 and parts[0] == "CommonModule":
cm_name = parts[1]
proc_name = parts[2]
elif len(parts) == 2:
cm_name = parts[0]
proc_name = parts[1]
else:
report_error(f"13. {md_type}.{prop_label} = '{method_ref}': expected format 'CommonModule.ModuleName.ProcedureName'")
check13_ok = False
cm_name = None
proc_name = None
if cm_name:
cm_xml = os.path.join(config_dir, "CommonModules", f"{cm_name}.xml")
if not os.path.exists(cm_xml):
report_error(f"13. {md_type}.{prop_label}: CommonModule '{cm_name}' not found (expected {cm_xml})")