mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-04 01:00:52 +03:00
test(subsystem-compile): cover bottom-up -Parent flow; hide children shortcut
The bottom-up flow (compile child with -Parent pointing at parent's XML — skill creates the real child file AND registers it in parent's ChildObjects) has been the documented canonical way to build nested subsystems since forever. It's in SKILL.md Примеры:58 and implemented in subsystem-compile.ps1:430-506. But zero test cases exercised it — all 7 pre-existing cases used the top-down `children: [...]` shortcut thataa93031made honest with stubs. Two problems with the status quo: 1. A model reading SKILL.md saw `"children": ["ДочерняяА", "ДочерняяБ"]` right in the main JSON-definition example and took it as the canonical way to create nested structure. It's a trap — the shortcut creates placeholder stubs with empty Synonym/Content that the model almost never actually wants. The natural flow (one subsystem-compile call per real subsystem) wasn't visible where the model looks first. 2. The canonical flow had no test safety net — nothing caught regressions in the register-in-parent code path (lines 430-506). Fix, minimal surface: - SKILL.md: remove `"children": [...]` from the JSON-definition example. Leave the `-Parent` example in the Примеры section (already there). The children field stays fully supported in the scripts (aa93031stub behavior unchanged) for legacy JSON — just not advertised. - New test case `nested-parent.json`: preRun compiles "Продажи" parent, main run compiles "Настройки" child with `-Parent Subsystems/Продажи.xml`. Verifies the real bottom-up flow: snapshot shows full child file with real Synonym/Explanation AND parent's `<ChildObjects>` updated to reference the child. verify-snapshots confirms platform accepts it. - Runner plumbing: `_skill.json` gains `{ "flag": "-Parent", "from": "workPath", "field": "parent", "optional": true }`. Required extending both `tests/skills/runner.mjs` and `tests/skills/verify-snapshots.mjs` (they each have their own copy of buildArgs) to support `optional: true` on workPath mappings — otherwise existing cases without params.parent would get the flag pushed with an empty value. Verification: - runner --filter subsystem-compile (PS1): 8/8 (was 7/7 +1) - runner --filter subsystem-compile --runtime python: 8/8 (dual-port clean) - verify-snapshots --skill subsystem-compile: 8/8 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
dc4ffa1fc8
commit
7a8f437e77
@@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<Language uuid="UUID-001">
|
||||
<Properties>
|
||||
<Name>Русский</Name>
|
||||
<Synonym>
|
||||
<v8:item>
|
||||
<v8:lang>ru</v8:lang>
|
||||
<v8:content>Русский</v8:content>
|
||||
</v8:item>
|
||||
</Synonym>
|
||||
<Comment/>
|
||||
<LanguageCode>ru</LanguageCode>
|
||||
</Properties>
|
||||
</Language>
|
||||
</MetaDataObject>
|
||||
Reference in New Issue
Block a user