Metadata Modeling
MCP routing
- Preferred path: use MCP
unicatoolsunica.view {},unica.viewon the object node,unica.apply,unica.viewon the subsystem node,unica.search,unica.check, andunica.run. - Runtime идёт через
unica.run: вызов безopотдаёт словарь операций и контракт каждой —argsSchema,execution,previewRequired,ifRevRequiredOnApply. Контракт вызова бери оттуда, а не из этого текста; выбирай только операцию сimplemented: trueи не выдумывай аргументов записи сargsSchema: null; превью исполнением не является. Не обходи контракт прямым runner-ом. - Use
unica.docswithsource: "development-standard"for the standards about modelling: 432, 468, 474, 531, 587, 603, 649, 677, 697, 704, 728, and diagnostics АПК:93, АПК:304, АПК:305, АПК:1205, АПК:1207, АПК:1210-1217, АПК:1329, АПК:1330. These are standards, not evidence of runtime behavior; confirm the wording before citing one. - Use
unica.viewon the role node when predefined items need their interactive-deletion rights checked. - Do not call internal analyzer, runtime, standards, or package adapters directly. They are hidden behind MCP
unica.
Scope boundary
This skill owns which class holds the data and how its attributes are typed. Register internals belong to register-design, what a document records and when to document-posting, event handlers to object-events, code hosting to module-placement, and form layout to form-patterns.
References
- Read
../../references/platform/metadata-modeling.mdfor the class choice, attribute typing, predefined items, and names and presentations. - Read
../../references/platform/register-design.mdwhen the answer turns out to be a register. - Read
../../references/platform/metadata-conventions.mdfor naming, synonym, and fill-check conventions.
Core model
Ask what changes and who changes it:
- A fact at a point in time → document. Most documents post, and an unposted one is a draft (std603).
- A stable list the user maintains → catalog.
- A fixed set known when the configuration is written → enumeration. Its values are metadata child objects, so adding one is a configuration change and a deployment, never a user action.
- A set of kinds the user must extend at run time → chart of characteristic types. This is the answer whenever "the customer will add their own types later" appears and an enumeration was the first instinct.
- One value for the whole infobase → constant.
- An accumulated resource or a state keyed by dimensions → register; go to
register-design.
A value several objects carry identically may be a common attribute (std677) rather than a repeated one.
Workflow
- State the business question the data must answer, and who is allowed to change the set of values. That answer picks the class.
- Check what already exists with
unica.view(the configuration root and the object) andunica.viewon the object node — an existing object with the same meaning is a reason to extend rather than add — and locate the owning subsystem withunica.viewon the subsystem node. - Type every attribute deliberately: string length, composite type set, and whether a defined type already covers it (std432, std728, std704).
- Decide predefined items and their update mode before creating the object, and check the interactive-deletion rights with
unica.viewon the role node (std697). - Create with
unica.applyand refine withunica.apply, one verifiable step at a time. - Fill names, synonyms, and presentations; leaving both object and list presentation empty is АПК:93.
- Verify statically with
unica.checkon the module node (test runs are outside the v0.13 surface), report runtime behavior as unverified, and search existing callers withunica.searchwhen a type changed.
Design rules
- A composite attribute used in joins, filters, or sorting contains only reference types. Mixing in
Строка,Число,Дата,УникальныйИдентификатор,Булево,ХранилищеЗначенияslows those queries markedly (std728, АПК:1329). - To combine a reference with free text, add a separate catalog for the free values instead of a primitive type, fill it automatically on write, and clean it with a scheduled job.
- Do not use
ЛюбаяСсылка,СправочникСсылка,ДокументСсылкаon stored objects; list the types explicitly (АПК:1330). An over-wide composite joins every table in the type on dotted access withoutВЫРАЗИТЬ, forces restructuring when a referenced object is deleted, and makes marked-object deletion pay more for reference search and locks. - String attributes use variable allowed length with a maximum set. Fixed length is only for a genuine equal-length guarantee (std432, АПК:1205). Unlimited length is for large user text and for machine-generated technical strings.
- A type used widely and likely to change on implementation becomes a defined type once, not a copy per use site (std704).
- Predefined items are created automatically: keep
ОбновлениеПредопределенныхДанных = Автоand do not flip it from code (std697, АПК:304, АПК:305). In a subordinate distributed-infobase node they arrive from the main node, so update handlers that fill them run only in the main node. - A presentation equal to the synonym is not stored, so setting it to the same text achieves nothing (АПК:1210 and its siblings).
Review checklist
- The class matches who is allowed to change the set of values, not what was quickest to add.
- No extensible set of kinds is modelled as an enumeration.
- Every composite attribute used in joins, filters, or sorting is reference-only.
- No stored attribute uses a universal composite type.
- Every string attribute has a maximum length, and fixed length is justified.
- A widely repeated type is a defined type, and a widely repeated value is a common attribute.
- Predefined items use automatic update, and interactive deletion rights are off.
- Object or list presentation is filled, and an object does not share a name with its own child (АПК:1207).
- Documents carry the comment field (std531).
Stop rules
- Do not change an attribute's type, length, or composite type set without a stated migration for the data already stored.
- Do not add a class of object without checking whether an existing one already means the same thing.
- Do not switch predefined-data update mode from code.
Contract gaps
If public MCP unica cannot inspect the object, its attribute types, its predefined items, or the diagnostics needed for the task, report a Unica MCP contract gap with the missing operation.