docs(semantics): simplify test markup protocol (Section VIII) and sync workflows

This commit is contained in:
2026-03-16 18:18:57 +03:00
parent 37af7fd6f3
commit c53c3f77cc
6 changed files with 172 additions and 625 deletions

View File

@@ -19,8 +19,13 @@ customModes:
- mcp
customInstructions: |
1. KNOWLEDGE GRAPH: ALWAYS read .ai/ROOT.md first to understand the project structure and navigation.
2. CO-LOCATION: Write tests in `__tests__` subdirectories relative to the code being tested (Fractal Strategy).
2. TEST DATA MANDATORY: For Complexity 5 modules, read @TEST_FIXTURE and @TEST_CONTRACT from .ai/standards/semantics.md.
2. TEST MARKUP (Section VIII):
- Use short semantic IDs for modules (e.g., [DEF:AuthTests:Module]).
- Use BINDS_TO only for major logic blocks (classes, complex mocks).
- Helpers remain Complexity 1 (no @PURPOSE/@RELATION needed).
- Test functions remain Complexity 2 (@PURPOSE only).
3. CO-LOCATION: Write tests in `__tests__` subdirectories relative to the code being tested (Fractal Strategy).
4. TEST DATA MANDATORY: For Complexity 5 modules, read @TEST_FIXTURE and @TEST_CONTRACT from .ai/standards/semantics.md.
3. UX CONTRACT TESTING: For Svelte components with @UX_STATE, @UX_FEEDBACK, @UX_RECOVERY tags, create tests for all state transitions.
4. NO DELETION: Never delete existing tests - only update if they fail due to legitimate bugs.
5. NO DUPLICATION: Check existing tests in `__tests__/` before creating new ones. Reuse existing test patterns.
@@ -51,8 +56,9 @@ customModes:
1. KNOWLEDGE GRAPH: ALWAYS read .ai/ROOT.md first to understand the project structure and navigation.
2. CONSTITUTION: Strictly follow architectural invariants in .ai/standards/constitution.md.
3. SEMANTIC PROTOCOL: ALWAYS use .ai/standards/semantics.md as your source of truth for syntax.
4. ANCHOR FORMAT: Use #[DEF:filename:Type] at start and #[/DEF:filename] at end.
3. TAGS: Add @COMPLEXITY, @SEMANTICS, @PURPOSE, @LAYER, @RELATION, @PRE, @POST, @UX_STATE, @UX_FEEDBACK, @UX_RECOVERY, @INVARIANT, @SIDE_EFFECT, @DATA_CONTRACT.
4. ANCHOR FORMAT: Use short semantic IDs (e.g., [DEF:AuthService:Class]).
5. TEST MARKUP (Section VIII): In test files, follow simplified rules: short IDs, BINDS_TO for large blocks only, Complexity 1 for helpers.
6. TAGS: Add @COMPLEXITY, @SEMANTICS, @PURPOSE, @LAYER, @RELATION, @PRE, @POST, @UX_STATE, @UX_FEEDBACK, @UX_RECOVERY, @INVARIANT, @SIDE_EFFECT, @DATA_CONTRACT.
4. COMPLEXITY COMPLIANCE (1-5):
- Complexity 1 (ATOMIC): Only anchors [DEF]...[/DEF]. @PURPOSE optional.
- Complexity 2 (SIMPLE): @PURPOSE required.
@@ -206,6 +212,13 @@ customModes:
1. СТОП-СИГНАЛ: Выведи `[COHERENCE_CHECK_FAILED]`.
2. ГИПОТЕЗА: Сгенерируй вызов `logger.explore("Ошибка в I/O / Состоянии / Зависимости -> Описание")`.
3. ЗАПРОС: Запроси разрешение на изменение контракта.
## VIII. ТЕСТЫ: ПРАВИЛА РАЗМЕТКИ
1. Короткие ID: Тестовые модули обязаны иметь короткие семантические ID.
2. BINDS_TO для крупных узлов: Только для крупных блоков (классы, сложные моки).
3. Complexity 1 для хелперов: Мелкие функции остаются C1 (без @PURPOSE/@RELATION).
4. Тестовые сценарии: По умолчанию Complexity 2 (@PURPOSE).
5. Запрет на цепочки: Не описывать граф вызовов внутри теста.
whenToUse: Use this mode when you need to update the project's semantic map, fix semantic compliance issues (missing anchors/tags/DbC ), or analyze the codebase structure. This mode is specialized for maintaining the `.ai/standards/semantics.md` standards.
description: Codebase semantic mapping and compliance expert
customInstructions: ""
@@ -233,9 +246,10 @@ customModes:
## ТВОЙ ЧЕК-ЛИСТ:
1. Валидность якорей (парность, соответствие Type).
2. Соответствие @COMPLEXITY (C1-C5) набору обязательных тегов.
3. Наличие @TEST_CONTRACT для критических узлов.
4. Качество логирования logger.reason/reflect для C4+.
2. Соответствие @COMPLEXITY (C1-C5) набору обязательных тегов (с учетом Section VIII для тестов).
3. Короткие ID для тестов (никаких путей импорта).
4. Наличие @TEST_CONTRACT для критических узлов.
5. Качество логирования logger.reason/reflect для C4+.
description: Безжалостный инспектор ОТК.
customInstructions: |-
1. ANALYSIS: Оценивай файлы по шкале сложности в .ai/standards/semantics.md.