Commit Graph

453 Commits

Author SHA1 Message Date
Nick Shirokov 4855cd1e01 merge: fix borrowed form CommandSet/ExcludedCommand/RowPictureDataPath stripping 2026-03-10 22:06:05 +03:00
Nick Shirokov 7abe26afee fix(cfe-borrow): strip CommandSet, ExcludedCommand and RowPictureDataPath from borrowed forms
ФормаСписка (list forms) contain elements invalid in extensions:
- <CommandSet><ExcludedCommand>Create</ExcludedCommand></CommandSet> at form root
- <ExcludedCommand> in nested AutoCommandBars within ChildItems
- <RowPictureDataPath> in table elements (e.g. Список.СостояниеДокумента)

All three cause "Неверное имя команды элемента формы" on load.
Verified against Configurator reference dump (ref-ext-dump-6).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 22:05:33 +03:00
Nick Shirokov 512562ca50 Merge branch 'dev' 2026-03-10 21:42:52 +03:00
Nick Shirokov 84d078bd05 fix(cfe-borrow,form-edit,cfe-patch-method): fix borrowed form structure to match Configurator
- cfe-borrow: keep AutoCommandBar ChildItems (buttons) with CommandName=0
  instead of stripping them — Configurator expects buttons to be present
- form-edit: insert Events section after AutoCommandBar, not before —
  matches Configurator's element ordering
- cfe-patch-method(py): fix \r\r\n double line endings by using
  newline="" in open() calls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:40:16 +03:00
Nick Shirokov 8584021446 fix(cfe-validate): remove false DataPath/TitleDataPath check from Check 11
Configurator stores DataPath inside <BaseForm> as original form snapshot —
this is normal behavior, not an error. Removes false WARN on
Configurator-exported extensions like JR2433.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:00:20 +03:00
Nick Shirokov e7e6c885c7 feat(cfe-validate): add checks 10-13 for deep extension validation
Add sub-item validation (Attribute, TabularSection, EnumValue, Form),
borrowed form structure checks, form dependency analysis (CommonPicture,
StyleItem with platform whitelist, Enum DesignTimeRef), and TypeLink
validation. Fix DataPath false positive by scoping check to BaseForm
content only. Both PS1 and Python ports updated to v1.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:58:17 +03:00
Nick Shirokov b5a779bd5d fix(cfe-borrow): fix dict key casing in Python auto-borrow (Uuid/Properties)
read_source_object returns keys with capital letters (Uuid, Properties),
but auto-borrow sections for CommonPicture, StyleItem, and Enum used
lowercase. E2E tested: Python port loads into BP_DEMO successfully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:23:34 +03:00
Nick Shirokov 6df64ae1c1 feat(cfe-borrow): full ChildItems form borrowing with auto-borrow dependencies
Borrow-Form now generates full ChildItems tree (matching Configurator output)
with stripping of DataPath, TitleDataPath, TypeLink, Events, CommandName→0.
Auto-borrows CommonPictures, StyleItems, and Enums+EnumValues referenced by
form elements. Verified loading into BP database with two production forms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:18:12 +03:00
Nick Shirokov 007b4ec69c fix(cfe-borrow): mirror minimal Form.xml changes to Python port
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:20:36 +03:00
Nick Shirokov cf5eae6428 fix(cfe-borrow): generate minimal Form.xml without ChildItems for borrowed forms
Configurator generates borrowed forms with only properties + AutoCommandBar +
empty Attributes — no ChildItems. ChildItems appear only when modifications are
added via form-edit. Copying full ChildItems caused XDTO errors on complex forms
due to unresolvable references (CommonPicture, StyleItem, xr: namespace elements).

Changes:
- Remove ChildItems extraction and output from Borrow-Form
- Strip ChildItems from AutoCommandBar (keep only Autofill property)
- Both main and BaseForm sections now contain only properties + minimal AutoCommandBar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:19:35 +03:00
Nick Shirokov c72f2210b5 fix(cfe-borrow): strip DataPath, Events and preserve form properties in Borrow-Form
Borrowed forms failed to load with "Неверный путь к данным" and "Событие не было загружено"
errors. Root cause: base form elements contained DataPath and Events referencing attributes
and handlers not present in the extension.

Changes:
- Strip <DataPath> from base elements in both AutoCommandBar and ChildItems
- Strip element-level <Events> from both sections
- Collect form-level properties (AutoTitle, WindowOpeningMode, etc.) and write them
  into both main and BaseForm sections
- Update 1c-extension-spec.md with rules 5-7

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:12:24 +03:00
Nick Shirokov 06584c29b2 Merge branch 'dev' 2026-03-09 20:43:43 +03:00
Nick Shirokov d94ffdea99 fix(skd-compile): quote argument-hint to fix YAML frontmatter parsing
Value starting with `[` was interpreted as YAML flow sequence,
breaking frontmatter parsing and the input hint in UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:43:08 +03:00
Nick Shirokov 9f370dd499 docs(role-validate): remove misleading OutFile hint for Cyrillic paths
Cyrillic stdout works fine — the hint caused weak models to waste
an extra turn writing to file and reading it back.

Verified: all 9 validate skills pass on Haiku in 4 turns each.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:30:49 +03:00
Nick Shirokov 903f1f2750 docs(validate): remove redundant ## Использование from all SKILL.md
The section duplicated ## Команда examples in slash-command format that
the model never needs — it receives arguments directly. Second example
paths moved into ## Команда as additional command lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:25:00 +03:00
Nick Shirokov 29b124f3fd docs(validate): concrete examples in SKILL.md, remove auto-resolve notes
- Replace abstract <...> placeholders with concrete paths in ## Команда
- Replace abstract examples with concrete paths in ## Использование
- Remove авторезолв notes from meta/epf/cf/cfe-validate
- Clean up erf-validate: remove Вывод/Верификация/Когда использовать,
  add -Detailed parameter, unify format with other validators

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:17:12 +03:00
Nick Shirokov ffdee04a95 refactor(validate): auto-detect metadata in role-validate, clean up SKILL.md
role-validate: remove MetadataPath param, auto-detect from RightsPath
(Roles/Name/Ext/Rights.xml → Roles/Name.xml). Always validate metadata
when file exists (was 7 checks, now 10). Deduplicate path computation.

SKILL.md: remove redundant auto-resolve notes (placeholder already shows
directory path), fix role-validate examples, replace mxl-validate
ProcessorName/TemplateName with concrete path examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:07:16 +03:00
Nick Shirokov b2a2534b5a feat(validate): auto-resolve directory paths, fix SKILL.md placeholders
Scripts now accept directory paths (e.g. Forms/ИмяФормы) and auto-resolve
to the target XML file. Silent fallbacks handle missing Ext/ level and
descriptor-to-file resolution. SKILL.md: concrete placeholders, unified
quotes, auto-resolve notes, role-validate MaxErrors in params.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:41:38 +03:00
Nick Shirokov 422e397381 feat(validate): brief output by default, -Detailed for verbose
All 10 validation skills (meta, epf, skd, cf, cfe, form, mxl, role,
subsystem, interface) now output a single summary line on success:
=== Validation OK: Type.Name (N checks) ===

Errors/warnings always shown. Full per-check [OK] output behind -Detailed flag.
Removed all N/A check lines. Unified role-validate output format.
Trimmed SKILL.md files from 42-119 to 51-67 lines.
Version bumps: meta-validate v1.2, all others v1.1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:14:44 +03:00
Nick Shirokov 191706b984 Merge branch 'dev' 2026-03-09 15:02:10 +03:00
Nick Shirokov 93e4130ff2 docs(README): update switch.py examples, remove stale src/ line
- Add claude-code --project-dir example for embedded clone workflow
- Remove misleading src/ directory from quick start tree
- Add note about git pull + re-run for updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:01:02 +03:00
Nick Shirokov 3f091b209c feat(switch): support claude-code install, smart runtime warnings, .gitignore propagation
- switch.py v1.2: `claude-code --project-dir` now copies skills (was error before)
- Skip runtime conversion for single-runtime skills (e.g. img-grid stays python)
- Distinguish info ("Python-версия не предусмотрена") from real missing-file warnings
- Print .gitignore recommendations for target project on install
- Copy root-level .gitignore from skills dir during install
- Interactive mode asks project path for all platforms, not just claude-code
- Add .gitignore in skills root (__pycache__/) and web-test/ (node_modules, *.png, *.mp4)
- Sync root .gitignore with all 13 platforms from PLATFORMS registry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:58:49 +03:00
Nick Shirokov 5d4ee6c58c chore: add debug/ to .gitignore for skill eval artifacts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:06:32 +03:00
Nick Shirokov 86c8440531 merge dev: meta-compile v1.2, meta-edit v1.4, batch mode, validation improvements
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:46:52 +03:00
Nick Shirokov 42cc7acdbe chore: bump script versions (meta-compile v1.2, meta-edit v1.4)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:45:05 +03:00
Nick Shirokov 72a4015a8d fix(meta-compile,meta-edit): sync type handling and validation between scripts
meta-compile: bare Number→Number(10,0), ValueStorage→xs:base64Binary,
lowercase ref synonyms (catalogref, documentref, enumref).
meta-edit: bare String default 0→10, reserved attribute name warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:39:18 +03:00
Nick Shirokov 843916642c docs(meta-compile): restructure trigger — types in trigger, shorter description
Move type enumeration from description to trigger clause for better
skill discovery matching. Remove implementation details from description.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:09:53 +03:00
Nick Shirokov 84f3662c02 docs(meta-compile): add workflow steps, remove redundant verification section
Add explicit 4-step workflow (write JSON → run script → /meta-edit →
/meta-validate) to guide the model through the optimal path instead of
free exploration. Remove standalone "Верификация" section as it
duplicates workflow step 4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:53:57 +03:00
Nick Shirokov 4cdd3377ae docs(meta-compile): soften reference guidance, prevent XML hunting
- Replace imperative "read reference before compiling" with conditional
  "if you need properties not shown in examples"
- Add explicit instruction not to search for XML in config dumps
- Rename "справочник" → "reference-файл" to avoid confusion with
  Catalog metadata type

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:43:04 +03:00
Nick Shirokov 730daf1089 fix(meta-compile): default bare String to String(10), fix SKILL.md examples
Bare `String` type (without length qualifier) now defaults to String(10)
instead of String(0) — matching 1C Designer behavior. String(0) means
unlimited length (NTEXT in SQL), which is rarely intended.

Also fixes SKILL.md: removes misleading `"synonym": "авто"` from JSON
example, clarifies synonym auto-generation from CamelCase name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:18:29 +03:00
Nick Shirokov c0255c71d0 docs(meta-compile): slim down SKILL.md with pattern-based examples
Replace 12 type-specific examples with 5 DSL pattern examples
(minimal, attributes, tabularSections, register, batch).
Strengthen reference file instruction to "прочитай перед компиляцией".
203 → 121 lines. Tested on Opus and Sonnet — both pass e2e.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:45:01 +03:00
Nick Shirokov cf1cd1a711 docs(meta-compile): add progressive disclosure reference files
Replace monolithic docs/meta-dsl-spec.md link with 4 domain-specific
reference files inside the skill directory. Agent reads only the
relevant file when compiling a specific type, reducing context usage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:12:49 +03:00
Nick Shirokov 5a1974be4e fix(meta-compile): parse shorthand syntax for Task AddressingAttributes
AddressingAttribute was taking the entire shorthand string (e.g.
"Name: String(100)") as the attribute name instead of parsing it
through Parse-AttributeShorthand. This caused String type without
length qualifiers (NTEXT in SQL), making Index creation impossible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:47:38 +03:00
Nick Shirokov 589091510b feat(meta-compile): add batch mode — JSON array in single file
Support passing a JSON array of object definitions in a single file.
Each element is compiled independently via subprocess isolation
(Start-Process in PS1, subprocess.call in PY).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:21:32 +03:00
Nick Shirokov 19667caccb feat(meta-validate): add batch mode — pipe-separated paths
Accept multiple object paths via pipe separator (|) in -ObjectPath.
Each object is validated separately with individual results, followed
by a summary line: "Batch: N objects, X passed, Y failed".
Single-path mode unchanged. Version bumped to v1.1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:38:21 +03:00
Nick Shirokov 97fc6dbd7f refactor(meta-compile): extract Build-TypeStr helper for type+length combination
Unify inline type string building logic (type + length/precision → "String(100)",
"Number(10,2)") into a shared Build-TypeStr/build_type_str function. Used by both
Parse-AttributeShorthand and Emit-ConstantProperties. Fix: check valueType before
type to avoid treating metadata type name (e.g. "Constant") as data type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:13:46 +03:00
Nick Shirokov 49108f72dc docs(meta-dsl-spec): update to v2.1 — reflect e2e-verified fixes
- §4.2: document separate type+length/precision fields in object form
- §7.4 Constant: add length/precision fields
- §7.7 DefinedType: document valueType (singular) alias
- §7.9 ScheduledJob: document CommonModule. auto-prefix for methodName
- §7.10 EventSubscription: document CommonModule. auto-prefix for handler
- §7.13 ExchangePlan: remove codeType/autonumbering/checkUnique (not valid)
- §7.14 ChartOfCharacteristicTypes: default String length 0→100
- §7.20 BusinessProcess: add task to example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:18:52 +03:00
Nick Shirokov dbb39b7a3e 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>
2026-03-08 11:05:29 +03:00
Nick Shirokov 87dc18b120 feat(meta-validate): add method reference and DocumentJournal column checks
Check 13: validates EventSubscription.Handler and ScheduledJob.MethodName
reference format (CommonModuleName.ProcedureName), verifies CommonModule
exists and optionally checks BSL for exported procedure.

Check 14: validates DocumentJournal Column References are non-empty
(empty References causes LoadConfigFromFiles to fail).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:08:46 +03:00
Nick Shirokov ca328e3e8f feat(meta-validate): add cross-object register-registrar check
Detect configDir by walking up from object path to find
Configuration.xml. For AccumulationRegister, AccountingRegister,
CalculationRegister, and InformationRegister (RecorderSubordinate) scan
Documents/*.xml to verify at least one document references the register
in RegisterRecords. Warn if no registrar found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:00:37 +03:00
Nick Shirokov c2b90a97ef feat(meta-validate): add forbidden property and DocumentJournal checks
Check 12: detect properties that are invalid for a given metadata type
and would cause LoadConfigFromFiles to fail:
- ChartOfCharacteristicTypes: CodeType
- ChartOfAccounts: Autonumbering, Hierarchical
- ChartOfCalculationTypes: CheckUnique, Autonumbering
- ExchangePlan: CodeType, CheckUnique, Autonumbering

Check 10 extensions:
- DocumentJournal: warn on empty RegisteredDocuments
- Add DependenceOnCalculationTypes to enum validation (Check 4)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:49:57 +03:00
Nick Shirokov e717d4a57f fix(meta-compile): remove invalid properties from ChartOf* types
ChartOfCharacteristicTypes: remove CodeType (not a valid property).
ChartOfAccounts: remove Autonumbering, Hierarchical (not valid).
ChartOfCalculationTypes: remove CheckUnique, Autonumbering (not valid),
fix DependenceOnCalculationTypes default from NotUsed to DontUse.

Verified against real ACC 8.3.24 dumps. E2E test passed:
cf-init → meta-compile ×18 → LoadConfigFromFiles → UpdateDBCfg.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:43:21 +03:00
Nick Shirokov 6051972391 fix(meta-compile,meta-validate): fix 7 e2e bugs, add hints and reserved name checks
Group 1: ExchangePlan — remove invalid CodeType/CheckUnique/Autonumbering;
Flowchart.xml — add version="2.17"; Content.xml — fix namespace + version.

Group 2: Add missing GeneratedType categories — DefinedType, ChartOfAccounts
ExtDimensionTypes/Row, CalculationRegister RecalculationsManager/Recalcs.

Group 3: BusinessProcess — emit <Task> property from DSL.

Group 4: Cross-reference [HINT] output after compilation for AccountingRegister,
CalculationRegister, BusinessProcess, ChartOfAccounts (oriented to /meta-edit DSL).

Group 5: Reserved attribute name warnings in meta-compile and meta-validate
(Check 7b); cross-reference validation in Check 10 with [HINT] output.

All changes synced to both PS1 and PY versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:33:56 +03:00
Nick Shirokov 24751a59de docs(epf-guide): clarify register column category limitation
Explain why stub database may lose DataPath bindings when forms
contain register record sets — source XML lacks dimension/resource/
attribute classification for register fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:06:28 +03:00
Nick Shirokov b824759a05 docs(skills): remove redundant description paragraphs from epf/erf skills
The intro paragraph on line 14 duplicated the frontmatter description
field. Per Anthropic best practices, the body should contain only
implementation details — the heading and frontmatter are sufficient.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:53:13 +03:00
Nick Shirokov fb23cbda56 docs(skills): remove cross-references between epf/erf skills
Drop "см. /erf-*" from epf-build/epf-dump and "Использует общий скрипт
из /epf-*" from erf-build/erf-dump to prevent the model from reading
duplicate skill files and wasting context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:50:14 +03:00
Nick Shirokov 69c89d3d70 fix(meta-compile,stub-db-create): add missing GeneratedType categories
Add 6 missing categories to meta-compile (ps1+py):
- AccountingRegister: ExtDimensions
- ChartOfCharacteristicTypes: Characteristic
- ChartOfCalculationTypes: DisplacingCalculationTypesRow, BaseCalculationTypesRow, LeadingCalculationTypesRow
- BusinessProcess: RoutePointRef

Fix incorrect category name in stub-db-create (ps1+py):
- AccountingRegisterExtDimensionTypes/ExtDimensionTypes → AccountingRegisterExtDimensions/ExtDimensions

Add GeneratedType reference table to 1c-config-objects-spec.md (section 29).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:24:31 +03:00
Nick Shirokov dee85e19d5 docs: update build-spec and epf-guide for auto-stub and dump requirements
- build-spec: replace outdated notes about empty base with auto-stub info
- build-spec: add dump notes about irreversible type loss in empty base
- epf-guide: add build/dump section explaining auto-stub and base requirement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:40:25 +03:00
Nick Shirokov 87348ec73c docs(skills): add trigger descriptions, remove redundant sections, fix paths
- Add "Используй когда..." triggers to epf-build, epf-dump, erf-build, erf-dump
- Remove "Коды возврата" sections (trivial info Claude already knows)
- Remove Hierarchical tree diagrams from dump skills (Claude sees output directly)
- Fix Windows backslashes to forward slashes in examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:35:08 +03:00
Nick Shirokov dd81c85366 fix(stub-db-create): warn about guessed register column categories
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:13:31 +03:00