fix(tests): экстракторы гарда пропускали копии — ложное «OK»

Разбор остатка по support-guard показал, что расхождения портов у *-info нет:
они читают тем же хелпером состояние поддержки для вывода, и фича есть в обоих
портах. Пропускал копии сам гард.

Два дефекта извлечения, оба давали ложное «OK», а не ложную тревогу:

1. PY: вложенные определения. Пять *-info объявляют is_external_root внутри
   другой функции; экстрактор искал только `^def` и перескакивал через тело
   внешней функции, так что вложенные для гарда не существовали.
2. PS1: однострочные функции. subsystem-info.ps1:18 — `function Out(...) { ... }`
   в одну строку; поиск закрывающей `}` на отдельной строке делал «телом» Out всё
   до следующей одиночной скобки, проглатывая следующую функцию.

После починки гард увидел 9 копий, которых не видел, — все совпали с эталонами.
Побочно вскрылось, что Report-OK в interface/subsystem/xdto-validate тоже был
невидим и потому не попал в прошлое сведение Report-*; теперь сведён.

Осталось расхождение имён: одно тело называлось _sg_is_external_root (17),
is_external_root (5 *-info) и _meta_is_external_root (meta-info). В PS1 имя было
единым изначально; PY сведён к _sg_is_external_root.

Реестр: 24 семьи, 319 копий (было 310), долг ноль.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-08-09 14:42:46 +03:00
co-authored by Claude Opus 5
parent 78ac3a8c36
commit 63e711905c
10 changed files with 50 additions and 30 deletions
@@ -353,7 +353,7 @@ def get_support_status_for_path(target_path):
except Exception:
pass
return None
def is_external_root(xml_path):
def _sg_is_external_root(xml_path):
if not os.path.isfile(xml_path):
return False
try:
@@ -367,14 +367,14 @@ def get_support_status_for_path(target_path):
rp = os.path.abspath(target_path)
# The target file itself may be the element meta-xml (e.g. Subsystems/X.xml).
elem_uuid = root_uuid(rp)
if is_external_root(rp):
if _sg_is_external_root(rp):
return None
bin_path = None
d = os.path.dirname(rp)
for _ in range(12):
if not d:
break
if is_external_root(d + ".xml"):
if _sg_is_external_root(d + ".xml"):
return None
if not elem_uuid:
elem_uuid = root_uuid(d + ".xml")
@@ -51,7 +51,8 @@ $script:output = New-Object System.Text.StringBuilder 8192
$script:allCommandNames = @()
function Out-Line([string]$msg) { $script:output.AppendLine($msg) | Out-Null }
function Report-OK([string]$msg) {
function Report-OK {
param([string]$msg)
$script:okCount++
if ($Detailed) { Out-Line "[OK] $msg" }
}
@@ -674,7 +674,7 @@ def get_ws_operations(child_objs):
# ── Support status of this object (Ext/ParentConfigurations.bin) ──
# See docs/1c-support-state-spec.md. Walks up to the config root, decodes the
# object's support rule. Never throws — degrades to "не на поддержке".
def _meta_is_external_root(xml_path):
def _sg_is_external_root(xml_path):
if not os.path.isfile(xml_path):
return False
try:
@@ -689,7 +689,7 @@ def _meta_is_external_root(xml_path):
def get_object_support_status(obj_uuid):
try:
if _meta_is_external_root(object_path):
if _sg_is_external_root(object_path):
return None
d = os.path.dirname(object_path)
bin_path = None
+3 -3
View File
@@ -321,7 +321,7 @@ def get_support_status_for_path(target_path):
except Exception:
pass
return None
def is_external_root(xml_path):
def _sg_is_external_root(xml_path):
if not os.path.isfile(xml_path):
return False
try:
@@ -335,14 +335,14 @@ def get_support_status_for_path(target_path):
rp = os.path.abspath(target_path)
# The target file itself may be the element meta-xml (e.g. Subsystems/X.xml).
elem_uuid = root_uuid(rp)
if is_external_root(rp):
if _sg_is_external_root(rp):
return None
bin_path = None
d = os.path.dirname(rp)
for _ in range(12):
if not d:
break
if is_external_root(d + ".xml"):
if _sg_is_external_root(d + ".xml"):
return None
if not elem_uuid:
elem_uuid = root_uuid(d + ".xml")
@@ -161,7 +161,7 @@ def get_support_status_for_path(target_path):
except Exception:
pass
return None
def is_external_root(xml_path):
def _sg_is_external_root(xml_path):
if not os.path.isfile(xml_path):
return False
try:
@@ -175,14 +175,14 @@ def get_support_status_for_path(target_path):
rp = os.path.abspath(target_path)
# The target file itself may be the element meta-xml (e.g. Subsystems/X.xml).
elem_uuid = root_uuid(rp)
if is_external_root(rp):
if _sg_is_external_root(rp):
return None
bin_path = None
d = os.path.dirname(rp)
for _ in range(12):
if not d:
break
if is_external_root(d + ".xml"):
if _sg_is_external_root(d + ".xml"):
return None
if not elem_uuid:
elem_uuid = root_uuid(d + ".xml")
+3 -3
View File
@@ -278,7 +278,7 @@ def get_support_status_for_path(target_path):
except Exception:
pass
return None
def is_external_root(xml_path):
def _sg_is_external_root(xml_path):
if not os.path.isfile(xml_path):
return False
try:
@@ -292,14 +292,14 @@ def get_support_status_for_path(target_path):
rp = os.path.abspath(target_path)
# The target file itself may be the element meta-xml (e.g. Subsystems/X.xml).
elem_uuid = root_uuid(rp)
if is_external_root(rp):
if _sg_is_external_root(rp):
return None
bin_path = None
d = os.path.dirname(rp)
for _ in range(12):
if not d:
break
if is_external_root(d + ".xml"):
if _sg_is_external_root(d + ".xml"):
return None
if not elem_uuid:
elem_uuid = root_uuid(d + ".xml")
@@ -150,7 +150,7 @@ def get_support_status_for_path(target_path):
except Exception:
pass
return None
def is_external_root(xml_path):
def _sg_is_external_root(xml_path):
if not os.path.isfile(xml_path):
return False
try:
@@ -164,14 +164,14 @@ def get_support_status_for_path(target_path):
rp = os.path.abspath(target_path)
# The target file itself may be the element meta-xml (e.g. Subsystems/X.xml).
elem_uuid = root_uuid(rp)
if is_external_root(rp):
if _sg_is_external_root(rp):
return None
bin_path = None
d = os.path.dirname(rp)
for _ in range(12):
if not d:
break
if is_external_root(d + ".xml"):
if _sg_is_external_root(d + ".xml"):
return None
if not elem_uuid:
elem_uuid = root_uuid(d + ".xml")
@@ -48,7 +48,8 @@ $script:okCount = 0
$script:output = New-Object System.Text.StringBuilder 8192
function Out-Line([string]$msg) { $script:output.AppendLine($msg) | Out-Null }
function Report-OK([string]$msg) {
function Report-OK {
param([string]$msg)
$script:okCount++
if ($Detailed) { Out-Line "[OK] $msg" }
}
@@ -43,7 +43,8 @@ $script:stopped = $false
$script:output = New-Object System.Text.StringBuilder
function Out-Line([string]$s) { [void]$script:output.AppendLine($s) }
function Report-OK([string]$msg) {
function Report-OK {
param([string]$msg)
$script:okCount++
if ($Detailed) { Out-Line "[OK] $msg" }
}