Skip to content

feat(meta)!: template.* и help.add растворены в meta.edit (ADR-0072) - #546

Merged
zeegin merged 7 commits into
mainfrom
feature/retire-template-help
Aug 17, 2026
Merged

feat(meta)!: template.* и help.add растворены в meta.edit (ADR-0072)#546
zeegin merged 7 commits into
mainfrom
feature/retire-template-help

Conversation

@zeegin

@zeegin zeegin commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Второй срез критической цепочки волны v0.13 (план #517, фаза 2). Closes #375.

Что сделано

unica.template.add, unica.template.remove и unica.help.add сняты из tools/list и runtime без псевдонимов совместимости — вызов отвечает unknown unica tool. Решение — ADR-0072 (accepted этим же PR). Поверхность: 74 → 71.

  • Макеты: регистрация и снятие — операции add/remove meta.edit по коллекции templates. Пробел покрытия закрыт этим же срезом (требование Снять unica.template.* и unica.help.add как дубли операций unica.meta.edit #375 п.2): элемент получает закрытый templateType из пяти видов (HTMLDocument, TextDocument, SpreadsheetDocument — по умолчанию, BinaryData, DataCompositionSchema), эмиссия дескриптора и начальное содержимое — по виду. Для HTMLDocument typed-канал пишет платформенную форму (primary — <Help>-дескриптор страниц + Ext/Template/ru.html); сырой HTML с DTD, который писал старый template.add, был дефектом снимаемого инструмента и валидатором по дампам не принимается.
  • Справка: развилка Снять unica.template.* и unica.help.add как дубли операций unica.meta.edit #375 решена по заявленному в задаче дефолту — растворение. Девятый вариант общего union meta.add/meta.edit: {"op": "addHelp", "lang"?} — create-only, Ext/Help.xml + Ext/Help/<lang>.html + IncludeHelpInContents формам владельца; семантика прежнего help.add без изменений, адресация — sourceSet + metadataPath, третий диалект селектора владельца исчез. Материализация — каналом фасета владельца (по образцу companion-writer Ext/Predefined.xml), ни один файл не стейджится до успешного полного плана.
  • Одна точка входа генерации: обработчики template.rs/help.rs удалены, разделяемые эмиттеры и гварды остались у своих модулей; template.rs больше не зовётся в обход meta.edit.

Приёмка #375 → проверки

  • tools/list без трёх, unknown unica toolretired_template_help_routes_fail_as_unknown_tools;
  • сценарии ведомости через meta.edit — corpus-кейсы перестроены (те же id и ветки, тот же состав файлов манифеста), 36 зелёных, включая инвентаризацию платформенной html-раскладки;
  • все виды TemplateTypetyped_template_add_covers_every_template_kind (+дефолт, +отказ неизвестного вида);
  • паритет справки — typed_add_help_matches_the_retired_help_add_files, create-only и preview-без-записи — отдельными тестами;
  • одна точка входа — обработчики удалены, диспатч-цепочка сжата;
  • таблица миграции — README пакета («Template and help migration»).

Сопутствующее одним набором (ADR-0021 §13)

  • ADR-0072 + индекс; план в docs/plans/2026-08-17-retire-template-help.md.
  • Ведомость regen (71) + --check in sync; tool-surface-review.json −3 записи.
  • Скиллы template-add/template-remove/help-add удалены; маршруты в meta-edit (шесть значений op, сценарии макета и справки) и epf-bsp-init обновлены.
  • Провенанс: записи снятых скиллов удалены — индекс описывает только пакетные скиллы (модель check-skill-upstreams.py), происхождение остаётся в истории; ADR фиксирует это явно.
  • Python-гарды: union {…, addHelp}, счётчики 71/33, replay-тест донорского template-add ушёл вместе с фикстурами reference-model.

Верификация

  • cargo test --no-fail-fast: все таргеты зелёные (включая lib целиком — известный флак project_health в этом прогоне не стрельнул; corpus 36 OK);
  • cargo clippy --all-targets: чисто; cargo fmt --check: чисто;
  • tests/ci: 764 OK (3 skipped); tests/dev: OK;
  • generate-tool-surface.py --check: in sync.

Summary by CodeRabbit

  • New Features

    • Added addHelp support through metadata editing, including optional language selection (defaulting to Russian).
    • Added typed template creation for HTML, text, spreadsheet, binary, and data composition schema templates.
    • Help creation now generates required resources and updates eligible forms safely.
  • Changes

    • Retired the standalone help and template add/remove tools; use metadata operations instead.
    • Updated documentation and migration guidance for the new workflows.
  • Bug Fixes

    • Improved validation, conflict handling, dry-run behavior, and transactional updates for help and template operations.

zeegin added 7 commits August 17, 2026 21:23
…act layer)

The meta.add/meta.edit union grows its ninth variant {op: "addHelp",
lang?}: tag, domain operation, published schema, parse arm and snapshot
tests. The descriptor pipeline does not change for help, so the
materialization arm fails closed until the file channel lands with the
parity test — a published build cannot half-apply the operation.

Refs #375
…072)

The help facet plans through the owner channel like the predefined
companion writer: create-only Help.xml and Help/<lang>.html, the
IncludeHelpInContents flip on the owner's forms guarded by exact
preimages, and a Help publication-plan entry. meta.edit add templates
gains a closed templateType element field covering all five kinds the
retiring template.add accepted; the HTMLDocument primary is the platform
page descriptor plus Ext/Template/ru.html — the raw-HTML primary the old
tool wrote was its own defect and the typed channel does not reproduce
it. Parity, create-only, preview and kind-coverage tests pin the
behavior.

Refs #375
…-0072)

The three duplicate routes leave tools/list and the runtime without
compatibility aliases; every call answers unknown unica tool. Template
registration travels through meta.edit add/remove on the templates
collection, embedded help through the addHelp operation. The corpus
cases rewire onto meta.edit with the same file layout — the typed
HTMLDocument payload passes the platform page-set inventory the old
raw-HTML primary never matched — and the mutator ledgers, support-guard
and format-path contract tables shrink by the retired trio.

Refs #375
…mplate/help retirement (ADR-0072)

The tool ledger regenerates at 71 tools; the template-add,
template-remove and help-add skills leave the package with their parity
reference models, meta-edit routes template registration and embedded
help, and the provenance index drops the retired entries — it describes
packaged skills only, so ADR-0072 states that origin stays in repository
history. Python guards follow: the shared operation union gains addHelp,
the mutation tool set shrinks to 33, and the donor template-add replay
test leaves with its fixture.

Refs #375
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bec224dd-3e7e-495a-a294-0517a93672cc

📥 Commits

Reviewing files that changed from the base of the PR and between 94ae876 and 20e1142.

📒 Files selected for processing (36)
  • crates/unica-coder/src/application/metadata.rs
  • crates/unica-coder/src/application/mod.rs
  • crates/unica-coder/src/application/operation_descriptors.rs
  • crates/unica-coder/src/application/tool_contracts.rs
  • crates/unica-coder/src/domain/metadata/operations.rs
  • crates/unica-coder/src/domain/metadata/results.rs
  • crates/unica-coder/src/infrastructure/format_guard.rs
  • crates/unica-coder/src/infrastructure/metadata_operations.rs
  • crates/unica-coder/src/infrastructure/native_operations/help.rs
  • crates/unica-coder/src/infrastructure/native_operations/meta/edit.rs
  • crates/unica-coder/src/infrastructure/native_operations/meta/help_facet.rs
  • crates/unica-coder/src/infrastructure/native_operations/meta/mod.rs
  • crates/unica-coder/src/infrastructure/native_operations/registry.rs
  • crates/unica-coder/src/infrastructure/native_operations/template.rs
  • crates/unica-coder/src/infrastructure/native_operations/typed_result.rs
  • crates/unica-coder/src/interfaces/mcp.rs
  • crates/unica-coder/tests/format_8_3_27_xml_corpus.rs
  • docs/plans/2026-08-17-retire-template-help.md
  • plugins/unica/README.md
  • plugins/unica/skills/epf-bsp-init/SKILL.md
  • plugins/unica/skills/help-add/SKILL.md
  • plugins/unica/skills/meta-edit/SKILL.md
  • plugins/unica/skills/template-add/SKILL.md
  • plugins/unica/skills/template-remove/SKILL.md
  • spec/architecture/tool-surface-review.json
  • spec/architecture/tool-surface.md
  • spec/decisions/0072-retire-template-help-into-meta-edit.md
  • spec/decisions/README.md
  • spec/provenance/skill-upstreams.json
  • tests/ci/test_reference_format_profile.py
  • tests/ci/test_tool_surface_ledger.py
  • tests/ci/test_unica_mcp_smoke.py
  • tests/ci/test_unica_skills.py
  • tests/fixtures/unica_mcp_script_parity/unica_reference_models/help-add/scripts/add-help.py
  • tests/fixtures/unica_mcp_script_parity/unica_reference_models/template-add/scripts/add-template.py
  • tests/fixtures/unica_mcp_script_parity/unica_reference_models/template-remove/scripts/remove-template.py

📝 Walkthrough

Walkthrough

The metadata model now supports typed templates and localized addHelp. Template and help creation routes move to meta.edit. The former three tools, handlers, skills, fixtures, and surface records are removed or migrated.

Changes

Metadata operation migration

Layer / File(s) Summary
Metadata contracts and validation
crates/unica-coder/src/application/metadata.rs, crates/unica-coder/src/domain/metadata/operations.rs, crates/unica-coder/src/application/tool_contracts.rs
Adds templateType, MetaTemplateKind, and the addHelp operation with validated language handling and target rules.
Help and template materialization
crates/unica-coder/src/infrastructure/native_operations/meta/*, crates/unica-coder/src/infrastructure/native_operations/help.rs, crates/unica-coder/src/infrastructure/metadata_operations.rs
Plans help files and form updates transactionally. Generates type-specific template content. Adds parity, create-only, dry-run, and template-kind tests.
Retired tool runtime and contracts
crates/unica-coder/src/application/{mod.rs,operation_descriptors.rs}, crates/unica-coder/src/infrastructure/{format_guard.rs,native_operations/*}, crates/unica-coder/src/interfaces/mcp.rs, tests/ci/*
Removes standalone help/template registrations, dispatch branches, guards, fixtures, skills, and related surface expectations.
Scenario, skill, and decision migration
crates/unica-coder/tests/format_8_3_27_xml_corpus.rs, plugins/unica/*, spec/*, docs/plans/*
Migrates corpus cases and documentation to meta.edit, records ADR-0072, and updates the published tool surface from 74 to 71 tools.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant MetaEdit
  participant HelpFacet
  participant FilePlan
  Client->>MetaEdit: submit addHelp or template operation
  MetaEdit->>HelpFacet: plan help facet resources
  HelpFacet->>FilePlan: stage files and form updates
  FilePlan-->>MetaEdit: return publication plan
  MetaEdit-->>Client: return typed result
Loading

Possibly related PRs

Suggested labels: ci:full

Suggested reviewers: korolevpavel

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/retire-template-help

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zeegin
zeegin enabled auto-merge (squash) August 17, 2026 21:41
@zeegin
zeegin merged commit cfd9adb into main Aug 17, 2026
22 checks passed
zeegin added a commit that referenced this pull request Aug 17, 2026
…ts already assert against live registry size
@zeegin

zeegin commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Снять unica.template.* и unica.help.add как дубли операций unica.meta.edit

1 participant